text
stringlengths 4
1.04M
|
|---|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . M E M O R Y _ D U M P --
-- --
-- B o d y --
-- --
-- Copyright (C) 2003-2005, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System; use System;
with System.Storage_Elements; use System.Storage_Elements;
with GNAT.IO; use GNAT.IO;
with GNAT.Debug_Utilities; use GNAT.Debug_Utilities;
with Unchecked_Conversion;
package body GNAT.Memory_Dump is
----------
-- Dump --
----------
procedure Dump (Addr : System.Address; Count : Natural) is
Ctr : Natural := Count;
-- Count of bytes left to output
Adr : Address := Addr;
-- Current address
N : Natural := 0;
-- Number of bytes output on current line
C : Character;
-- Character at current storage address
AIL : constant := Address_Image_Length - 4 + 2;
-- Number of chars in initial address + colon + space
Line_Len : constant Natural := AIL + 3 * 16 + 2 + 16;
-- Line length for entire line
Line_Buf : String (1 .. Line_Len);
Hex : constant array (0 .. 15) of Character := "0123456789ABCDEF";
type Char_Ptr is access all Character;
function To_Char_Ptr is new Unchecked_Conversion (Address, Char_Ptr);
begin
while Ctr /= 0 loop
-- Start of line processing
if N = 0 then
declare
S : constant String := Image (Adr);
begin
Line_Buf (1 .. AIL) := S (4 .. S'Length - 1) & ": ";
Line_Buf (AIL + 1 .. Line_Buf'Last) := (others => ' ');
Line_Buf (AIL + 3 * 16 + 1) := '"';
end;
end if;
-- Add one character to current line
C := To_Char_Ptr (Adr).all;
Adr := Adr + 1;
Ctr := Ctr - 1;
Line_Buf (AIL + 3 * N + 1) := Hex (Character'Pos (C) / 16);
Line_Buf (AIL + 3 * N + 2) := Hex (Character'Pos (C) mod 16);
if C < ' ' or else C = Character'Val (16#7F#) then
C := '?';
end if;
Line_Buf (AIL + 3 * 16 + 2 + N) := C;
N := N + 1;
-- End of line processing
if N = 16 then
Line_Buf (Line_Buf'Last) := '"';
GNAT.IO.Put_Line (Line_Buf);
N := 0;
end if;
end loop;
-- Deal with possible last partial line
if N /= 0 then
Line_Buf (AIL + 3 * 16 + 2 + N) := '"';
GNAT.IO.Put_Line (Line_Buf (1 .. AIL + 3 * 16 + 2 + N));
end if;
return;
end Dump;
end GNAT.Memory_Dump;
|
with Ada.Exception_Identification.From_Here;
with Ada.Unchecked_Conversion;
with System.C_Encoding;
with System.Formatting;
with System.Long_Long_Integer_Types;
with C;
package body Interfaces.COBOL is
use Ada.Exception_Identification.From_Here;
use type System.Bit_Order;
use type System.Long_Long_Integer_Types.Word_Unsigned;
use type C.size_t;
subtype Word_Unsigned is System.Long_Long_Integer_Types.Word_Unsigned;
subtype Long_Long_Unsigned is
System.Long_Long_Integer_Types.Long_Long_Unsigned;
function add_overflow (
a, b : Long_Long_Integer;
res : not null access Long_Long_Integer)
return Boolean
with Import,
Convention => Intrinsic,
External_Name => "__builtin_saddll_overflow";
function mul_overflow (
a, b : Long_Long_Integer;
res : not null access Long_Long_Integer)
return Boolean
with Import,
Convention => Intrinsic,
External_Name => "__builtin_smulll_overflow";
function bswap64 (x : Long_Long_Integer) return Long_Long_Integer
with Import,
Convention => Intrinsic,
External_Name => "__builtin_bswap64";
procedure unreachable
with Import,
Convention => Intrinsic, External_Name => "__builtin_unreachable";
pragma No_Return (unreachable);
-- display formats
function Valid_Unsigned (Item : Numeric) return Boolean;
function Valid_Leading_Separate (Item : Numeric) return Boolean;
function Valid_Trailing_Separate (Item : Numeric) return Boolean;
function Valid_Leading_Nonseparate (Item : Numeric) return Boolean;
function Valid_Trailing_Nonseparate (Item : Numeric) return Boolean;
function Valid_Unsigned (Item : Numeric) return Boolean is
begin
if Item'First <= Item'Last then
for I in Item'Range loop
if Item (I) not in '0' .. '9' then
return False;
end if;
end loop;
return True;
else
return False;
end if;
end Valid_Unsigned;
function Valid_Leading_Separate (Item : Numeric) return Boolean is
begin
return Item'First <= Item'Last
and then (Item (Item'First) = '+' or else Item (Item'First) = '-')
and then Valid_Unsigned (Item (Item'First + 1 .. Item'Last));
end Valid_Leading_Separate;
function Valid_Trailing_Separate (Item : Numeric) return Boolean is
begin
return Item'First <= Item'Last
and then (Item (Item'Last) = '+' or else Item (Item'Last) = '-')
and then Valid_Unsigned (Item (Item'First .. Item'Last - 1));
end Valid_Trailing_Separate;
function Valid_Leading_Nonseparate (Item : Numeric) return Boolean is
begin
return Item'First <= Item'Last
and then (
Item (Item'First) in '0' .. '9'
or else Item (Item'First) in 'p' .. 'y')
and then (
Item'First = Item'Last
or else Valid_Unsigned (Item (Item'First + 1 .. Item'Last)));
end Valid_Leading_Nonseparate;
function Valid_Trailing_Nonseparate (Item : Numeric) return Boolean is
begin
return Item'First <= Item'Last
and then (
Item (Item'Last) in '0' .. '9'
or else Item (Item'Last) in 'p' .. 'y')
and then (
Item'First = Item'Last
or else Valid_Unsigned (Item (Item'First .. Item'Last - 1)));
end Valid_Trailing_Nonseparate;
function Unchecked_Unsigned_To_Decimal (Item : Numeric)
return Long_Long_Integer;
function Unsigned_To_Decimal (Item : Numeric) return Long_Long_Integer;
function Leading_Separate_To_Decimal (Item : Numeric)
return Long_Long_Integer;
function Trailing_Separate_To_Decimal (Item : Numeric)
return Long_Long_Integer;
function Leading_Nonseparate_To_Decimal (Item : Numeric)
return Long_Long_Integer;
function Trailing_Nonseparate_To_Decimal (Item : Numeric)
return Long_Long_Integer;
function Unchecked_Unsigned_To_Decimal (Item : Numeric)
return Long_Long_Integer
is
Result : aliased Long_Long_Integer := 0;
begin
for I in Item'Range loop
declare
E : COBOL_Character renames Item (I);
X : Long_Long_Integer;
begin
case E is
when '0' .. '9' =>
X := COBOL_Character'Pos (E) - COBOL_Character'Pos ('0');
when 'p' .. 'y' =>
X := COBOL_Character'Pos (E) - COBOL_Character'Pos ('p');
when others =>
unreachable;
end case;
if mul_overflow (Result, 10, Result'Access) then
Raise_Exception (Conversion_Error'Identity);
end if;
if add_overflow (Result, X, Result'Access) then
Raise_Exception (Conversion_Error'Identity);
end if;
end;
end loop;
return Result;
end Unchecked_Unsigned_To_Decimal;
function Unsigned_To_Decimal (Item : Numeric) return Long_Long_Integer is
begin
if Valid_Unsigned (Item) then
return Unchecked_Unsigned_To_Decimal (Item);
else
Raise_Exception (Conversion_Error'Identity);
end if;
end Unsigned_To_Decimal;
function Leading_Separate_To_Decimal (Item : Numeric)
return Long_Long_Integer is
begin
if Valid_Leading_Separate (Item) then
declare
Minus : constant Boolean := Item (Item'First) = '-';
Result : Long_Long_Integer;
begin
Result := Unchecked_Unsigned_To_Decimal (
Item (Item'First + 1 .. Item'Last));
if Minus then
Result := -Result;
end if;
return Result;
end;
else
Raise_Exception (Conversion_Error'Identity);
end if;
end Leading_Separate_To_Decimal;
function Trailing_Separate_To_Decimal (Item : Numeric)
return Long_Long_Integer is
begin
if Valid_Trailing_Separate (Item) then
declare
Minus : constant Boolean := Item (Item'Last) = '-';
Result : Long_Long_Integer;
begin
Result := Unchecked_Unsigned_To_Decimal (
Item (Item'First .. Item'Last - 1));
if Minus then
Result := -Result;
end if;
return Result;
end;
else
Raise_Exception (Conversion_Error'Identity);
end if;
end Trailing_Separate_To_Decimal;
function Leading_Nonseparate_To_Decimal (Item : Numeric)
return Long_Long_Integer is
begin
if Valid_Leading_Nonseparate (Item) then
declare
Minus : constant Boolean := Item (Item'First) in 'p' .. 'y';
Result : Long_Long_Integer;
begin
Result := Unchecked_Unsigned_To_Decimal (Item);
if Minus then
Result := -Result;
end if;
return Result;
end;
else
Raise_Exception (Conversion_Error'Identity);
end if;
end Leading_Nonseparate_To_Decimal;
function Trailing_Nonseparate_To_Decimal (Item : Numeric)
return Long_Long_Integer is
begin
if Valid_Trailing_Nonseparate (Item) then
declare
Minus : constant Boolean := Item (Item'Last) in 'p' .. 'y';
Result : Long_Long_Integer;
begin
Result := Unchecked_Unsigned_To_Decimal (Item);
if Minus then
Result := -Result;
end if;
return Result;
end;
else
Raise_Exception (Conversion_Error'Identity);
end if;
end Trailing_Nonseparate_To_Decimal;
function Length_To_Display_Unsigned (Item : Long_Long_Integer)
return Natural;
procedure To_Display_Unsigned (
Item : Long_Long_Integer;
Result : out Numeric);
function To_Display_Unsigned (Item : Long_Long_Integer) return Numeric;
function To_Display_Leading_Separate (Item : Long_Long_Integer)
return Numeric;
function To_Display_Trailing_Separate (Item : Long_Long_Integer)
return Numeric;
function To_Display_Leading_Nonseparate (Item : Long_Long_Integer)
return Numeric;
function To_Display_Trailing_Nonseparate (Item : Long_Long_Integer)
return Numeric;
function Length_To_Display_Unsigned (Item : Long_Long_Integer)
return Natural is
begin
if Long_Long_Integer'Size <= Standard'Word_Size then
return System.Formatting.Digits_Width (Word_Unsigned (Item));
else
return System.Formatting.Digits_Width (Long_Long_Unsigned (Item));
end if;
end Length_To_Display_Unsigned;
procedure To_Display_Unsigned (
Item : Long_Long_Integer;
Result : out Numeric)
is
pragma Compile_Time_Error (
Numeric'Component_Size /= String'Component_Size,
"size mismatch");
Result_As_Ada : String (Result'Range);
for Result_As_Ada'Address use Result'Address;
Last : Natural;
Error : Boolean; -- ignored
begin
if Long_Long_Integer'Size <= Standard'Word_Size then
System.Formatting.Image (
Word_Unsigned (Item),
Result_As_Ada,
Last,
Width => Result'Length,
Error => Error);
else
System.Formatting.Image (
Long_Long_Unsigned (Item),
Result_As_Ada,
Last,
Width => Result'Length,
Error => Error);
end if;
end To_Display_Unsigned;
function To_Display_Unsigned (Item : Long_Long_Integer) return Numeric is
begin
if Item < 0 then
Raise_Exception (Conversion_Error'Identity);
end if;
return Result : Numeric (1 .. Length_To_Display_Unsigned (Item)) do
To_Display_Unsigned (Item, Result);
end return;
end To_Display_Unsigned;
function To_Display_Leading_Separate (Item : Long_Long_Integer)
return Numeric
is
Abs_Item : constant Long_Long_Integer := abs Item;
begin
return Result :
Numeric (1 .. Length_To_Display_Unsigned (Abs_Item) + 1)
do
if Item < 0 then
Result (Result'First) := '-';
else
Result (Result'First) := '+';
end if;
To_Display_Unsigned (
Abs_Item,
Result (Result'First + 1 .. Result'Last));
end return;
end To_Display_Leading_Separate;
function To_Display_Trailing_Separate (Item : Long_Long_Integer)
return Numeric
is
Abs_Item : constant Long_Long_Integer := abs Item;
begin
return Result :
Numeric (1 .. Length_To_Display_Unsigned (Abs_Item) + 1)
do
if Item < 0 then
Result (Result'Last) := '-';
else
Result (Result'Last) := '+';
end if;
To_Display_Unsigned (
Abs_Item,
Result (Result'First .. Result'Last - 1));
end return;
end To_Display_Trailing_Separate;
function To_Display_Leading_Nonseparate (Item : Long_Long_Integer)
return Numeric is
begin
return Result : Numeric := To_Display_Unsigned (abs Item) do
if Item < 0 then
Result (Result'First) := COBOL_Character'Val (
COBOL_Character'Pos (Result (Result'First))
+ (COBOL_Character'Pos ('p') - COBOL_Character'Pos ('0')));
end if;
end return;
end To_Display_Leading_Nonseparate;
function To_Display_Trailing_Nonseparate (Item : Long_Long_Integer)
return Numeric is
begin
return Result : Numeric := To_Display_Unsigned (abs Item) do
if Item < 0 then
Result (Result'Last) := COBOL_Character'Val (
COBOL_Character'Pos (Result (Result'Last))
+ (COBOL_Character'Pos ('p') - COBOL_Character'Pos ('0')));
end if;
end return;
end To_Display_Trailing_Nonseparate;
-- packed formats
function Valid_Unsigned (Item : Packed_Decimal) return Boolean;
function Valid_Signed (Item : Packed_Decimal) return Boolean;
function Valid_Unsigned (Item : Packed_Decimal) return Boolean is
begin
return Valid_Signed (Item)
and then Item (Item'Last) /= 16#B#
and then Item (Item'Last) /= 16#D#;
end Valid_Unsigned;
function Valid_Signed (Item : Packed_Decimal) return Boolean is
begin
if Item'Length = 0
or else Item'Length rem 2 /= 0
or else Item (Item'Last) < 16#A#
then
return False;
else
for I in Item'First .. Item'Last - 1 loop
if Item (I) >= 16#A# then
return False;
end if;
end loop;
return True;
end if;
end Valid_Signed;
function Unchecked_Unsigned_To_Decimal (Item : Packed_Decimal)
return Long_Long_Integer;
function Unsigned_To_Decimal (Item : Packed_Decimal)
return Long_Long_Integer;
function Signed_To_Decimal (Item : Packed_Decimal)
return Long_Long_Integer;
function Unchecked_Unsigned_To_Decimal (Item : Packed_Decimal)
return Long_Long_Integer
is
Result : aliased Long_Long_Integer := 0;
begin
for I in Item'First .. Item'Last - 1 loop
if mul_overflow (Result, 10, Result'Access) then
Raise_Exception (Conversion_Error'Identity);
end if;
if add_overflow (
Result,
Long_Long_Integer (Item (I)),
Result'Access)
then
Raise_Exception (Conversion_Error'Identity);
end if;
end loop;
return Result;
end Unchecked_Unsigned_To_Decimal;
function Unsigned_To_Decimal (Item : Packed_Decimal)
return Long_Long_Integer is
begin
if Valid_Unsigned (Item) then
return Unchecked_Unsigned_To_Decimal (Item);
else
Raise_Exception (Conversion_Error'Identity);
end if;
end Unsigned_To_Decimal;
function Signed_To_Decimal (Item : Packed_Decimal)
return Long_Long_Integer is
begin
if Valid_Signed (Item) then
declare
Result : Long_Long_Integer := Unchecked_Unsigned_To_Decimal (Item);
begin
if Item (Item'Last) = 16#B# or else Item (Item'Last) = 16#D# then
Result := -Result;
end if;
return Result;
end;
else
Raise_Exception (Conversion_Error'Identity);
end if;
end Signed_To_Decimal;
function Length_To_Packed (Item : Long_Long_Integer) return Natural;
function To_Packed_Unsigned (Item : Long_Long_Integer)
return Packed_Decimal;
function To_Packed_Signed (Item : Long_Long_Integer)
return Packed_Decimal;
function Length_To_Packed (Item : Long_Long_Integer) return Natural is
begin
-- The packed form is BCD and terminated with a magic number.
return 2
+ Natural (
Word_Unsigned (Length_To_Display_Unsigned (Item)) and not 1);
end Length_To_Packed;
function To_Packed_Unsigned (Item : Long_Long_Integer)
return Packed_Decimal is
begin
if Item < 0 then
Raise_Exception (Conversion_Error'Identity);
end if;
return Result : Packed_Decimal (1 .. Length_To_Packed (Item)) do
declare
X : Long_Long_Unsigned := Long_Long_Unsigned (Item);
begin
for I in reverse Result'First .. Result'Last - 1 loop
System.Long_Long_Integer_Types.Divide (X, 10,
Quotient => X,
Remainder => Long_Long_Unsigned (Result (I)));
end loop;
end;
Result (Result'Last) := 16#F#;
end return;
end To_Packed_Unsigned;
function To_Packed_Signed (Item : Long_Long_Integer)
return Packed_Decimal is
begin
return Result : Packed_Decimal := To_Packed_Unsigned (abs Item) do
if Item < 0 then
Result (Result'Last) := 16#D#;
else
Result (Result'Last) := 16#C#;
end if;
end return;
end To_Packed_Signed;
-- binary formats
subtype Byte_Array_1 is Byte_Array (1 .. 1);
subtype Byte_Array_2 is Byte_Array (1 .. 2);
subtype Byte_Array_4 is Byte_Array (1 .. 4);
subtype Byte_Array_8 is Byte_Array (1 .. 8);
function To_Integer_8 is
new Ada.Unchecked_Conversion (Byte_Array_1, Integer_8);
function To_Integer_16 is
new Ada.Unchecked_Conversion (Byte_Array_2, Integer_16);
function To_Integer_32 is
new Ada.Unchecked_Conversion (Byte_Array_4, Integer_32);
function To_Integer_64 is
new Ada.Unchecked_Conversion (Byte_Array_8, Integer_64);
function To_Byte_Array is
new Ada.Unchecked_Conversion (Integer_8, Byte_Array_1);
function To_Byte_Array is
new Ada.Unchecked_Conversion (Integer_16, Byte_Array_2);
function To_Byte_Array is
new Ada.Unchecked_Conversion (Integer_32, Byte_Array_4);
function To_Byte_Array is
new Ada.Unchecked_Conversion (Integer_64, Byte_Array_8);
function High_Order_First_To_Decimal (Item : Byte_Array)
return Long_Long_Integer;
function Low_Order_First_To_Decimal (Item : Byte_Array)
return Long_Long_Integer;
function Native_Binary_To_Decimal (Item : Byte_Array)
return Long_Long_Integer;
function High_Order_First_To_Decimal (Item : Byte_Array)
return Long_Long_Integer
is
Result : Long_Long_Integer := Native_Binary_To_Decimal (Item);
begin
if System.Default_Bit_Order /= System.High_Order_First then
Result := bswap64 (Result);
end if;
return Result;
end High_Order_First_To_Decimal;
function Low_Order_First_To_Decimal (Item : Byte_Array)
return Long_Long_Integer
is
Result : Long_Long_Integer := Native_Binary_To_Decimal (Item);
begin
if System.Default_Bit_Order /= System.Low_Order_First then
Result := bswap64 (Result);
end if;
return Result;
end Low_Order_First_To_Decimal;
function Native_Binary_To_Decimal (Item : Byte_Array)
return Long_Long_Integer is
begin
case Item'Length is
when 1 =>
return Long_Long_Integer (To_Integer_8 (Item));
when 2 =>
return Long_Long_Integer (To_Integer_16 (Item));
when 4 =>
return Long_Long_Integer (To_Integer_32 (Item));
when 8 =>
return Long_Long_Integer (To_Integer_64 (Item));
when others =>
Raise_Exception (Conversion_Error'Identity);
end case;
end Native_Binary_To_Decimal;
function To_Binary_High_Order_First (Item : Long_Long_Integer)
return Byte_Array;
function To_Binary_Low_Order_First (Item : Long_Long_Integer)
return Byte_Array;
function To_Native_Binary (Item : Long_Long_Integer) return Byte_Array;
function To_Binary_High_Order_First (Item : Long_Long_Integer)
return Byte_Array
is
X : Long_Long_Integer := Item;
begin
if System.Default_Bit_Order /= System.High_Order_First then
X := bswap64 (X);
end if;
return To_Native_Binary (X);
end To_Binary_High_Order_First;
function To_Binary_Low_Order_First (Item : Long_Long_Integer)
return Byte_Array
is
X : Long_Long_Integer := Item;
begin
if System.Default_Bit_Order /= System.Low_Order_First then
X := bswap64 (X);
end if;
return To_Native_Binary (X);
end To_Binary_Low_Order_First;
function To_Native_Binary (Item : Long_Long_Integer) return Byte_Array is
begin
if Item in -16#80# .. 16#7F# then
return To_Byte_Array (Integer_8 (Item));
elsif Item in -16#8000# .. 16#7FFF# then
return To_Byte_Array (Integer_16 (Item));
elsif Item in -16#8000_0000# .. 16#7FFF_FFFF# then
return To_Byte_Array (Integer_32 (Item));
else
return To_Byte_Array (Integer_64 (Item));
end if;
end To_Native_Binary;
-- implementation
function Ada_To_COBOL (
Item : Character;
Substitute : COBOL_Character := '?')
return COBOL_Character is
begin
return COBOL_Character (
System.C_Encoding.To_char (
Item,
Substitute => C.char (Substitute)));
end Ada_To_COBOL;
function COBOL_To_Ada (
Item : COBOL_Character;
Substitute : Character := '?')
return Character is
begin
return System.C_Encoding.To_Character (
C.char (Item),
Substitute => Substitute);
end COBOL_To_Ada;
function To_COBOL (
Item : String;
Substitute : Alphanumeric := "?")
return Alphanumeric
is
Result : Alphanumeric (
1 ..
System.C_Encoding.Expanding_To_char * Item'Length);
Last : Natural;
begin
To_COBOL (Item, Result, Last, Substitute => Substitute);
return Result (1 .. Last);
end To_COBOL;
function To_Ada (
Item : Alphanumeric;
Substitute : String := "?")
return String
is
Result : String (
1 ..
System.C_Encoding.Expanding_To_Character * Item'Length);
Last : Natural;
begin
To_Ada (Item, Result, Last, Substitute => Substitute);
return Result (1 .. Last);
end To_Ada;
procedure To_COBOL (
Item : String;
Target : out Alphanumeric;
Last : out Natural;
Substitute : Alphanumeric := "?") is
begin
if Item'Length = 0 then
Last := Target'First - 1;
else
declare
Target_As_C : C.char_array (0 .. Target'Length - 1);
for Target_As_C'Address use Target'Address;
Substitute_As_C : C.char_array (0 .. Substitute'Length - 1);
for Substitute_As_C'Address use Substitute'Address;
Count : C.size_t;
begin
System.C_Encoding.To_Non_Nul_Terminated (
Item,
Target_As_C,
Count,
Substitute => Substitute_As_C);
Last := Target'First + Natural (Count) - 1;
end;
end if;
end To_COBOL;
procedure To_Ada (
Item : Alphanumeric;
Target : out String;
Last : out Natural;
Substitute : String := "?")
is
begin
if Item'Length = 0 then
Last := Target'First - 1;
else
declare
Item_As_C : C.char_array (0 .. Item'Length - 1);
for Item_As_C'Address use Item'Address;
Count : Natural;
begin
System.C_Encoding.From_Non_Nul_Terminated (
Item_As_C,
Target,
Count,
Substitute => Substitute);
Last := Target'First + Count - 1;
end;
end if;
end To_Ada;
package body Decimal_Conversions is
function Valid (Item : Numeric; Format : Display_Format)
return Boolean is
begin
case Format is
when U => -- Unsigned
return Valid_Unsigned (Item);
when LS => -- Leading_Separate
return Valid_Leading_Separate (Item);
when TS => -- Trailing_Separate
return Valid_Trailing_Separate (Item);
when LN => -- Leading_Nonseparate
return Valid_Leading_Nonseparate (Item);
when TN => -- Trailing_Nonseparate
return Valid_Trailing_Nonseparate (Item);
end case;
end Valid;
function Length (Format : Display_Format) return Natural is
begin
case Format is
when U | LN | TN => -- Unsigned or Nonseparate
return Num'Digits;
when LS | TS => -- Separate
return Num'Digits + 1;
end case;
end Length;
function To_Decimal (Item : Numeric; Format : Display_Format)
return Num
is
Result : Num'Base;
begin
case Format is
when U => -- Unsigned
Result := Num'Base'Fixed_Value (Unsigned_To_Decimal (Item));
when LS => -- Leading_Separate
Result := Num'Base'Fixed_Value (
Leading_Separate_To_Decimal (Item));
when TS => -- Trailing_Separate
Result := Num'Base'Fixed_Value (
Trailing_Separate_To_Decimal (Item));
when LN => -- Leading_Nonseparate
Result := Num'Base'Fixed_Value (
Leading_Nonseparate_To_Decimal (Item));
when TN => -- Trailing_Nonseparate
Result := Num'Base'Fixed_Value (
Trailing_Nonseparate_To_Decimal (Item));
end case;
if Result not in Num then
raise Conversion_Error;
end if;
return Result;
end To_Decimal;
function To_Display (Item : Num; Format : Display_Format)
return Numeric is
begin
case Format is
when U => -- Unsigned
return To_Display_Unsigned (
Long_Long_Integer'Integer_Value (Item));
when LS => -- Leading_Separate
return To_Display_Leading_Separate (
Long_Long_Integer'Integer_Value (Item));
when TS => -- Trailing_Separate
return To_Display_Trailing_Separate (
Long_Long_Integer'Integer_Value (Item));
when LN => -- Leading_Nonseparate
return To_Display_Leading_Nonseparate (
Long_Long_Integer'Integer_Value (Item));
when TN => -- Trailing_Nonseparate
return To_Display_Trailing_Nonseparate (
Long_Long_Integer'Integer_Value (Item));
end case;
end To_Display;
function Valid (Item : Packed_Decimal; Format : Packed_Format)
return Boolean is
begin
case Format is
when U => -- Packed_Unsigned
return Valid_Unsigned (Item);
when S => -- Packed_Signed
return Valid_Signed (Item);
end case;
end Valid;
function Length (Format : Packed_Format) return Natural is
pragma Unreferenced (Format);
begin
return 2 + Natural (Word_Unsigned'(Num'Digits) and not 1);
end Length;
function To_Decimal (Item : Packed_Decimal; Format : Packed_Format)
return Num
is
Result : Num'Base;
begin
case Format is
when U => -- Packed_Unsigned
Result := Num'Base'Fixed_Value (Unsigned_To_Decimal (Item));
when S => -- Packed_Signed
Result := Num'Base'Fixed_Value (Signed_To_Decimal (Item));
end case;
if Result not in Num then
raise Conversion_Error;
end if;
return Result;
end To_Decimal;
function To_Packed (Item : Num; Format : Packed_Format)
return Packed_Decimal is
begin
case Format is
when U => -- Packed_Unsigned
return To_Packed_Unsigned (
Long_Long_Integer'Integer_Value (Item));
when S => -- Packed_Signed
return To_Packed_Signed (
Long_Long_Integer'Integer_Value (Item));
end case;
end To_Packed;
function Valid (Item : Byte_Array; Format : Binary_Format)
return Boolean is
begin
-- CXB4007 checks a value in the range
case Item'Length is
when 1 | 2 | 4 | 8 =>
declare
Value : Num'Base;
begin
case Format is
when H => -- High_Order_First
Value := Num'Base'Fixed_Value (
High_Order_First_To_Decimal (Item));
when L => -- Low_Order_First
Value := Num'Base'Fixed_Value (
Low_Order_First_To_Decimal (Item));
when N => -- Native_Binary
Value := Num'Base'Fixed_Value (
Native_Binary_To_Decimal (Item));
end case;
return Value in Num;
end;
when others =>
return False;
end case;
end Valid;
function Length (Format : Binary_Format) return Natural is
pragma Unreferenced (Format);
First : constant Long_Long_Integer :=
Long_Long_Integer'Integer_Value (Num'First);
Last : constant Long_Long_Integer :=
Long_Long_Integer'Integer_Value (Num'Last);
begin
if First in -16#80# .. 16#7F#
and then Last in -16#80# .. 16#7F#
then
return 1;
elsif First in -16#8000# .. 16#7FFF#
and then Last in -16#8000# .. 16#7FFF#
then
return 2;
elsif First in -16#8000_0000# .. 16#7FFF_FFFF#
and then Last in -16#8000_0000# .. 16#7FFF_FFFF#
then
return 4;
else
return 8;
end if;
end Length;
function To_Decimal (Item : Byte_Array; Format : Binary_Format)
return Num
is
Result : Num'Base;
begin
case Format is
when H => -- High_Order_First
Result := Num'Base'Fixed_Value (
High_Order_First_To_Decimal (Item));
when L => -- Low_Order_First
Result := Num'Base'Fixed_Value (
Low_Order_First_To_Decimal (Item));
when N => -- Native_Binary
Result := Num'Base'Fixed_Value (
Native_Binary_To_Decimal (Item));
end case;
if Result not in Num then
raise Conversion_Error;
end if;
return Result;
end To_Decimal;
function To_Binary (Item : Num; Format : Binary_Format)
return Byte_Array is
begin
case Format is
when H => -- High_Order_First
return To_Binary_High_Order_First (
Long_Long_Integer'Integer_Value (Item));
when L => -- Low_Order_First
return To_Binary_Low_Order_First (
Long_Long_Integer'Integer_Value (Item));
when N => -- Native_Binary
return To_Native_Binary (
Long_Long_Integer'Integer_Value (Item));
end case;
end To_Binary;
function To_Decimal (Item : Binary) return Num is
Result : constant Num'Base := Num'Fixed_Value (Item);
begin
if Result not in Num then
raise Conversion_Error;
end if;
return Result;
end To_Decimal;
function To_Decimal (Item : Long_Binary) return Num is
Result : constant Num'Base := Num'Fixed_Value (Item);
begin
if Result not in Num then
raise Conversion_Error;
end if;
return Result;
end To_Decimal;
function To_Binary (Item : Num) return Binary is
begin
if Long_Long_Integer'Integer_Value (Item) not in
Long_Long_Integer (Binary'First) ..
Long_Long_Integer (Binary'Last)
then
raise Conversion_Error;
end if;
return Binary'Integer_Value (Item);
end To_Binary;
function To_Long_Binary (Item : Num) return Long_Binary is
begin
return Long_Binary'Integer_Value (Item);
end To_Long_Binary;
end Decimal_Conversions;
end Interfaces.COBOL;
|
-- ----------------------------------------------------------------- --
-- --
-- This is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU General Public --
-- License as published by the Free Software Foundation; either --
-- version 2 of the License, or (at your option) any later version. --
-- --
-- This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. --
-- --
-- You should have received a copy of the GNU General Public --
-- License along with this library; if not, write to the --
-- Free Software Foundation, Inc., 59 Temple Place - Suite 330, --
-- Boston, MA 02111-1307, USA. --
-- --
-- ----------------------------------------------------------------- --
-- ----------------------------------------------------------------- --
-- This is a translation, to the Ada programming language, of the --
-- original C test files written by Sam Lantinga - www.libsdl.org --
-- translation made by Antonio F. Vargas - www.adapower.net/~avargas --
-- ----------------------------------------------------------------- --
with Interfaces.C;
with Interfaces.C.Strings;
with Ada.Command_Line;
with SDL.Video;
with SDL.Events;
package TestGL_Sprogs is
package V renames SDL.Video;
package Ev renames SDL.Events;
package C renames Interfaces.C;
package CS renames Interfaces.C.Strings;
package CL renames Ada.Command_Line;
procedure HotKey_ToggleFullScreen;
procedure HotKey_ToggleGrab;
procedure HotKey_Iconify;
procedure RunGLTest (video_flags : in out V.Surface_Flags;
logo : Boolean; slowly : Boolean;
bppixel : C.int; gamma : C.C_float);
end TestGL_Sprogs;
|
with Littlefs; use Littlefs;
with System.Storage_Elements; use System.Storage_Elements;
with Interfaces.C; use Interfaces.C;
with Interfaces; use Interfaces;
with System;
package body RAM_BD is
function Read (C : access constant LFS_Config;
Block : LFS_Block;
Off : LFS_Offset;
Buffer : System.Address;
Size : LFS_Size)
return int
with Convention => C;
function Prog (C : access constant LFS_Config;
Block : LFS_Block;
Off : LFS_Offset;
Buffer : System.Address;
Size : LFS_Size)
return int
with Convention => C;
function Erase (C : access constant LFS_Config;
Block : LFS_Block)
return int
with Convention => C;
function Sync (C : access constant LFS_Config) return int
with Convention => C;
----------
-- Read --
----------
function Read (C : access constant LFS_Config;
Block : LFS_Block;
Off : LFS_Offset;
Buffer : System.Address;
Size : LFS_Size)
return int
is
Offset : constant LFS_Offset := Off + C.Block_Size * LFS_Size (Block);
Dev_Buf : Storage_Array (1 .. Storage_Offset (Size))
with Address => To_Address
(To_Integer (C.Context) + Integer_Address (Offset));
Read_Buf : Storage_Array (1 .. Storage_Offset (Size))
with Address => Buffer;
begin
Read_Buf := Dev_Buf;
return 0;
end Read;
function Prog (C : access constant LFS_Config;
Block : LFS_Block;
Off : LFS_Offset;
Buffer : System.Address;
Size : LFS_Size)
return int
is
Offset : constant LFS_Offset := Off + C.Block_Size * LFS_Size (Block);
Dev_Buf : Storage_Array (1 .. Storage_Offset (Size))
with Address => To_Address
(To_Integer (C.Context) + Integer_Address (Offset));
Read_Buf : Storage_Array (1 .. Storage_Offset (Size))
with Address => Buffer;
begin
Dev_Buf := Read_Buf;
return 0;
end Prog;
function Erase (C : access constant LFS_Config;
Block : LFS_Block)
return int
is
pragma Unreferenced (Block, C);
begin
return 0;
end Erase;
function Sync (C : access constant LFS_Config) return int is
pragma Unreferenced (C);
begin
return 0;
end Sync;
type LFS_Config_Access is access all Littlefs.LFS_Config;
type Storage_Array_Access is access all Storage_Array;
------------
-- Create --
------------
function Create (Size : Littlefs.LFS_Size)
return access constant Littlefs.LFS_Config
is
Ret : constant LFS_Config_Access := new LFS_Config;
Buf : constant Storage_Array_Access :=
new Storage_Array (1 .. Storage_Offset (Size));
begin
Ret.Context := Buf (Buf'First)'Address;
Ret.Read := Read'Access;
Ret.Prog := Prog'Access;
Ret.Erase := Erase'Access;
Ret.Sync := Sync'Access;
Ret.Read_Size := 2048;
Ret.Prog_Size := 2048;
Ret.Block_Size := 2048;
Ret.Block_Count := Size / 2048;
Ret.Block_Cycles := 700;
Ret.Cache_Size := Ret.Block_Size;
Ret.Lookahead_Size := Ret.Block_Size;
Ret.Read_Buffer := System.Null_Address;
Ret.Prog_Buffer := System.Null_Address;
Ret.Lookahead_Buffer := System.Null_Address;
Ret.Name_Max := 0;
Ret.File_Max := 0;
Ret.Attr_Max := 0;
return Ret;
end Create;
end RAM_BD;
|
pragma License (Unrestricted);
-- Ada 2012
with Ada.Characters.Conversions;
with Ada.Strings.Generic_Hash_Case_Insensitive;
function Ada.Strings.Wide_Hash_Case_Insensitive is
new Generic_Hash_Case_Insensitive (
Wide_Character,
Wide_String,
Characters.Conversions.Get);
-- pragma Pure (Ada.Strings.Wide_Hash_Case_Insensitive);
pragma Preelaborate (Ada.Strings.Wide_Hash_Case_Insensitive); -- use maps
|
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Elements.Declarations;
with Program.Lexical_Elements;
with Program.Elements.Defining_Identifiers;
with Program.Elements.Parameter_Specifications;
with Program.Elements.Aspect_Specifications;
package Program.Elements.Procedure_Body_Stubs is
pragma Pure (Program.Elements.Procedure_Body_Stubs);
type Procedure_Body_Stub is
limited interface and Program.Elements.Declarations.Declaration;
type Procedure_Body_Stub_Access is access all Procedure_Body_Stub'Class
with Storage_Size => 0;
not overriding function Name
(Self : Procedure_Body_Stub)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access is abstract;
not overriding function Parameters
(Self : Procedure_Body_Stub)
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access is abstract;
not overriding function Aspects
(Self : Procedure_Body_Stub)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access is abstract;
not overriding function Has_Not (Self : Procedure_Body_Stub) return Boolean
is abstract;
not overriding function Has_Overriding
(Self : Procedure_Body_Stub)
return Boolean is abstract;
type Procedure_Body_Stub_Text is limited interface;
type Procedure_Body_Stub_Text_Access is
access all Procedure_Body_Stub_Text'Class with Storage_Size => 0;
not overriding function To_Procedure_Body_Stub_Text
(Self : in out Procedure_Body_Stub)
return Procedure_Body_Stub_Text_Access is abstract;
not overriding function Not_Token
(Self : Procedure_Body_Stub_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Overriding_Token
(Self : Procedure_Body_Stub_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Procedure_Token
(Self : Procedure_Body_Stub_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Left_Bracket_Token
(Self : Procedure_Body_Stub_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Right_Bracket_Token
(Self : Procedure_Body_Stub_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Is_Token
(Self : Procedure_Body_Stub_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function Separate_Token
(Self : Procedure_Body_Stub_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
not overriding function With_Token
(Self : Procedure_Body_Stub_Text)
return Program.Lexical_Elements.Lexical_Element_Access is abstract;
not overriding function Semicolon_Token
(Self : Procedure_Body_Stub_Text)
return not null Program.Lexical_Elements.Lexical_Element_Access
is abstract;
end Program.Elements.Procedure_Body_Stubs;
|
--
-- Copyright 2018 The wookey project team <wookey@ssi.gouv.fr>
-- - 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.debug;
with ewok.tasks; use ewok.tasks;
with ewok.tasks_shared; use ewok.tasks_shared;
with ewok.exported.devices; use ewok.exported.devices;
with ewok.devices_shared; use ewok.devices_shared;
with ewok.devices;
package body ewok.syscalls.cfg.dev
with spark_mode => off
is
--pragma debug_policy (IGNORE);
package TSK renames ewok.tasks;
procedure dev_map
(caller_id : in ewok.tasks_shared.t_task_id;
params : in out t_parameters;
mode : in ewok.tasks_shared.t_task_mode)
is
dev_descriptor : unsigned_8
with address => params(1)'address;
dev_id : ewok.devices_shared.t_device_id;
dev : ewok.devices.t_checked_user_device_access;
ok : boolean;
begin
--
-- Checking user inputs
--
-- Task must not be in ISR mode
-- NOTE
-- The reasons to forbid a task in ISR mode to map/unmap some devices
-- are not technical. An ISR *must* be a minimal piece of code that
-- manage only the interrupts provided by a specific hardware.
if mode = ewok.tasks_shared.TASK_MODE_ISRTHREAD then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_map(): forbidden in ISR mode"));
goto ret_denied;
end if;
-- No map/unmap before end of initialization
if not is_init_done (caller_id) then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_map(): forbidden during init sequence"));
goto ret_denied;
end if;
-- Valid device descriptor ?
if dev_descriptor not in TSK.tasks_list(caller_id).device_id'range
then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_map(): invalid device descriptor"));
goto ret_inval;
end if;
dev_id := TSK.tasks_list(caller_id).device_id (dev_descriptor);
-- Used device descriptor ?
if dev_id = ID_DEV_UNUSED then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_map(): unused device"));
goto ret_inval;
end if;
-- Defensive programming. Verifying that the device really belongs to the
-- task
if ewok.devices.get_task_from_id (dev_id) /= caller_id then
raise program_error;
end if;
-- Verifying that the device may be voluntary mapped by the task
dev := ewok.devices.get_user_device (dev_id);
if dev.map_mode /= ewok.exported.devices.DEV_MAP_VOLUNTARY then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_map(): not a DEV_MAP_VOLUNTARY device"));
goto ret_denied;
end if;
-- Verifying that the device is not already mapped
if TSK.is_mounted (caller_id, dev_id) then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_map(): the device is already mapped"));
goto ret_denied;
end if;
--
-- Mapping the device
--
TSK.mount_device (caller_id, dev_id, ok);
if not ok then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_map(): mount_device() failed (no free region?)"));
goto ret_busy;
end if;
-- We enable the device if its not already enabled
-- FIXME - That code should not be here.
-- Should create a special syscall for enabling/disabling
-- devices (cf. ewok-syscalls-init.adb)
ewok.devices.enable_device (dev_id, ok);
if not ok then
goto ret_denied;
end if;
set_return_value (caller_id, mode, SYS_E_DONE);
TSK.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_inval>>
set_return_value (caller_id, mode, SYS_E_INVAL);
TSK.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_denied>>
set_return_value (caller_id, mode, SYS_E_DENIED);
TSK.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_busy>>
set_return_value (caller_id, mode, SYS_E_BUSY);
TSK.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
end dev_map;
procedure dev_unmap
(caller_id : in ewok.tasks_shared.t_task_id;
params : in out t_parameters;
mode : in ewok.tasks_shared.t_task_mode)
is
dev_descriptor : unsigned_8
with address => params(1)'address;
dev_id : ewok.devices_shared.t_device_id;
dev : ewok.devices.t_checked_user_device_access;
ok : boolean;
begin
--
-- Checking user inputs
--
-- Task must not be in ISR mode
-- NOTE
-- The reasons to forbid a task in ISR mode to map/unmap some devices
-- are not technical. An ISR *must* be a minimal piece of code that
-- manage only the interrupts provided by a specific hardware.
if mode = ewok.tasks_shared.TASK_MODE_ISRTHREAD then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_unmap(): forbidden in ISR mode"));
goto ret_denied;
end if;
-- No unmap before end of initialization
if not is_init_done (caller_id) then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_unmap(): forbidden during init sequence"));
goto ret_denied;
end if;
-- Valid device descriptor ?
if dev_descriptor not in TSK.tasks_list(caller_id).device_id'range
then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_unmap(): invalid device descriptor"));
goto ret_inval;
end if;
dev_id := TSK.tasks_list(caller_id).device_id (dev_descriptor);
-- Used device descriptor ?
if dev_id = ID_DEV_UNUSED then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_unmap(): unused device"));
goto ret_inval;
end if;
-- Defensive programming. Verifying that the device really belongs to the
-- task
if ewok.devices.get_task_from_id (dev_id) /= caller_id then
raise program_error;
end if;
-- Verifying that the device may be voluntary unmapped by the task
dev := ewok.devices.get_user_device (dev_id);
if dev.map_mode /= ewok.exported.devices.DEV_MAP_VOLUNTARY then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_unmap(): not a DEV_MAP_VOLUNTARY device"));
goto ret_denied;
end if;
--
-- Unmapping the device
--
TSK.unmount_device (caller_id, dev_id, ok);
if not ok then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_unmap(): device is not mapped"));
goto ret_denied;
end if;
set_return_value (caller_id, mode, SYS_E_DONE);
TSK.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_inval>>
set_return_value (caller_id, mode, SYS_E_INVAL);
TSK.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_denied>>
set_return_value (caller_id, mode, SYS_E_DENIED);
TSK.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
end dev_unmap;
procedure dev_release
(caller_id : in ewok.tasks_shared.t_task_id;
params : in out t_parameters;
mode : in ewok.tasks_shared.t_task_mode)
is
dev_descriptor : unsigned_8
with address => params(1)'address;
dev_id : ewok.devices_shared.t_device_id;
ok : boolean;
begin
-- No release before end of initialization
if not is_init_done (caller_id) then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_release(): forbidden during init sequence"));
goto ret_denied;
end if;
-- Valid device descriptor ?
if dev_descriptor not in TSK.tasks_list(caller_id).device_id'range
then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_release(): invalid device descriptor"));
goto ret_inval;
end if;
dev_id := TSK.tasks_list(caller_id).device_id (dev_descriptor);
-- Used device descriptor ?
if dev_id = ID_DEV_UNUSED then
pragma DEBUG (debug.log (debug.ERROR,
ewok.tasks.tasks_list(caller_id).name
& ": dev_release(): unused device"));
goto ret_inval;
end if;
-- Defensive programming. Verifying that the device really belongs to the
-- task
if ewok.devices.get_task_from_id (dev_id) /= caller_id then
raise program_error;
end if;
--
-- Releasing the device
--
-- Unmounting the device
if TSK.is_mounted (caller_id, dev_id) then
TSK.unmount_device (caller_id, dev_id, ok);
if not ok then
raise program_error; -- Should never happen
end if;
end if;
-- Removing it from the task's list of used devices
TSK.remove_device (caller_id, dev_id, ok);
if not ok then
raise program_error; -- Should never happen
end if;
-- Release GPIOs, EXTIs and interrupts
ewok.devices.release_device (caller_id, dev_id, ok);
set_return_value (caller_id, mode, SYS_E_DONE);
TSK.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_inval>>
set_return_value (caller_id, mode, SYS_E_INVAL);
TSK.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_denied>>
set_return_value (caller_id, mode, SYS_E_DENIED);
TSK.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
end dev_release;
end ewok.syscalls.cfg.dev;
|
function Is_Prime(Item : Positive) return Boolean is
Result : Boolean := True;
Test : Natural;
begin
if Item /= 2 and Item mod 2 = 0 then
Result := False;
else
Test := 3;
while Test < Integer(Sqrt(Float(Item))) loop
if Item mod Test = 0 then
Result := False;
exit;
end if;
Test := Test + 2;
end loop;
end if;
return Result;
end Is_Prime;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . W I D E _ W I D E _ S U P E R B O U N D E D --
-- --
-- S p e c --
-- --
-- Copyright (C) 2003-2012, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This non generic package contains most of the implementation of the
-- generic package Ada.Strings.Wide_Wide_Bounded.Generic_Bounded_Length.
-- It defines type Super_String as a discriminated record with the maximum
-- length as the discriminant. Individual instantiations of the package
-- Strings.Wide_Wide_Bounded.Generic_Bounded_Length use this type with
-- an appropriate discriminant value set.
with Ada.Strings.Wide_Wide_Maps;
package Ada.Strings.Wide_Wide_Superbounded is
pragma Preelaborate;
Wide_Wide_NUL : constant Wide_Wide_Character :=
Wide_Wide_Character'Val (0);
-- Wide_Wide_Bounded.Generic_Bounded_Length.Wide_Wide_Bounded_String is
-- derived from Super_String, with the constraint of the maximum length.
type Super_String (Max_Length : Positive) is record
Current_Length : Natural := 0;
Data : Wide_Wide_String (1 .. Max_Length);
-- A previous version had a default initial value for Data, which is
-- no longer necessary, because we now special-case this type in the
-- compiler, so "=" composes properly for descendants of this type.
-- Leaving it out is more efficient.
end record;
-- The subprograms defined for Super_String are similar to those defined
-- for Bounded_Wide_Wide_String, except that they have different names, so
-- that they can be renamed in Wide_Wide_Bounded.Generic_Bounded_Length.
function Super_Length (Source : Super_String) return Natural;
--------------------------------------------------------
-- Conversion, Concatenation, and Selection Functions --
--------------------------------------------------------
function To_Super_String
(Source : Wide_Wide_String;
Max_Length : Natural;
Drop : Truncation := Error) return Super_String;
-- Note the additional parameter Max_Length, which specifies the maximum
-- length setting of the resulting Super_String value.
-- The following procedures have declarations (and semantics) that are
-- exactly analogous to those declared in Ada.Strings.Wide_Wide_Bounded.
function Super_To_String (Source : Super_String) return Wide_Wide_String;
procedure Set_Super_String
(Target : out Super_String;
Source : Wide_Wide_String;
Drop : Truncation := Error);
function Super_Append
(Left : Super_String;
Right : Super_String;
Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Super_String;
Right : Wide_Wide_String;
Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Wide_Wide_String;
Right : Super_String;
Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Super_String;
Right : Wide_Wide_Character;
Drop : Truncation := Error) return Super_String;
function Super_Append
(Left : Wide_Wide_Character;
Right : Super_String;
Drop : Truncation := Error) return Super_String;
procedure Super_Append
(Source : in out Super_String;
New_Item : Super_String;
Drop : Truncation := Error);
procedure Super_Append
(Source : in out Super_String;
New_Item : Wide_Wide_String;
Drop : Truncation := Error);
procedure Super_Append
(Source : in out Super_String;
New_Item : Wide_Wide_Character;
Drop : Truncation := Error);
function Concat
(Left : Super_String;
Right : Super_String) return Super_String;
function Concat
(Left : Super_String;
Right : Wide_Wide_String) return Super_String;
function Concat
(Left : Wide_Wide_String;
Right : Super_String) return Super_String;
function Concat
(Left : Super_String;
Right : Wide_Wide_Character) return Super_String;
function Concat
(Left : Wide_Wide_Character;
Right : Super_String) return Super_String;
function Super_Element
(Source : Super_String;
Index : Positive) return Wide_Wide_Character;
procedure Super_Replace_Element
(Source : in out Super_String;
Index : Positive;
By : Wide_Wide_Character);
function Super_Slice
(Source : Super_String;
Low : Positive;
High : Natural) return Wide_Wide_String;
function Super_Slice
(Source : Super_String;
Low : Positive;
High : Natural) return Super_String;
procedure Super_Slice
(Source : Super_String;
Target : out Super_String;
Low : Positive;
High : Natural);
function "="
(Left : Super_String;
Right : Super_String) return Boolean;
function Equal
(Left : Super_String;
Right : Super_String) return Boolean renames "=";
function Equal
(Left : Super_String;
Right : Wide_Wide_String) return Boolean;
function Equal
(Left : Wide_Wide_String;
Right : Super_String) return Boolean;
function Less
(Left : Super_String;
Right : Super_String) return Boolean;
function Less
(Left : Super_String;
Right : Wide_Wide_String) return Boolean;
function Less
(Left : Wide_Wide_String;
Right : Super_String) return Boolean;
function Less_Or_Equal
(Left : Super_String;
Right : Super_String) return Boolean;
function Less_Or_Equal
(Left : Super_String;
Right : Wide_Wide_String) return Boolean;
function Less_Or_Equal
(Left : Wide_Wide_String;
Right : Super_String) return Boolean;
function Greater
(Left : Super_String;
Right : Super_String) return Boolean;
function Greater
(Left : Super_String;
Right : Wide_Wide_String) return Boolean;
function Greater
(Left : Wide_Wide_String;
Right : Super_String) return Boolean;
function Greater_Or_Equal
(Left : Super_String;
Right : Super_String) return Boolean;
function Greater_Or_Equal
(Left : Super_String;
Right : Wide_Wide_String) return Boolean;
function Greater_Or_Equal
(Left : Wide_Wide_String;
Right : Super_String) return Boolean;
----------------------
-- Search Functions --
----------------------
function Super_Index
(Source : Super_String;
Pattern : Wide_Wide_String;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity)
return Natural;
function Super_Index
(Source : Super_String;
Pattern : Wide_Wide_String;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Super_Index
(Source : Super_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership := Inside;
Going : Direction := Forward) return Natural;
function Super_Index
(Source : Super_String;
Pattern : Wide_Wide_String;
From : Positive;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity)
return Natural;
function Super_Index
(Source : Super_String;
Pattern : Wide_Wide_String;
From : Positive;
Going : Direction := Forward;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Super_Index
(Source : Super_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
From : Positive;
Test : Membership := Inside;
Going : Direction := Forward) return Natural;
function Super_Index_Non_Blank
(Source : Super_String;
Going : Direction := Forward) return Natural;
function Super_Index_Non_Blank
(Source : Super_String;
From : Positive;
Going : Direction := Forward) return Natural;
function Super_Count
(Source : Super_String;
Pattern : Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping :=
Wide_Wide_Maps.Identity)
return Natural;
function Super_Count
(Source : Super_String;
Pattern : Wide_Wide_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Natural;
function Super_Count
(Source : Super_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set) return Natural;
procedure Super_Find_Token
(Source : Super_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
From : Positive;
Test : Membership;
First : out Positive;
Last : out Natural);
procedure Super_Find_Token
(Source : Super_String;
Set : Wide_Wide_Maps.Wide_Wide_Character_Set;
Test : Membership;
First : out Positive;
Last : out Natural);
------------------------------------
-- String Translation Subprograms --
------------------------------------
function Super_Translate
(Source : Super_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping)
return Super_String;
procedure Super_Translate
(Source : in out Super_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping);
function Super_Translate
(Source : Super_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function)
return Super_String;
procedure Super_Translate
(Source : in out Super_String;
Mapping : Wide_Wide_Maps.Wide_Wide_Character_Mapping_Function);
---------------------------------------
-- String Transformation Subprograms --
---------------------------------------
function Super_Replace_Slice
(Source : Super_String;
Low : Positive;
High : Natural;
By : Wide_Wide_String;
Drop : Truncation := Error) return Super_String;
procedure Super_Replace_Slice
(Source : in out Super_String;
Low : Positive;
High : Natural;
By : Wide_Wide_String;
Drop : Truncation := Error);
function Super_Insert
(Source : Super_String;
Before : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error) return Super_String;
procedure Super_Insert
(Source : in out Super_String;
Before : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error);
function Super_Overwrite
(Source : Super_String;
Position : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error) return Super_String;
procedure Super_Overwrite
(Source : in out Super_String;
Position : Positive;
New_Item : Wide_Wide_String;
Drop : Truncation := Error);
function Super_Delete
(Source : Super_String;
From : Positive;
Through : Natural) return Super_String;
procedure Super_Delete
(Source : in out Super_String;
From : Positive;
Through : Natural);
---------------------------------
-- String Selector Subprograms --
---------------------------------
function Super_Trim
(Source : Super_String;
Side : Trim_End) return Super_String;
procedure Super_Trim
(Source : in out Super_String;
Side : Trim_End);
function Super_Trim
(Source : Super_String;
Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : Wide_Wide_Maps.Wide_Wide_Character_Set) return Super_String;
procedure Super_Trim
(Source : in out Super_String;
Left : Wide_Wide_Maps.Wide_Wide_Character_Set;
Right : Wide_Wide_Maps.Wide_Wide_Character_Set);
function Super_Head
(Source : Super_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error) return Super_String;
procedure Super_Head
(Source : in out Super_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error);
function Super_Tail
(Source : Super_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error) return Super_String;
procedure Super_Tail
(Source : in out Super_String;
Count : Natural;
Pad : Wide_Wide_Character := Wide_Wide_Space;
Drop : Truncation := Error);
------------------------------------
-- String Constructor Subprograms --
------------------------------------
-- Note: in some of the following routines, there is an extra parameter
-- Max_Length which specifies the value of the maximum length for the
-- resulting Super_String value.
function Times
(Left : Natural;
Right : Wide_Wide_Character;
Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Times
(Left : Natural;
Right : Wide_Wide_String;
Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Times
(Left : Natural;
Right : Super_String) return Super_String;
function Super_Replicate
(Count : Natural;
Item : Wide_Wide_Character;
Drop : Truncation := Error;
Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Super_Replicate
(Count : Natural;
Item : Wide_Wide_String;
Drop : Truncation := Error;
Max_Length : Positive) return Super_String;
-- Note the additional parameter Max_Length
function Super_Replicate
(Count : Natural;
Item : Super_String;
Drop : Truncation := Error) return Super_String;
private
-- Pragma Inline declarations
pragma Inline ("=");
pragma Inline (Less);
pragma Inline (Less_Or_Equal);
pragma Inline (Greater);
pragma Inline (Greater_Or_Equal);
pragma Inline (Concat);
pragma Inline (Super_Count);
pragma Inline (Super_Element);
pragma Inline (Super_Find_Token);
pragma Inline (Super_Index);
pragma Inline (Super_Index_Non_Blank);
pragma Inline (Super_Length);
pragma Inline (Super_Replace_Element);
pragma Inline (Super_Slice);
pragma Inline (Super_To_String);
end Ada.Strings.Wide_Wide_Superbounded;
|
package Tkmrpc.Request.Cfg is
end Tkmrpc.Request.Cfg;
|
-- WORDS, a Latin dictionary, by Colonel William Whitaker (USAF, Retired)
--
-- Copyright William A. Whitaker (1936–2010)
--
-- This is a free program, which means it is proper to copy it and pass
-- it on to your friends. Consider it a developmental item for which
-- there is no charge. However, just for form, it is Copyrighted
-- (c). Permission is hereby freely given for any and all use of program
-- and data. You can sell it as your own, but at least tell me.
--
-- This version is distributed without obligation, but the developer
-- would appreciate comments and suggestions.
--
-- All parts of the WORDS system, source code and data files, are made freely
-- available to anyone who wishes to use them, for whatever purpose.
with Latin_Utils.Inflections_Package; use Latin_Utils.Inflections_Package;
with Latin_Utils.Dictionary_Package; use Latin_Utils.Dictionary_Package;
package Support_Utils.Uniques_Package is
type Unique_Item;
type Unique_List is access Unique_Item;
type Unique_Item is
record
Stem : Stem_Type := Null_Stem_Type;
Qual : Quality_Record := Null_Quality_Record;
Kind : Kind_Entry := Null_Kind_Entry;
MNPC : Dict_IO.Count := Null_MNPC;
Succ : Unique_List;
end record;
type Latin_Uniques is array (Character range 'a' .. 'z') of Unique_List;
Null_Latin_Uniques : Latin_Uniques := (others => null);
Unq : Latin_Uniques := Null_Latin_Uniques;
type Uniques_De_Array is
array (Dict_IO.Positive_Count range <>) of Dictionary_Entry;
Uniques_De : Uniques_De_Array (1 .. 100) :=
(others => Null_Dictionary_Entry);
end Support_Utils.Uniques_Package;
|
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2019 onox <denkpadje@gmail.com>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Orka.Transforms.SIMD_Vector_Conversions;
generic
with package Conversions is new Orka.Transforms.SIMD_Vector_Conversions (<>);
package Orka.Transforms.SIMD_Matrix_Conversions is
pragma Pure;
function Convert
(Elements : Conversions.From_Matrices.Matrix_Type) return Conversions.To_Matrices.Matrix_Type
is (Conversions.Convert (Elements (X)),
Conversions.Convert (Elements (Y)),
Conversions.Convert (Elements (Z)),
Conversions.Convert (Elements (W)));
end Orka.Transforms.SIMD_Matrix_Conversions;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Text_IO.Complex_IO --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Ada.Numerics.Generic_Complex_Types;
generic
with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>);
package Terminal_Interface.Curses.Text_IO.Complex_IO is
use Complex_Types;
Default_Fore : Field := 2;
Default_Aft : Field := Real'Digits - 1;
Default_Exp : Field := 3;
procedure Put
(Win : Window;
Item : Complex;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
procedure Put
(Item : Complex;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
private
pragma Inline (Put);
end Terminal_Interface.Curses.Text_IO.Complex_IO;
|
-- {{Ada/Sourceforge|fibonacci_1.adb}}
pragma License (Gpl);
pragma Ada_95;
with Ada.Text_IO;
with Ada.Command_Line;
procedure Fibonacci_1 is
type Integer_Type is range 0 .. 999_999_999_999_999_999;
package CL renames Ada.Command_Line;
package T_IO renames Ada.Text_IO;
package I_IO is new Ada.Text_IO.Integer_IO (Integer_Type);
function Fib (N : Integer_Type) return Integer_Type;
Last : Positive;
Value : Integer_Type;
function Fib (N : Integer_Type) return Integer_Type is
begin
if N = 0 then
return 0;
elsif N = 1 then
return 1;
else
return Fib (N - 1) + Fib (N - 2);
end if;
end Fib;
begin
I_IO.Get
(From => CL.Argument (1),
Item => Value,
Last => Last);
T_IO.Put ("The Fibonacci of ");
I_IO.Put
(Item => Value,
Width => 3,
Base => I_IO.Default_Base);
T_IO.Put (" is ");
I_IO.Put
(Item => Fib (Value),
Width => I_IO.Default_Width,
Base => I_IO.Default_Base);
return;
end Fibonacci_1;
----------------------------------------------------------------------------
-- $Author: krischik $
--
-- $Revision: 226 $
-- $Date: 2007-12-02 15:11:44 +0000 (Sun, 02 Dec 2007) $
--
-- $Id: fibonacci_1.adb 226 2007-12-02 15:11:44Z krischik $
-- $HeadURL: file:///svn/p/wikibook-ada/code/trunk/demos/Source/fibonacci_1.adb $
----------------------------------------------------------------------------
-- vim: textwidth=0 nowrap tabstop=8 shiftwidth=3 softtabstop=3 expandtab
-- vim: filetype=ada encoding=utf-8 fileformat=unix foldmethod=indent
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
package AMF.Standard_Profile_L3 is
pragma Preelaborate;
end AMF.Standard_Profile_L3;
|
-- Copyright (c) 2015-2017 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
-- @summary
-- Lexical Analysis Stuff
--
-- @description
-- This package provides namespace for lexical analysis algorithms
-- and related data types.
package Incr.Lexers is
pragma Pure;
end Incr.Lexers;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- F M A P --
-- --
-- B o d y --
-- --
-- Copyright (C) 2001-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Opt; use Opt;
with Osint; use Osint;
with Output; use Output;
with Table;
with Types; use Types;
pragma Warnings (Off);
-- This package is used also by gnatcoll
with System.OS_Lib; use System.OS_Lib;
pragma Warnings (On);
with Unchecked_Conversion;
with GNAT.HTable;
package body Fmap is
No_Mapping_File : Boolean := False;
-- Set to True when the specified mapping file cannot be read in
-- procedure Initialize, so that no attempt is made to open the mapping
-- file in procedure Update_Mapping_File.
function To_Big_String_Ptr is new Unchecked_Conversion
(Source_Buffer_Ptr, Big_String_Ptr);
Max_Buffer : constant := 1_500;
Buffer : String (1 .. Max_Buffer);
-- Used to buffer output when writing to a new mapping file
Buffer_Last : Natural := 0;
-- Index of last valid character in Buffer
type Mapping is record
Uname : Unit_Name_Type;
Fname : File_Name_Type;
end record;
package File_Mapping is new Table.Table (
Table_Component_Type => Mapping,
Table_Index_Type => Int,
Table_Low_Bound => 0,
Table_Initial => 1_000,
Table_Increment => 1_000,
Table_Name => "Fmap.File_Mapping");
-- Mapping table to map unit names to file names
package Path_Mapping is new Table.Table (
Table_Component_Type => Mapping,
Table_Index_Type => Int,
Table_Low_Bound => 0,
Table_Initial => 1_000,
Table_Increment => 1_000,
Table_Name => "Fmap.Path_Mapping");
-- Mapping table to map file names to path names
type Header_Num is range 0 .. 1_000;
function Hash (F : Unit_Name_Type) return Header_Num;
-- Function used to compute hash of unit name
No_Entry : constant Int := -1;
-- Signals no entry in following table
package Unit_Hash_Table is new GNAT.HTable.Simple_HTable (
Header_Num => Header_Num,
Element => Int,
No_Element => No_Entry,
Key => Unit_Name_Type,
Hash => Hash,
Equal => "=");
-- Hash table to map unit names to file names. Used in conjunction with
-- table File_Mapping above.
function Hash (F : File_Name_Type) return Header_Num;
-- Function used to compute hash of file name
package File_Hash_Table is new GNAT.HTable.Simple_HTable (
Header_Num => Header_Num,
Element => Int,
No_Element => No_Entry,
Key => File_Name_Type,
Hash => Hash,
Equal => "=");
-- Hash table to map file names to path names. Used in conjunction with
-- table Path_Mapping above.
Last_In_Table : Int := 0;
package Forbidden_Names is new GNAT.HTable.Simple_HTable (
Header_Num => Header_Num,
Element => Boolean,
No_Element => False,
Key => File_Name_Type,
Hash => Hash,
Equal => "=");
-----------------------------
-- Add_Forbidden_File_Name --
-----------------------------
procedure Add_Forbidden_File_Name (Name : File_Name_Type) is
begin
Forbidden_Names.Set (Name, True);
end Add_Forbidden_File_Name;
---------------------
-- Add_To_File_Map --
---------------------
procedure Add_To_File_Map
(Unit_Name : Unit_Name_Type;
File_Name : File_Name_Type;
Path_Name : File_Name_Type)
is
Unit_Entry : constant Int := Unit_Hash_Table.Get (Unit_Name);
File_Entry : constant Int := File_Hash_Table.Get (File_Name);
begin
if Unit_Entry = No_Entry or else
File_Mapping.Table (Unit_Entry).Fname /= File_Name
then
File_Mapping.Increment_Last;
Unit_Hash_Table.Set (Unit_Name, File_Mapping.Last);
File_Mapping.Table (File_Mapping.Last) :=
(Uname => Unit_Name, Fname => File_Name);
end if;
if File_Entry = No_Entry or else
Path_Mapping.Table (File_Entry).Fname /= Path_Name
then
Path_Mapping.Increment_Last;
File_Hash_Table.Set (File_Name, Path_Mapping.Last);
Path_Mapping.Table (Path_Mapping.Last) :=
(Uname => Unit_Name, Fname => Path_Name);
end if;
end Add_To_File_Map;
----------
-- Hash --
----------
function Hash (F : File_Name_Type) return Header_Num is
begin
return Header_Num (Int (F) rem Header_Num'Range_Length);
end Hash;
function Hash (F : Unit_Name_Type) return Header_Num is
begin
return Header_Num (Int (F) rem Header_Num'Range_Length);
end Hash;
----------------
-- Initialize --
----------------
procedure Initialize (File_Name : String) is
Src : Source_Buffer_Ptr;
Hi : Source_Ptr;
BS : Big_String_Ptr;
SP : String_Ptr;
First : Positive := 1;
Last : Natural := 0;
Uname : Unit_Name_Type;
Fname : File_Name_Type;
Pname : File_Name_Type;
procedure Empty_Tables;
-- Remove all entries in case of incorrect mapping file
function Find_File_Name return File_Name_Type;
-- Return Error_File_Name if the name buffer contains "/", otherwise
-- call Name_Find. "/" is the path name in the mapping file to indicate
-- that a source has been suppressed, and thus should not be found by
-- the compiler.
function Find_Unit_Name return Unit_Name_Type;
-- Return the unit name in the name buffer. Return Error_Unit_Name if
-- the name buffer contains "/".
procedure Get_Line;
-- Get a line from the mapping file, where a line is SP (First .. Last)
procedure Report_Truncated;
-- Report a warning when the mapping file is truncated
-- (number of lines is not a multiple of 3).
------------------
-- Empty_Tables --
------------------
procedure Empty_Tables is
begin
Unit_Hash_Table.Reset;
File_Hash_Table.Reset;
Path_Mapping.Set_Last (0);
File_Mapping.Set_Last (0);
Last_In_Table := 0;
end Empty_Tables;
--------------------
-- Find_File_Name --
--------------------
function Find_File_Name return File_Name_Type is
begin
if Name_Buffer (1 .. Name_Len) = "/" then
-- A path name of "/" is the indication that the source has been
-- "suppressed". Return Error_File_Name so that the compiler does
-- not find the source, even if it is in the include path.
return Error_File_Name;
else
return Name_Find;
end if;
end Find_File_Name;
--------------------
-- Find_Unit_Name --
--------------------
function Find_Unit_Name return Unit_Name_Type is
begin
return Unit_Name_Type (Find_File_Name);
end Find_Unit_Name;
--------------
-- Get_Line --
--------------
procedure Get_Line is
use ASCII;
begin
First := Last + 1;
-- If not at the end of file, skip the end of line
while First < SP'Last
and then (SP (First) = CR
or else SP (First) = LF
or else SP (First) = EOF)
loop
First := First + 1;
end loop;
-- If not at the end of file, find the end of this new line
if First < SP'Last and then SP (First) /= EOF then
Last := First;
while Last < SP'Last
and then SP (Last + 1) /= CR
and then SP (Last + 1) /= LF
and then SP (Last + 1) /= EOF
loop
Last := Last + 1;
end loop;
end if;
end Get_Line;
----------------------
-- Report_Truncated --
----------------------
procedure Report_Truncated is
begin
Write_Str ("warning: mapping file """);
Write_Str (File_Name);
Write_Line (""" is truncated");
end Report_Truncated;
-- Start of processing for Initialize
begin
Empty_Tables;
Name_Len := File_Name'Length;
Name_Buffer (1 .. Name_Len) := File_Name;
Read_Source_File (Name_Enter, 0, Hi, Src, Config);
if Src = null then
Write_Str ("warning: could not read mapping file """);
Write_Str (File_Name);
Write_Line ("""");
No_Mapping_File := True;
else
BS := To_Big_String_Ptr (Src);
SP := BS (1 .. Natural (Hi))'Unrestricted_Access;
loop
-- Get the unit name
Get_Line;
-- Exit if end of file has been reached
exit when First > Last;
if (Last < First + 2) or else (SP (Last - 1) /= '%')
or else (SP (Last) /= 's' and then SP (Last) /= 'b')
then
Write_Line
("warning: mapping file """ & File_Name &
""" is incorrectly formatted");
Write_Line ("Line = """ & SP (First .. Last) & '"');
Empty_Tables;
return;
end if;
Name_Len := Last - First + 1;
Name_Buffer (1 .. Name_Len) := SP (First .. Last);
Uname := Find_Unit_Name;
-- Get the file name
Get_Line;
-- If end of line has been reached, file is truncated
if First > Last then
Report_Truncated;
Empty_Tables;
return;
end if;
Name_Len := Last - First + 1;
Name_Buffer (1 .. Name_Len) := SP (First .. Last);
Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
Fname := Find_File_Name;
-- Get the path name
Get_Line;
-- If end of line has been reached, file is truncated
if First > Last then
Report_Truncated;
Empty_Tables;
return;
end if;
Name_Len := Last - First + 1;
Name_Buffer (1 .. Name_Len) := SP (First .. Last);
Pname := Find_File_Name;
-- Add the mappings for this unit name
Add_To_File_Map (Uname, Fname, Pname);
end loop;
end if;
-- Record the length of the two mapping tables
Last_In_Table := File_Mapping.Last;
end Initialize;
----------------------
-- Mapped_File_Name --
----------------------
function Mapped_File_Name (Unit : Unit_Name_Type) return File_Name_Type is
The_Index : constant Int := Unit_Hash_Table.Get (Unit);
begin
if The_Index = No_Entry then
return No_File;
else
return File_Mapping.Table (The_Index).Fname;
end if;
end Mapped_File_Name;
----------------------
-- Mapped_Path_Name --
----------------------
function Mapped_Path_Name (File : File_Name_Type) return File_Name_Type is
Index : Int := No_Entry;
begin
if Forbidden_Names.Get (File) then
return Error_File_Name;
end if;
Index := File_Hash_Table.Get (File);
if Index = No_Entry then
return No_File;
else
return Path_Mapping.Table (Index).Fname;
end if;
end Mapped_Path_Name;
------------------
-- Reset_Tables --
------------------
procedure Reset_Tables is
begin
File_Mapping.Init;
Path_Mapping.Init;
Unit_Hash_Table.Reset;
File_Hash_Table.Reset;
Forbidden_Names.Reset;
Last_In_Table := 0;
end Reset_Tables;
-------------------------
-- Update_Mapping_File --
-------------------------
procedure Update_Mapping_File (File_Name : String) is
File : File_Descriptor;
N_Bytes : Integer;
File_Entry : Int;
Status : Boolean;
-- For the call to Close
procedure Put_Line (Name : Name_Id);
-- Put Name as a line in the Mapping File
--------------
-- Put_Line --
--------------
procedure Put_Line (Name : Name_Id) is
begin
Get_Name_String (Name);
-- If the Buffer is full, write it to the file
if Buffer_Last + Name_Len + 1 > Buffer'Last then
N_Bytes := Write (File, Buffer (1)'Address, Buffer_Last);
if N_Bytes < Buffer_Last then
Fail ("disk full");
end if;
Buffer_Last := 0;
end if;
-- Add the line to the Buffer
Buffer (Buffer_Last + 1 .. Buffer_Last + Name_Len) :=
Name_Buffer (1 .. Name_Len);
Buffer_Last := Buffer_Last + Name_Len + 1;
Buffer (Buffer_Last) := ASCII.LF;
end Put_Line;
-- Start of processing for Update_Mapping_File
begin
-- If the mapping file could not be read, then it will not be possible
-- to update it.
if No_Mapping_File then
return;
end if;
-- Only Update if there are new entries in the mappings
if Last_In_Table < File_Mapping.Last then
File := Open_Read_Write (Name => File_Name, Fmode => Binary);
if File /= Invalid_FD then
if Last_In_Table > 0 then
Lseek (File, 0, Seek_End);
end if;
for Unit in Last_In_Table + 1 .. File_Mapping.Last loop
Put_Line (Name_Id (File_Mapping.Table (Unit).Uname));
Put_Line (Name_Id (File_Mapping.Table (Unit).Fname));
File_Entry :=
File_Hash_Table.Get (File_Mapping.Table (Unit).Fname);
Put_Line (Name_Id (Path_Mapping.Table (File_Entry).Fname));
end loop;
-- Before closing the file, write the buffer to the file. It is
-- guaranteed that the Buffer is not empty, because Put_Line has
-- been called at least 3 times, and after a call to Put_Line, the
-- Buffer is not empty.
N_Bytes := Write (File, Buffer (1)'Address, Buffer_Last);
if N_Bytes < Buffer_Last then
Fail ("disk full");
end if;
Close (File, Status);
if not Status then
Fail ("disk full");
end if;
elsif not Quiet_Output then
Write_Str ("warning: could not open mapping file """);
Write_Str (File_Name);
Write_Line (""" for update");
end if;
end if;
end Update_Mapping_File;
end Fmap;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Program.Nodes.Single_Protected_Declarations is
function Create
(Protected_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
New_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions.Expression_Vector_Access;
With_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Definition : not null Program.Elements.Protected_Definitions
.Protected_Definition_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Single_Protected_Declaration is
begin
return Result : Single_Protected_Declaration :=
(Protected_Token => Protected_Token, Name => Name,
With_Token => With_Token, Aspects => Aspects, Is_Token => Is_Token,
New_Token => New_Token, Progenitors => Progenitors,
With_Token_2 => With_Token_2, Definition => Definition,
Semicolon_Token => Semicolon_Token, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Definition : not null Program.Elements.Protected_Definitions
.Protected_Definition_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Single_Protected_Declaration is
begin
return Result : Implicit_Single_Protected_Declaration :=
(Name => Name, Aspects => Aspects, Progenitors => Progenitors,
Definition => Definition, Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Name
(Self : Base_Single_Protected_Declaration)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access is
begin
return Self.Name;
end Name;
overriding function Aspects
(Self : Base_Single_Protected_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access is
begin
return Self.Aspects;
end Aspects;
overriding function Progenitors
(Self : Base_Single_Protected_Declaration)
return Program.Elements.Expressions.Expression_Vector_Access is
begin
return Self.Progenitors;
end Progenitors;
overriding function Definition
(Self : Base_Single_Protected_Declaration)
return not null Program.Elements.Protected_Definitions
.Protected_Definition_Access is
begin
return Self.Definition;
end Definition;
overriding function Protected_Token
(Self : Single_Protected_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Protected_Token;
end Protected_Token;
overriding function With_Token
(Self : Single_Protected_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.With_Token;
end With_Token;
overriding function Is_Token
(Self : Single_Protected_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Is_Token;
end Is_Token;
overriding function New_Token
(Self : Single_Protected_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.New_Token;
end New_Token;
overriding function With_Token_2
(Self : Single_Protected_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.With_Token_2;
end With_Token_2;
overriding function Semicolon_Token
(Self : Single_Protected_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Semicolon_Token;
end Semicolon_Token;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Single_Protected_Declaration)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Single_Protected_Declaration)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Single_Protected_Declaration)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
procedure Initialize
(Self : aliased in out Base_Single_Protected_Declaration'Class) is
begin
Set_Enclosing_Element (Self.Name, Self'Unchecked_Access);
for Item in Self.Aspects.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
for Item in Self.Progenitors.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
Set_Enclosing_Element (Self.Definition, Self'Unchecked_Access);
null;
end Initialize;
overriding function Is_Single_Protected_Declaration_Element
(Self : Base_Single_Protected_Declaration)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Single_Protected_Declaration_Element;
overriding function Is_Declaration_Element
(Self : Base_Single_Protected_Declaration)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Declaration_Element;
overriding procedure Visit
(Self : not null access Base_Single_Protected_Declaration;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Single_Protected_Declaration (Self);
end Visit;
overriding function To_Single_Protected_Declaration_Text
(Self : aliased in out Single_Protected_Declaration)
return Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration_Text_Access is
begin
return Self'Unchecked_Access;
end To_Single_Protected_Declaration_Text;
overriding function To_Single_Protected_Declaration_Text
(Self : aliased in out Implicit_Single_Protected_Declaration)
return Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Single_Protected_Declaration_Text;
end Program.Nodes.Single_Protected_Declarations;
|
with Ada.Text_IO; use Ada.Text_IO;
package body Types.Strings is
package Io is new Ada.Text_IO.Float_IO (Float);
function To_String
(Value : Float)
return String is
begin
-- Use IO package to convert number to a string
-- Use global objects from spec to control formatting
return "";
end To_String;
-- Implement
function To_String
(Value : Miles_T)
return String is
begin
return To_String (Float (Value));
end To_String;
function To_String
(Value : Hours_T)
return String is
begin
return To_String (Float (Value));
end To_String;
-- Implement functions to convert your types to strings
end Types.Strings;
|
-----------------------------------------------------------------------
-- Ada Labs --
-- --
-- Copyright (C) 2008-2009, AdaCore --
-- --
-- Labs is free software; you can redistribute it and/or modify it --
-- under the terms of the GNU General Public License as published by --
-- the Free Software Foundation; either version 2 of the License, or --
-- (at your option) any later version. --
-- --
-- This program is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. You should have received --
-- a copy of the GNU General Public License along with this program; --
-- if not, write to the Free Software Foundation, Inc., 59 Temple --
-- Place - Suite 330, Boston, MA 02111-1307, USA. --
-----------------------------------------------------------------------
with Libm_Single; use Libm_Single;
package body Solar_System is
-- QUESTION 1
Bodies_Collision : exception;
procedure Init_Body
(B : Bodies_Enum_T;
Bodies : in out Bodies_Array_T;
Radius : Float;
Color : RGBA_T;
Distance : Float;
Angle : Float;
Speed : Float;
Turns_Around : Bodies_Enum_T;
Visible : Boolean := True)
is
begin
Bodies (B) :=
(Distance => Distance,
Speed => Speed,
Angle => Angle,
Turns_Around => Turns_Around,
Visible => Visible,
Color => Color,
Radius => Radius,
others => <>);
end Init_Body;
-- implement a function to compute the X coordinate
-- x of the reference + distance * cos(angle)
function Compute_X
(Body_To_Move : Body_T;
Turns_Around : Body_T) return Float;
-- implement a function to compute the Y coordinate
-- y of the reference + distance * sin(angle)
function Compute_Y
(Body_To_Move : Body_T;
Turns_Around : Body_T) return Float;
function Compute_X
(Body_To_Move : Body_T;
Turns_Around : Body_T) return Float
is
begin
return Turns_Around.X + Body_To_Move.Distance * Cos (Body_To_Move.Angle);
end Compute_X;
function Compute_Y
(Body_To_Move : Body_T;
Turns_Around : Body_T) return Float
is
begin
return Turns_Around.Y + Body_To_Move.Distance * Sin (Body_To_Move.Angle);
end Compute_Y;
function Colliding (A : Body_T; B : Body_T) return Boolean is
begin
return (A.X - B.X) ** 2 + (A.Y - B.Y) ** 2 <= (A.Radius + B.Radius) ** 2;
end Colliding;
procedure Move (Body_To_Move : in out Body_T; Bodies : Bodies_Array_T) is
begin
Body_To_Move.X :=
Compute_X (Body_To_Move, Bodies (Body_To_Move.Turns_Around));
Body_To_Move.Y :=
Compute_Y (Body_To_Move, Bodies (Body_To_Move.Turns_Around));
Body_To_Move.Angle := Body_To_Move.Angle + Body_To_Move.Speed;
for Body_Collision_Check of Bodies loop
if Body_To_Move /= Body_Collision_Check
and then Colliding (Body_To_Move, Body_Collision_Check) then
-- QUESTION 2
raise Bodies_Collision;
end if;
end loop;
end Move;
procedure Move_All (Bodies : in out Bodies_Array_T) is
begin
-- loop over all bodies and call Move procedure
for B of Bodies loop
declare
begin
-- call the move procedure for each body
Move (B, Bodies);
-- QUESTION 3
exception
when Bodies_Collision =>
B.Speed := -B.Speed;
end;
end loop;
end Move_All;
end Solar_System;
|
-- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_copy_gc_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
pad0 : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
src_gc : aliased xcb.xcb_gcontext_t;
dst_gc : aliased xcb.xcb_gcontext_t;
value_mask : aliased Interfaces.Unsigned_32;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C.size_t range <>) of aliased xcb.xcb_copy_gc_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_copy_gc_request_t.Item,
Element_Array => xcb.xcb_copy_gc_request_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C.size_t range <>) of aliased xcb.xcb_copy_gc_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_copy_gc_request_t.Pointer,
Element_Array => xcb.xcb_copy_gc_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_copy_gc_request_t;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . I N T E R R U P T S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
-- This package encapsulates the implementation of interrupt or signal
-- handlers. It is logically an extension of the body of Ada.Interrupts. It
-- is made a child of System to allow visibility of various runtime system
-- internal data and operations.
-- See System.Interrupt_Management for core interrupt/signal interfaces
-- These two packages are separated to allow System.Interrupt_Management to be
-- used without requiring the whole tasking implementation to be linked and
-- elaborated.
with System.Tasking;
with System.Tasking.Protected_Objects.Entries;
with System.OS_Interface;
package System.Interrupts is
pragma Elaborate_Body;
-- Comment needed on why this is here ???
-------------------------
-- Constants and types --
-------------------------
Default_Interrupt_Priority : constant System.Interrupt_Priority :=
System.Interrupt_Priority'Last;
-- Default value used when a pragma Interrupt_Handler or Attach_Handler is
-- specified without an Interrupt_Priority pragma, see D.3(10).
type Ada_Interrupt_ID is range 0 .. System.OS_Interface.Max_Interrupt;
-- Avoid inheritance by Ada.Interrupts.Interrupt_ID of unwanted operations
type Interrupt_ID is range 0 .. System.OS_Interface.Max_Interrupt;
subtype System_Interrupt_Id is Interrupt_ID;
-- This synonym is introduced so that the type is accessible through
-- rtsfind, otherwise the name clashes with its homonym in Ada.Interrupts.
type Parameterless_Handler is access protected procedure;
----------------------
-- General services --
----------------------
-- Attempt to attach a Handler to an Interrupt to which an Entry is
-- already bound will raise a Program_Error.
function Is_Reserved (Interrupt : Interrupt_ID) return Boolean;
function Is_Entry_Attached (Interrupt : Interrupt_ID) return Boolean;
function Is_Handler_Attached (Interrupt : Interrupt_ID) return Boolean;
function Current_Handler
(Interrupt : Interrupt_ID) return Parameterless_Handler;
-- Calling the following procedures with New_Handler = null and Static =
-- true means that we want to modify the current handler regardless of the
-- previous handler's binding status. (i.e. we do not care whether it is a
-- dynamic or static handler)
procedure Attach_Handler
(New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
Static : Boolean := False);
procedure Exchange_Handler
(Old_Handler : out Parameterless_Handler;
New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
Static : Boolean := False);
procedure Detach_Handler
(Interrupt : Interrupt_ID;
Static : Boolean := False);
function Reference
(Interrupt : Interrupt_ID) return System.Address;
--------------------------------
-- Interrupt Entries Services --
--------------------------------
-- Routines needed for Interrupt Entries
procedure Bind_Interrupt_To_Entry
(T : System.Tasking.Task_Id;
E : System.Tasking.Task_Entry_Index;
Int_Ref : System.Address);
-- Bind the given interrupt to the given entry. If the interrupt is
-- already bound to another entry, Program_Error will be raised.
procedure Detach_Interrupt_Entries (T : System.Tasking.Task_Id);
-- This procedure detaches all the Interrupt Entries bound to a task
------------------------------
-- POSIX.5 Signals Services --
------------------------------
-- Routines needed for POSIX dot5 POSIX_Signals
procedure Block_Interrupt (Interrupt : Interrupt_ID);
-- Block the Interrupt on the process level
procedure Unblock_Interrupt (Interrupt : Interrupt_ID);
function Unblocked_By
(Interrupt : Interrupt_ID) return System.Tasking.Task_Id;
-- It returns the ID of the last Task which Unblocked this Interrupt.
-- It returns Null_Task if no tasks have ever requested the Unblocking
-- operation or the Interrupt is currently Blocked.
function Is_Blocked (Interrupt : Interrupt_ID) return Boolean;
-- Comment needed ???
procedure Ignore_Interrupt (Interrupt : Interrupt_ID);
-- Set the sigaction for the interrupt to SIG_IGN
procedure Unignore_Interrupt (Interrupt : Interrupt_ID);
-- Comment needed ???
function Is_Ignored (Interrupt : Interrupt_ID) return Boolean;
-- Comment needed ???
-- Note : Direct calls to sigaction, sigprocmask, thr_sigsetmask, or any
-- other low-level interface that changes the signal action or signal mask
-- needs careful thought.
-- One may achieve the effect of system calls first making RTS blocked (by
-- calling Block_Interrupt) for the signal under consideration. This will
-- make all the tasks in RTS blocked for the Interrupt.
----------------------
-- Protection Types --
----------------------
-- Routines and types needed to implement Interrupt_Handler and
-- Attach_Handler.
-- There are two kinds of protected objects that deal with interrupts:
-- (1) Only Interrupt_Handler pragmas are used. We need to be able to tell
-- if an Interrupt_Handler applies to a given procedure, so
-- Register_Interrupt_Handler has to be called for all the potential
-- handlers, it should be done by calling Register_Interrupt_Handler with
-- the handler code address. On finalization, which can happen only has
-- part of library level finalization since PO with Interrupt_Handler
-- pragmas can only be declared at library level, nothing special needs to
-- be done since the default handlers have been restored as part of task
-- completion which is done just before global finalization.
-- Dynamic_Interrupt_Protection should be used in this case.
-- (2) Attach_Handler pragmas are used, and possibly Interrupt_Handler
-- pragma. We need to attach the handlers to the given interrupts when the
-- object is elaborated. This should be done by constructing an array of
-- pairs (interrupt, handler) from the pragmas and calling Install_Handlers
-- with it (types to be used are New_Handler_Item and New_Handler_Array).
-- On finalization, we need to restore the handlers that were installed
-- before the elaboration of the PO, so we need to store these previous
-- handlers. This is also done by Install_Handlers, the room for this
-- information is provided by adding a discriminant which is the number
-- of Attach_Handler pragmas and an array of this size in the protection
-- type, Static_Interrupt_Protection.
procedure Register_Interrupt_Handler
(Handler_Addr : System.Address);
-- This routine should be called by the compiler to allow the handler be
-- used as an Interrupt Handler. That means call this procedure for each
-- pragma Interrupt_Handler providing the address of the handler (not
-- including the pointer to the actual PO, this way this routine is called
-- only once for each type definition of PO).
type Static_Handler_Index is range 0 .. Integer'Last;
subtype Positive_Static_Handler_Index is
Static_Handler_Index range 1 .. Static_Handler_Index'Last;
-- Comment needed ???
type Previous_Handler_Item is record
Interrupt : Interrupt_ID;
Handler : Parameterless_Handler;
Static : Boolean;
end record;
-- Contains all the information needed to restore a previous handler
type Previous_Handler_Array is array
(Positive_Static_Handler_Index range <>) of Previous_Handler_Item;
type New_Handler_Item is record
Interrupt : Interrupt_ID;
Handler : Parameterless_Handler;
end record;
-- Contains all the information from an Attach_Handler pragma
type New_Handler_Array is
array (Positive_Static_Handler_Index range <>) of New_Handler_Item;
-- Comment needed ???
-- Case (1)
type Dynamic_Interrupt_Protection is new
Tasking.Protected_Objects.Entries.Protection_Entries with null record;
-- ??? Finalize is not overloaded since we currently have no
-- way to detach the handlers during library level finalization.
function Has_Interrupt_Or_Attach_Handler
(Object : access Dynamic_Interrupt_Protection) return Boolean;
-- Returns True
-- Case (2)
type Static_Interrupt_Protection
(Num_Entries : Tasking.Protected_Objects.Protected_Entry_Index;
Num_Attach_Handler : Static_Handler_Index)
is new
Tasking.Protected_Objects.Entries.Protection_Entries (Num_Entries) with
record
Previous_Handlers : Previous_Handler_Array (1 .. Num_Attach_Handler);
end record;
function Has_Interrupt_Or_Attach_Handler
(Object : access Static_Interrupt_Protection) return Boolean;
-- Returns True
overriding procedure Finalize (Object : in out Static_Interrupt_Protection);
-- Restore previous handlers as required by C.3.1(12) then call
-- Finalize (Protection).
procedure Install_Handlers
(Object : access Static_Interrupt_Protection;
New_Handlers : New_Handler_Array);
-- Store the old handlers in Object.Previous_Handlers and install
-- the new static handlers.
procedure Install_Restricted_Handlers
(Prio : Any_Priority;
Handlers : New_Handler_Array);
-- Install the static Handlers for the given interrupts and do not
-- store previously installed handlers. This procedure is used when
-- the Ravenscar restrictions are in place since in that case there
-- are only library-level protected handlers that will be installed
-- at initialization and never be replaced.
end System.Interrupts;
|
-- CD2B11D.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT THE EXPRESSION IN A COLLECTION SIZE CLAUSE
-- FOR AN ACCESS TYPE NEED NOT BE STATIC.
-- HISTORY:
-- BCB 09/23/87 CREATED ORIGINAL TEST.
-- PWB 05/11/89 CHANGED EXTENSION FROM '.DEP' TO '.ADA'.
WITH REPORT; USE REPORT;
PROCEDURE CD2B11D IS
TYPE CHECK_TYPE IS ACCESS INTEGER;
FOR CHECK_TYPE'STORAGE_SIZE USE 256;
TYPE ACC_TYPE IS ACCESS INTEGER;
FOR ACC_TYPE'STORAGE_SIZE USE IDENT_INT (256);
BEGIN
TEST ("CD2B11D", "CHECK THAT THE EXPRESSION IN A COLLECTION " &
"SIZE SPECIFICATION FOR AN ACCESS TYPE "&
"NEED NOT BE STATIC");
IF ACC_TYPE'STORAGE_SIZE < IDENT_INT (256) THEN
FAILED ("INCORRECT VALUE FOR STORAGE_SIZE");
END IF;
RESULT;
END CD2B11D;
|
-----------------------------------------------------------------------
-- dynamo -- Ada Code Generator
-- Copyright (C) 2009, 2010, 2011, 2012 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with GNAT.Command_Line; use GNAT.Command_Line;
with GNAT.Traceback.Symbolic;
with Sax.Readers;
with Ada.Text_IO;
with Ada.Strings.Unbounded;
with Ada.Exceptions;
with Ada.Directories;
with Ada.Command_Line;
with Util.Files;
with Util.Log.Loggers;
with Gen.Generator;
with Gen.Commands;
with Gen.Configs;
procedure Dynamo is
use Ada;
use Ada.Strings.Unbounded;
use Ada.Directories;
use Ada.Command_Line;
use Gen.Commands;
procedure Set_Config_Directory (Path : in String;
Silent : in Boolean := False);
procedure Print_Configuration (Generator : in Gen.Generator.Handler);
Out_Dir : Unbounded_String;
Config_Dir : Unbounded_String;
Template_Dir : Unbounded_String;
Status : Exit_Status := Success;
Debug : Boolean := False;
Print_Config : Boolean := False;
-- ------------------------------
-- Print information about dynamo configuration
-- ------------------------------
procedure Print_Configuration (Generator : in Gen.Generator.Handler) is
begin
Ada.Text_IO.Put_Line ("Dynamo version : " & Gen.Configs.VERSION);
Ada.Text_IO.Put_Line ("Config directory : " & Generator.Get_Config_Directory);
Ada.Text_IO.Put_Line ("UML directory : "
& Generator.Get_Parameter (Gen.Configs.GEN_UML_DIR));
Ada.Text_IO.Put_Line ("Templates directory : "
& Generator.Get_Parameter (Gen.Configs.GEN_TEMPLATES_DIRS));
Ada.Text_IO.Put_Line ("GNAT project directory : "
& Generator.Get_Parameter (Gen.Configs.GEN_GNAT_PROJECT_DIRS));
end Print_Configuration;
-- ------------------------------
-- Verify and set the configuration path
-- ------------------------------
procedure Set_Config_Directory (Path : in String;
Silent : in Boolean := False) is
Log_Path : constant String := Ada.Directories.Compose (Path, "log4j.properties");
begin
-- Ignore if the config directory was already set.
if Length (Config_Dir) > 0 then
return;
end if;
-- Check that we can read some configuration file.
if not Ada.Directories.Exists (Log_Path) then
if not Silent then
Ada.Text_IO.Put_Line ("Invalid config directory: " & Path);
Status := Failure;
end if;
return;
end if;
-- Configure the logs
Util.Log.Loggers.Initialize (Log_Path);
Config_Dir := To_Unbounded_String (Path);
end Set_Config_Directory;
begin
Initialize_Option_Scan (Stop_At_First_Non_Switch => True, Section_Delimiters => "targs");
-- Parse the command line
loop
case Getopt ("* v d o: t: c:") is
when ASCII.NUL => exit;
when 'o' =>
Out_Dir := To_Unbounded_String (Parameter & "/");
when 't' =>
Template_Dir := To_Unbounded_String (Parameter & "/");
when 'c' =>
Set_Config_Directory (Parameter);
when 'd' =>
Debug := True;
when 'v' =>
Print_Config := True;
when '*' =>
exit;
when others =>
null;
end case;
end loop;
if Length (Config_Dir) = 0 then
declare
Name : constant String := Ada.Command_Line.Command_Name;
Path : constant String := Ada.Directories.Containing_Directory (Name);
Dir : constant String := Containing_Directory (Path);
begin
Set_Config_Directory (Compose (Dir, "config"), True);
Set_Config_Directory (Util.Files.Compose (Dir, "share/dynamo/base"), True);
Set_Config_Directory (Gen.Configs.CONFIG_DIR, True);
end;
end if;
if Status /= Success then
Gen.Commands.Short_Help_Usage;
Ada.Command_Line.Set_Exit_Status (Status);
return;
end if;
if Ada.Command_Line.Argument_Count = 0 then
Gen.Commands.Short_Help_Usage;
Set_Exit_Status (Failure);
return;
end if;
declare
Cmd_Name : constant String := Full_Switch;
Cmd : Gen.Commands.Command_Access;
Generator : Gen.Generator.Handler;
begin
if Length (Out_Dir) > 0 then
Gen.Generator.Set_Result_Directory (Generator, To_String (Out_Dir));
end if;
if Length (Template_Dir) > 0 then
Gen.Generator.Set_Template_Directory (Generator, Template_Dir);
end if;
Gen.Generator.Initialize (Generator, Config_Dir, Debug);
if Print_Config then
Print_Configuration (Generator);
return;
end if;
Cmd := Gen.Commands.Find_Command (Cmd_Name);
-- Check that the command exists.
if Cmd = null then
if Cmd_Name'Length > 0 then
Ada.Text_IO.Put_Line ("Invalid command: '" & Cmd_Name & "'");
end if;
Gen.Commands.Short_Help_Usage;
Set_Exit_Status (Failure);
return;
end if;
Cmd.Execute (Generator);
Ada.Command_Line.Set_Exit_Status (Gen.Generator.Get_Status (Generator));
end;
exception
when E : Invalid_Switch =>
Ada.Text_IO.Put_Line ("Invalid option: " & Ada.Exceptions.Exception_Message (E));
Gen.Commands.Short_Help_Usage;
Ada.Command_Line.Set_Exit_Status (2);
when E : Gen.Generator.Fatal_Error =>
Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Message (E));
Ada.Command_Line.Set_Exit_Status (1);
when E : Sax.Readers.XML_Fatal_Error =>
Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Message (E));
Ada.Command_Line.Set_Exit_Status (1);
when E : others =>
Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Message (E));
Ada.Text_IO.Put_Line (GNAT.Traceback.Symbolic.Symbolic_Traceback (E));
Ada.Command_Line.Set_Exit_Status (1);
end Dynamo;
|
with Ada.Text_IO; use Ada.Text_IO;
procedure Adventofcode.Day_12.Main is
begin
Put_Line ("Day-12");
end Adventofcode.Day_12.Main;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- V M S _ C O N V --
-- --
-- B o d y --
-- --
-- Copyright (C) 1996-2006, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Gnatvsn; use Gnatvsn;
with Hostparm;
with Opt;
with Osint; use Osint;
with Targparm; use Targparm;
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
package body VMS_Conv is
Keep_Temps_Option : constant Item_Ptr :=
new Item'
(Id => Id_Option,
Name =>
new String'("/KEEP_TEMPORARY_FILES"),
Next => null,
Command => Undefined,
Unix_String => null);
Param_Count : Natural := 0;
-- Number of parameter arguments so far
Arg_Num : Natural;
-- Argument number
Arg_File : Ada.Text_IO.File_Type;
-- A file where arguments are read from
Commands : Item_Ptr;
-- Pointer to head of list of command items, one for each command, with
-- the end of the list marked by a null pointer.
Last_Command : Item_Ptr;
-- Pointer to last item in Commands list
Command : Item_Ptr;
-- Pointer to command item for current command
Make_Commands_Active : Item_Ptr := null;
-- Set to point to Command entry for COMPILE, BIND, or LINK as appropriate
-- if a COMMANDS_TRANSLATION switch has been encountered while processing
-- a MAKE Command.
Output_File_Expected : Boolean := False;
-- True for GNAT LINK after -o switch, so that the ".ali" extension is
-- not added to the executable file name.
package Buffer is new Table.Table
(Table_Component_Type => Character,
Table_Index_Type => Integer,
Table_Low_Bound => 1,
Table_Initial => 4096,
Table_Increment => 2,
Table_Name => "Buffer");
function Init_Object_Dirs return Argument_List;
-- Get the list of the object directories
function Invert_Sense (S : String) return VMS_Data.String_Ptr;
-- Given a unix switch string S, computes the inverse (adding or
-- removing ! characters as required), and returns a pointer to
-- the allocated result on the heap.
function Is_Extensionless (F : String) return Boolean;
-- Returns true if the filename has no extension
function Match (S1, S2 : String) return Boolean;
-- Determines whether S1 and S2 match (this is a case insensitive match)
function Match_Prefix (S1, S2 : String) return Boolean;
-- Determines whether S1 matches a prefix of S2. This is also a case
-- insensitive match (for example Match ("AB","abc") is True).
function Matching_Name
(S : String;
Itm : Item_Ptr;
Quiet : Boolean := False) return Item_Ptr;
-- Determines if the item list headed by Itm and threaded through the
-- Next fields (with null marking the end of the list), contains an
-- entry that uniquely matches the given string. The match is case
-- insensitive and permits unique abbreviation. If the match succeeds,
-- then a pointer to the matching item is returned. Otherwise, an
-- appropriate error message is written. Note that the discriminant
-- of Itm is used to determine the appropriate form of this message.
-- Quiet is normally False as shown, if it is set to True, then no
-- error message is generated in a not found situation (null is still
-- returned to indicate the not-found situation).
function OK_Alphanumerplus (S : String) return Boolean;
-- Checks that S is a string of alphanumeric characters,
-- returning True if all alphanumeric characters,
-- False if empty or a non-alphanumeric character is present.
function OK_Integer (S : String) return Boolean;
-- Checks that S is a string of digits, returning True if all digits,
-- False if empty or a non-digit is present.
procedure Place (C : Character);
-- Place a single character in the buffer, updating Ptr
procedure Place (S : String);
-- Place a string character in the buffer, updating Ptr
procedure Place_Lower (S : String);
-- Place string in buffer, forcing letters to lower case, updating Ptr
procedure Place_Unix_Switches (S : VMS_Data.String_Ptr);
-- Given a unix switch string, place corresponding switches in Buffer,
-- updating Ptr appropriatelly. Note that in the case of use of ! the
-- result may be to remove a previously placed switch.
procedure Preprocess_Command_Data;
-- Preprocess the string form of the command and options list into the
-- internal form.
procedure Process_Argument (The_Command : in out Command_Type);
-- Process one argument from the command line, or one line from
-- from a command line file. For the first call, set The_Command.
procedure Validate_Command_Or_Option (N : VMS_Data.String_Ptr);
-- Check that N is a valid command or option name, i.e. that it is of the
-- form of an Ada identifier with upper case letters and underscores.
procedure Validate_Unix_Switch (S : VMS_Data.String_Ptr);
-- Check that S is a valid switch string as described in the syntax for
-- the switch table item UNIX_SWITCH or else begins with a backquote.
----------------------
-- Init_Object_Dirs --
----------------------
function Init_Object_Dirs return Argument_List is
Object_Dirs : Integer;
Object_Dir : Argument_List (1 .. 256);
Object_Dir_Name : String_Access;
begin
Object_Dirs := 0;
Object_Dir_Name := new String'(Object_Dir_Default_Prefix);
Get_Next_Dir_In_Path_Init (Object_Dir_Name);
loop
declare
Dir : constant String_Access :=
String_Access (Get_Next_Dir_In_Path (Object_Dir_Name));
begin
exit when Dir = null;
Object_Dirs := Object_Dirs + 1;
Object_Dir (Object_Dirs) :=
new String'("-L" &
To_Canonical_Dir_Spec
(To_Host_Dir_Spec
(Normalize_Directory_Name (Dir.all).all,
True).all, True).all);
end;
end loop;
Object_Dirs := Object_Dirs + 1;
Object_Dir (Object_Dirs) := new String'("-lgnat");
if OpenVMS_On_Target then
Object_Dirs := Object_Dirs + 1;
Object_Dir (Object_Dirs) := new String'("-ldecgnat");
end if;
return Object_Dir (1 .. Object_Dirs);
end Init_Object_Dirs;
----------------
-- Initialize --
----------------
procedure Initialize is
begin
Command_List :=
(Bind =>
(Cname => new S'("BIND"),
Usage => new S'("GNAT BIND file[.ali] /qualifiers"),
VMS_Only => False,
Unixcmd => new S'("gnatbind"),
Unixsws => null,
Switches => Bind_Switches'Access,
Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => "ali"),
Chop =>
(Cname => new S'("CHOP"),
Usage => new S'("GNAT CHOP file [directory] /qualifiers"),
VMS_Only => False,
Unixcmd => new S'("gnatchop"),
Unixsws => null,
Switches => Chop_Switches'Access,
Params => new Parameter_Array'(1 => File, 2 => Optional_File),
Defext => " "),
Clean =>
(Cname => new S'("CLEAN"),
Usage => new S'("GNAT CLEAN /qualifiers files"),
VMS_Only => False,
Unixcmd => new S'("gnatclean"),
Unixsws => null,
Switches => Clean_Switches'Access,
Params => new Parameter_Array'(1 => File),
Defext => " "),
Compile =>
(Cname => new S'("COMPILE"),
Usage => new S'("GNAT COMPILE filespec[,...] /qualifiers"),
VMS_Only => False,
Unixcmd => new S'("gnatmake"),
Unixsws => new Argument_List'(1 => new String'("-f"),
2 => new String'("-u"),
3 => new String'("-c")),
Switches => GCC_Switches'Access,
Params => new Parameter_Array'(1 => Files_Or_Wildcard),
Defext => " "),
Check =>
(Cname => new S'("CHECK"),
Usage => new S'("GNAT CHECK name /qualifiers"),
VMS_Only => False,
Unixcmd => new S'("gnatcheck"),
Unixsws => null,
Switches => Check_Switches'Access,
Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => " "),
Elim =>
(Cname => new S'("ELIM"),
Usage => new S'("GNAT ELIM name /qualifiers"),
VMS_Only => False,
Unixcmd => new S'("gnatelim"),
Unixsws => null,
Switches => Elim_Switches'Access,
Params => new Parameter_Array'(1 => Other_As_Is),
Defext => "ali"),
Find =>
(Cname => new S'("FIND"),
Usage => new S'("GNAT FIND pattern[:sourcefile[:line"
& "[:column]]] filespec[,...] /qualifiers"),
VMS_Only => False,
Unixcmd => new S'("gnatfind"),
Unixsws => null,
Switches => Find_Switches'Access,
Params => new Parameter_Array'(1 => Other_As_Is,
2 => Files_Or_Wildcard),
Defext => "ali"),
Krunch =>
(Cname => new S'("KRUNCH"),
Usage => new S'("GNAT KRUNCH file [/COUNT=nnn]"),
VMS_Only => False,
Unixcmd => new S'("gnatkr"),
Unixsws => null,
Switches => Krunch_Switches'Access,
Params => new Parameter_Array'(1 => File),
Defext => " "),
Link =>
(Cname => new S'("LINK"),
Usage => new S'("GNAT LINK file[.ali]"
& " [extra obj_&_lib_&_exe_&_opt files]"
& " /qualifiers"),
VMS_Only => False,
Unixcmd => new S'("gnatlink"),
Unixsws => null,
Switches => Link_Switches'Access,
Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => "ali"),
List =>
(Cname => new S'("LIST"),
Usage => new S'("GNAT LIST /qualifiers object_or_ali_file"),
VMS_Only => False,
Unixcmd => new S'("gnatls"),
Unixsws => null,
Switches => List_Switches'Access,
Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => "ali"),
Make =>
(Cname => new S'("MAKE"),
Usage => new S'("GNAT MAKE file(s) /qualifiers (includes "
& "COMPILE /qualifiers)"),
VMS_Only => False,
Unixcmd => new S'("gnatmake"),
Unixsws => null,
Switches => Make_Switches'Access,
Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => " "),
Metric =>
(Cname => new S'("METRIC"),
Usage => new S'("GNAT METRIC /qualifiers source_file"),
VMS_Only => False,
Unixcmd => new S'("gnatmetric"),
Unixsws => null,
Switches => Metric_Switches'Access,
Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => " "),
Name =>
(Cname => new S'("NAME"),
Usage => new S'("GNAT NAME /qualifiers naming-pattern "
& "[naming-patterns]"),
VMS_Only => False,
Unixcmd => new S'("gnatname"),
Unixsws => null,
Switches => Name_Switches'Access,
Params => new Parameter_Array'(1 => Unlimited_As_Is),
Defext => " "),
Preprocess =>
(Cname => new S'("PREPROCESS"),
Usage =>
new S'("GNAT PREPROCESS ifile ofile dfile /qualifiers"),
VMS_Only => False,
Unixcmd => new S'("gnatprep"),
Unixsws => null,
Switches => Prep_Switches'Access,
Params => new Parameter_Array'(1 .. 3 => File),
Defext => " "),
Pretty =>
(Cname => new S'("PRETTY"),
Usage => new S'("GNAT PRETTY /qualifiers source_file"),
VMS_Only => False,
Unixcmd => new S'("gnatpp"),
Unixsws => null,
Switches => Pretty_Switches'Access,
Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => " "),
Setup =>
(Cname => new S'("SETUP"),
Usage => new S'("GNAT SETUP /qualifiers"),
VMS_Only => False,
Unixcmd => new S'(""),
Unixsws => null,
Switches => Setup_Switches'Access,
Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => " "),
Shared =>
(Cname => new S'("SHARED"),
Usage => new S'("GNAT SHARED [obj_&_lib_&_exe_&_opt"
& "files] /qualifiers"),
VMS_Only => True,
Unixcmd => new S'("gcc"),
Unixsws =>
new Argument_List'(new String'("-shared") & Init_Object_Dirs),
Switches => Shared_Switches'Access,
Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => " "),
Stub =>
(Cname => new S'("STUB"),
Usage => new S'("GNAT STUB file [directory]/qualifiers"),
VMS_Only => False,
Unixcmd => new S'("gnatstub"),
Unixsws => null,
Switches => Stub_Switches'Access,
Params => new Parameter_Array'(1 => File, 2 => Optional_File),
Defext => " "),
Xref =>
(Cname => new S'("XREF"),
Usage => new S'("GNAT XREF filespec[,...] /qualifiers"),
VMS_Only => False,
Unixcmd => new S'("gnatxref"),
Unixsws => null,
Switches => Xref_Switches'Access,
Params => new Parameter_Array'(1 => Files_Or_Wildcard),
Defext => "ali")
);
end Initialize;
------------------
-- Invert_Sense --
------------------
function Invert_Sense (S : String) return VMS_Data.String_Ptr is
Sinv : String (1 .. S'Length * 2);
-- Result (for sure long enough)
Sinvp : Natural := 0;
-- Pointer to output string
begin
for Sp in S'Range loop
if Sp = S'First or else S (Sp - 1) = ',' then
if S (Sp) = '!' then
null;
else
Sinv (Sinvp + 1) := '!';
Sinv (Sinvp + 2) := S (Sp);
Sinvp := Sinvp + 2;
end if;
else
Sinv (Sinvp + 1) := S (Sp);
Sinvp := Sinvp + 1;
end if;
end loop;
return new String'(Sinv (1 .. Sinvp));
end Invert_Sense;
----------------------
-- Is_Extensionless --
----------------------
function Is_Extensionless (F : String) return Boolean is
begin
for J in reverse F'Range loop
if F (J) = '.' then
return False;
elsif F (J) = '/' or else F (J) = ']' or else F (J) = ':' then
return True;
end if;
end loop;
return True;
end Is_Extensionless;
-----------
-- Match --
-----------
function Match (S1, S2 : String) return Boolean is
Dif : constant Integer := S2'First - S1'First;
begin
if S1'Length /= S2'Length then
return False;
else
for J in S1'Range loop
if To_Lower (S1 (J)) /= To_Lower (S2 (J + Dif)) then
return False;
end if;
end loop;
return True;
end if;
end Match;
------------------
-- Match_Prefix --
------------------
function Match_Prefix (S1, S2 : String) return Boolean is
begin
if S1'Length > S2'Length then
return False;
else
return Match (S1, S2 (S2'First .. S2'First + S1'Length - 1));
end if;
end Match_Prefix;
-------------------
-- Matching_Name --
-------------------
function Matching_Name
(S : String;
Itm : Item_Ptr;
Quiet : Boolean := False) return Item_Ptr
is
P1, P2 : Item_Ptr;
procedure Err;
-- Little procedure to output command/qualifier/option as appropriate
-- and bump error count.
---------
-- Err --
---------
procedure Err is
begin
if Quiet then
return;
end if;
Errors := Errors + 1;
if Itm /= null then
case Itm.Id is
when Id_Command =>
Put (Standard_Error, "command");
when Id_Switch =>
if Hostparm.OpenVMS then
Put (Standard_Error, "qualifier");
else
Put (Standard_Error, "switch");
end if;
when Id_Option =>
Put (Standard_Error, "option");
end case;
else
Put (Standard_Error, "input");
end if;
Put (Standard_Error, ": ");
Put (Standard_Error, S);
end Err;
-- Start of processing for Matching_Name
begin
-- If exact match, that's the one we want
P1 := Itm;
while P1 /= null loop
if Match (S, P1.Name.all) then
return P1;
else
P1 := P1.Next;
end if;
end loop;
-- Now check for prefix matches
P1 := Itm;
while P1 /= null loop
if P1.Name.all = "/<other>" then
return P1;
elsif not Match_Prefix (S, P1.Name.all) then
P1 := P1.Next;
else
-- Here we have found one matching prefix, so see if there is
-- another one (which is an ambiguity)
P2 := P1.Next;
while P2 /= null loop
if Match_Prefix (S, P2.Name.all) then
if not Quiet then
Put (Standard_Error, "ambiguous ");
Err;
Put (Standard_Error, " (matches ");
Put (Standard_Error, P1.Name.all);
while P2 /= null loop
if Match_Prefix (S, P2.Name.all) then
Put (Standard_Error, ',');
Put (Standard_Error, P2.Name.all);
end if;
P2 := P2.Next;
end loop;
Put_Line (Standard_Error, ")");
end if;
return null;
end if;
P2 := P2.Next;
end loop;
-- If we fall through that loop, then there was only one match
return P1;
end if;
end loop;
-- If we fall through outer loop, there was no match
if not Quiet then
Put (Standard_Error, "unrecognized ");
Err;
New_Line (Standard_Error);
end if;
return null;
end Matching_Name;
-----------------------
-- OK_Alphanumerplus --
-----------------------
function OK_Alphanumerplus (S : String) return Boolean is
begin
if S'Length = 0 then
return False;
else
for J in S'Range loop
if not (Is_Alphanumeric (S (J)) or else
S (J) = '_' or else S (J) = '$')
then
return False;
end if;
end loop;
return True;
end if;
end OK_Alphanumerplus;
----------------
-- OK_Integer --
----------------
function OK_Integer (S : String) return Boolean is
begin
if S'Length = 0 then
return False;
else
for J in S'Range loop
if not Is_Digit (S (J)) then
return False;
end if;
end loop;
return True;
end if;
end OK_Integer;
--------------------
-- Output_Version --
--------------------
procedure Output_Version is
begin
Put ("GNAT ");
Put_Line (Gnatvsn.Gnat_Version_String);
Put_Line ("Copyright 1996-" &
Current_Year &
", Free Software Foundation, Inc.");
end Output_Version;
-----------
-- Place --
-----------
procedure Place (C : Character) is
begin
Buffer.Increment_Last;
Buffer.Table (Buffer.Last) := C;
end Place;
procedure Place (S : String) is
begin
for J in S'Range loop
Place (S (J));
end loop;
end Place;
-----------------
-- Place_Lower --
-----------------
procedure Place_Lower (S : String) is
begin
for J in S'Range loop
Place (To_Lower (S (J)));
end loop;
end Place_Lower;
-------------------------
-- Place_Unix_Switches --
-------------------------
procedure Place_Unix_Switches (S : VMS_Data.String_Ptr) is
P1, P2, P3 : Natural;
Remove : Boolean;
Slen, Sln2 : Natural;
Wild_Card : Boolean := False;
begin
P1 := S'First;
while P1 <= S'Last loop
if S (P1) = '!' then
P1 := P1 + 1;
Remove := True;
else
Remove := False;
end if;
P2 := P1;
pragma Assert (S (P1) = '-' or else S (P1) = '`');
while P2 < S'Last and then S (P2 + 1) /= ',' loop
P2 := P2 + 1;
end loop;
-- Switch is now in S (P1 .. P2)
Slen := P2 - P1 + 1;
if Remove then
Wild_Card := S (P2) = '*';
if Wild_Card then
Slen := Slen - 1;
P2 := P2 - 1;
end if;
P3 := 1;
while P3 <= Buffer.Last - Slen loop
if Buffer.Table (P3) = ' '
and then String (Buffer.Table (P3 + 1 .. P3 + Slen)) =
S (P1 .. P2)
and then (Wild_Card
or else
P3 + Slen = Buffer.Last
or else
Buffer.Table (P3 + Slen + 1) = ' ')
then
Sln2 := Slen;
if Wild_Card then
while P3 + Sln2 /= Buffer.Last
and then Buffer.Table (P3 + Sln2 + 1) /= ' '
loop
Sln2 := Sln2 + 1;
end loop;
end if;
Buffer.Table (P3 .. Buffer.Last - Sln2 - 1) :=
Buffer.Table (P3 + Sln2 + 1 .. Buffer.Last);
Buffer.Set_Last (Buffer.Last - Sln2 - 1);
else
P3 := P3 + 1;
end if;
end loop;
if Wild_Card then
P2 := P2 + 1;
end if;
else
pragma Assert (S (P2) /= '*');
Place (' ');
if S (P1) = '`' then
P1 := P1 + 1;
end if;
Place (S (P1 .. P2));
end if;
P1 := P2 + 2;
end loop;
end Place_Unix_Switches;
-----------------------------
-- Preprocess_Command_Data --
-----------------------------
procedure Preprocess_Command_Data is
begin
for C in Real_Command_Type loop
declare
Command : constant Item_Ptr := new Command_Item;
Last_Switch : Item_Ptr;
-- Last switch in list
begin
-- Link new command item into list of commands
if Last_Command = null then
Commands := Command;
else
Last_Command.Next := Command;
end if;
Last_Command := Command;
-- Fill in fields of new command item
Command.Name := Command_List (C).Cname;
Command.Usage := Command_List (C).Usage;
Command.Command := C;
if Command_List (C).Unixsws = null then
Command.Unix_String := Command_List (C).Unixcmd;
else
declare
Cmd : String (1 .. 5_000);
Last : Natural := 0;
Sws : constant Argument_List_Access :=
Command_List (C).Unixsws;
begin
Cmd (1 .. Command_List (C).Unixcmd'Length) :=
Command_List (C).Unixcmd.all;
Last := Command_List (C).Unixcmd'Length;
for J in Sws'Range loop
Last := Last + 1;
Cmd (Last) := ' ';
Cmd (Last + 1 .. Last + Sws (J)'Length) :=
Sws (J).all;
Last := Last + Sws (J)'Length;
end loop;
Command.Unix_String := new String'(Cmd (1 .. Last));
end;
end if;
Command.Params := Command_List (C).Params;
Command.Defext := Command_List (C).Defext;
Validate_Command_Or_Option (Command.Name);
-- Process the switch list
for S in Command_List (C).Switches'Range loop
declare
SS : constant VMS_Data.String_Ptr :=
Command_List (C).Switches (S);
P : Natural := SS'First;
Sw : Item_Ptr := new Switch_Item;
Last_Opt : Item_Ptr;
-- Pointer to last option
begin
-- Link new switch item into list of switches
if Last_Switch = null then
Command.Switches := Sw;
else
Last_Switch.Next := Sw;
end if;
Last_Switch := Sw;
-- Process switch string, first get name
while SS (P) /= ' ' and SS (P) /= '=' loop
P := P + 1;
end loop;
Sw.Name := new String'(SS (SS'First .. P - 1));
-- Direct translation case
if SS (P) = ' ' then
Sw.Translation := T_Direct;
Sw.Unix_String := new String'(SS (P + 1 .. SS'Last));
Validate_Unix_Switch (Sw.Unix_String);
if SS (P - 1) = '>' then
Sw.Translation := T_Other;
elsif SS (P + 1) = '`' then
null;
-- Create the inverted case (/NO ..)
elsif SS (SS'First + 1 .. SS'First + 2) /= "NO" then
Sw := new Switch_Item;
Last_Switch.Next := Sw;
Last_Switch := Sw;
Sw.Name :=
new String'("/NO" & SS (SS'First + 1 .. P - 1));
Sw.Translation := T_Direct;
Sw.Unix_String := Invert_Sense (SS (P + 1 .. SS'Last));
Validate_Unix_Switch (Sw.Unix_String);
end if;
-- Directories translation case
elsif SS (P + 1) = '*' then
pragma Assert (SS (SS'Last) = '*');
Sw.Translation := T_Directories;
Sw.Unix_String := new String'(SS (P + 2 .. SS'Last - 1));
Validate_Unix_Switch (Sw.Unix_String);
-- Directory translation case
elsif SS (P + 1) = '%' then
pragma Assert (SS (SS'Last) = '%');
Sw.Translation := T_Directory;
Sw.Unix_String := new String'(SS (P + 2 .. SS'Last - 1));
Validate_Unix_Switch (Sw.Unix_String);
-- File translation case
elsif SS (P + 1) = '@' then
pragma Assert (SS (SS'Last) = '@');
Sw.Translation := T_File;
Sw.Unix_String := new String'(SS (P + 2 .. SS'Last - 1));
Validate_Unix_Switch (Sw.Unix_String);
-- No space file translation case
elsif SS (P + 1) = '<' then
pragma Assert (SS (SS'Last) = '>');
Sw.Translation := T_No_Space_File;
Sw.Unix_String := new String'(SS (P + 2 .. SS'Last - 1));
Validate_Unix_Switch (Sw.Unix_String);
-- Numeric translation case
elsif SS (P + 1) = '#' then
pragma Assert (SS (SS'Last) = '#');
Sw.Translation := T_Numeric;
Sw.Unix_String := new String'(SS (P + 2 .. SS'Last - 1));
Validate_Unix_Switch (Sw.Unix_String);
-- Alphanumerplus translation case
elsif SS (P + 1) = '|' then
pragma Assert (SS (SS'Last) = '|');
Sw.Translation := T_Alphanumplus;
Sw.Unix_String := new String'(SS (P + 2 .. SS'Last - 1));
Validate_Unix_Switch (Sw.Unix_String);
-- String translation case
elsif SS (P + 1) = '"' then
pragma Assert (SS (SS'Last) = '"');
Sw.Translation := T_String;
Sw.Unix_String := new String'(SS (P + 2 .. SS'Last - 1));
Validate_Unix_Switch (Sw.Unix_String);
-- Commands translation case
elsif SS (P + 1) = '?' then
Sw.Translation := T_Commands;
Sw.Unix_String := new String'(SS (P + 2 .. SS'Last));
-- Options translation case
else
Sw.Translation := T_Options;
Sw.Unix_String := new String'("");
P := P + 1; -- bump past =
while P <= SS'Last loop
declare
Opt : constant Item_Ptr := new Option_Item;
Q : Natural;
begin
-- Link new option item into options list
if Last_Opt = null then
Sw.Options := Opt;
else
Last_Opt.Next := Opt;
end if;
Last_Opt := Opt;
-- Fill in fields of new option item
Q := P;
while SS (Q) /= ' ' loop
Q := Q + 1;
end loop;
Opt.Name := new String'(SS (P .. Q - 1));
Validate_Command_Or_Option (Opt.Name);
P := Q + 1;
Q := P;
while Q <= SS'Last and then SS (Q) /= ' ' loop
Q := Q + 1;
end loop;
Opt.Unix_String := new String'(SS (P .. Q - 1));
Validate_Unix_Switch (Opt.Unix_String);
P := Q + 1;
end;
end loop;
end if;
end;
end loop;
end;
end loop;
end Preprocess_Command_Data;
----------------------
-- Process_Argument --
----------------------
procedure Process_Argument (The_Command : in out Command_Type) is
Argv : String_Access;
Arg_Idx : Integer;
function Get_Arg_End
(Argv : String;
Arg_Idx : Integer) return Integer;
-- Begins looking at Arg_Idx + 1 and returns the index of the
-- last character before a slash or else the index of the last
-- character in the string Argv.
-----------------
-- Get_Arg_End --
-----------------
function Get_Arg_End
(Argv : String;
Arg_Idx : Integer) return Integer
is
begin
for J in Arg_Idx + 1 .. Argv'Last loop
if Argv (J) = '/' then
return J - 1;
end if;
end loop;
return Argv'Last;
end Get_Arg_End;
-- Start of processing for Process_Argument
begin
-- If an argument file is open, read the next non empty line
if Is_Open (Arg_File) then
declare
Line : String (1 .. 256);
Last : Natural;
begin
loop
Get_Line (Arg_File, Line, Last);
exit when Last /= 0 or else End_Of_File (Arg_File);
end loop;
-- If the end of the argument file has been reached, close it
if End_Of_File (Arg_File) then
Close (Arg_File);
-- If the last line was empty, return after increasing Arg_Num
-- to go to the next argument on the comment line.
if Last = 0 then
Arg_Num := Arg_Num + 1;
return;
end if;
end if;
Argv := new String'(Line (1 .. Last));
Arg_Idx := 1;
if Argv (1) = '@' then
Put_Line (Standard_Error, "argument file cannot contain @cmd");
raise Error_Exit;
end if;
end;
else
-- No argument file is open, get the argument on the command line
Argv := new String'(Argument (Arg_Num));
Arg_Idx := Argv'First;
-- Check if this is the specification of an argument file
if Argv (Arg_Idx) = '@' then
-- The first argument on the command line cannot be an argument
-- file.
if Arg_Num = 1 then
Put_Line
(Standard_Error,
"Cannot specify argument line before command");
raise Error_Exit;
end if;
-- Open the file, after conversion of the name to canonical form.
-- Fail if file is not found.
declare
Canonical_File_Name : String_Access :=
To_Canonical_File_Spec (Argv (Arg_Idx + 1 .. Argv'Last));
begin
Open (Arg_File, In_File, Canonical_File_Name.all);
Free (Canonical_File_Name);
return;
exception
when others =>
Put (Standard_Error, "Cannot open argument file """);
Put (Standard_Error, Argv (Arg_Idx + 1 .. Argv'Last));
Put_Line (Standard_Error, """");
raise Error_Exit;
end;
end if;
end if;
<<Tryagain_After_Coalesce>>
loop
declare
Next_Arg_Idx : Integer;
Arg : String_Access;
begin
Next_Arg_Idx := Get_Arg_End (Argv.all, Arg_Idx);
Arg := new String'(Argv (Arg_Idx .. Next_Arg_Idx));
-- The first one must be a command name
if Arg_Num = 1 and then Arg_Idx = Argv'First then
Command := Matching_Name (Arg.all, Commands);
if Command = null then
raise Error_Exit;
end if;
The_Command := Command.Command;
Output_File_Expected := False;
-- Give usage information if only command given
if Argument_Count = 1
and then Next_Arg_Idx = Argv'Last
then
Output_Version;
New_Line;
Put_Line
("List of available qualifiers and options");
New_Line;
Put (Command.Usage.all);
Set_Col (53);
Put_Line (Command.Unix_String.all);
declare
Sw : Item_Ptr := Command.Switches;
begin
while Sw /= null loop
Put (" ");
Put (Sw.Name.all);
case Sw.Translation is
when T_Other =>
Set_Col (53);
Put_Line (Sw.Unix_String.all &
"/<other>");
when T_Direct =>
Set_Col (53);
Put_Line (Sw.Unix_String.all);
when T_Directories =>
Put ("=(direc,direc,..direc)");
Set_Col (53);
Put (Sw.Unix_String.all);
Put (" direc ");
Put (Sw.Unix_String.all);
Put_Line (" direc ...");
when T_Directory =>
Put ("=directory");
Set_Col (53);
Put (Sw.Unix_String.all);
if Sw.Unix_String (Sw.Unix_String'Last)
/= '='
then
Put (' ');
end if;
Put_Line ("directory ");
when T_File | T_No_Space_File =>
Put ("=file");
Set_Col (53);
Put (Sw.Unix_String.all);
if Sw.Translation = T_File
and then Sw.Unix_String
(Sw.Unix_String'Last) /= '='
then
Put (' ');
end if;
Put_Line ("file ");
when T_Numeric =>
Put ("=nnn");
Set_Col (53);
if Sw.Unix_String
(Sw.Unix_String'First) = '`'
then
Put (Sw.Unix_String
(Sw.Unix_String'First + 1
.. Sw.Unix_String'Last));
else
Put (Sw.Unix_String.all);
end if;
Put_Line ("nnn");
when T_Alphanumplus =>
Put ("=xyz");
Set_Col (53);
if Sw.Unix_String
(Sw.Unix_String'First) = '`'
then
Put (Sw.Unix_String
(Sw.Unix_String'First + 1
.. Sw.Unix_String'Last));
else
Put (Sw.Unix_String.all);
end if;
Put_Line ("xyz");
when T_String =>
Put ("=");
Put ('"');
Put ("<string>");
Put ('"');
Set_Col (53);
Put (Sw.Unix_String.all);
if Sw.Unix_String
(Sw.Unix_String'Last) /= '='
then
Put (' ');
end if;
Put ("<string>");
New_Line;
when T_Commands =>
Put (" (switches for ");
Put (Sw.Unix_String
(Sw.Unix_String'First + 7
.. Sw.Unix_String'Last));
Put (')');
Set_Col (53);
Put (Sw.Unix_String
(Sw.Unix_String'First
.. Sw.Unix_String'First + 5));
Put_Line (" switches");
when T_Options =>
declare
Opt : Item_Ptr := Sw.Options;
begin
Put_Line ("=(option,option..)");
while Opt /= null loop
Put (" ");
Put (Opt.Name.all);
if Opt = Sw.Options then
Put (" (D)");
end if;
Set_Col (53);
Put_Line (Opt.Unix_String.all);
Opt := Opt.Next;
end loop;
end;
end case;
Sw := Sw.Next;
end loop;
end;
raise Normal_Exit;
end if;
-- Special handling for internal debugging switch /?
elsif Arg.all = "/?" then
Display_Command := True;
Output_File_Expected := False;
-- Special handling of internal option /KEEP_TEMPORARY_FILES
elsif Arg'Length >= 7
and then Matching_Name
(Arg.all, Keep_Temps_Option, True) /= null
then
Opt.Keep_Temporary_Files := True;
-- Copy -switch unchanged
elsif Arg (Arg'First) = '-' then
Place (' ');
Place (Arg.all);
-- Set Output_File_Expected for the next argument
Output_File_Expected :=
Arg.all = "-o" and then The_Command = Link;
-- Copy quoted switch with quotes stripped
elsif Arg (Arg'First) = '"' then
if Arg (Arg'Last) /= '"' then
Put (Standard_Error, "misquoted argument: ");
Put_Line (Standard_Error, Arg.all);
Errors := Errors + 1;
else
Place (' ');
Place (Arg (Arg'First + 1 .. Arg'Last - 1));
end if;
Output_File_Expected := False;
-- Parameter Argument
elsif Arg (Arg'First) /= '/'
and then Make_Commands_Active = null
then
Param_Count := Param_Count + 1;
if Param_Count <= Command.Params'Length then
case Command.Params (Param_Count) is
when File | Optional_File =>
declare
Normal_File : constant String_Access :=
To_Canonical_File_Spec
(Arg.all);
begin
Place (' ');
Place_Lower (Normal_File.all);
if Is_Extensionless (Normal_File.all)
and then Command.Defext /= " "
then
Place ('.');
Place (Command.Defext);
end if;
end;
when Unlimited_Files =>
declare
Normal_File : constant String_Access :=
To_Canonical_File_Spec
(Arg.all);
File_Is_Wild : Boolean := False;
File_List : String_Access_List_Access;
begin
for J in Arg'Range loop
if Arg (J) = '*'
or else Arg (J) = '%'
then
File_Is_Wild := True;
end if;
end loop;
if File_Is_Wild then
File_List := To_Canonical_File_List
(Arg.all, False);
for J in File_List.all'Range loop
Place (' ');
Place_Lower (File_List.all (J).all);
end loop;
else
Place (' ');
Place_Lower (Normal_File.all);
-- Add extension if not present, except after
-- switch -o.
if Is_Extensionless (Normal_File.all)
and then Command.Defext /= " "
and then not Output_File_Expected
then
Place ('.');
Place (Command.Defext);
end if;
end if;
Param_Count := Param_Count - 1;
end;
when Other_As_Is =>
Place (' ');
Place (Arg.all);
when Unlimited_As_Is =>
Place (' ');
Place (Arg.all);
Param_Count := Param_Count - 1;
when Files_Or_Wildcard =>
-- Remove spaces from a comma separated list
-- of file names and adjust control variables
-- accordingly.
while Arg_Num < Argument_Count and then
(Argv (Argv'Last) = ',' xor
Argument (Arg_Num + 1)
(Argument (Arg_Num + 1)'First) = ',')
loop
Argv := new String'
(Argv.all & Argument (Arg_Num + 1));
Arg_Num := Arg_Num + 1;
Arg_Idx := Argv'First;
Next_Arg_Idx :=
Get_Arg_End (Argv.all, Arg_Idx);
Arg := new String'
(Argv (Arg_Idx .. Next_Arg_Idx));
end loop;
-- Parse the comma separated list of VMS
-- filenames and place them on the command
-- line as space separated Unix style
-- filenames. Lower case and add default
-- extension as appropriate.
declare
Arg1_Idx : Integer := Arg'First;
function Get_Arg1_End
(Arg : String;
Arg_Idx : Integer) return Integer;
-- Begins looking at Arg_Idx + 1 and
-- returns the index of the last character
-- before a comma or else the index of the
-- last character in the string Arg.
------------------
-- Get_Arg1_End --
------------------
function Get_Arg1_End
(Arg : String;
Arg_Idx : Integer) return Integer
is
begin
for J in Arg_Idx + 1 .. Arg'Last loop
if Arg (J) = ',' then
return J - 1;
end if;
end loop;
return Arg'Last;
end Get_Arg1_End;
begin
loop
declare
Next_Arg1_Idx :
constant Integer :=
Get_Arg1_End (Arg.all, Arg1_Idx);
Arg1 :
constant String :=
Arg (Arg1_Idx .. Next_Arg1_Idx);
Normal_File :
constant String_Access :=
To_Canonical_File_Spec (Arg1);
begin
Place (' ');
Place_Lower (Normal_File.all);
if Is_Extensionless (Normal_File.all)
and then Command.Defext /= " "
then
Place ('.');
Place (Command.Defext);
end if;
Arg1_Idx := Next_Arg1_Idx + 1;
end;
exit when Arg1_Idx > Arg'Last;
-- Don't allow two or more commas in
-- a row
if Arg (Arg1_Idx) = ',' then
Arg1_Idx := Arg1_Idx + 1;
if Arg1_Idx > Arg'Last or else
Arg (Arg1_Idx) = ','
then
Put_Line
(Standard_Error,
"Malformed Parameter: " &
Arg.all);
Put (Standard_Error, "usage: ");
Put_Line (Standard_Error,
Command.Usage.all);
raise Error_Exit;
end if;
end if;
end loop;
end;
end case;
end if;
-- Reset Output_File_Expected, in case it was True
Output_File_Expected := False;
-- Qualifier argument
else
Output_File_Expected := False;
-- This code is too heavily nested, should be
-- separated out as separate subprogram ???
declare
Sw : Item_Ptr;
SwP : Natural;
P2 : Natural;
Endp : Natural := 0; -- avoid warning!
Opt : Item_Ptr;
begin
SwP := Arg'First;
while SwP < Arg'Last
and then Arg (SwP + 1) /= '='
loop
SwP := SwP + 1;
end loop;
-- At this point, the switch name is in
-- Arg (Arg'First..SwP) and if that is not the
-- whole switch, then there is an equal sign at
-- Arg (SwP + 1) and the rest of Arg is what comes
-- after the equal sign.
-- If make commands are active, see if we have
-- another COMMANDS_TRANSLATION switch belonging
-- to gnatmake.
if Make_Commands_Active /= null then
Sw :=
Matching_Name
(Arg (Arg'First .. SwP),
Command.Switches,
Quiet => True);
if Sw /= null
and then Sw.Translation = T_Commands
then
null;
else
Sw :=
Matching_Name
(Arg (Arg'First .. SwP),
Make_Commands_Active.Switches,
Quiet => False);
end if;
-- For case of GNAT MAKE or CHOP, if we cannot
-- find the switch, then see if it is a
-- recognized compiler switch instead, and if
-- so process the compiler switch.
elsif Command.Name.all = "MAKE"
or else Command.Name.all = "CHOP" then
Sw :=
Matching_Name
(Arg (Arg'First .. SwP),
Command.Switches,
Quiet => True);
if Sw = null then
Sw :=
Matching_Name
(Arg (Arg'First .. SwP),
Matching_Name
("COMPILE", Commands).Switches,
Quiet => False);
end if;
-- For all other cases, just search the relevant
-- command.
else
Sw :=
Matching_Name
(Arg (Arg'First .. SwP),
Command.Switches,
Quiet => False);
end if;
if Sw /= null then
case Sw.Translation is
when T_Direct =>
Place_Unix_Switches (Sw.Unix_String);
if SwP < Arg'Last
and then Arg (SwP + 1) = '='
then
Put (Standard_Error,
"qualifier options ignored: ");
Put_Line (Standard_Error, Arg.all);
end if;
when T_Directories =>
if SwP + 1 > Arg'Last then
Put (Standard_Error,
"missing directories for: ");
Put_Line (Standard_Error, Arg.all);
Errors := Errors + 1;
elsif Arg (SwP + 2) /= '(' then
SwP := SwP + 2;
Endp := Arg'Last;
elsif Arg (Arg'Last) /= ')' then
-- Remove spaces from a comma separated
-- list of file names and adjust
-- control variables accordingly.
if Arg_Num < Argument_Count and then
(Argv (Argv'Last) = ',' xor
Argument (Arg_Num + 1)
(Argument (Arg_Num + 1)'First) = ',')
then
Argv :=
new String'(Argv.all
& Argument
(Arg_Num + 1));
Arg_Num := Arg_Num + 1;
Arg_Idx := Argv'First;
Next_Arg_Idx :=
Get_Arg_End (Argv.all, Arg_Idx);
Arg := new String'
(Argv (Arg_Idx .. Next_Arg_Idx));
goto Tryagain_After_Coalesce;
end if;
Put (Standard_Error,
"incorrectly parenthesized " &
"or malformed argument: ");
Put_Line (Standard_Error, Arg.all);
Errors := Errors + 1;
else
SwP := SwP + 3;
Endp := Arg'Last - 1;
end if;
while SwP <= Endp loop
declare
Dir_Is_Wild : Boolean := False;
Dir_Maybe_Is_Wild : Boolean := False;
Dir_List : String_Access_List_Access;
begin
P2 := SwP;
while P2 < Endp
and then Arg (P2 + 1) /= ','
loop
-- A wildcard directory spec on
-- VMS will contain either * or
-- % or ...
if Arg (P2) = '*' then
Dir_Is_Wild := True;
elsif Arg (P2) = '%' then
Dir_Is_Wild := True;
elsif Dir_Maybe_Is_Wild
and then Arg (P2) = '.'
and then Arg (P2 + 1) = '.'
then
Dir_Is_Wild := True;
Dir_Maybe_Is_Wild := False;
elsif Dir_Maybe_Is_Wild then
Dir_Maybe_Is_Wild := False;
elsif Arg (P2) = '.'
and then Arg (P2 + 1) = '.'
then
Dir_Maybe_Is_Wild := True;
end if;
P2 := P2 + 1;
end loop;
if Dir_Is_Wild then
Dir_List :=
To_Canonical_File_List
(Arg (SwP .. P2), True);
for J in Dir_List.all'Range loop
Place_Unix_Switches
(Sw.Unix_String);
Place_Lower
(Dir_List.all (J).all);
end loop;
else
Place_Unix_Switches
(Sw.Unix_String);
Place_Lower
(To_Canonical_Dir_Spec
(Arg (SwP .. P2), False).all);
end if;
SwP := P2 + 2;
end;
end loop;
when T_Directory =>
if SwP + 1 > Arg'Last then
Put (Standard_Error,
"missing directory for: ");
Put_Line (Standard_Error, Arg.all);
Errors := Errors + 1;
else
Place_Unix_Switches (Sw.Unix_String);
-- Some switches end in "=". No space
-- here
if Sw.Unix_String
(Sw.Unix_String'Last) /= '='
then
Place (' ');
end if;
Place_Lower
(To_Canonical_Dir_Spec
(Arg (SwP + 2 .. Arg'Last),
False).all);
end if;
when T_File | T_No_Space_File =>
if SwP + 1 > Arg'Last then
Put (Standard_Error,
"missing file for: ");
Put_Line (Standard_Error, Arg.all);
Errors := Errors + 1;
else
Place_Unix_Switches (Sw.Unix_String);
-- Some switches end in "=". No space
-- here.
if Sw.Translation = T_File
and then Sw.Unix_String
(Sw.Unix_String'Last) /= '='
then
Place (' ');
end if;
Place_Lower
(To_Canonical_File_Spec
(Arg (SwP + 2 .. Arg'Last)).all);
end if;
when T_Numeric =>
if OK_Integer (Arg (SwP + 2 .. Arg'Last)) then
Place_Unix_Switches (Sw.Unix_String);
Place (Arg (SwP + 2 .. Arg'Last));
else
Put (Standard_Error, "argument for ");
Put (Standard_Error, Sw.Name.all);
Put_Line
(Standard_Error, " must be numeric");
Errors := Errors + 1;
end if;
when T_Alphanumplus =>
if OK_Alphanumerplus
(Arg (SwP + 2 .. Arg'Last))
then
Place_Unix_Switches (Sw.Unix_String);
Place (Arg (SwP + 2 .. Arg'Last));
else
Put (Standard_Error, "argument for ");
Put (Standard_Error, Sw.Name.all);
Put_Line (Standard_Error,
" must be alphanumeric");
Errors := Errors + 1;
end if;
when T_String =>
-- A String value must be extended to the
-- end of the Argv, otherwise strings like
-- "foo/bar" get split at the slash.
-- The begining and ending of the string
-- are flagged with embedded nulls which
-- are removed when building the Spawn
-- call. Nulls are use because they won't
-- show up in a /? output. Quotes aren't
-- used because that would make it
-- difficult to embed them.
Place_Unix_Switches (Sw.Unix_String);
if Next_Arg_Idx /= Argv'Last then
Next_Arg_Idx := Argv'Last;
Arg := new String'
(Argv (Arg_Idx .. Next_Arg_Idx));
SwP := Arg'First;
while SwP < Arg'Last and then
Arg (SwP + 1) /= '=' loop
SwP := SwP + 1;
end loop;
end if;
Place (ASCII.NUL);
Place (Arg (SwP + 2 .. Arg'Last));
Place (ASCII.NUL);
when T_Commands =>
-- Output -largs/-bargs/-cargs
Place (' ');
Place (Sw.Unix_String
(Sw.Unix_String'First ..
Sw.Unix_String'First + 5));
if Sw.Unix_String
(Sw.Unix_String'First + 7 ..
Sw.Unix_String'Last) = "MAKE"
then
Make_Commands_Active := null;
else
-- Set source of new commands, also
-- setting this non-null indicates that
-- we are in the special commands mode
-- for processing the -xargs case.
Make_Commands_Active :=
Matching_Name
(Sw.Unix_String
(Sw.Unix_String'First + 7 ..
Sw.Unix_String'Last),
Commands);
end if;
when T_Options =>
if SwP + 1 > Arg'Last then
Place_Unix_Switches
(Sw.Options.Unix_String);
SwP := Endp + 1;
elsif Arg (SwP + 2) /= '(' then
SwP := SwP + 2;
Endp := Arg'Last;
elsif Arg (Arg'Last) /= ')' then
Put (Standard_Error,
"incorrectly parenthesized argument: ");
Put_Line (Standard_Error, Arg.all);
Errors := Errors + 1;
SwP := Endp + 1;
else
SwP := SwP + 3;
Endp := Arg'Last - 1;
end if;
while SwP <= Endp loop
P2 := SwP;
while P2 < Endp
and then Arg (P2 + 1) /= ','
loop
P2 := P2 + 1;
end loop;
-- Option name is in Arg (SwP .. P2)
Opt := Matching_Name (Arg (SwP .. P2),
Sw.Options);
if Opt /= null then
Place_Unix_Switches
(Opt.Unix_String);
end if;
SwP := P2 + 2;
end loop;
when T_Other =>
Place_Unix_Switches
(new String'(Sw.Unix_String.all &
Arg.all));
end case;
end if;
end;
end if;
Arg_Idx := Next_Arg_Idx + 1;
end;
exit when Arg_Idx > Argv'Last;
end loop;
if not Is_Open (Arg_File) then
Arg_Num := Arg_Num + 1;
end if;
end Process_Argument;
--------------------------------
-- Validate_Command_Or_Option --
--------------------------------
procedure Validate_Command_Or_Option (N : VMS_Data.String_Ptr) is
begin
pragma Assert (N'Length > 0);
for J in N'Range loop
if N (J) = '_' then
pragma Assert (N (J - 1) /= '_');
null;
else
pragma Assert (Is_Upper (N (J)) or else Is_Digit (N (J)));
null;
end if;
end loop;
end Validate_Command_Or_Option;
--------------------------
-- Validate_Unix_Switch --
--------------------------
procedure Validate_Unix_Switch (S : VMS_Data.String_Ptr) is
begin
if S (S'First) = '`' then
return;
end if;
pragma Assert (S (S'First) = '-' or else S (S'First) = '!');
for J in S'First + 1 .. S'Last loop
pragma Assert (S (J) /= ' ');
if S (J) = '!' then
pragma Assert (S (J - 1) = ',' and then S (J + 1) = '-');
null;
end if;
end loop;
end Validate_Unix_Switch;
--------------------
-- VMS_Conversion --
--------------------
procedure VMS_Conversion (The_Command : out Command_Type) is
Result : Command_Type := Undefined;
Result_Set : Boolean := False;
begin
Buffer.Init;
-- First we must preprocess the string form of the command and options
-- list into the internal form that we use.
Preprocess_Command_Data;
-- If no parameters, give complete list of commands
if Argument_Count = 0 then
Output_Version;
New_Line;
Put_Line ("List of available commands");
New_Line;
while Commands /= null loop
Put (Commands.Usage.all);
Set_Col (53);
Put_Line (Commands.Unix_String.all);
Commands := Commands.Next;
end loop;
raise Normal_Exit;
end if;
Arg_Num := 1;
-- Loop through arguments
while Arg_Num <= Argument_Count loop
Process_Argument (Result);
if not Result_Set then
The_Command := Result;
Result_Set := True;
end if;
end loop;
-- Gross error checking that the number of parameters is correct.
-- Not applicable to Unlimited_Files parameters.
if (Param_Count = Command.Params'Length - 1
and then Command.Params (Param_Count + 1) = Unlimited_Files)
or else Param_Count <= Command.Params'Length
then
null;
else
Put_Line (Standard_Error,
"Parameter count of "
& Integer'Image (Param_Count)
& " not equal to expected "
& Integer'Image (Command.Params'Length));
Put (Standard_Error, "usage: ");
Put_Line (Standard_Error, Command.Usage.all);
Errors := Errors + 1;
end if;
if Errors > 0 then
raise Error_Exit;
else
-- Prepare arguments for a call to spawn, filtering out
-- embedded nulls place there to delineate strings.
declare
P1, P2 : Natural;
Inside_Nul : Boolean := False;
Arg : String (1 .. 1024);
Arg_Ctr : Natural;
begin
P1 := 1;
while P1 <= Buffer.Last and then Buffer.Table (P1) = ' ' loop
P1 := P1 + 1;
end loop;
Arg_Ctr := 1;
Arg (Arg_Ctr) := Buffer.Table (P1);
while P1 <= Buffer.Last loop
if Buffer.Table (P1) = ASCII.NUL then
if Inside_Nul then
Inside_Nul := False;
else
Inside_Nul := True;
end if;
end if;
if Buffer.Table (P1) = ' ' and then not Inside_Nul then
P1 := P1 + 1;
Arg_Ctr := Arg_Ctr + 1;
Arg (Arg_Ctr) := Buffer.Table (P1);
else
Last_Switches.Increment_Last;
P2 := P1;
while P2 < Buffer.Last
and then (Buffer.Table (P2 + 1) /= ' ' or else
Inside_Nul)
loop
P2 := P2 + 1;
Arg_Ctr := Arg_Ctr + 1;
Arg (Arg_Ctr) := Buffer.Table (P2);
if Buffer.Table (P2) = ASCII.NUL then
Arg_Ctr := Arg_Ctr - 1;
if Inside_Nul then
Inside_Nul := False;
else
Inside_Nul := True;
end if;
end if;
end loop;
Last_Switches.Table (Last_Switches.Last) :=
new String'(String (Arg (1 .. Arg_Ctr)));
P1 := P2 + 2;
Arg_Ctr := 1;
Arg (Arg_Ctr) := Buffer.Table (P1);
end if;
end loop;
end;
end if;
end VMS_Conversion;
end VMS_Conv;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of STMicroelectronics nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
-- --
-- This file is based on X-CUBE-53L0A1 STM32Cube expansion --
-- --
-- COPYRIGHT(c) 2016 STMicroelectronics --
------------------------------------------------------------------------------
with HAL.I2C;
package VL53L0X is
Fix_Point_16_16_Delta : constant := 1.0 / (2.0 ** 16);
type Fix_Point_16_16 is
delta Fix_Point_16_16_Delta
range -2.0 ** 15 .. 2.0 ** 15 - Fix_Point_16_16_Delta
with Size => 32;
type VL53L0X_Ranging_Sensor
(Port : not null HAL.I2C.Any_I2C_Port) is limited private;
type VL53L0X_GPIO_Functionality is
(No_Interrupt,
Level_Low,
Level_High,
Out_Of_Window,
New_Sample_Ready);
type VL53L0X_Interrupt_Polarity is
(Polarity_Low,
Polarity_High);
procedure Initialize
(This : in out VL53L0X_Ranging_Sensor);
function Read_Id (This : VL53L0X_Ranging_Sensor) return HAL.UInt16;
procedure Set_Device_Address
(This : in out VL53L0X_Ranging_Sensor;
Addr : HAL.I2C.I2C_Address;
Status : out Boolean);
procedure Data_Init
(This : in out VL53L0X_Ranging_Sensor;
Status : out Boolean);
procedure Static_Init
(This : in out VL53L0X_Ranging_Sensor;
GPIO_Function : VL53L0X_GPIO_Functionality;
Status : out Boolean);
procedure Perform_Ref_Calibration
(This : in out VL53L0X_Ranging_Sensor;
Status : out Boolean);
procedure Start_Range_Single_Millimeters
(This : VL53L0X_Ranging_Sensor;
Status : out Boolean);
-- Start a read operation on sensor
function Range_Value_Available
(This : VL53L0X_Ranging_Sensor) return Boolean;
-- Returns True when a new value is available
function Read_Range_Millimeters
(This : VL53L0X_Ranging_Sensor) return HAL.UInt16
with Pre => Range_Value_Available (This);
-- Read the available ranging value
function Read_Range_Single_Millimeters
(This : VL53L0X_Ranging_Sensor) return HAL.UInt16;
procedure Set_GPIO_Config
(This : in out VL53L0X_Ranging_Sensor;
Functionality : VL53L0X_GPIO_Functionality;
Polarity : VL53L0X_Interrupt_Polarity;
Status : out Boolean);
procedure Clear_Interrupt_Mask
(This : VL53L0X_Ranging_Sensor);
function Measurement_Timing_Budget
(This : VL53L0X_Ranging_Sensor) return HAL.UInt32;
procedure Set_Measurement_Timing_Budget
(This : VL53L0X_Ranging_Sensor;
Budget_Micro_Seconds : HAL.UInt32;
Status : out Boolean);
-- Sets the measurement timing budget.
-- The more time, the more precisions. By default, the budget is ~33ms
procedure Set_Signal_Rate_Limit
(This : VL53L0X_Ranging_Sensor;
Rate_Limit : Fix_Point_16_16);
-- Default signal rate: 0.25 MCPS
procedure Set_VCSEL_Pulse_Period_Pre_Range
(This : VL53L0X_Ranging_Sensor;
Period : HAL.UInt8;
Status : out Boolean);
-- Default period: 14 PCLKs
procedure Set_VCSEL_Pulse_Period_Final_Range
(This : VL53L0X_Ranging_Sensor;
Period : HAL.UInt8;
Status : out Boolean);
-- Default period: 10 PCLKs
procedure SetInterMeasurementPeriodMilliSeconds
(This : VL53L0X_Ranging_Sensor;
Period : HAL.UInt32;
Status : out Boolean);
procedure GetInterMeasurementPeriodMilliSeconds
(This : in out VL53L0X_Ranging_Sensor;
Status : out Boolean);
procedure GetDeviceParameters
(This : in out VL53L0X_Ranging_Sensor;
Status : out Boolean);
private
REG_SYSRANGE_START : constant := 16#000#;
-- mask existing bit in #REG_SYSRANGE_START
REG_SYSRANGE_MODE_MASK : constant := 16#0F#;
-- bit 0 in #REG_SYSRANGE_START write 1 toggle state in
-- continuous mode and arm next shot in single shot mode
REG_SYSRANGE_MODE_START_STOP : constant := 16#01#;
-- bit 1 write 0 in #REG_SYSRANGE_START set single shot mode
REG_SYSRANGE_MODE_SINGLESHOT : constant := 16#00#;
-- bit 1 write 1 in #REG_SYSRANGE_START set back-to-back
-- operation mode
REG_SYSRANGE_MODE_BACKTOBACK : constant := 16#02#;
-- bit 2 write 1 in #REG_SYSRANGE_START set timed operation
-- mode
REG_SYSRANGE_MODE_TIMED : constant := 16#04#;
-- bit 3 write 1 in #REG_SYSRANGE_START set histogram operation
-- mode
REG_SYSRANGE_MODE_HISTOGRAM : constant := 16#08#;
REG_SYSTEM_THRESH_HIGH : constant := 16#000C#;
REG_SYSTEM_THRESH_LOW : constant := 16#000E#;
REG_SYSTEM_SEQUENCE_CONFIG : constant := 16#0001#;
REG_SYSTEM_RANGE_CONFIG : constant := 16#0009#;
REG_SYSTEM_INTERMEASUREMENT_PERIOD : constant := 16#0004#;
REG_SYSTEM_INTERRUPT_CONFIG_GPIO : constant := 16#000A#;
REG_SYSTEM_INTERRUPT_GPIO_DISABLED : constant := 16#00#;
REG_SYSTEM_INTERRUPT_GPIO_LEVEL_LOW : constant := 16#01#;
REG_SYSTEM_INTERRUPT_GPIO_LEVEL_HIGH : constant := 16#02#;
REG_SYSTEM_INTERRUPT_GPIO_OUT_OF_WINDOW : constant := 16#03#;
REG_SYSTEM_INTERRUPT_GPIO_NEW_SAMPLE_READY : constant := 16#04#;
REG_GPIO_HV_MUX_ACTIVE_HIGH : constant := 16#0084#;
REG_SYSTEM_INTERRUPT_CLEAR : constant := 16#000B#;
-- Result registers
REG_RESULT_INTERRUPT_STATUS : constant := 16#0013#;
REG_RESULT_RANGE_STATUS : constant := 16#0014#;
REG_RESULT_CORE_PAGE : constant := 1;
REG_RESULT_CORE_AMBIENT_WINDOW_EVENTS_RTN : constant := 16#00BC#;
REG_RESULT_CORE_RANGING_TOTAL_EVENTS_RTN : constant := 16#00C0#;
REG_RESULT_CORE_AMBIENT_WINDOW_EVENTS_REF : constant := 16#00D0#;
REG_RESULT_CORE_RANGING_TOTAL_EVENTS_REF : constant := 16#00D4#;
REG_RESULT_PEAK_SIGNAL_RATE_REF : constant := 16#00B6#;
-- Algo register
REG_ALGO_PART_TO_PART_RANGE_OFFSET_MM : constant := 16#0028#;
REG_I2C_SLAVE_DEVICE_ADDRESS : constant := 16#008A#;
-- Check Limit registers
REG_MSRC_CONFIG_CONTROL : constant := 16#0060#;
REG_PRE_RANGE_CONFIG_MIN_SNR : constant := 16#0027#;
REG_PRE_RANGE_CONFIG_VALID_PHASE_LOW : constant := 16#0056#;
REG_PRE_RANGE_CONFIG_VALID_PHASE_HIGH : constant := 16#0057#;
REG_PRE_RANGE_MIN_COUNT_RATE_RTN_LIMIT : constant := 16#0064#;
REG_FINAL_RANGE_CONFIG_MIN_SNR : constant := 16#0067#;
REG_FINAL_RANGE_CONFIG_VALID_PHASE_LOW : constant := 16#0047#;
REG_FINAL_RANGE_CONFIG_VALID_PHASE_HIGH : constant := 16#0048#;
REG_FINAL_RANGE_CONFIG_MIN_COUNT_RATE_RTN_LIMIT : constant := 16#0044#;
REG_PRE_RANGE_CONFIG_SIGMA_THRESH_HI : constant := 16#0061#;
REG_PRE_RANGE_CONFIG_SIGMA_THRESH_LO : constant := 16#0062#;
-- PRE RANGE registers
REG_PRE_RANGE_CONFIG_VCSEL_PERIOD : constant := 16#0050#;
REG_PRE_RANGE_CONFIG_TIMEOUT_MACROP_HI : constant := 16#0051#;
REG_PRE_RANGE_CONFIG_TIMEOUT_MACROP_LO : constant := 16#0052#;
REG_SYSTEM_HISTOGRAM_BIN : constant := 16#0081#;
REG_HISTOGRAM_CONFIG_INITIAL_PHASE_SELECT : constant := 16#0033#;
REG_HISTOGRAM_CONFIG_READOUT_CTRL : constant := 16#0055#;
REG_FINAL_RANGE_CONFIG_VCSEL_PERIOD : constant := 16#0070#;
REG_FINAL_RANGE_CONFIG_TIMEOUT_MACROP_HI : constant := 16#0071#;
REG_FINAL_RANGE_CONFIG_TIMEOUT_MACROP_LO : constant := 16#0072#;
REG_CROSSTALK_COMPENSATION_PEAK_RATE_MCPS : constant := 16#0020#;
REG_MSRC_CONFIG_TIMEOUT_MACROP : constant := 16#0046#;
REG_SOFT_RESET_GO2_SOFT_RESET_N : constant := 16#00bf#;
REG_IDENTIFICATION_MODEL_ID : constant := 16#00c0#;
REG_IDENTIFICATION_REVISION_ID : constant := 16#00c2#;
REG_OSC_CALIBRATE_VAL : constant := 16#00f8#;
SIGMA_ESTIMATE_MAX_VALUE : constant := 65535;
-- equivalent to a range sigma of 655.35mm
REG_GLOBAL_CONFIG_VCSEL_WIDTH : constant := 16#032#;
REG_GLOBAL_CONFIG_SPAD_ENABLES_REF_0 : constant := 16#0B0#;
REG_GLOBAL_CONFIG_SPAD_ENABLES_REF_1 : constant := 16#0B1#;
REG_GLOBAL_CONFIG_SPAD_ENABLES_REF_2 : constant := 16#0B2#;
REG_GLOBAL_CONFIG_SPAD_ENABLES_REF_3 : constant := 16#0B3#;
REG_GLOBAL_CONFIG_SPAD_ENABLES_REF_4 : constant := 16#0B4#;
REG_GLOBAL_CONFIG_SPAD_ENABLES_REF_5 : constant := 16#0B5#;
REG_GLOBAL_CONFIG_REF_EN_START_SELECT : constant := 16#B6#;
REG_DYNAMIC_SPAD_NUM_REQUESTED_REF_SPAD : constant := 16#4E#;
REG_DYNAMIC_SPAD_REF_EN_START_OFFSET : constant := 16#4F#;
REG_POWER_MANAGEMENT_GO1_POWER_FORCE : constant := 16#80#;
-- Speed of light in um per 1E-10 Seconds
SPEED_OF_LIGHT_IN_AIR : constant := 2997;
REG_VHV_CONFIG_PAD_SCL_SDA_EXTSUP_HV : constant := 16#0089#;
REG_ALGO_PHASECAL_LIM : constant := 16#0030#;
REG_ALGO_PHASECAL_CONFIG_TIMEOUT : constant := 16#0030#;
type VL53L0X_Device_Specific_Parameters is record
Osc_Frequency : HAL.UInt32 := 0;
Last_Timeout : HAL.UInt16 := 0;
Pin0_Functionality : VL53L0X_GPIO_Functionality := No_Interrupt;
Final_Range_Timeout_Micro_Seconds : HAL.UInt32 := 0;
Final_Range_Vcsel_Pulse_Period : HAL.UInt8 := 0;
Pre_Range_Timeout_Micro_Seconds : HAL.UInt32 := 0;
Pre_Range_Vcsel_Pulse_Period : HAL.UInt8 := 0;
Sigma_Est_Ref_Array : HAL.UInt16 := 0;
Sigma_Est_Eff_Pulse_Width : HAL.UInt16 := 0;
Sigma_Est_Eff_Amb_Width : HAL.UInt16 := 0;
StopVariable : HAL.UInt8;
TargetRefRate : HAL.UInt16;
SigmaEstimate : Fix_Point_16_16;
SignalEstimate : Fix_Point_16_16;
LastSignalRefMcps : Fix_Point_16_16;
-- uint8_t *pTuningSettingsPointer;
UseInternalTuningSettings : Boolean;
Linearity_Corrective_Gain : HAL.UInt16;
Dmax_Cal_Range_MilliMeter : HAL.UInt16;
Dmax_Cal_Signal_Rate_Rtn_MegaCps : HAL.UInt32;
Read_Data_From_Device_Done : Boolean := False;
Module_Id : HAL.UInt8;
Revision : HAL.UInt8;
Reference_SPAD_Count : HAL.UInt8;
Reference_SPAD_Type : HAL.UInt8;
Reference_SPADs_Initialised : Boolean := False;
Part_UID_Upper : HAL.UInt32;
Part_UID_Lower : HAL.UInt32;
end record;
type Histogram_Modes is
(Disabled,
Reference_Only,
Return_Only,
Both);
type Device_Modes is
(Single_Ranging,
Continuous_Ranging,
Continuous_Timed_Ranging,
Single_Histogram);
CHECKENABLE_NUMBER_OF_CHECKS : constant HAL.UInt32 := 6;
type LimitChecksEnableT is array (1 .. CHECKENABLE_NUMBER_OF_CHECKS) of Boolean;
type LimitChecksStatusT is array (1 .. CHECKENABLE_NUMBER_OF_CHECKS) of HAL.UInt8;
type LimitChecksValueT is array (1 .. CHECKENABLE_NUMBER_OF_CHECKS) of Fix_Point_16_16;
type VL53L0X_Device_Parameters is record
Device_Mode : Device_Modes;
Histogram_Mode : Histogram_Modes;
X_Talk_Compensation_Enable : Boolean;
X_Talk_Compensation_Range_MilliMeter : HAL.UInt16;
X_Talk_Compensation_Rate_Mcps : Fix_Point_16_16;
MeasurementTimingBudgetMicroSeconds : HAL.UInt32;
InterMeasurementPeriodMilliSeconds : HAL.UInt32;
RangeOffsetMicroMeters : HAL.UInt32;
LimitChecksEnable : LimitChecksEnableT;
LimitChecksStatus : LimitChecksStatusT;
LimitChecksValue : LimitChecksValueT;
WrapAroundCheckEnable : Boolean;
end record;
type VL53L0X_Ranging_Sensor (Port : not null HAL.I2C.Any_I2C_Port)
is limited record
-- Default address: can be changed by software
I2C_Address : HAL.I2C.I2C_Address := 16#52#;
Stop_Variable : HAL.UInt8;
Device_Specific_Params : VL53L0X_Device_Specific_Parameters;
Device_Params : VL53L0X_Device_Parameters;
end record;
procedure I2C_Write
(This : VL53L0X_Ranging_Sensor;
Data : HAL.UInt8_Array;
Status : out Boolean);
procedure I2C_Read
(This : VL53L0X_Ranging_Sensor;
Data : out HAL.UInt8_Array;
Status : out Boolean);
procedure Write
(This : VL53L0X_Ranging_Sensor;
Index : HAL.UInt8;
Data : HAL.UInt8_Array;
Status : out Boolean);
procedure Write
(This : VL53L0X_Ranging_Sensor;
Index : HAL.UInt8;
Data : HAL.UInt8;
Status : out Boolean);
procedure Write
(This : VL53L0X_Ranging_Sensor;
Index : HAL.UInt8;
Data : HAL.UInt16;
Status : out Boolean);
procedure Write
(This : VL53L0X_Ranging_Sensor;
Index : HAL.UInt8;
Data : HAL.UInt32;
Status : out Boolean);
procedure Read
(This : VL53L0X_Ranging_Sensor;
Index : HAL.UInt8;
Data : out HAL.UInt8_Array;
Status : out Boolean);
procedure Read
(This : VL53L0X_Ranging_Sensor;
Index : HAL.UInt8;
Data : out HAL.UInt8;
Status : out Boolean);
procedure Read
(This : VL53L0X_Ranging_Sensor;
Index : HAL.UInt8;
Data : out HAL.UInt16;
Status : out Boolean);
procedure Read
(This : VL53L0X_Ranging_Sensor;
Index : HAL.UInt8;
Data : out HAL.UInt32;
Status : out Boolean);
function Set_Signal_Rate_Limit
(This : VL53L0X_Ranging_Sensor;
Limit_Mcps : Fix_Point_16_16) return Boolean;
function SPAD_Info
(This : VL53L0X_Ranging_Sensor;
SPAD_Count : out HAL.UInt8;
Is_Aperture : out Boolean) return Boolean;
type VL53L0x_Sequence_Step is
(TCC, DSS, MSRC, Pre_Range, Final_Range);
type VL53L0x_Sequence_Step_Enabled is
array (VL53L0x_Sequence_Step) of Boolean;
type VL53L0x_Sequence_Step_Timeout is
array (VL53L0x_Sequence_Step) of HAL.UInt32;
function Sequence_Step_Enabled
(This : VL53L0X_Ranging_Sensor) return VL53L0x_Sequence_Step_Enabled;
function Sequence_Step_Timeout
(This : VL53L0X_Ranging_Sensor;
Step : VL53L0x_Sequence_Step;
As_Mclks : Boolean := False) return HAL.UInt32;
function VCSel_Pulse_Period
(This : VL53L0X_Ranging_Sensor;
Sequence : VL53L0x_Sequence_Step) return HAL.UInt8;
procedure Set_VCSel_Pulse_Period
(This : VL53L0X_Ranging_Sensor;
Period : HAL.UInt8;
Sequence : VL53L0x_Sequence_Step;
Status : out Boolean);
end VL53L0X;
|
package conecta4 is
Max_Columnas: constant integer:=9;
Max_Filas: constant Integer:=6;
type T_celda is (Rojo, Azul, Nada);
subtype T_Ficha is T_celda range Rojo..Azul;
subtype T_Fila is Integer range 1..Max_Filas;
subtype T_Columna is Integer range 1..Max_Columnas;
type T_Tablero is array (T_Fila,T_Columna) of T_Celda;
end conecta4;
|
------------------------------------------------------------------------------
-- Copyright (c) 2017, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.Web.Comment_Cookies.Base_64 provides a very simple encoder for --
-- comment cookie information. --
------------------------------------------------------------------------------
with Natools.S_Expressions;
package Natools.Web.Comment_Cookies.Base_64 is
pragma Preelaborate;
Key : constant Character := '0';
function Encoder (Data : in S_Expressions.Atom) return String;
function Decoder (Data : in String) return S_Expressions.Atom;
end Natools.Web.Comment_Cookies.Base_64;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Termcap --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 2000,2004 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.9 $
-- $Date: 2004/08/21 21:37:00 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
with Interfaces.C; use Interfaces.C;
with Interfaces.C.Strings; use Interfaces.C.Strings;
package body Terminal_Interface.Curses.Termcap is
function Get_Entry (Name : String) return Boolean
is
function tgetent (name : char_array; val : char_array)
return C_Int;
pragma Import (C, tgetent, "tgetent");
NameTxt : char_array (0 .. Name'Length);
Length : size_t;
ignored : constant char_array (0 .. 0) := (0 => nul);
result : C_Int;
begin
To_C (Name, NameTxt, Length);
result := tgetent (char_array (ignored), NameTxt);
if result = -1 then
raise Curses_Exception;
else
return Boolean'Val (result);
end if;
end Get_Entry;
------------------------------------------------------------------------------
function Get_Flag (Name : String) return Boolean
is
function tgetflag (id : char_array) return C_Int;
pragma Import (C, tgetflag, "tgetflag");
Txt : char_array (0 .. Name'Length);
Length : size_t;
begin
To_C (Name, Txt, Length);
if tgetflag (Txt) = 0 then
return False;
else
return True;
end if;
end Get_Flag;
------------------------------------------------------------------------------
procedure Get_Number (Name : in String;
Value : out Integer;
Result : out Boolean)
is
function tgetnum (id : char_array) return C_Int;
pragma Import (C, tgetnum, "tgetnum");
Txt : char_array (0 .. Name'Length);
Length : size_t;
begin
To_C (Name, Txt, Length);
Value := Integer (tgetnum (Txt));
if Value = -1 then
Result := False;
else
Result := True;
end if;
end Get_Number;
------------------------------------------------------------------------------
procedure Get_String (Name : String;
Value : out String;
Result : out Boolean)
is
function tgetstr (id : char_array;
buf : char_array) return chars_ptr;
pragma Import (C, tgetstr, "tgetstr");
Txt : char_array (0 .. Name'Length);
Length : size_t;
Txt2 : chars_ptr;
type t is new char_array (0 .. 1024); -- does it need to be 1024?
Return_Buffer : constant t := (others => nul);
begin
To_C (Name, Txt, Length);
Txt2 := tgetstr (Txt, char_array (Return_Buffer));
if Txt2 = Null_Ptr then
Result := False;
else
Value := Fill_String (Txt2);
Result := True;
end if;
end Get_String;
function Get_String (Name : String) return Boolean
is
function tgetstr (Id : char_array;
buf : char_array) return chars_ptr;
pragma Import (C, tgetstr, "tgetstr");
Txt : char_array (0 .. Name'Length);
Length : size_t;
Txt2 : chars_ptr;
type t is new char_array (0 .. 1024); -- does it need to be 1024?
Phony_Txt : constant t := (others => nul);
begin
To_C (Name, Txt, Length);
Txt2 := tgetstr (Txt, char_array (Phony_Txt));
if Txt2 = Null_Ptr then
return False;
else
return True;
end if;
end Get_String;
------------------------------------------------------------------------------
function TGoto (Cap : String;
Col : Column_Position;
Row : Line_Position) return Termcap_String is
function tgoto (cap : char_array;
col : C_Int;
row : C_Int) return chars_ptr;
pragma Import (C, tgoto);
Txt : char_array (0 .. Cap'Length);
Length : size_t;
begin
To_C (Cap, Txt, Length);
return Termcap_String (Fill_String
(tgoto (Txt, C_Int (Col), C_Int (Row))));
end TGoto;
end Terminal_Interface.Curses.Termcap;
|
-- Copyright 2012-2020 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with System;
package Pck is
procedure Do_Nothing (A : System.Address);
end Pck;
|
with Ada.Exceptions; use Ada.Exceptions;
with Ada.Text_IO; use Ada.Text_IO;
with Important_Dates; use Important_Dates;
procedure Main with
SPARK_Mode => On
is
Calendar : Calendar_T;
procedure Run_Test is
begin
Put_Line ("Good result:");
Print_Events
(Calendar => Calendar,
Number_Of_Events => 10,
Date => (2_020, 4, 20));
begin
Put_Line ("Past the end:");
Print_Events (Calendar, 5, (2_020, 12, 20));
exception
when The_Err : others =>
Put_Line ("Exception " & Exception_Information (The_Err));
end;
begin
Put_Line ("Predicate failure:");
Print_Events (Calendar, 5, (2_020, 4, 31));
exception
when The_Err : others =>
Put_Line ("Exception " & Exception_Information (The_Err));
end;
exception
when The_Err : others =>
Put_Line ("Unexpected Exception " & Exception_Information (The_Err));
end Run_Test;
begin
Add_Event (Calendar, "Administrative Professionals Day", (2_020, 4, 22));
Add_Event (Calendar, "Air Force Birthday", (2_020, 9, 18));
Add_Event (Calendar, "American Eagle Day", (2_020, 6, 20));
Add_Event (Calendar, "Arbor Day", (2_020, 4, 24));
Add_Event (Calendar, "Armed Forces Day", (2_020, 5, 16));
Add_Event (Calendar, "Army Birthday", (2_020, 6, 14));
Add_Event (Calendar, "Bastille Day", (2_020, 7, 14));
Add_Event (Calendar, "Belmont Stakes", (2_020, 6, 6));
Add_Event (Calendar, "Bennington Battle Day", (2_020, 8, 16));
Add_Event (Calendar, "Bill of Rights Day", (2_020, 12, 15));
Add_Event (Calendar, "Black Friday", (2_020, 11, 27));
Add_Event (Calendar, "Boss's Day", (2_020, 10, 16));
Add_Event (Calendar, "Child Health Day", (2_020, 10, 5));
Add_Event (Calendar, "Chinese New Year", (2_020, 1, 25));
Add_Event (Calendar, "Christmas Day", (2_020, 12, 25));
Add_Event (Calendar, "Coast Guard Birthday", (2_020, 8, 4));
Add_Event (Calendar, "Colorado Day", (2_020, 8, 1));
Add_Event (Calendar, "Columbus Day", (2_020, 10, 12));
Add_Event
(Calendar, "Constitution Day and Citizenship Day", (2_020, 9, 17));
Add_Event (Calendar, "Cyber Monday", (2_020, 11, 30));
Add_Event (Calendar, "Daylight Saving Time ends", (2_020, 11, 1));
Add_Event (Calendar, "Daylight Saving Time starts", (2_020, 3, 8));
Add_Event (Calendar, "December Solstice", (2_020, 12, 21));
Add_Event (Calendar, "Election Day", (2_020, 11, 3));
Add_Event (Calendar, "Elizabeth Peratrovich Day", (2_020, 2, 16));
Add_Event
(Calendar, "Emergency Medical Services for Children Day", (2_020, 5, 20));
Add_Event (Calendar, "Employee Appreciation Day", (2_020, 3, 6));
Add_Event (Calendar, "Evacuation Day", (2_020, 3, 17));
Add_Event (Calendar, "Family Day", (2_020, 11, 27));
Add_Event (Calendar, "Father's Day", (2_020, 6, 21));
Add_Event (Calendar, "Flag Day", (2_020, 6, 14));
Add_Event (Calendar, "Gold Star Mother's Day", (2_020, 9, 27));
Add_Event (Calendar, "Groundhog Day", (2_020, 2, 2));
Add_Event (Calendar, "Halloween", (2_020, 10, 31));
Add_Event (Calendar, "Independence Day", (2_020, 7, 4));
Add_Event (Calendar, "June Solstice", (2_020, 6, 20));
Add_Event (Calendar, "Kentucky Derby", (2_020, 5, 2));
Add_Event (Calendar, "Labor Day", (2_020, 9, 7));
Add_Event (Calendar, "Law Day", (2_020, 5, 1));
Add_Event (Calendar, "Leif Erikson Day", (2_020, 10, 9));
Remove_Event (Calendar, "Child Health Day", (2_020, 10, 5));
Add_Event (Calendar, "Lincoln's Birthday", (2_020, 2, 12));
Add_Event (Calendar, "Linus Pauling Day", (2_020, 2, 28));
Remove_Event (Calendar, "My Birthday", (2_020, 1, 1));
Add_Event (Calendar, "March Equinox", (2_020, 3, 19));
Add_Event (Calendar, "Marine Corps Birthday", (2_020, 11, 10));
Add_Event (Calendar, "Martin Luther King Jr. Day", (2_020, 1, 20));
Remove_Event (Calendar, "Colorado Day", (2_020, 8, 1));
Add_Event (Calendar, "Memorial Day", (2_020, 5, 25));
Add_Event (Calendar, "Military Spouse Appreciation Day", (2_020, 5, 8));
Remove_Event (Calendar, "Daylight Saving Time ends", (2_020, 11, 1));
Add_Event (Calendar, "Mother's Day", (2_020, 5, 10));
Add_Event (Calendar, "National Aviation Day", (2_020, 8, 19));
Add_Event (Calendar, "National CleanUp Day", (2_020, 9, 19));
Remove_Event (Calendar, "Groundhog Day", (2_020, 2, 2));
Add_Event (Calendar, "Navy Birthday", (2_020, 10, 13));
Add_Event (Calendar, "New Year's Day", (2_020, 1, 1));
Add_Event (Calendar, "New Year's Eve", (2_020, 12, 31));
Add_Event (Calendar, "New York City Marathon", (2_020, 11, 1));
Remove_Event (Calendar, "Independence Day", (2_020, 7, 4));
Remove_Event (Calendar, "Labor Day", (2_020, 9, 7));
Add_Event (Calendar, "Pan American Aviation Day", (2_020, 12, 17));
Add_Event (Calendar, "Parents' Day", (2_020, 7, 26));
Add_Event (Calendar, "Patriot's Day", (2_020, 4, 20));
Add_Event (Calendar, "Peace Officers Memorial Day", (2_020, 5, 15));
Add_Event (Calendar, "Pioneer Day", (2_020, 7, 24));
Add_Event (Calendar, "Preakness Stakes", (2_020, 5, 16));
Remove_Event (Calendar, "Law Day", (2_020, 5, 1));
Add_Event (Calendar, "Presidents' Day", (2_020, 2, 17));
Add_Event (Calendar, "Purple Heart Day", (2_020, 8, 7));
Add_Event (Calendar, "Read Across America Day", (2_020, 3, 2));
Add_Event (Calendar, "Senior Citizens Day", (2_020, 8, 21));
Add_Event (Calendar, "September Equinox", (2_020, 9, 22));
Add_Event (Calendar, "Stephen Foster Memorial Day", (2_020, 1, 13));
Remove_Event (Calendar, "New Year's Day", (2_020, 1, 1));
Add_Event (Calendar, "Super Bowl", (2_020, 2, 2));
Add_Event (Calendar, "Super Tuesday", (2_020, 3, 3));
Remove_Event (Calendar, "Read Across America Day", (2_020, 3, 2));
Add_Event (Calendar, "Susan B. Anthony's Birthday", (2_020, 2, 15));
Add_Event (Calendar, "Thanksgiving Day", (2_020, 11, 26));
Add_Event (Calendar, "Thomas Jefferson's Birthday", (2_020, 4, 13));
Remove_Event (Calendar, "Thomas Jefferson's Birthday", (2_020, 4, 13));
Add_Event (Calendar, "Truman Day", (2_020, 5, 8));
Add_Event (Calendar, "Valentine's Day", (2_020, 2, 14));
Remove_Event (Calendar, "Bill of Rights Day", (2_020, 12, 15));
Add_Event (Calendar, "Veterans Day", (2_020, 11, 11));
Add_Event (Calendar, "Wright Brothers Day", (2_020, 12, 17));
Remove_Event (Calendar, "Belmont Stakes", (2_020, 6, 6));
Run_Test;
end Main;
|
with HAL; use HAL;
with HAL.GPIO; use HAL.GPIO;
with USB.Device;
with USB.Device.MIDI;
with USB.Device.Serial;
with USB.Device.HID.Gamepad;
with SAM.Device; use SAM.Device;
with SAM.USB;
with SAM_SVD.USB;
with SAM.Main_Clock;
with SAM.Clock_Generator;
with SAM.Clock_Generator.IDs;
with SAM.Clock_Setup_120Mhz;
with SAM.Port;
with SAM.Functions;
with Interfaces; use Interfaces;
with PyGamer; -- Elaborate PyGamer
pragma Unreferenced (PyGamer);
with PyGamer.Controls;
with pygamer_usb_gamepad_Config;
package body USB_Gamepad is
Stack : USB.Device.USB_Device_Stack (Max_Classes => 3);
Pad : aliased USB.Device.HID.Gamepad.Instance;
UDC : aliased SAM.USB.UDC
(Periph => SAM_SVD.USB.USB_Periph'Access,
EP_Buffers_Size => 512,
Max_Packet_Size => 64);
USB_DP : SAM.Port.GPIO_Point renames PA25;
USB_DM : SAM.Port.GPIO_Point renames PA24;
USB_ID : SAM.Port.GPIO_Point renames PA23;
procedure Run is
use type USB.Device.Init_Result;
begin
SAM.Clock_Generator.Configure_Periph_Channel
(SAM.Clock_Generator.IDs.USB, SAM.Clock_Setup_120Mhz.Clk_48Mhz);
SAM.Main_Clock.USB_On;
USB_DP.Clear;
USB_DP.Set_Mode (HAL.GPIO.Output);
USB_DP.Set_Pull_Resistor (HAL.GPIO.Floating);
USB_DP.Set_Function (SAM.Functions.PA25_USB_DP);
USB_DM.Clear;
USB_DM.Set_Mode (HAL.GPIO.Output);
USB_DM.Set_Pull_Resistor (HAL.GPIO.Floating);
USB_DM.Set_Function (SAM.Functions.PA25_USB_DP);
USB_ID.Clear;
USB_ID.Set_Mode (HAL.GPIO.Output);
USB_ID.Set_Pull_Resistor (HAL.GPIO.Floating);
USB_ID.Set_Function (SAM.Functions.PA23_USB_SOF_1KHZ);
if not Stack.Register_Class (Pad'Access) then
raise Program_Error;
end if;
if Stack.Initialize
(UDC'Access,
USB.To_USB_String ("Fabien"),
USB.To_USB_String ("PyGamer Gamepad"),
USB.To_USB_String (pygamer_usb_gamepad_Config.Crate_Version),
UDC.Max_Packet_Size) /= USB.Device.Ok
then
raise Program_Error;
end if;
Stack.Start;
declare
S : Natural := 1;
begin
loop
Stack.Poll;
if Pad.Ready then
PyGamer.Controls.Scan;
declare
use USB.Device.HID.Gamepad;
X_Val : constant Integer_8 :=
Integer_8 (PyGamer.Controls.Joystick_X);
Y_Val : constant Integer_8 :=
Integer_8 (PyGamer.Controls.Joystick_Y);
Buttons : UInt8 := 0;
begin
Pad.Set_Axis (X, X_Val);
Pad.Set_Axis (Y, Y_Val);
if PyGamer.Controls.Pressed (PyGamer.Controls.A) then
Buttons := Buttons or 2#0000_0001#;
end if;
if PyGamer.Controls.Pressed (PyGamer.Controls.B) then
Buttons := Buttons or 2#0000_0010#;
end if;
if PyGamer.Controls.Pressed (PyGamer.Controls.Sel) then
Buttons := Buttons or 2#0000_0100#;
end if;
if PyGamer.Controls.Pressed (PyGamer.Controls.Start) then
Buttons := Buttons or 2#0000_1000#;
end if;
Pad.Set_Buttons (Buttons);
Pad.Send_Report (UDC);
end;
end if;
end loop;
end;
end Run;
end USB_Gamepad;
|
with Extraction.Utilities;
private package Extraction.Graph_Operations is
type Graph_Context is tagged private;
function Create_Graph_Context
(Graph_File : access GW.GraphML_File;
Directory_Prefix : VFS.Virtual_File;
Project_Context : Utilities.Project_Context)
return Graph_Context;
procedure Write_Node
(Graph : Graph_Context;
File : VFS.Virtual_File);
procedure Write_Node
(Graph : Graph_Context;
Project : GPR.Project_Type);
procedure Write_Node
(Graph : Graph_Context;
Basic_Decl : LAL.Basic_Decl);
procedure Write_Node
(Graph : Graph_Context;
Defining_Name : LAL.Defining_Name;
Basic_Decl : LAL.Basic_Decl);
procedure Write_Edge
(Graph : Graph_Context;
Source_Project : GPR.Project_Type;
Target_Project : GPR.Project_Type;
Edge_Ty : GraphML_Writers.Edge_Type;
Edge_Attrs : GW.Attribute_Value_Sets.Map := GW.Attribute_Value_Sets.Empty);
procedure Write_Edge
(Graph : Graph_Context;
Source_Project : GPR.Project_Type;
Target_File : VFS.Virtual_File;
Edge_Ty : GraphML_Writers.Edge_Type;
Edge_Attrs : GW.Attribute_Value_Sets.Map := GW.Attribute_Value_Sets.Empty);
procedure Write_Edge
(Graph : Graph_Context;
Source_File : VFS.Virtual_File;
Target_Project : GPR.Project_Type;
Edge_Ty : GraphML_Writers.Edge_Type;
Edge_Attrs : GW.Attribute_Value_Sets.Map := GW.Attribute_Value_Sets.Empty);
procedure Write_Edge
(Graph : Graph_Context;
Source_File : VFS.Virtual_File;
Target_File : VFS.Virtual_File;
Edge_Ty : GraphML_Writers.Edge_Type;
Edge_Attrs : GW.Attribute_Value_Sets.Map := GW.Attribute_Value_Sets.Empty);
procedure Write_Edge
(Graph : Graph_Context;
Source_Unit : LAL.Analysis_Unit;
Target_Name : LAL.Defining_Name;
Target_Decl : LAL.Basic_Decl'Class;
Edge_Ty : GraphML_Writers.Edge_Type;
Edge_Attrs : GW.Attribute_Value_Sets.Map := GW.Attribute_Value_Sets.Empty);
procedure Write_Edge
(Graph : Graph_Context;
Source_Name : LAL.Defining_Name;
Source_Decl : LAL.Basic_Decl'Class;
Target_Unit : LAL.Analysis_Unit;
Edge_Ty : GraphML_Writers.Edge_Type;
Edge_Attrs : GW.Attribute_Value_Sets.Map := GW.Attribute_Value_Sets.Empty);
procedure Write_Edge
(Graph : Graph_Context;
Source_Decl : LAL.Basic_Decl'Class;
Target_Decl : LAL.Basic_Decl'Class;
Edge_Ty : GraphML_Writers.Edge_Type;
Edge_Attrs : GW.Attribute_Value_Sets.Map := GW.Attribute_Value_Sets.Empty);
procedure Write_Edge
(Graph : Graph_Context;
Source_Name : LAL.Defining_Name;
Source_Decl : LAL.Basic_Decl'Class;
Target_Decl : LAL.Basic_Decl'Class;
Edge_Ty : GraphML_Writers.Edge_Type;
Edge_Attrs : GW.Attribute_Value_Sets.Map := GW.Attribute_Value_Sets.Empty);
procedure Write_Edge
(Graph : Graph_Context;
Source_Decl : LAL.Basic_Decl'Class;
Target_Name : LAL.Defining_Name;
Target_Decl : LAL.Basic_Decl'Class;
Edge_Ty : GraphML_Writers.Edge_Type;
Edge_Attrs : GW.Attribute_Value_Sets.Map := GW.Attribute_Value_Sets.Empty);
procedure Write_Edge
(Graph : Graph_Context;
Source_Name : LAL.Defining_Name;
Source_Decl : LAL.Basic_Decl'Class;
Target_Name : LAL.Defining_Name;
Target_Decl : LAL.Basic_Decl'Class;
Edge_Ty : GraphML_Writers.Edge_Type;
Edge_Attrs : GW.Attribute_Value_Sets.Map := GW.Attribute_Value_Sets.Empty);
private
type Graph_Context is tagged record
Graph_File : access GW.GraphML_File;
Directory_Prefix : VFS.Virtual_File;
Project_Context : Utilities.Project_Context;
end record;
end Extraction.Graph_Operations;
|
-----------------------------------------------------------------------
-- babel-streams-cached -- Cached stream management
-- Copyright (C) 2014, 2015 Stephane.Carrez
-- Written by Stephane.Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body Babel.Streams.Cached is
package BAV renames Babel.Files.Buffers.Buffer_Access_Vectors;
-- ------------------------------
-- Load the file stream into the cache and use the buffer pool to obtain more buffers
-- for the cache.
-- ------------------------------
procedure Load (Stream : in out Stream_Type;
File : in out Babel.Streams.Stream_Type'Class;
Pool : in out Babel.Files.Buffers.Buffer_Pool) is
use type Babel.Files.Buffers.Buffer_Access;
Buffer : Babel.Files.Buffers.Buffer_Access;
begin
loop
File.Read (Buffer);
exit when Buffer = null;
Stream.Buffers.Append (Buffer);
Pool.Get_Buffer (Buffer);
File.Set_Buffer (Buffer);
end loop;
Stream.Current := Stream.Buffers.First;
end Load;
-- ------------------------------
-- Read the data stream as much as possible and return the result in a buffer.
-- The buffer is owned by the stream and need not be released. The same buffer may
-- or may not be returned by the next <tt>Read</tt> operation.
-- A null buffer is returned when the end of the data stream is reached.
-- ------------------------------
overriding
procedure Read (Stream : in out Stream_Type;
Buffer : out Babel.Files.Buffers.Buffer_Access) is
begin
if BAV.Has_Element (Stream.Current) then
Buffer := BAV.Element (Stream.Current);
BAV.Next (Stream.Current);
else
Buffer := null;
end if;
end Read;
-- ------------------------------
-- Write the buffer in the data stream.
-- ------------------------------
overriding
procedure Write (Stream : in out Stream_Type;
Buffer : in Babel.Files.Buffers.Buffer_Access) is
begin
null;
end Write;
-- ------------------------------
-- Prepare to read again the data stream from the beginning.
-- ------------------------------
overriding
procedure Rewind (Stream : in out Stream_Type) is
begin
Stream.Current := Stream.Buffers.First;
end Rewind;
-- ------------------------------
-- Release the buffers associated with the cache.
-- ------------------------------
overriding
procedure Finalize (Stream : in out Stream_Type) is
Buffer : Babel.Files.Buffers.Buffer_Access;
begin
while not Stream.Buffers.Is_Empty loop
Buffer := Stream.Buffers.Last_Element;
Babel.Files.Buffers.Release (Buffer);
Stream.Buffers.Delete_Last;
end loop;
Babel.Streams.Stream_Type (Stream).Finalize;
end Finalize;
end Babel.Streams.Cached;
|
with Measure_Units; use Measure_Units;
with Ada.Text_IO; use Ada.Text_IO;
procedure Aviotest0 is
Avg_Speed : Kn := 350.0;
Travel_Time : Duration := 2.0 * 3600.0; -- two hours
CR : Climb_Rate := 1500.0;
Climb_Time : Duration := 60.0 * 20; -- 2 minutes
Alt0 : Ft := 50_000.0; -- from here
Alt1 : Ft := 20_000.0; -- to here
Sink_Time : Duration := 60.0 * 10; -- in 10 minutes
begin
Put_Line ("avg speed (kt): " & Avg_Speed);
Put_Line ("avg speed (m/s): " & To_Mps (Avg_Speed));
Put_Line ("flight duration (s): " & Duration'Image (Travel_Time));
Put_Line ("distance (NM): " & (Avg_Speed * Travel_Time));
Put_Line ("distance (m): " & To_Meters (Avg_Speed * Travel_Time));
Put_Line ("climb rate (ft/min): " & CR);
Put_Line ("alt (ft) after "
& Duration'Image (Climb_Time)
& " s: "
& (CR * Climb_Time));
Put_Line ("change alt rate (ft/m): " & ((Alt1 - Alt0) / Sink_Time));
end Aviotest0;
|
package Test_3 is end;
|
-- Copyright 2019 Michael Casadevall <michael@casadevall.pro>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to
-- deal in the Software without restriction, including without limitation the
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-- sell copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-- DEALINGS IN THE SOFTWARE.
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Exceptions; use Ada.Exceptions;
with GNAT.Sockets; use GNAT.Sockets;
with DNSCatcher.DNS; use DNSCatcher.DNS;
with DNSCatcher.DNS.Client;
with DNSCatcher.Config;
with DNSCatcher.Utils.Logger; use DNSCatcher.Utils.Logger;
with DNSCatcher.DNS.Transaction_Manager;
use DNSCatcher.DNS.Transaction_Manager;
with DNSCatcher.Network.UDP.Sender;
with DNSCatcher.Network.UDP.Receiver;
with DNSCatcher.Types; use DNSCatcher.Types;
procedure DNSC is
DClient : DNSCatcher.DNS.Client.Client;
Capture_Config : DNSCatcher.Config.Configuration;
Logger_Task : DNSCatcher.Utils.Logger.Logger;
Transaction_Manager_Ptr : DNS_Transaction_Manager_Task_Ptr;
Sender_Interface : DNSCatcher.Network.UDP.Sender.UDP_Sender_Interface;
Receiver_Interface : DNSCatcher.Network.UDP.Receiver.UDP_Receiver_Interface;
Outbound_Packet : Raw_Packet_Record_Ptr;
Logger_Packet : DNSCatcher.Utils.Logger.Logger_Message_Packet_Ptr;
Socket : Socket_Type;
begin
Capture_Config.Local_Listen_Port := 41231;
Capture_Config.Upstream_DNS_Server := To_Unbounded_String ("4.2.2.2");
Capture_Config.Upstream_DNS_Server_Port := 53;
-- Configure the logger
Capture_Config.Logger_Config.Log_Level := DEBUG;
Capture_Config.Logger_Config.Use_Color := True;
Logger_Task.Initialize (Capture_Config.Logger_Config);
Logger_Task.Start;
Logger_Packet := new Logger_Message_Packet;
Transaction_Manager_Ptr := new DNS_Transaction_Manager_Task;
-- Socket has to be shared between receiver and sender. This likely needs to
-- move to to a higher level class
begin
Create_Socket
(Socket => Socket,
Mode => Socket_Datagram);
Set_Socket_Option
(Socket => Socket,
Level => IP_Protocol_For_IP_Level,
Option => (GNAT.Sockets.Receive_Timeout, Timeout => 1.0));
Bind_Socket
(Socket => Socket,
Address =>
(Family => Family_Inet, Addr => Any_Inet_Addr,
Port => Capture_Config.Local_Listen_Port));
exception
when Exp_Error : GNAT.Sockets.Socket_Error =>
begin
Logger_Packet := new DNSCatcher.Utils.Logger.Logger_Message_Packet;
Logger_Packet.Log_Message
(ERROR, "Socket error: " & Exception_Information (Exp_Error));
Logger_Packet.Log_Message (ERROR, "Refusing to start!");
Logger_Queue.Add_Packet (Logger_Packet);
goto Shutdown_Procedure;
end;
end;
-- Start up all tasks
Sender_Interface.Initialize (Socket => Socket);
Sender_Interface.Start;
Receiver_Interface.Initialize
(Capture_Config, Transaction_Manager_Ptr, Socket);
Receiver_Interface.Start;
Transaction_Manager_Ptr.Set_Packet_Queue
(Sender_Interface.Get_Packet_Queue_Ptr);
Transaction_Manager_Ptr.Start;
-- Generate our packet
DClient.Create_Header;
DClient.Add_Query (To_Unbounded_String ("casadevall.pro"), A, INternet);
Outbound_Packet := DClient.Create_Packet (Capture_Config);
Transaction_Manager_Ptr.From_Client_Resolver_Packet
(Packet => Outbound_Packet,
Local => True);
Logger_Queue.Add_Packet (Logger_Packet);
delay 2.0;
-- And tear it all down
<<Shutdown_Procedure>>
Sender_Interface.Shutdown;
Transaction_Manager_Ptr.Stop;
Receiver_Interface.Shutdown;
Logger_Task.Stop;
exception
when Error : others =>
begin
Put (Standard_Error, "Unknown error: ");
Put_Line (Standard_Error, Exception_Information (Error));
Logger_Task.Stop;
end;
end DNSC;
|
------------------------------------------------------------------------------
-- A d a r u n - t i m e s p e c i f i c a t i o n --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of this file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
package Ada is
pragma Pure (Ada);
end Ada;
------------------------------------------------------------------------------
-- Copyright (c) 2006-2013, Maxim Reznik
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * Neither the name of the Maxim Reznik, IE nor the names of its
-- contributors may be used to endorse or promote products derived from
-- this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2013, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Ada.Calendar.Time_Zones;
with League.Calendars.ISO_8601;
package body League.Calendars.Ada_Conversions is
-------------------
-- From_Ada_Time --
-------------------
function From_Ada_Time (Item : Ada.Calendar.Time) return Date_Time is
use type Ada.Calendar.Time;
Offset : constant Ada.Calendar.Time_Zones.Time_Offset
:= Ada.Calendar.Time_Zones.UTC_Time_Offset (Item);
UTC : constant Ada.Calendar.Time := Item - Duration (Offset) * 60.0;
-- XXX Must be reviewed after implementation of timezone support.
-- Ada.Calendar.Time is local time and time zone conversion will be
-- applied automatically by League.Calendars.ISO_8601.Create.
Year : Ada.Calendar.Year_Number;
Month : Ada.Calendar.Month_Number;
Day : Ada.Calendar.Day_Number;
Seconds : Ada.Calendar.Day_Duration;
Whole_Seconds : Integer;
Hour : League.Calendars.ISO_8601.Hour_Number;
Minute : League.Calendars.ISO_8601.Minute_Number;
Second : League.Calendars.ISO_8601.Second_Number;
Fraction : League.Calendars.ISO_8601.Nanosecond_100_Number;
begin
Ada.Calendar.Split (UTC, Year, Month, Day, Seconds);
Whole_Seconds := Integer (Seconds - 0.5);
-- Conversion to integer uses mathematical rounding, so we need to
-- subtract by 0.5 to extract whole number of seconds.
Hour :=
League.Calendars.ISO_8601.Hour_Number (Whole_Seconds / 3_600);
Minute :=
League.Calendars.ISO_8601.Minute_Number
((Whole_Seconds / 60) mod 60);
Second :=
League.Calendars.ISO_8601.Second_Number (Whole_Seconds mod 60);
Fraction :=
League.Calendars.ISO_8601.Nanosecond_100_Number
((Seconds - Ada.Calendar.Day_Duration (Whole_Seconds))
* 10_000_000);
return
League.Calendars.ISO_8601.Create
(League.Calendars.ISO_8601.Year_Number (Year),
League.Calendars.ISO_8601.Month_Number (Month),
League.Calendars.ISO_8601.Day_Number (Day),
Hour,
Minute,
Second,
Fraction);
end From_Ada_Time;
end League.Calendars.Ada_Conversions;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2016-2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with STM32_SVD.PWR; use STM32_SVD.PWR;
with STM32_SVD.RCC; use STM32_SVD.RCC;
with Cortex_M_SVD.SCB; use Cortex_M_SVD.SCB;
with System.Machine_Code; use System.Machine_Code;
package body STM32.Power_Control is
------------
-- Enable --
------------
procedure Enable is
begin
RCC_Periph.APB1ENR.PWREN := True;
end Enable;
--------------------------------------
-- Disable_Backup_Domain_Protection --
--------------------------------------
procedure Disable_Backup_Domain_Protection is
begin
PWR_Periph.CR.DBP := True;
end Disable_Backup_Domain_Protection;
-------------------------------------
-- Enable_Backup_Domain_Protection --
-------------------------------------
procedure Enable_Backup_Domain_Protection is
begin
PWR_Periph.CR.DBP := False;
end Enable_Backup_Domain_Protection;
-----------------
-- Wakeup_Flag --
-----------------
function Wakeup_Flag return Boolean
is (PWR_Periph.CSR.WUF);
-----------------------
-- Clear_Wakeup_Flag --
-----------------------
procedure Clear_Wakeup_Flag is
begin
PWR_Periph.CR.CWUF := True;
end Clear_Wakeup_Flag;
------------------
-- Standby_Flag --
------------------
function Standby_Flag return Boolean
is (PWR_Periph.CSR.SBF);
------------------------
-- Clear_Standby_Flag --
------------------------
procedure Clear_Standby_Flag is
begin
PWR_Periph.CR.CSBF := True;
end Clear_Standby_Flag;
------------------------------
-- Set_Power_Down_Deepsleep --
------------------------------
procedure Set_Power_Down_Deepsleep (Enabled : Boolean := True) is
begin
PWR_Periph.CR.PDDS := Enabled;
end Set_Power_Down_Deepsleep;
-----------------------------
-- Set_Low_Power_Deepsleep --
-----------------------------
procedure Set_Low_Power_Deepsleep (Enabled : Boolean := True) is
begin
PWR_Periph.CR.LPDS := Enabled;
end Set_Low_Power_Deepsleep;
-----------------------
-- Enable_Wakeup_Pin --
-----------------------
procedure Enable_Wakeup_Pin (Enabled : Boolean := True) is
begin
PWR_Periph.CSR.EWUP := Enabled;
end Enable_Wakeup_Pin;
------------------------
-- Enter_Standby_Mode --
------------------------
procedure Enter_Standby_Mode is
begin
Clear_Wakeup_Flag;
Clear_Standby_Flag;
Set_Power_Down_Deepsleep;
SCB_Periph.SCR.SLEEPDEEP := True;
loop
Asm ("wfi", Volatile => True);
end loop;
end Enter_Standby_Mode;
end STM32.Power_Control;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . T A S K I N G --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2006, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
--
--
--
--
--
--
--
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides necessary type definitions for compiler interface
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
with Ada.Exceptions;
-- Used for Exception_Id
-- Exception_Occurrence
with System.Parameters;
-- used for Size_Type
with System.Task_Info;
-- used for Task_Info_Type
with System.Soft_Links;
-- used for TSD
with System.Task_Primitives;
-- used for Private_Data
with System.Stack_Usage;
-- used for Stack_Analyzer
with Unchecked_Conversion;
package System.Tasking is
pragma Preelaborate;
-------------------
-- Locking Rules --
-------------------
-- The following rules must be followed at all times, to prevent
-- deadlock and generally ensure correct operation of locking.
-- Never lock a lock unless abort is deferred
-- Never undefer abort while holding a lock
-- Overlapping critical sections must be properly nested, and locks must
-- be released in LIFO order. e.g., the following is not allowed:
-- Lock (X);
-- ...
-- Lock (Y);
-- ...
-- Unlock (X);
-- ...
-- Unlock (Y);
-- Locks with lower (smaller) level number cannot be locked
-- while holding a lock with a higher level number. (The level
-- 1. System.Tasking.PO_Simple.Protection.L (any PO lock)
-- 2. System.Tasking.Initialization.Global_Task_Lock (in body)
-- 3. System.Task_Primitives.Operations.Single_RTS_Lock
-- 4. System.Tasking.Ada_Task_Control_Block.LL.L (any TCB lock)
-- Clearly, there can be no circular chain of hold-and-wait
-- relationships involving locks in different ordering levels.
-- We used to have Global_Task_Lock before Protection.L but this was
-- clearly wrong since there can be calls to "new" inside protected
-- operations. The new ordering prevents these failures.
-- Sometimes we need to hold two ATCB locks at the same time. To allow us
-- to order the locking, each ATCB is given a unique serial number. If one
-- needs to hold locks on several ATCBs at once, the locks with lower
-- serial numbers must be locked first.
-- We don't always need to check the serial numbers, since the serial
-- numbers are assigned sequentially, and so:
-- . The parent of a task always has a lower serial number.
-- . The activator of a task always has a lower serial number.
-- . The environment task has a lower serial number than any other task.
-- . If the activator of a task is different from the task's parent,
-- the parent always has a lower serial number than the activator.
---------------------------------
-- Task_Id related definitions --
---------------------------------
type Ada_Task_Control_Block;
type Task_Id is access all Ada_Task_Control_Block;
Null_Task : constant Task_Id;
type Task_List is array (Positive range <>) of Task_Id;
function Self return Task_Id;
pragma Inline (Self);
-- This is the compiler interface version of this function. Do not call
-- from the run-time system.
function To_Task_Id is new Unchecked_Conversion (System.Address, Task_Id);
function To_Address is new Unchecked_Conversion (Task_Id, System.Address);
-----------------------
-- Enumeration types --
-----------------------
type Task_States is
(Unactivated,
-- Task has been created but has not been activated.
-- It cannot be executing.
-- Active states
-- For all states from here down, the task has been activated.
-- For all states from here down, except for Terminated, the task
-- may be executing.
-- Activator = null iff it has not yet completed activating.
-- For all states from here down,
-- the task has been activated, and may be executing.
Runnable,
-- Task is not blocked for any reason known to Ada.
-- (It may be waiting for a mutex, though.)
-- It is conceptually "executing" in normal mode.
Terminated,
-- The task is terminated, in the sense of ARM 9.3 (5).
-- Any dependents that were waiting on terminate
-- alternatives have been awakened and have terminated themselves.
Activator_Sleep,
-- Task is waiting for created tasks to complete activation
Acceptor_Sleep,
-- Task is waiting on an accept or selective wait statement
Entry_Caller_Sleep,
-- Task is waiting on an entry call
Async_Select_Sleep,
-- Task is waiting to start the abortable part of an
-- asynchronous select statement.
Delay_Sleep,
-- Task is waiting on a select statement with only a delay
-- alternative open.
Master_Completion_Sleep,
-- Master completion has two phases.
-- In Phase 1 the task is sleeping in Complete_Master
-- having completed a master within itself,
-- and is waiting for the tasks dependent on that master to become
-- terminated or waiting on a terminate Phase.
Master_Phase_2_Sleep,
-- In Phase 2 the task is sleeping in Complete_Master
-- waiting for tasks on terminate alternatives to finish
-- terminating.
-- The following are special uses of sleep, for server tasks
-- within the run-time system.
Interrupt_Server_Idle_Sleep,
Interrupt_Server_Blocked_Interrupt_Sleep,
Timer_Server_Sleep,
AST_Server_Sleep,
Asynchronous_Hold,
-- The task has been held by Asynchronous_Task_Control.Hold_Task
Interrupt_Server_Blocked_On_Event_Flag
-- The task has been blocked on a system call waiting for the
-- completion event.
);
type Call_Modes is
(Simple_Call, Conditional_Call, Asynchronous_Call, Timed_Call);
type Select_Modes is (Simple_Mode, Else_Mode, Terminate_Mode, Delay_Mode);
subtype Delay_Modes is Integer;
-------------------------------
-- Entry related definitions --
-------------------------------
Null_Entry : constant := 0;
Max_Entry : constant := Integer'Last;
Interrupt_Entry : constant := -2;
Cancelled_Entry : constant := -1;
type Entry_Index is range Interrupt_Entry .. Max_Entry;
Null_Task_Entry : constant := Null_Entry;
Max_Task_Entry : constant := Max_Entry;
type Task_Entry_Index is new Entry_Index
range Null_Task_Entry .. Max_Task_Entry;
type Entry_Call_Record;
type Entry_Call_Link is access all Entry_Call_Record;
type Entry_Queue is record
Head : Entry_Call_Link;
Tail : Entry_Call_Link;
end record;
type Task_Entry_Queue_Array is
array (Task_Entry_Index range <>) of Entry_Queue;
----------------------------------
-- Entry_Call_Record definition --
----------------------------------
type Entry_Call_State is
(Never_Abortable,
-- the call is not abortable, and never can be
Not_Yet_Abortable,
-- the call is not abortable, but may become so
Was_Abortable,
-- the call is not abortable, but once was
Now_Abortable,
-- the call is abortable
Done,
-- the call has been completed
Cancelled
-- the call was asynchronous, and was cancelled
);
-- Never_Abortable is used for calls that are made in a abort
-- deferred region (see ARM 9.8(5-11), 9.8 (20)).
-- Such a call is never abortable.
-- The Was_ vs. Not_Yet_ distinction is needed to decide whether it
-- is OK to advance into the abortable part of an async. select stmt.
-- That is allowed iff the mode is Now_ or Was_.
-- Done indicates the call has been completed, without cancellation,
-- or no call has been made yet at this ATC nesting level,
-- and so aborting the call is no longer an issue.
-- Completion of the call does not necessarily indicate "success";
-- the call may be returning an exception if Exception_To_Raise is
-- non-null.
-- Cancelled indicates the call was cancelled,
-- and so aborting the call is no longer an issue.
-- The call is on an entry queue unless
-- State >= Done, in which case it may or may not be still Onqueue.
-- Please do not modify the order of the values, without checking
-- all uses of this type. We rely on partial "monotonicity" of
-- Entry_Call_Record.State to avoid locking when we access this
-- value for certain tests. In particular:
-- 1) Once State >= Done, we can rely that the call has been
-- completed. If State >= Done, it will not
-- change until the task does another entry call at this level.
-- 2) Once State >= Was_Abortable, we can rely that the call has
-- been queued abortably at least once, and so the check for
-- whether it is OK to advance to the abortable part of an
-- async. select statement does not need to lock anything.
type Restricted_Entry_Call_Record is record
Self : Task_Id;
-- ID of the caller
Mode : Call_Modes;
State : Entry_Call_State;
pragma Atomic (State);
-- Indicates part of the state of the call.
--
-- Protection: If the call is not on a queue, it should only be
-- accessed by Self, and Self does not need any lock to modify this
-- field.
--
-- Once the call is on a queue, the value should be something other
-- than Done unless it is cancelled, and access is controller by the
-- "server" of the queue -- i.e., the lock of Checked_To_Protection
-- (Call_Target) if the call record is on the queue of a PO, or the
-- lock of Called_Target if the call is on the queue of a task. See
-- comments on type declaration for more details.
Uninterpreted_Data : System.Address;
-- Data passed by the compiler
Exception_To_Raise : Ada.Exceptions.Exception_Id;
-- The exception to raise once this call has been completed without
-- being aborted.
end record;
pragma Suppress_Initialization (Restricted_Entry_Call_Record);
-------------------------------------------
-- Task termination procedure definition --
-------------------------------------------
-- We need to redefine here these types (already defined in
-- Ada.Task_Termination) for avoiding circular dependencies.
type Cause_Of_Termination is (Normal, Abnormal, Unhandled_Exception);
-- Possible causes for task termination:
--
-- Normal means that the task terminates due to completing the
-- last sentence of its body, or as a result of waiting on a
-- terminate alternative.
-- Abnormal means that the task terminates because it is being aborted
-- handled_Exception means that the task terminates because of exception
-- raised by by the execution of its task_body.
type Termination_Handler is access protected procedure
(Cause : Cause_Of_Termination;
T : Task_Id;
X : Ada.Exceptions.Exception_Occurrence);
-- Used to represent protected procedures to be executed when task
-- terminates.
------------------------------------
-- Task related other definitions --
------------------------------------
type Activation_Chain is limited private;
-- Comment required ???
type Activation_Chain_Access is access all Activation_Chain;
-- Comment required ???
type Task_Procedure_Access is access procedure (Arg : System.Address);
type Access_Boolean is access all Boolean;
function Detect_Blocking return Boolean;
pragma Inline (Detect_Blocking);
-- Return whether the Detect_Blocking pragma is enabled
----------------------------------------------
-- Ada_Task_Control_Block (ATCB) definition --
----------------------------------------------
-- Notes on protection (synchronization) of TRTS data structures
-- Any field of the TCB can be written by the activator of a task when the
-- task is created, since no other task can access the new task's
-- state until creation is complete.
-- The protection for each field is described in a comment starting with
-- "Protection:".
-- When a lock is used to protect an ATCB field, this lock is simply named
-- Some protection is described in terms of tasks related to the
-- ATCB being protected. These are:
-- Self: The task which is controlled by this ATCB
-- Acceptor: A task accepting a call from Self
-- Caller: A task calling an entry of Self
-- Parent: The task executing the master on which Self depends
-- Dependent: A task dependent on Self
-- Activator: The task that created Self and initiated its activation
-- Created: A task created and activated by Self
-- Note: The order of the fields is important to implement efficiently
-- tasking support under gdb.
-- Currently gdb relies on the order of the State, Parent, Base_Priority,
-- Task_Image, Task_Image_Len, Call and LL fields.
-------------------------
-- Common ATCB section --
-------------------------
-- Section used by all GNARL implementations (regular and restricted)
type Common_ATCB is record
State : Task_States;
pragma Atomic (State);
-- Encodes some basic information about the state of a task,
-- including whether it has been activated, whether it is sleeping,
-- and whether it is terminated.
--
-- Protection: Self.L
Parent : Task_Id;
-- The task on which this task depends.
-- See also Master_Level and Master_Within.
Base_Priority : System.Any_Priority;
-- Base priority, not changed during entry calls, only changed
-- via dynamic priorities package.
--
-- Protection: Only written by Self, accessed by anyone
Current_Priority : System.Any_Priority;
-- Active priority, except that the effects of protected object
-- priority ceilings are not reflected. This only reflects explicit
-- priority changes and priority inherited through task activation
-- and rendezvous.
--
-- Ada 95 notes: In Ada 95, this field will be transferred to the
-- Priority field of an Entry_Calls component when an entry call
-- is initiated. The Priority of the Entry_Calls component will not
-- change for the duration of the call. The accepting task can
-- use it to boost its own priority without fear of its changing in
-- the meantime.
--
-- This can safely be used in the priority ordering
-- of entry queues. Once a call is queued, its priority does not
-- change.
--
-- Since an entry call cannot be made while executing
-- a protected action, the priority of a task will never reflect a
-- priority ceiling change at the point of an entry call.
--
-- Protection: Only written by Self, and only accessed when Acceptor
-- accepts an entry or when Created activates, at which points Self is
-- suspended.
Protected_Action_Nesting : Natural;
pragma Atomic (Protected_Action_Nesting);
-- The dynamic level of protected action nesting for this task. This
-- field is needed for checking whether potentially blocking operations
-- are invoked from protected actions. pragma Atomic is used because it
-- can be read/written from protected interrupt handlers.
Task_Image : String (1 .. 32);
-- Hold a string that provides a readable id for task,
-- built from the variable of which it is a value or component.
Task_Image_Len : Natural;
-- Actual length of Task_Image
Call : Entry_Call_Link;
-- The entry call that has been accepted by this task.
--
-- Protection: Self.L. Self will modify this field when Self.Accepting
-- is False, and will not need the mutex to do so. Once a task sets
-- Pending_ATC_Level = 0, no other task can access this field.
LL : aliased Task_Primitives.Private_Data;
-- Control block used by the underlying low-level tasking service
-- (GNULLI).
--
-- Protection: This is used only by the GNULLI implementation, which
-- takes care of all of its synchronization.
Task_Arg : System.Address;
-- The argument to task procedure. Provide a handle for discriminant
-- information
--
-- Protection: Part of the synchronization between Self and Activator.
-- Activator writes it, once, before Self starts executing. Thereafter,
-- Self only reads it.
Task_Entry_Point : Task_Procedure_Access;
-- Information needed to call the procedure containing the code for
-- the body of this task.
--
-- Protection: Part of the synchronization between Self and Activator.
-- Activator writes it, once, before Self starts executing. Self reads
-- it, once, as part of its execution.
Compiler_Data : System.Soft_Links.TSD;
-- Task-specific data needed by the compiler to store per-task
-- structures.
--
-- Protection: Only accessed by Self
All_Tasks_Link : Task_Id;
-- Used to link this task to the list of all tasks in the system
--
-- Protection: RTS_Lock
Activation_Link : Task_Id;
-- Used to link this task to a list of tasks to be activated
--
-- Protection: Only used by Activator
Activator : Task_Id;
-- The task that created this task, either by declaring it as a task
-- object or by executing a task allocator. The value is null iff Self
-- has completed activation.
--
-- Protection: Set by Activator before Self is activated, and only read
-- and modified by Self after that.
Wait_Count : Integer;
-- This count is used by a task that is waiting for other tasks. At all
-- other times, the value should be zero. It is used differently in
-- several different states. Since a task cannot be in more than one of
-- these states at the same time, a single counter suffices.
--
-- Protection: Self.L
-- Activator_Sleep
-- This is the number of tasks that this task is activating, i.e. the
-- children that have started activation but have not completed it.
--
-- Protection: Self.L and Created.L. Both mutexes must be locked, since
-- Self.Activation_Count and Created.State must be synchronized.
-- Master_Completion_Sleep (phase 1)
-- This is the number dependent tasks of a master being completed by
-- Self that are not activated, not terminated, and not waiting on a
-- terminate alternative.
-- Master_Completion_2_Sleep (phase 2)
-- This is the count of tasks dependent on a master being completed by
-- Self which are waiting on a terminate alternative.
Elaborated : Access_Boolean;
-- Pointer to a flag indicating that this task's body has been
-- elaborated. The flag is created and managed by the
-- compiler-generated code.
--
-- Protection: The field itself is only accessed by Activator. The flag
-- that it points to is updated by Master and read by Activator; access
-- is assumed to be atomic.
Activation_Failed : Boolean;
-- Set to True if activation of a chain of tasks fails,
-- so that the activator should raise Tasking_Error.
Task_Info : System.Task_Info.Task_Info_Type;
-- System-specific attributes of the task as specified by the
-- Task_Info pragma.
Analyzer : System.Stack_Usage.Stack_Analyzer;
-- For storing informations used to measure the stack usage
Global_Task_Lock_Nesting : Natural;
-- This is the current nesting level of calls to
-- System.Tasking.Initialization.Lock_Task. This allows a task to call
-- Lock_Task multiple times without deadlocking. A task only locks
-- Global_Task_Lock when its Global_Task_Lock_Nesting goes from 0 to 1,
-- and only unlocked when it goes from 1 to 0.
--
-- Protection: Only accessed by Self
Fall_Back_Handler : Termination_Handler;
-- This is the fall-back handler that applies to the dependent tasks of
-- the task.
--
-- Protection: Self.L
Specific_Handler : Termination_Handler;
-- This is the specific handler that applies only to this task, and not
-- any of its dependent tasks.
--
-- Protection: Self.L
end record;
---------------------------------------
-- Restricted_Ada_Task_Control_Block --
---------------------------------------
-- This type should only be used by the restricted GNARLI and by
-- restricted GNULL implementations to allocate an ATCB (see
-- System.Task_Primitives.Operations.New_ATCB) that will take
-- significantly less memory.
-- Note that the restricted GNARLI should only access fields that are
-- present in the Restricted_Ada_Task_Control_Block structure.
type Restricted_Ada_Task_Control_Block (Entry_Num : Task_Entry_Index) is
record
Common : Common_ATCB;
-- The common part between various tasking implementations
Entry_Call : aliased Restricted_Entry_Call_Record;
-- Protection: This field is used on entry call "queues" associated
-- with protected objects, and is protected by the protected object
-- lock.
end record;
pragma Suppress_Initialization (Restricted_Ada_Task_Control_Block);
Interrupt_Manager_ID : Task_Id;
-- This task ID is declared here to break circular dependencies.
-- Also declare Interrupt_Manager_ID after Task_Id is known, to avoid
-- generating unneeded finalization code.
-----------------------
-- List of all Tasks --
-----------------------
All_Tasks_List : Task_Id;
-- Global linked list of all tasks
------------------------------------------
-- Regular (non restricted) definitions --
------------------------------------------
--------------------------------
-- Master Related Definitions --
--------------------------------
subtype Master_Level is Integer;
subtype Master_ID is Master_Level;
-- Normally, a task starts out with internal master nesting level one
-- larger than external master nesting level. It is incremented to one by
-- Enter_Master, which is called in the task body only if the compiler
-- thinks the task may have dependent tasks. It is set to for the
-- environment task, the level 2 is reserved for server tasks of the
-- run-time system (the so called "independent tasks"), and the level 3 is
-- for the library level tasks.
Environment_Task_Level : constant Master_Level := 1;
Independent_Task_Level : constant Master_Level := 2;
Library_Task_Level : constant Master_Level := 3;
------------------------------
-- Task size, priority info --
------------------------------
Unspecified_Priority : constant Integer := System.Priority'First - 1;
Priority_Not_Boosted : constant Integer := System.Priority'First - 1;
-- Definition of Priority actually has to come from the RTS configuration
subtype Rendezvous_Priority is Integer
range Priority_Not_Boosted .. System.Any_Priority'Last;
------------------------------------
-- Rendezvous related definitions --
------------------------------------
No_Rendezvous : constant := 0;
Max_Select : constant Integer := Integer'Last;
-- RTS-defined
subtype Select_Index is Integer range No_Rendezvous .. Max_Select;
-- type Select_Index is range No_Rendezvous .. Max_Select;
subtype Positive_Select_Index is
Select_Index range 1 .. Select_Index'Last;
type Accept_Alternative is record
Null_Body : Boolean;
S : Task_Entry_Index;
end record;
type Accept_List is
array (Positive_Select_Index range <>) of Accept_Alternative;
type Accept_List_Access is access constant Accept_List;
-----------------------------------
-- ATC_Level related definitions --
-----------------------------------
Max_ATC_Nesting : constant Natural := 20;
subtype ATC_Level_Base is Integer range 0 .. Max_ATC_Nesting;
ATC_Level_Infinity : constant ATC_Level_Base := ATC_Level_Base'Last;
subtype ATC_Level is ATC_Level_Base range 0 .. ATC_Level_Base'Last - 1;
subtype ATC_Level_Index is ATC_Level range 1 .. ATC_Level'Last;
----------------------------------
-- Entry_Call_Record definition --
----------------------------------
type Entry_Call_Record is record
Self : Task_Id;
-- ID of the caller
Mode : Call_Modes;
State : Entry_Call_State;
pragma Atomic (State);
-- Indicates part of the state of the call
--
-- Protection: If the call is not on a queue, it should only be
-- accessed by Self, and Self does not need any lock to modify this
-- field. Once the call is on a queue, the value should be something
-- other than Done unless it is cancelled, and access is controller by
-- the "server" of the queue -- i.e., the lock of Checked_To_Protection
-- (Call_Target) if the call record is on the queue of a PO, or the
-- lock of Called_Target if the call is on the queue of a task. See
-- comments on type declaration for more details.
Uninterpreted_Data : System.Address;
-- Data passed by the compiler
Exception_To_Raise : Ada.Exceptions.Exception_Id;
-- The exception to raise once this call has been completed without
-- being aborted.
Prev : Entry_Call_Link;
Next : Entry_Call_Link;
Level : ATC_Level;
-- One of Self and Level are redundant in this implementation, since
-- each Entry_Call_Record is at Self.Entry_Calls (Level). Since we must
-- have access to the entry call record to be reading this, we could
-- get Self from Level, or Level from Self. However, this requires
-- non-portable address arithmetic.
E : Entry_Index;
Prio : System.Any_Priority;
-- The above fields are those that there may be some hope of packing.
-- They are gathered together to allow for compilers that lay records
-- out contiguously, to allow for such packing.
Called_Task : Task_Id;
pragma Atomic (Called_Task);
-- Use for task entry calls. The value is null if the call record is
-- not in use. Conversely, unless State is Done and Onqueue is false,
-- Called_Task points to an ATCB.
--
-- Protection: Called_Task.L
Called_PO : System.Address;
pragma Atomic (Called_PO);
-- Similar to Called_Task but for protected objects
--
-- Note that the previous implementation tried to merge both
-- Called_Task and Called_PO but this ended up in many unexpected
-- complications (e.g having to add a magic number in the ATCB, which
-- caused gdb lots of confusion) with no real gain since the
-- Lock_Server implementation still need to loop around chasing for
-- pointer changes even with a single pointer.
Acceptor_Prev_Call : Entry_Call_Link;
-- For task entry calls only
Acceptor_Prev_Priority : Rendezvous_Priority := Priority_Not_Boosted;
-- For task entry calls only. The priority of the most recent prior
-- call being serviced. For protected entry calls, this function should
-- be performed by GNULLI ceiling locking.
Cancellation_Attempted : Boolean := False;
pragma Atomic (Cancellation_Attempted);
-- Cancellation of the call has been attempted.
-- Consider merging this into State???
Requeue_With_Abort : Boolean := False;
-- Temporary to tell caller whether requeue is with abort.
-- Find a better way of doing this ???
Needs_Requeue : Boolean := False;
-- Temporary to tell acceptor of task entry call that
-- Exceptional_Complete_Rendezvous needs to do requeue.
end record;
------------------------------------
-- Task related other definitions --
------------------------------------
type Access_Address is access all System.Address;
-- Comment on what this is used for ???
pragma No_Strict_Aliasing (Access_Address);
-- This type is used in contexts where aliasing may be an issue (see
-- for example s-tataat.adb), so we avoid any incorrect aliasing
-- assumptions.
----------------------------------------------
-- Ada_Task_Control_Block (ATCB) definition --
----------------------------------------------
type Entry_Call_Array is array (ATC_Level_Index) of
aliased Entry_Call_Record;
type Direct_Index is range 0 .. Parameters.Default_Attribute_Count;
subtype Direct_Index_Range is Direct_Index range 1 .. Direct_Index'Last;
-- Attributes with indices in this range are stored directly in the task
-- control block. Such attributes must be Address-sized. Other attributes
-- will be held in dynamically allocated records chained off of the task
-- control block.
type Direct_Attribute_Element is mod Memory_Size;
pragma Atomic (Direct_Attribute_Element);
type Direct_Attribute_Array is
array (Direct_Index_Range) of aliased Direct_Attribute_Element;
type Direct_Index_Vector is mod 2 ** Parameters.Default_Attribute_Count;
-- This is a bit-vector type, used to store information about
-- the usage of the direct attribute fields.
type Task_Serial_Number is mod 2 ** 64;
-- Used to give each task a unique serial number
type Ada_Task_Control_Block (Entry_Num : Task_Entry_Index) is record
Common : Common_ATCB;
-- The common part between various tasking implementations
Entry_Calls : Entry_Call_Array;
-- An array of entry calls
--
-- Protection: The elements of this array are on entry call queues
-- associated with protected objects or task entries, and are protected
-- by the protected object lock or Acceptor.L, respectively.
New_Base_Priority : System.Any_Priority;
-- New value for Base_Priority (for dynamic priorities package)
--
-- Protection: Self.L
Open_Accepts : Accept_List_Access;
-- This points to the Open_Accepts array of accept alternatives passed
-- to the RTS by the compiler-generated code to Selective_Wait. It is
-- non-null iff this task is ready to accept an entry call.
--
-- Protection: Self.L
Chosen_Index : Select_Index;
-- The index in Open_Accepts of the entry call accepted by a selective
-- wait executed by this task.
--
-- Protection: Written by both Self and Caller. Usually protected by
-- Self.L. However, once the selection is known to have been written it
-- can be accessed without protection. This happens after Self has
-- updated it itself using information from a suspended Caller, or
-- after Caller has updated it and awakened Self.
Master_of_Task : Master_Level;
-- The task executing the master of this task, and the ID of this task's
-- master (unique only among masters currently active within Parent).
--
-- Protection: Set by Activator before Self is activated, and read
-- after Self is activated.
Master_Within : Master_Level;
-- The ID of the master currently executing within this task; that is,
-- the most deeply nested currently active master.
--
-- Protection: Only written by Self, and only read by Self or by
-- dependents when Self is attempting to exit a master. Since Self will
-- not write this field until the master is complete, the
-- synchronization should be adequate to prevent races.
Alive_Count : Integer := 0;
-- Number of tasks directly dependent on this task (including itself)
-- that are still "alive", i.e. not terminated.
--
-- Protection: Self.L
Awake_Count : Integer := 0;
-- Number of tasks directly dependent on this task (including itself)
-- still "awake", i.e., are not terminated and not waiting on a
-- terminate alternative.
--
-- Invariant: Awake_Count <= Alive_Count
-- Protection: Self.L
-- Beginning of flags
Aborting : Boolean := False;
pragma Atomic (Aborting);
-- Self is in the process of aborting. While set, prevents multiple
-- abort signals from being sent by different aborter while abort
-- is acted upon. This is essential since an aborter which calls
-- Abort_To_Level could set the Pending_ATC_Level to yet a lower level
-- (than the current level), may be preempted and would send the
-- abort signal when resuming execution. At this point, the abortee
-- may have completed abort to the proper level such that the
-- signal (and resulting abort exception) are not handled any more.
-- In other words, the flag prevents a race between multiple aborters
--
-- Protection: protected by atomic access.
ATC_Hack : Boolean := False;
pragma Atomic (ATC_Hack);
-- ?????
-- Temporary fix, to allow Undefer_Abort to reset Aborting in the
-- handler for Abort_Signal that encloses an async. entry call.
-- For the longer term, this should be done via code in the
-- handler itself.
Callable : Boolean := True;
-- It is OK to call entries of this task
Dependents_Aborted : Boolean := False;
-- This is set to True by whichever task takes responsibility for
-- aborting the dependents of this task.
--
-- Protection: Self.L
Interrupt_Entry : Boolean := False;
-- Indicates if one or more Interrupt Entries are attached to the task.
-- This flag is needed for cleaning up the Interrupt Entry bindings.
Pending_Action : Boolean := False;
-- Unified flag indicating some action needs to be take when abort
-- next becomes undeferred. Currently set if:
-- . Pending_Priority_Change is set
-- . Pending_ATC_Level is changed
-- . Requeue involving POs
-- (Abortable field may have changed and the Wait_Until_Abortable
-- has to recheck the abortable status of the call.)
-- . Exception_To_Raise is non-null
--
-- Protection: Self.L
--
-- This should never be reset back to False outside of the procedure
-- Do_Pending_Action, which is called by Undefer_Abort. It should only
-- be set to True by Set_Priority and Abort_To_Level.
Pending_Priority_Change : Boolean := False;
-- Flag to indicate pending priority change (for dynamic priorities
-- package). The base priority is updated on the next abort
-- completion point (aka. synchronization point).
--
-- Protection: Self.L
Terminate_Alternative : Boolean := False;
-- Task is accepting Select with Terminate Alternative
--
-- Protection: Self.L
-- End of flags
-- Beginning of counts
ATC_Nesting_Level : ATC_Level := 1;
-- The dynamic level of ATC nesting (currently executing nested
-- asynchronous select statements) in this task.
-- Protection: Self_ID.L. Only Self reads or updates this field.
-- Decrementing it deallocates an Entry_Calls component, and care must
-- be taken that all references to that component are eliminated before
-- doing the decrement. This in turn will require locking a protected
-- object (for a protected entry call) or the Acceptor's lock (for a
-- task entry call). No other task should attempt to read or modify
-- this value.
Deferral_Level : Natural := 1;
-- This is the number of times that Defer_Abortion has been called by
-- this task without a matching Undefer_Abortion call. Abortion is only
-- allowed when this zero. It is initially 1, to protect the task at
-- startup.
-- Protection: Only updated by Self; access assumed to be atomic
Pending_ATC_Level : ATC_Level_Base := ATC_Level_Infinity;
-- The ATC level to which this task is currently being aborted. If the
-- value is zero, the entire task has "completed". That may be via
-- abort, exception propagation, or normal exit. If the value is
-- ATC_Level_Infinity, the task is not being aborted to any level. If
-- the value is positive, the task has not completed. This should ONLY
-- be modified by Abort_To_Level and Exit_One_ATC_Level.
--
-- Protection: Self.L
Serial_Number : Task_Serial_Number;
-- A growing number to provide some way to check locking rules/ordering
Known_Tasks_Index : Integer := -1;
-- Index in the System.Tasking.Debug.Known_Tasks array
User_State : Long_Integer := 0;
-- User-writeable location, for use in debugging tasks; also provides a
-- simple task specific data.
Direct_Attributes : Direct_Attribute_Array;
-- For task attributes that have same size as Address
Is_Defined : Direct_Index_Vector := 0;
-- Bit I is 1 iff Direct_Attributes (I) is defined
Indirect_Attributes : Access_Address;
-- A pointer to chain of records for other attributes that are not
-- address-sized, including all tagged types.
Entry_Queues : Task_Entry_Queue_Array (1 .. Entry_Num);
-- An array of task entry queues
--
-- Protection: Self.L. Once a task has set Self.Stage to Completing, it
-- has exclusive access to this field.
end record;
--------------------
-- Initialization --
--------------------
procedure Initialize;
-- This procedure constitutes the first part of the initialization of the
-- GNARL. This includes creating data structures to make the initial thread
-- into the environment task. The last part of the initialization is done
-- in System.Tasking.Initialization or System.Tasking.Restricted.Stages.
-- All the initializations used to be in Tasking.Initialization, but this
-- is no longer possible with the run time simplification (including
-- optimized PO and the restricted run time) since one cannot rely on
-- System.Tasking.Initialization being present, as was done before.
procedure Initialize_ATCB
(Self_ID : Task_Id;
Task_Entry_Point : Task_Procedure_Access;
Task_Arg : System.Address;
Parent : Task_Id;
Elaborated : Access_Boolean;
Base_Priority : System.Any_Priority;
Task_Info : System.Task_Info.Task_Info_Type;
Stack_Size : System.Parameters.Size_Type;
T : Task_Id;
Success : out Boolean);
-- Initialize fields of a TCB and link into global TCB structures Call
-- this only with abort deferred and holding RTS_Lock. Need more
-- documentation, mention T, and describe Success ???
private
Null_Task : constant Task_Id := null;
type Activation_Chain is record
T_ID : Task_Id;
end record;
pragma Volatile (Activation_Chain);
-- Activation_chain is an in-out parameter of initialization procedures
-- and it must be passed by reference because the init proc may terminate
-- abnormally after creating task components, and these must be properly
-- registered for removal (Expunge_Unactivated_Tasks).
end System.Tasking;
|
<AnimDB FragDef="chrysalis/objects/desk/workdesk/fragment_ids.xml" TagDef="chrysalis/objects/desk/workdesk/tags.xml">
<FragmentList>
<Interact>
<Fragment BlendOutDuration="0.2" Tags="ScopeSlave">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0.2"/>
<Animation name="drawer_top_open"/>
</AnimLayer>
</Fragment>
</Interact>
<Closed>
<Fragment BlendOutDuration="0.2" Tags="ScopeSlave">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0.2"/>
<Animation name="door_close"/>
</AnimLayer>
</Fragment>
<Fragment BlendOutDuration="0.2" Tags=""/>
</Closed>
<Open>
<Fragment BlendOutDuration="0.2" Tags="ScopeSlave">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0.2"/>
<Animation name="drawer_bottom_open"/>
</AnimLayer>
</Fragment>
<Fragment BlendOutDuration="0.2" Tags=""/>
</Open>
<Opening>
<Fragment BlendOutDuration="0.2" Tags="ScopeSlave">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0.2"/>
<Animation name="drawer_top_open"/>
</AnimLayer>
</Fragment>
</Opening>
<Closing>
<Fragment BlendOutDuration="0.2" Tags="ScopeSlave">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0.2"/>
<Animation name="drawer_top_close"/>
</AnimLayer>
</Fragment>
<Fragment BlendOutDuration="0.2" Tags=""/>
</Closing>
</FragmentList>
</AnimDB>
|
-- package Quadrature
--
-- The equation is dY/dt = F (t).
-- The solution is just the area under the curve - quadrature.
-- F(t) is input as a generic formal function called Integrand.
--
-- If you want (d/dt)**N Y = F(t), then N is written as
--
-- N = Order_of_Equation
--
-- Then the integrated Y(0) is solution of (d/dt)**N Y = F(t),
-- Then the integrated Y(1) is solution of (d/dt)**N-1 Y = F(t),
-- and so on.
generic
type Real is digits <>;
with function Integrand (X : Real) return Real is <>;
package Quadrature is
Order_of_Equation : constant Positive := 1;
type Dyn_Index is range 0 .. Order_of_Equation-1;
type Dynamical_Variable is array(Dyn_Index) of Real;
DynZero : constant Dynamical_Variable := (others => (+0.0));
function F
(Time : Real;
Y : Dynamical_Variable)
return Dynamical_Variable;
-- Defines the equation to be integrated,
-- dY/dt = F (t, Y). Even if the equation is t or Y
-- independent, it must be entered in this form.
function "*"
(Left : Real;
Right : Dynamical_Variable)
return Dynamical_Variable;
function "+"
(Left : Dynamical_Variable;
Right : Dynamical_Variable)
return Dynamical_Variable;
function "-"
(Left : Dynamical_Variable;
Right : Dynamical_Variable)
return Dynamical_Variable;
function Norm (Y : Dynamical_Variable) return Real;
pragma Inline (F, "*", "+", "-", Norm);
end Quadrature;
|
generic
type Real is digits <>;
package Generic_Quaternions is
type Quaternion is record
A, B, C, D : Real;
end record;
function "abs" (Left : Quaternion) return Real;
function Conj (Left : Quaternion) return Quaternion;
function "-" (Left : Quaternion) return Quaternion;
function "+" (Left, Right : Quaternion) return Quaternion;
function "-" (Left, Right : Quaternion) return Quaternion;
function "*" (Left : Quaternion; Right : Real) return Quaternion;
function "*" (Left : Real; Right : Quaternion) return Quaternion;
function "*" (Left, Right : Quaternion) return Quaternion;
function Image (Left : Quaternion) return String;
end Generic_Quaternions;
|
with System;
use System;
package Qsort is
type vector is array (Integer range <>) of Integer;
type vector_ptr is access vector;
task type SortTask is
entry PortIn(ValIn : in vector_ptr);
entry PortOut(ValOut : out vector);
end SortTask;
type Sort_access is access SortTask;
procedure Sort (List : in out vector_ptr);
end Qsort;
|
with
Ada.Tags,
AdaM.Factory;
package body AdaM.Entity
is
-- Entities
--
function to_spec_Source (the_Entities : in Entities) return text_Vectors.Vector
is
the_Source : text_Vectors.Vector;
begin
for Each of the_Entities
loop
the_Source.append (Each.to_Source);
end loop;
return the_Source;
end to_spec_Source;
-- Entity
--
-- function Name (Self : in Item) return String
-- is
-- pragma Unreferenced (Self);
-- begin
-- return "<anon>";
-- end Name;
-- function full_Name (Self : in Item'Class) return String
-- is
-- begin
-- if Self.parent_Entity = null
-- then
-- return Self.Name;
-- else
-- return Self.parent_Entity.full_Name & "." & Self.Name;
-- end if;
-- end full_Name;
-- function to_spec_Source (Self : in Item) return text_Vectors.Vector
-- is
-- pragma Unreferenced (Self);
-- the_Source : text_Vectors.Vector;
-- begin
-- raise Program_Error with "TODO";
-- return the_Source;
-- end to_spec_Source;
function parent_Entity (Self : in Item) return Entity.view
is
begin
return Self.parent_Entity;
end parent_Entity;
procedure parent_Entity_is (Self : in out Item; Now : in Entity.View)
is
begin
Self.parent_Entity := Now;
end parent_Entity_is;
function Children (Self : access Item) return Entities_view
is
begin
return Self.Children'unchecked_Access;
end Children;
function Children (Self : in Item) return Entities'Class
is
begin
return Self.Children;
end Children;
procedure Children_are (Self : in out Item; Now : in Entities'Class)
is
begin
Self.Children := Entities (Now);
end Children_are;
function is_Public (Self : in Item) return Boolean
is
begin
return Self.is_Public;
end is_Public;
procedure is_Public (Self : in out Item; Now : in Boolean := True)
is
begin
Self.is_Public := Now;
end is_Public;
----------
-- Streams
--
procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : in View)
is
use Ada.Tags;
begin
if Self = null
then
AdaM.Id'write (Stream, null_Id);
return;
end if;
AdaM.Id'write (Stream, Self.Id);
String 'output (Stream, external_Tag (Self.all'Tag));
end View_write;
procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : out View)
is
Id : AdaM.Id;
begin
AdaM.Id'read (Stream, Id);
if Id = null_Id
then
Self := null;
return;
end if;
declare
use Ada.Tags;
the_String : constant String := String'Input (Stream); -- Read tag as string from stream.
the_Tag : constant Tag := Descendant_Tag (the_String, Item'Tag); -- Convert to a tag.
begin
Self := View (AdaM.Factory.to_View (Id, the_Tag));
end;
end View_read;
end AdaM.Entity;
|
-- Copyright (c) 2013, Nordic Semiconductor ASA
-- 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 Nordic Semiconductor ASA nor the names of its
-- contributors may be used to endorse or promote products derived from
-- this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--
-- This spec has been automatically generated from nrf51.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package NRF_SVD.WDT is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- Enable interrupt on TIMEOUT event.
type INTENSET_TIMEOUT_Field is
(-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENSET_TIMEOUT_Field use
(Disabled => 0,
Enabled => 1);
-- Enable interrupt on TIMEOUT event.
type INTENSET_TIMEOUT_Field_1 is
(-- Reset value for the field
Intenset_Timeout_Field_Reset,
-- Enable interrupt on write.
Set)
with Size => 1;
for INTENSET_TIMEOUT_Field_1 use
(Intenset_Timeout_Field_Reset => 0,
Set => 1);
-- Interrupt enable set register.
type INTENSET_Register is record
-- Enable interrupt on TIMEOUT event.
TIMEOUT : INTENSET_TIMEOUT_Field_1 :=
Intenset_Timeout_Field_Reset;
-- unspecified
Reserved_1_31 : HAL.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for INTENSET_Register use record
TIMEOUT at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-- Disable interrupt on TIMEOUT event.
type INTENCLR_TIMEOUT_Field is
(-- Interrupt disabled.
Disabled,
-- Interrupt enabled.
Enabled)
with Size => 1;
for INTENCLR_TIMEOUT_Field use
(Disabled => 0,
Enabled => 1);
-- Disable interrupt on TIMEOUT event.
type INTENCLR_TIMEOUT_Field_1 is
(-- Reset value for the field
Intenclr_Timeout_Field_Reset,
-- Disable interrupt on write.
Clear)
with Size => 1;
for INTENCLR_TIMEOUT_Field_1 use
(Intenclr_Timeout_Field_Reset => 0,
Clear => 1);
-- Interrupt enable clear register.
type INTENCLR_Register is record
-- Disable interrupt on TIMEOUT event.
TIMEOUT : INTENCLR_TIMEOUT_Field_1 :=
Intenclr_Timeout_Field_Reset;
-- unspecified
Reserved_1_31 : HAL.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for INTENCLR_Register use record
TIMEOUT at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-- Watchdog running status.
type RUNSTATUS_RUNSTATUS_Field is
(-- Watchdog timer is not running.
Notrunning,
-- Watchdog timer is running.
Running)
with Size => 1;
for RUNSTATUS_RUNSTATUS_Field use
(Notrunning => 0,
Running => 1);
-- Watchdog running status.
type RUNSTATUS_Register is record
-- Read-only. Watchdog running status.
RUNSTATUS : RUNSTATUS_RUNSTATUS_Field;
-- unspecified
Reserved_1_31 : HAL.UInt31;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RUNSTATUS_Register use record
RUNSTATUS at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-- Request status for RR[0].
type REQSTATUS_RR0_Field is
(-- RR[0] register is not enabled or has already requested reload.
Disabledorrequested,
-- RR[0] register is enabled and has not jet requested.
Enabledandunrequested)
with Size => 1;
for REQSTATUS_RR0_Field use
(Disabledorrequested => 0,
Enabledandunrequested => 1);
-- Request status for RR[1].
type REQSTATUS_RR1_Field is
(-- RR[1] register is not enabled or has already requested reload.
Disabledorrequested,
-- RR[1] register is enabled and has not jet requested.
Enabledandunrequested)
with Size => 1;
for REQSTATUS_RR1_Field use
(Disabledorrequested => 0,
Enabledandunrequested => 1);
-- Request status for RR[2].
type REQSTATUS_RR2_Field is
(-- RR[2] register is not enabled or has already requested reload.
Disabledorrequested,
-- RR[2] register is enabled and has not jet requested.
Enabledandunrequested)
with Size => 1;
for REQSTATUS_RR2_Field use
(Disabledorrequested => 0,
Enabledandunrequested => 1);
-- Request status for RR[3].
type REQSTATUS_RR3_Field is
(-- RR[3] register is not enabled or has already requested reload.
Disabledorrequested,
-- RR[3] register is enabled and has not jet requested.
Enabledandunrequested)
with Size => 1;
for REQSTATUS_RR3_Field use
(Disabledorrequested => 0,
Enabledandunrequested => 1);
-- Request status for RR[4].
type REQSTATUS_RR4_Field is
(-- RR[4] register is not enabled or has already requested reload.
Disabledorrequested,
-- RR[4] register is enabled and has not jet requested.
Enabledandunrequested)
with Size => 1;
for REQSTATUS_RR4_Field use
(Disabledorrequested => 0,
Enabledandunrequested => 1);
-- Request status for RR[5].
type REQSTATUS_RR5_Field is
(-- RR[5] register is not enabled or has already requested reload.
Disabledorrequested,
-- RR[5] register is enabled and has not jet requested.
Enabledandunrequested)
with Size => 1;
for REQSTATUS_RR5_Field use
(Disabledorrequested => 0,
Enabledandunrequested => 1);
-- Request status for RR[6].
type REQSTATUS_RR6_Field is
(-- RR[6] register is not enabled or has already requested reload.
Disabledorrequested,
-- RR[6] register is enabled and has not jet requested.
Enabledandunrequested)
with Size => 1;
for REQSTATUS_RR6_Field use
(Disabledorrequested => 0,
Enabledandunrequested => 1);
-- Request status for RR[7].
type REQSTATUS_RR7_Field is
(-- RR[7] register is not enabled or has already requested reload.
Disabledorrequested,
-- RR[7] register is enabled and has not jet requested.
Enabledandunrequested)
with Size => 1;
for REQSTATUS_RR7_Field use
(Disabledorrequested => 0,
Enabledandunrequested => 1);
-- Request status.
type REQSTATUS_Register is record
-- Read-only. Request status for RR[0].
RR0 : REQSTATUS_RR0_Field;
-- Read-only. Request status for RR[1].
RR1 : REQSTATUS_RR1_Field;
-- Read-only. Request status for RR[2].
RR2 : REQSTATUS_RR2_Field;
-- Read-only. Request status for RR[3].
RR3 : REQSTATUS_RR3_Field;
-- Read-only. Request status for RR[4].
RR4 : REQSTATUS_RR4_Field;
-- Read-only. Request status for RR[5].
RR5 : REQSTATUS_RR5_Field;
-- Read-only. Request status for RR[6].
RR6 : REQSTATUS_RR6_Field;
-- Read-only. Request status for RR[7].
RR7 : REQSTATUS_RR7_Field;
-- unspecified
Reserved_8_31 : HAL.UInt24;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for REQSTATUS_Register use record
RR0 at 0 range 0 .. 0;
RR1 at 0 range 1 .. 1;
RR2 at 0 range 2 .. 2;
RR3 at 0 range 3 .. 3;
RR4 at 0 range 4 .. 4;
RR5 at 0 range 5 .. 5;
RR6 at 0 range 6 .. 6;
RR7 at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-- Enable or disable RR[0] register.
type RREN_RR0_Field is
(-- RR[0] register is disabled.
Disabled,
-- RR[0] register is enabled.
Enabled)
with Size => 1;
for RREN_RR0_Field use
(Disabled => 0,
Enabled => 1);
-- Enable or disable RR[1] register.
type RREN_RR1_Field is
(-- RR[1] register is disabled.
Disabled,
-- RR[1] register is enabled.
Enabled)
with Size => 1;
for RREN_RR1_Field use
(Disabled => 0,
Enabled => 1);
-- Enable or disable RR[2] register.
type RREN_RR2_Field is
(-- RR[2] register is disabled.
Disabled,
-- RR[2] register is enabled.
Enabled)
with Size => 1;
for RREN_RR2_Field use
(Disabled => 0,
Enabled => 1);
-- Enable or disable RR[3] register.
type RREN_RR3_Field is
(-- RR[3] register is disabled.
Disabled,
-- RR[3] register is enabled.
Enabled)
with Size => 1;
for RREN_RR3_Field use
(Disabled => 0,
Enabled => 1);
-- Enable or disable RR[4] register.
type RREN_RR4_Field is
(-- RR[4] register is disabled.
Disabled,
-- RR[4] register is enabled.
Enabled)
with Size => 1;
for RREN_RR4_Field use
(Disabled => 0,
Enabled => 1);
-- Enable or disable RR[5] register.
type RREN_RR5_Field is
(-- RR[5] register is disabled.
Disabled,
-- RR[5] register is enabled.
Enabled)
with Size => 1;
for RREN_RR5_Field use
(Disabled => 0,
Enabled => 1);
-- Enable or disable RR[6] register.
type RREN_RR6_Field is
(-- RR[6] register is disabled.
Disabled,
-- RR[6] register is enabled.
Enabled)
with Size => 1;
for RREN_RR6_Field use
(Disabled => 0,
Enabled => 1);
-- Enable or disable RR[7] register.
type RREN_RR7_Field is
(-- RR[7] register is disabled.
Disabled,
-- RR[7] register is enabled.
Enabled)
with Size => 1;
for RREN_RR7_Field use
(Disabled => 0,
Enabled => 1);
-- Reload request enable.
type RREN_Register is record
-- Enable or disable RR[0] register.
RR0 : RREN_RR0_Field := NRF_SVD.WDT.Enabled;
-- Enable or disable RR[1] register.
RR1 : RREN_RR1_Field := NRF_SVD.WDT.Disabled;
-- Enable or disable RR[2] register.
RR2 : RREN_RR2_Field := NRF_SVD.WDT.Disabled;
-- Enable or disable RR[3] register.
RR3 : RREN_RR3_Field := NRF_SVD.WDT.Disabled;
-- Enable or disable RR[4] register.
RR4 : RREN_RR4_Field := NRF_SVD.WDT.Disabled;
-- Enable or disable RR[5] register.
RR5 : RREN_RR5_Field := NRF_SVD.WDT.Disabled;
-- Enable or disable RR[6] register.
RR6 : RREN_RR6_Field := NRF_SVD.WDT.Disabled;
-- Enable or disable RR[7] register.
RR7 : RREN_RR7_Field := NRF_SVD.WDT.Disabled;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RREN_Register use record
RR0 at 0 range 0 .. 0;
RR1 at 0 range 1 .. 1;
RR2 at 0 range 2 .. 2;
RR3 at 0 range 3 .. 3;
RR4 at 0 range 4 .. 4;
RR5 at 0 range 5 .. 5;
RR6 at 0 range 6 .. 6;
RR7 at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-- Configure the watchdog to pause or not while the CPU is sleeping.
type CONFIG_SLEEP_Field is
(-- Pause watchdog while the CPU is asleep.
Pause,
-- Do not pause watchdog while the CPU is asleep.
Run)
with Size => 1;
for CONFIG_SLEEP_Field use
(Pause => 0,
Run => 1);
-- Configure the watchdog to pause or not while the CPU is halted by the
-- debugger.
type CONFIG_HALT_Field is
(-- Pause watchdog while the CPU is halted by the debugger.
Pause,
-- Do not pause watchdog while the CPU is halted by the debugger.
Run)
with Size => 1;
for CONFIG_HALT_Field use
(Pause => 0,
Run => 1);
-- Configuration register.
type CONFIG_Register is record
-- Configure the watchdog to pause or not while the CPU is sleeping.
SLEEP : CONFIG_SLEEP_Field := NRF_SVD.WDT.Run;
-- unspecified
Reserved_1_2 : HAL.UInt2 := 16#0#;
-- Configure the watchdog to pause or not while the CPU is halted by the
-- debugger.
HALT : CONFIG_HALT_Field := NRF_SVD.WDT.Pause;
-- unspecified
Reserved_4_31 : HAL.UInt28 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CONFIG_Register use record
SLEEP at 0 range 0 .. 0;
Reserved_1_2 at 0 range 1 .. 2;
HALT at 0 range 3 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
-- Reload requests registers.
-- Reload requests registers.
type RR_Registers is array (0 .. 7) of HAL.UInt32;
-- Peripheral power control.
type POWER_POWER_Field is
(-- Module power disabled.
Disabled,
-- Module power enabled.
Enabled)
with Size => 1;
for POWER_POWER_Field use
(Disabled => 0,
Enabled => 1);
-- Peripheral power control.
type POWER_Register is record
-- Peripheral power control.
POWER : POWER_POWER_Field := NRF_SVD.WDT.Disabled;
-- unspecified
Reserved_1_31 : HAL.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for POWER_Register use record
POWER at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Watchdog Timer.
type WDT_Peripheral is record
-- Start the watchdog.
TASKS_START : aliased HAL.UInt32;
-- Watchdog timeout.
EVENTS_TIMEOUT : aliased HAL.UInt32;
-- Interrupt enable set register.
INTENSET : aliased INTENSET_Register;
-- Interrupt enable clear register.
INTENCLR : aliased INTENCLR_Register;
-- Watchdog running status.
RUNSTATUS : aliased RUNSTATUS_Register;
-- Request status.
REQSTATUS : aliased REQSTATUS_Register;
-- Counter reload value in number of 32kiHz clock cycles.
CRV : aliased HAL.UInt32;
-- Reload request enable.
RREN : aliased RREN_Register;
-- Configuration register.
CONFIG : aliased CONFIG_Register;
-- Reload requests registers.
RR : aliased RR_Registers;
-- Peripheral power control.
POWER : aliased POWER_Register;
end record
with Volatile;
for WDT_Peripheral use record
TASKS_START at 16#0# range 0 .. 31;
EVENTS_TIMEOUT at 16#100# range 0 .. 31;
INTENSET at 16#304# range 0 .. 31;
INTENCLR at 16#308# range 0 .. 31;
RUNSTATUS at 16#400# range 0 .. 31;
REQSTATUS at 16#404# range 0 .. 31;
CRV at 16#504# range 0 .. 31;
RREN at 16#508# range 0 .. 31;
CONFIG at 16#50C# range 0 .. 31;
RR at 16#600# range 0 .. 255;
POWER at 16#FFC# range 0 .. 31;
end record;
-- Watchdog Timer.
WDT_Periph : aliased WDT_Peripheral
with Import, Address => WDT_Base;
end NRF_SVD.WDT;
|
-- Standard Ada library specification
-- Copyright (c) 2003-2018 Maxim Reznik <reznikmm@gmail.com>
-- Copyright (c) 2004-2016 AXE Consultants
-- Copyright (c) 2004, 2005, 2006 Ada-Europe
-- Copyright (c) 2000 The MITRE Corporation, Inc.
-- Copyright (c) 1992, 1993, 1994, 1995 Intermetrics, Inc.
-- SPDX-License-Identifier: BSD-3-Clause and LicenseRef-AdaReferenceManual
---------------------------------------------------------------------------
package Ada.Task_Identification is
pragma Preelaborate(Task_Identification);
type Task_Id is private;
pragma Preelaborable_Initialization (Task_Id);
Null_Task_Id : constant Task_Id;
function "=" (Left, Right : Task_Id) return Boolean;
function Image (T : Task_Id) return String;
function Current_Task return Task_Id;
procedure Abort_Task (T : in out Task_Id);
function Is_Terminated (T : Task_Id) return Boolean;
function Is_Callable (T : Task_Id) return Boolean;
private
pragma Import (Ada, Task_Id);
pragma Import (Ada, Null_Task_Id);
end Ada.Task_Identification;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Identifiers;
with Program.Element_Visitors;
package Program.Nodes.Identifiers is
pragma Preelaborate;
type Identifier is
new Program.Nodes.Node and Program.Elements.Identifiers.Identifier
and Program.Elements.Identifiers.Identifier_Text
with private;
function Create
(Identifier_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Identifier;
type Implicit_Identifier is
new Program.Nodes.Node and Program.Elements.Identifiers.Identifier
with private;
function Create
(Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Identifier
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Identifier is
abstract new Program.Nodes.Node
and Program.Elements.Identifiers.Identifier
with null record;
procedure Initialize (Self : aliased in out Base_Identifier'Class);
overriding procedure Visit
(Self : not null access Base_Identifier;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Is_Identifier_Element
(Self : Base_Identifier)
return Boolean;
overriding function Is_Expression_Element
(Self : Base_Identifier)
return Boolean;
type Identifier is
new Base_Identifier and Program.Elements.Identifiers.Identifier_Text
with record
Identifier_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Identifier_Text
(Self : aliased in out Identifier)
return Program.Elements.Identifiers.Identifier_Text_Access;
overriding function Identifier_Token
(Self : Identifier)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Image (Self : Identifier) return Text;
type Implicit_Identifier is
new Base_Identifier
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Identifier_Text
(Self : aliased in out Implicit_Identifier)
return Program.Elements.Identifiers.Identifier_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Identifier)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Identifier)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Identifier)
return Boolean;
overriding function Image (Self : Implicit_Identifier) return Text;
end Program.Nodes.Identifiers;
|
with Ada.Text_IO;
-- with Mes_Tasches_P;
with Input_1;
-- procedure Client is
procedure Input is
begin
Ada.Text_IO.Put_Line ("Tasks won't stop, kill it with CTRL-C");
-- Mes_Tasches_P.Ma_Tasche.Accepter (Continuer => True);
Input_1.Ma_Tasche.Accepter (Continuer => True);
end Input;
-- end Client;
|
-- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces.C;
with Interfaces.C.Strings;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_extension_t is
-- Item
--
type Item is record
name : aliased Interfaces.C.Strings.chars_ptr;
global_id : aliased Interfaces.C.int;
end record;
-- Item_Array
--
type Item_Array is
array (Interfaces.C.size_t range <>) of aliased xcb.xcb_extension_t.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_extension_t.Item,
Element_Array => xcb.xcb_extension_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_extension_t.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_extension_t.Pointer,
Element_Array => xcb.xcb_extension_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_extension_t;
|
with Ada.Calendar;
with Ada.Directories;
with Ada.Text_IO.Text_Streams;
with Ada.Unchecked_Conversion;
with Interfaces.C.Pointers;
with SDL;
with SDL.Error;
with SDL.Events.Events;
with SDL.Events.Keyboards;
with SDL.Images.IO;
with SDL.Log;
-- with SDL.Video.Palettes;
with SDL.Video.Pixel_Formats;
-- with SDL.Video.Pixels;
with SDL.Video.Rectangles;
-- with SDL.Video.Renderers.Makers;
-- with SDL.Video.Textures.Makers;
with SDL.Video.Surfaces;
with SDL.Video.Windows.Makers;
with SDL.Versions;
with System;
with System.Address_To_Access_Conversions;
procedure Load_Surface is
use type Interfaces.C.int;
W : SDL.Video.Windows.Window;
Window_Size : constant SDL.Positive_Sizes := (Width => 800, Height => 640);
begin
SDL.Log.Set (Category => SDL.Log.Application, Priority => SDL.Log.Debug);
if SDL.Initialise (Flags => SDL.Enable_Screen) = True and SDL.Images.Initialise then
SDL.Video.Windows.Makers.Create (Win => W,
Title => "Surface (Esc to exit)",
Position => SDL.Natural_Coordinates'(X => 100, Y => 100),
Size => Window_Size,
Flags => SDL.Video.Windows.Resizable);
-- Main loop.
declare
Event : SDL.Events.Events.Events;
Window_Surface : SDL.Video.Surfaces.Surface;
Image_Surface : SDL.Video.Surfaces.Surface;
Image_Area : SDL.Video.Rectangles.Rectangle := (X => 0, Y => 0, Width => 400, Height => 300);
Image_Dest_Area : SDL.Video.Rectangles.Rectangle := (X => Window_Size.Width / 2 - Image_Area.Width / 2,
Y => Window_Size.Height / 2 - Image_Area.Height / 2,
Width => 400,
Height => 300);
Finished : Boolean := False;
use type SDL.Events.Event_Types;
use type SDL.Events.Keyboards.Key_Codes;
use type SDL.Events.Keyboards.Scan_Codes;
begin
Window_Surface := W.Get_Surface;
SDL.Images.IO.Create (Image_Surface, "../../test/assets/sdl_logo_400_300.png");
Window_Surface.Blit (Self_Area => Image_Dest_Area,
Source => Image_Surface,
Source_Area => Image_Area);
W.Update_Surface;
SDL.Images.IO.Write_PNG (Window_Surface, "load_surface.png");
loop
while SDL.Events.Events.Poll (Event) loop
case Event.Common.Event_Type is
when SDL.Events.Quit =>
Finished := True;
when SDL.Events.Keyboards.Key_Down =>
if Event.Keyboard.Key_Sym.Key_Code = SDL.Events.Keyboards.Code_Escape then
Finished := True;
end if;
when others =>
null;
end case;
end loop;
exit when Finished;
end loop;
end;
SDL.Log.Put_Debug ("");
W.Finalize;
SDL.Images.Finalise;
SDL.Finalise;
end if;
end Load_Surface;
|
-- Abstract :
--
-- Common utilities for Gen_Emacs_Wisi_*_Parse
--
-- Copyright (C) 2018 - 2019 Free Software Foundation, Inc.
--
-- This program 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 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
-- distributed with this program; see file COPYING. If not, write to
-- the Free Software Foundation, 51 Franklin Street, Suite 500, Boston,
-- MA 02110-1335, USA.
pragma License (GPL);
with Ada.Strings.Unbounded;
with System;
with Wisi;
with WisiToken.Parse.LR.Parser;
package Emacs_Wisi_Common_Parse is
Protocol_Version : constant String := "5";
-- Protocol_Version defines the data sent between elisp and the
-- background process, except for the language-specific parameters,
-- which are defined by the Language_Protocol_Version parameter to
-- Parse_Stream, below.
--
-- This value must match wisi-process-parse.el
-- wisi-process-parse-protocol-version.
--
-- See wisi-process-parse.el functions, and this package body, for
-- the implementation of the protocol.
--
-- Only changes once per wisi release. Increment as soon as required,
-- record new version in NEWS-wisi.text.
Prompt : constant String := ";;> ";
Protocol_Error : exception;
Finish : exception;
procedure Usage (Name : in String);
procedure Read_Input (A : System.Address; N : Integer);
function Get_Command_Length return Integer;
function Get_String
(Source : in String;
Last : in out Integer)
return String;
function Get_Integer
(Source : in String;
Last : in out Integer)
return Integer;
type Process_Start_Params is record
Recover_Log_File_Name : Ada.Strings.Unbounded.Unbounded_String;
-- log enabled if non-empty.
end record;
function Get_Process_Start_Params return Process_Start_Params;
-- Get from Ada.Command_Line. Handles --help by outputing help,
-- raising Finish.
procedure Process_Stream
(Name : in String;
Language_Protocol_Version : in String;
Partial_Parse_Active : in out Boolean;
Params : in Process_Start_Params;
Parser : in out WisiToken.Parse.LR.Parser.Parser;
Parse_Data : in out Wisi.Parse_Data_Type'Class;
Descriptor : in WisiToken.Descriptor);
----------
-- Parse command
type Parse_Params is record
Post_Parse_Action : Wisi.Post_Parse_Action_Type;
Source_File_Name : Ada.Strings.Unbounded.Unbounded_String;
Begin_Byte_Pos : Integer;
-- Source file byte position of first char sent; start parse here.
End_Byte_Pos : Integer;
-- Byte position of last char sent.
Goal_Byte_Pos : Integer;
-- Byte position of end of desired parse region; terminate parse at
-- or after here.
Begin_Char_Pos : WisiToken.Buffer_Pos;
-- Char position of first char sent.
Begin_Line : WisiToken.Line_Number_Type;
End_Line : WisiToken.Line_Number_Type;
-- Line number of line containing Begin_Byte_Pos, End_Byte_Pos
Begin_Indent : Integer;
-- Indentation of Line_Begin
Partial_Parse_Active : Boolean;
Debug_Mode : Boolean;
Parse_Verbosity : Integer;
McKenzie_Verbosity : Integer;
Action_Verbosity : Integer;
McKenzie_Disable : Integer;
Task_Count : Integer;
Check_Limit : Integer;
Enqueue_Limit : Integer;
Max_Parallel : Integer;
Byte_Count : Integer;
-- Count of bytes of source file sent.
end record;
function Get_Parse_Params (Command_Line : in String; Last : in out Integer) return Parse_Params;
----------
-- Refactor command
type Refactor_Params is record
Refactor_Action : Positive; -- Language-specific
Source_File_Name : Ada.Strings.Unbounded.Unbounded_String;
Parse_Region : WisiToken.Buffer_Region;
-- Source file byte region to parse.
Edit_Begin : WisiToken.Buffer_Pos;
-- Source file byte position at start of expression to refactor.
Parse_Begin_Char_Pos : WisiToken.Buffer_Pos;
-- Char position of first char sent.
Parse_Begin_Line : WisiToken.Line_Number_Type;
Parse_End_Line : WisiToken.Line_Number_Type;
-- Line numbers of lines containing Parse_Begin_Byte_Pos, Parse_End_Byte_Pos
Parse_Begin_Indent : Integer;
-- Indentation of Parse_Begin_Line
Debug_Mode : Boolean;
Parse_Verbosity : Integer;
Action_Verbosity : Integer;
Max_Parallel : Integer;
Byte_Count : Integer;
-- Count of bytes of source file sent.
end record;
function Get_Refactor_Params (Command_Line : in String; Last : in out Integer) return Refactor_Params;
end Emacs_Wisi_Common_Parse;
|
-- Copyright (c) 2016 onox <denkpadje@gmail.com>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Characters.Latin_1;
with Ada.IO_Exceptions;
with Ada.Strings.Bounded;
package body JSON.Tokenizers is
procedure Read_String
(Stream : in out Streams.Stream'Class;
Next_Token : out Token)
is
C : Character;
Index, Length : Streams.AS.Stream_Element_Offset := 0;
Escaped : Boolean := False;
use type Streams.AS.Stream_Element_Offset;
begin
loop
C := Stream.Read_Character (Index);
-- An unescaped '"' character denotes the end of the string
exit when not Escaped and C = '"';
Length := Length + 1;
if Escaped then
case C is
when '"' | '\' | '/' | 'b' | 'f' | 'n' | 'r' | 't' | 'u' =>
null;
when others =>
raise Tokenizer_Error with "Unexpected escaped character in string";
end case;
elsif C /= '\' then
-- Check C is not a control character
if Character'Pos (C) <= 31 then
raise Tokenizer_Error with "Unexpected control character in string";
end if;
end if;
Escaped := not Escaped and C = '\';
end loop;
Next_Token := Token'
(Kind => String_Token, String_Offset => Index - Length, String_Length => Length);
end Read_String;
procedure Test_Leading_Zeroes (First : Character; Value : String) is
Leading_Zero_Message : constant String := "Leading zeroes in number are not allowed";
Minus_Digit_Message : constant String := "Expected at least one digit after - sign";
begin
if First = '-' then
if Value'Length >= 3 and then Value (Value'First .. Value'First + 1) = "-0" then
raise Tokenizer_Error with Leading_Zero_Message;
elsif Value'Length = 1 then
raise Tokenizer_Error with Minus_Digit_Message;
end if;
elsif First = '0' and Value'Length >= 2 then
raise Tokenizer_Error with Leading_Zero_Message;
end if;
end Test_Leading_Zeroes;
procedure Read_Number
(Stream : in out Streams.Stream'Class;
First : Character;
Next_Token : out Token)
is
package SB is new Ada.Strings.Bounded.Generic_Bounded_Length
(Max => Types.Maximum_String_Length_Numbers);
Value : SB.Bounded_String;
C : Character;
Is_Float, Checked_Leading_Zeroes : Boolean := False;
Error_Dot_Message : constant String
:= "Number must contain at least one digit after decimal point";
Error_Exp_Message : constant String
:= "Expected optional +/- sign after e/E and then at least one digit";
Error_Plus_Message : constant String
:= "Prefixing number with '+' character is not allowed";
Error_One_Digit_Message : constant String
:= "Expected at least one digit after +/- sign in number";
Error_Length_Message : constant String
:= "Number is longer than" & Types.Maximum_String_Length_Numbers'Image & " characters";
procedure Create_Token_From_Number is
Number : constant String := SB.To_String (Value);
begin
if Is_Float then
Next_Token := Token'(Kind => Float_Token,
Float_Value => Types.Float_Type'Value (Number));
else
Next_Token := Token'(Kind => Integer_Token,
Integer_Value => Types.Integer_Type'Value (Number));
end if;
end Create_Token_From_Number;
begin
if First = '+' then
raise Tokenizer_Error with Error_Plus_Message;
end if;
SB.Append (Value, First);
-- Accept sequence of digits, including leading zeroes
loop
C := Stream.Read_Character;
exit when C not in '0' .. '9';
SB.Append (Value, C);
end loop;
-- Test whether value contains leading zeroes
Test_Leading_Zeroes (First, SB.To_String (Value));
Checked_Leading_Zeroes := True;
-- Tokenize fraction part
if C = '.' then
Is_Float := True;
-- Append the dot
SB.Append (Value, C);
-- Require at least one digit after decimal point
begin
C := Stream.Read_Character;
if C not in '0' .. '9' then
raise Tokenizer_Error with Error_Dot_Message;
end if;
SB.Append (Value, C);
exception
when Ada.IO_Exceptions.End_Error =>
raise Tokenizer_Error with Error_Dot_Message;
end;
-- Accept sequence of digits
loop
C := Stream.Read_Character;
exit when C not in '0' .. '9';
SB.Append (Value, C);
end loop;
end if;
-- Tokenize exponent part
if C in 'e' | 'E' then
-- Append the 'e' or 'E' character
SB.Append (Value, C);
begin
C := Stream.Read_Character;
-- Append optional '+' or '-' character
if C in '+' | '-' then
-- If exponent is negative, number will be a float
if C = '-' then
Is_Float := True;
end if;
SB.Append (Value, C);
-- Require at least one digit after +/- sign
C := Stream.Read_Character;
if C not in '0' .. '9' then
raise Tokenizer_Error with Error_One_Digit_Message;
end if;
SB.Append (Value, C);
elsif C in '0' .. '9' then
SB.Append (Value, C);
else
raise Tokenizer_Error with Error_Exp_Message;
end if;
exception
when Ada.IO_Exceptions.End_Error =>
raise Tokenizer_Error with Error_Exp_Message;
end;
-- Accept sequence of digits
loop
C := Stream.Read_Character;
exit when C not in '0' .. '9';
SB.Append (Value, C);
end loop;
end if;
Create_Token_From_Number;
Stream.Write_Character (C);
exception
-- End_Error is raised if the number if followed by an EOF
when Ada.IO_Exceptions.End_Error =>
-- Test whether value contains leading zeroes
if not Checked_Leading_Zeroes then
Test_Leading_Zeroes (First, SB.To_String (Value));
end if;
Create_Token_From_Number;
when Ada.Strings.Length_Error =>
raise Tokenizer_Error with Error_Length_Message;
end Read_Number;
procedure Read_Literal
(Stream : in out Streams.Stream'Class;
First : Character;
Next_Token : out Token)
is
package SB is new Ada.Strings.Bounded.Generic_Bounded_Length (Max => 5);
Value : SB.Bounded_String;
C : Character;
Unexpected_Literal_Message : constant String
:= "Expected literal 'true', 'false', or 'null'";
procedure Create_Token_From_Literal is
Literal : constant String := SB.To_String (Value);
begin
if Literal = "true" then
Next_Token := Token'(Kind => Boolean_Token, Boolean_Value => True);
elsif Literal = "false" then
Next_Token := Token'(Kind => Boolean_Token, Boolean_Value => False);
elsif Literal = "null" then
Next_Token := Token'(Kind => Null_Token);
else
raise Tokenizer_Error with Unexpected_Literal_Message;
end if;
end Create_Token_From_Literal;
begin
SB.Append (Value, First);
loop
C := Stream.Read_Character;
exit when C not in 'a' .. 'z';
SB.Append (Value, C);
end loop;
Create_Token_From_Literal;
Stream.Write_Character (C);
exception
-- End_Error is raised if the literal if followed by an EOF
when Ada.IO_Exceptions.End_Error =>
Create_Token_From_Literal;
when Ada.Strings.Length_Error =>
raise Tokenizer_Error with Unexpected_Literal_Message;
end Read_Literal;
procedure Read_Token
(Stream : in out Streams.Stream'Class;
Next_Token : out Token;
Expect_EOF : Boolean := False)
is
C : Character;
use Ada.Characters.Latin_1;
begin
loop
-- Read the first next character and decide which token it could be part of
C := Stream.Read_Character;
-- Skip whitespace
exit when C not in Space | HT | LF | CR;
end loop;
if Expect_EOF then
raise Tokenizer_Error with "Expected to read EOF";
end if;
case C is
when '[' =>
Next_Token := Token'(Kind => Begin_Array_Token);
when '{' =>
Next_Token := Token'(Kind => Begin_Object_Token);
when ']' =>
Next_Token := Token'(Kind => End_Array_Token);
when '}' =>
Next_Token := Token'(Kind => End_Object_Token);
when ':' =>
Next_Token := Token'(Kind => Name_Separator_Token);
when ',' =>
Next_Token := Token'(Kind => Value_Separator_Token);
when '"' =>
Read_String (Stream, Next_Token);
when '0' .. '9' | '+' | '-' =>
Read_Number (Stream, C, Next_Token);
when 'a' .. 'z' =>
Read_Literal (Stream, C, Next_Token);
when others =>
raise Tokenizer_Error with "Unexpected character";
end case;
exception
when Ada.IO_Exceptions.End_Error =>
if Expect_EOF then
Next_Token := Token'(Kind => EOF_Token);
else
raise Tokenizer_Error with "Unexpectedly read EOF";
end if;
end Read_Token;
end JSON.Tokenizers;
|
-----------------------------------------------------------------------
-- awa-tests-helpers - Helpers for AWA unit tests
-- Copyright (C) 2011, 2017 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with ASF.Responses.Mockup;
with Ada.Strings.Unbounded;
package AWA.Tests.Helpers is
-- Extract from the Location header the part that is after the given base string.
-- If the Location header does not start with the base string, returns the empty
-- string.
function Extract_Redirect (Reply : in ASF.Responses.Mockup.Response'Class;
Base : in String) return String;
function Extract_Redirect (Reply : in ASF.Responses.Mockup.Response'Class;
Base : in String) return Ada.Strings.Unbounded.Unbounded_String;
-- Extract from the response content a link with a given title.
function Extract_Link (Content : in String;
Title : in String) return String;
end AWA.Tests.Helpers;
|
with Ada.Strings.Fixed;
with Gtk.Main;
with Gtk.Handlers;
with Gtk.Button;
with Gtk.Window;
with Gtk.GEntry;
with Gtk.Editable;
with Gtk.Box;
with Gtk.Widget;
with Glib.Values;
procedure Disabling is
type My_Natural is range 0 .. 10;
The_Value : My_Natural := 0;
Main_Window : Gtk.Window.Gtk_Window;
Content : Gtk.Box.Gtk_Vbox;
Increment_Button : Gtk.Button.Gtk_Button;
Decrement_Button : Gtk.Button.Gtk_Button;
Entry_Field : Gtk.GEntry.Gtk_Entry;
package Entry_Callbacks is new Gtk.Handlers.Callback
(Gtk.GEntry.Gtk_Entry_Record);
package Button_Callbacks is new Gtk.Handlers.Callback
(Gtk.Button.Gtk_Button_Record);
package Window_Callbacks is new Gtk.Handlers.Return_Callback
(Gtk.Window.Gtk_Window_Record, Boolean);
-- update displayed text
procedure Update_Entry is
begin
Gtk.GEntry.Set_Text
(The_Entry => Entry_Field,
Text =>
Ada.Strings.Fixed.Trim
(Source => My_Natural'Image (The_Value),
Side => Ada.Strings.Both));
end Update_Entry;
procedure Check_Value is
begin
Gtk.Widget.Set_Sensitive
(Gtk.Widget.Gtk_Widget (Decrement_Button),
The_Value > 0);
Gtk.Widget.Set_Sensitive
(Gtk.Widget.Gtk_Widget (Increment_Button),
The_Value < 10);
Gtk.Widget.Set_Sensitive
(Gtk.Widget.Gtk_Widget (Entry_Field),
The_Value = 0);
end Check_Value;
procedure On_Changed_Text
(Object : access Gtk.GEntry.Gtk_Entry_Record'Class;
Params : Glib.Values.GValues)
is
pragma Unreferenced (Params, Object);
begin
The_Value := My_Natural'Value (Gtk.GEntry.Get_Text (Entry_Field));
Check_Value;
Update_Entry;
exception
when Constraint_Error =>
The_Value := 0;
end On_Changed_Text;
-- make sure that only numbers are entered
procedure On_Insert_Text
(Object : access Gtk.GEntry.Gtk_Entry_Record'Class;
Params : Glib.Values.GValues)
is
Length : constant Glib.Gint :=
Glib.Values.Get_Int (Glib.Values.Nth (Params, 2));
Text : constant String :=
Glib.Values.Get_String (Glib.Values.Nth (Params, 1), Length);
begin
declare
Number : My_Natural;
pragma Unreferenced (Number);
begin
Number := My_Natural'Value (Text);
exception
when Constraint_Error =>
-- refuse values that are not parsable
Gtk.Handlers.Emit_Stop_By_Name
(Object => Object,
Name => Gtk.Editable.Signal_Insert_Text);
end;
end On_Insert_Text;
-- Callback for click event
procedure On_Increment_Click
(Object : access Gtk.Button.Gtk_Button_Record'Class)
is
pragma Unreferenced (Object);
begin
The_Value := The_Value + 1;
Check_Value;
Update_Entry;
end On_Increment_Click;
-- Callback for click event
procedure On_Decrement_Click
(Object : access Gtk.Button.Gtk_Button_Record'Class)
is
pragma Unreferenced (Object);
begin
The_Value := The_Value - 1;
Check_Value;
Update_Entry;
end On_Decrement_Click;
-- Callback for delete event
function On_Main_Window_Delete
(Object : access Gtk.Window.Gtk_Window_Record'Class)
return Boolean
is
pragma Unreferenced (Object);
begin
Gtk.Main.Main_Quit;
return True;
end On_Main_Window_Delete;
begin
Gtk.Main.Init;
Gtk.GEntry.Gtk_New (Widget => Entry_Field);
Entry_Callbacks.Connect
(Widget => Entry_Field,
Name => Gtk.Editable.Signal_Insert_Text,
Cb => On_Insert_Text'Access);
Entry_Callbacks.Connect
(Widget => Entry_Field,
Name => Gtk.Editable.Signal_Changed,
Cb => On_Changed_Text'Access);
Gtk.Button.Gtk_New (Button => Increment_Button, Label => "Increment");
Gtk.Button.Gtk_New (Button => Decrement_Button, Label => "Decrement");
Button_Callbacks.Connect
(Widget => Increment_Button,
Name => Gtk.Button.Signal_Clicked,
Marsh => Button_Callbacks.To_Marshaller (On_Increment_Click'Access));
Button_Callbacks.Connect
(Widget => Decrement_Button,
Name => Gtk.Button.Signal_Clicked,
Marsh => Button_Callbacks.To_Marshaller (On_Decrement_Click'Access));
Gtk.Box.Gtk_New_Vbox (Box => Content);
Gtk.Box.Add (Container => Content, Widget => Entry_Field);
Gtk.Box.Add (Container => Content, Widget => Increment_Button);
Gtk.Box.Add (Container => Content, Widget => Decrement_Button);
Gtk.Window.Gtk_New (Window => Main_Window);
Gtk.Window.Add (Container => Main_Window, Widget => Content);
Window_Callbacks.Connect
(Widget => Main_Window,
Name => Gtk.Widget.Signal_Delete_Event,
Cb => On_Main_Window_Delete'Access);
Gtk.Window.Show_All (Widget => Main_Window);
Update_Entry;
Gtk.Main.Main;
end Disabling;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Internals.UML_Multiplicity_Elements;
with AMF.Internals.UML_Named_Elements;
with AMF.UML.Connectable_Element_Template_Parameters;
with AMF.UML.Connector_Ends.Collections;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Multiplicity_Elements;
with AMF.UML.Named_Elements;
with AMF.UML.Namespaces;
with AMF.UML.Operations;
with AMF.UML.Packages.Collections;
with AMF.UML.Parameter_Sets.Collections;
with AMF.UML.Parameterable_Elements;
with AMF.UML.Parameters;
with AMF.UML.String_Expressions;
with AMF.UML.Template_Parameters;
with AMF.UML.Types;
with AMF.UML.Value_Specifications;
with AMF.Visitors;
package AMF.Internals.UML_Parameters is
package UML_Multiplicity_Elements is
new AMF.Internals.UML_Multiplicity_Elements
(AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy);
type UML_Parameter_Proxy is
limited new UML_Multiplicity_Elements.UML_Multiplicity_Element_Proxy
and AMF.UML.Parameters.UML_Parameter with null record;
overriding function Get_Default
(Self : not null access constant UML_Parameter_Proxy)
return AMF.Optional_String;
-- Getter of Parameter::default.
--
-- Specifies a String that represents a value to be used when no argument
-- is supplied for the Parameter.
overriding procedure Set_Default
(Self : not null access UML_Parameter_Proxy;
To : AMF.Optional_String);
-- Setter of Parameter::default.
--
-- Specifies a String that represents a value to be used when no argument
-- is supplied for the Parameter.
overriding function Get_Default_Value
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Value_Specifications.UML_Value_Specification_Access;
-- Getter of Parameter::defaultValue.
--
-- Specifies a ValueSpecification that represents a value to be used when
-- no argument is supplied for the Parameter.
overriding procedure Set_Default_Value
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Value_Specifications.UML_Value_Specification_Access);
-- Setter of Parameter::defaultValue.
--
-- Specifies a ValueSpecification that represents a value to be used when
-- no argument is supplied for the Parameter.
overriding function Get_Direction
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.UML_Parameter_Direction_Kind;
-- Getter of Parameter::direction.
--
-- Indicates whether a parameter is being sent into or out of a behavioral
-- element.
overriding procedure Set_Direction
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.UML_Parameter_Direction_Kind);
-- Setter of Parameter::direction.
--
-- Indicates whether a parameter is being sent into or out of a behavioral
-- element.
overriding function Get_Effect
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Optional_UML_Parameter_Effect_Kind;
-- Getter of Parameter::effect.
--
-- Specifies the effect that the owner of the parameter has on values
-- passed in or out of the parameter.
overriding procedure Set_Effect
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Optional_UML_Parameter_Effect_Kind);
-- Setter of Parameter::effect.
--
-- Specifies the effect that the owner of the parameter has on values
-- passed in or out of the parameter.
overriding function Get_Is_Exception
(Self : not null access constant UML_Parameter_Proxy)
return Boolean;
-- Getter of Parameter::isException.
--
-- Tells whether an output parameter may emit a value to the exclusion of
-- the other outputs.
overriding procedure Set_Is_Exception
(Self : not null access UML_Parameter_Proxy;
To : Boolean);
-- Setter of Parameter::isException.
--
-- Tells whether an output parameter may emit a value to the exclusion of
-- the other outputs.
overriding function Get_Is_Stream
(Self : not null access constant UML_Parameter_Proxy)
return Boolean;
-- Getter of Parameter::isStream.
--
-- Tells whether an input parameter may accept values while its behavior
-- is executing, or whether an output parameter post values while the
-- behavior is executing.
overriding procedure Set_Is_Stream
(Self : not null access UML_Parameter_Proxy;
To : Boolean);
-- Setter of Parameter::isStream.
--
-- Tells whether an input parameter may accept values while its behavior
-- is executing, or whether an output parameter post values while the
-- behavior is executing.
overriding function Get_Operation
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Operations.UML_Operation_Access;
-- Getter of Parameter::operation.
--
-- References the Operation owning this parameter.
overriding procedure Set_Operation
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Operations.UML_Operation_Access);
-- Setter of Parameter::operation.
--
-- References the Operation owning this parameter.
overriding function Get_Parameter_Set
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Parameter_Sets.Collections.Set_Of_UML_Parameter_Set;
-- Getter of Parameter::parameterSet.
--
-- The parameter sets containing the parameter. See ParameterSet.
overriding function Get_End
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Connector_Ends.Collections.Ordered_Set_Of_UML_Connector_End;
-- Getter of ConnectableElement::end.
--
-- Denotes a set of connector ends that attaches to this connectable
-- element.
overriding function Get_Template_Parameter
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Connectable_Element_Template_Parameters.UML_Connectable_Element_Template_Parameter_Access;
-- Getter of ConnectableElement::templateParameter.
--
-- The ConnectableElementTemplateParameter for this ConnectableElement
-- parameter.
overriding procedure Set_Template_Parameter
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Connectable_Element_Template_Parameters.UML_Connectable_Element_Template_Parameter_Access);
-- Setter of ConnectableElement::templateParameter.
--
-- The ConnectableElementTemplateParameter for this ConnectableElement
-- parameter.
overriding function Get_Type
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Types.UML_Type_Access;
-- Getter of TypedElement::type.
--
-- The type of the TypedElement.
-- This information is derived from the return result for this Operation.
overriding procedure Set_Type
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Types.UML_Type_Access);
-- Setter of TypedElement::type.
--
-- The type of the TypedElement.
-- This information is derived from the return result for this Operation.
overriding function Get_Client_Dependency
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
overriding function Get_Name_Expression
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding procedure Set_Name_Expression
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access);
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding function Get_Namespace
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
overriding function Get_Qualified_Name
(Self : not null access constant UML_Parameter_Proxy)
return AMF.Optional_String;
-- Getter of NamedElement::qualifiedName.
--
-- A name which allows the NamedElement to be identified within a
-- hierarchy of nested Namespaces. It is constructed from the names of the
-- containing namespaces starting at the root of the hierarchy and ending
-- with the name of the NamedElement itself.
overriding function Get_Owning_Template_Parameter
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
-- Getter of ParameterableElement::owningTemplateParameter.
--
-- The formal template parameter that owns this element.
overriding procedure Set_Owning_Template_Parameter
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
-- Setter of ParameterableElement::owningTemplateParameter.
--
-- The formal template parameter that owns this element.
overriding function Get_Template_Parameter
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Template_Parameters.UML_Template_Parameter_Access;
-- Getter of ParameterableElement::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding procedure Set_Template_Parameter
(Self : not null access UML_Parameter_Proxy;
To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access);
-- Setter of ParameterableElement::templateParameter.
--
-- The template parameter that exposes this element as a formal parameter.
overriding function Default
(Self : not null access constant UML_Parameter_Proxy)
return AMF.Optional_String;
-- Operation Parameter::default.
--
-- Missing derivation for Parameter::/default : String
overriding function Compatible_With
(Self : not null access constant UML_Parameter_Proxy;
Other : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access)
return Boolean;
-- Operation MultiplicityElement::compatibleWith.
--
-- The operation compatibleWith takes another multiplicity as input. It
-- checks if one multiplicity is compatible with another.
overriding function Includes_Cardinality
(Self : not null access constant UML_Parameter_Proxy;
C : Integer)
return Boolean;
-- Operation MultiplicityElement::includesCardinality.
--
-- The query includesCardinality() checks whether the specified
-- cardinality is valid for this multiplicity.
overriding function Includes_Multiplicity
(Self : not null access constant UML_Parameter_Proxy;
M : AMF.UML.Multiplicity_Elements.UML_Multiplicity_Element_Access)
return Boolean;
-- Operation MultiplicityElement::includesMultiplicity.
--
-- The query includesMultiplicity() checks whether this multiplicity
-- includes all the cardinalities allowed by the specified multiplicity.
overriding function Iss
(Self : not null access constant UML_Parameter_Proxy;
Lowerbound : Integer;
Upperbound : Integer)
return Boolean;
-- Operation MultiplicityElement::is.
--
-- The operation is determines if the upper and lower bound of the ranges
-- are the ones given.
overriding function Ends
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Connector_Ends.Collections.Set_Of_UML_Connector_End;
-- Operation ConnectableElement::end.
--
-- Missing derivation for ConnectableElement::/end : ConnectorEnd
overriding function All_Owning_Packages
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Parameter_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
overriding function Namespace
(Self : not null access constant UML_Parameter_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding function Is_Compatible_With
(Self : not null access constant UML_Parameter_Proxy;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean;
-- Operation ParameterableElement::isCompatibleWith.
--
-- The query isCompatibleWith() determines if this parameterable element
-- is compatible with the specified parameterable element. By default
-- parameterable element P is compatible with parameterable element Q if
-- the kind of P is the same or a subtype as the kind of Q. Subclasses
-- should override this operation to specify different compatibility
-- constraints.
overriding function Is_Template_Parameter
(Self : not null access constant UML_Parameter_Proxy)
return Boolean;
-- Operation ParameterableElement::isTemplateParameter.
--
-- The query isTemplateParameter() determines if this parameterable
-- element is exposed as a formal template parameter.
overriding procedure Enter_Element
(Self : not null access constant UML_Parameter_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Leave_Element
(Self : not null access constant UML_Parameter_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Visit_Element
(Self : not null access constant UML_Parameter_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of iterator interface.
end AMF.Internals.UML_Parameters;
|
with System;
package Unc_Memops is
pragma Elaborate_Body;
type size_t is mod 2 ** Standard'Address_Size;
subtype addr_t is System.Address;
function Alloc (Size : size_t) return addr_t;
procedure Free (Ptr : addr_t);
function Realloc (Ptr : addr_t; Size : size_t) return addr_t;
procedure Expect_Symetry (Status : Boolean);
-- Whether we expect "free"s to match "alloc" return values in
-- reverse order, like alloc->X, alloc->Y should be followed by
-- free Y, free X.
private
-- Uncomment the exports below to really exercise the alternate versions.
-- This only works when using an installed version of the tools which
-- grabs the runtime library objects from an archive, hence doesn't force
-- the inclusion of s-memory.o.
-- pragma Export (C, Alloc, "__gnat_malloc");
-- pragma Export (C, Free, "__gnat_free");
-- pragma Export (C, Realloc, "__gnat_realloc");
end;
|
-- This spec has been automatically generated from STM32WL5x_CM0P.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.GPIO is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- MODER array element
subtype MODER_Element is HAL.UInt2;
-- MODER array
type MODER_Field_Array is array (0 .. 15) of MODER_Element
with Component_Size => 2, Size => 32;
-- GPIO port mode register
type MODER_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MODER as a value
Val : HAL.UInt32;
when True =>
-- MODER as an array
Arr : MODER_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MODER_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- OTYPER_OT array
type OTYPER_OT_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for OTYPER_OT
type OTYPER_OT_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- OT as a value
Val : HAL.UInt16;
when True =>
-- OT as an array
Arr : OTYPER_OT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for OTYPER_OT_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port output type register
type OTYPER_Register is record
-- Port x configuration bits (y = 0..15)
OT : OTYPER_OT_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OTYPER_Register use record
OT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- OSPEEDR array element
subtype OSPEEDR_Element is HAL.UInt2;
-- OSPEEDR array
type OSPEEDR_Field_Array is array (0 .. 15) of OSPEEDR_Element
with Component_Size => 2, Size => 32;
-- GPIO port output speed register
type OSPEEDR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- OSPEEDR as a value
Val : HAL.UInt32;
when True =>
-- OSPEEDR as an array
Arr : OSPEEDR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OSPEEDR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- PUPDR array element
subtype PUPDR_Element is HAL.UInt2;
-- PUPDR array
type PUPDR_Field_Array is array (0 .. 15) of PUPDR_Element
with Component_Size => 2, Size => 32;
-- GPIO port pull-up/pull-down register
type PUPDR_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PUPDR as a value
Val : HAL.UInt32;
when True =>
-- PUPDR as an array
Arr : PUPDR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PUPDR_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- IDR array
type IDR_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for IDR
type IDR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- IDR as a value
Val : HAL.UInt16;
when True =>
-- IDR as an array
Arr : IDR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for IDR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port input data register
type IDR_Register is record
-- Read-only. Port input data (y = 0..15)
IDR : IDR_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IDR_Register use record
IDR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- ODR array
type ODR_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for ODR
type ODR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- ODR as a value
Val : HAL.UInt16;
when True =>
-- ODR as an array
Arr : ODR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for ODR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port output data register
type ODR_Register is record
-- Port output data (y = 0..15)
ODR : ODR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ODR_Register use record
ODR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- BSRR_BS array
type BSRR_BS_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for BSRR_BS
type BSRR_BS_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BS as a value
Val : HAL.UInt16;
when True =>
-- BS as an array
Arr : BSRR_BS_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for BSRR_BS_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- BSRR_BR array
type BSRR_BR_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for BSRR_BR
type BSRR_BR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BR as a value
Val : HAL.UInt16;
when True =>
-- BR as an array
Arr : BSRR_BR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for BSRR_BR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port bit set/reset register
type BSRR_Register is record
-- Write-only. Port x set bit y (y= 0..15)
BS : BSRR_BS_Field := (As_Array => False, Val => 16#0#);
-- Write-only. Port x set bit y (y= 0..15)
BR : BSRR_BR_Field := (As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BSRR_Register use record
BS at 0 range 0 .. 15;
BR at 0 range 16 .. 31;
end record;
-- LCKR_LCK array
type LCKR_LCK_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for LCKR_LCK
type LCKR_LCK_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- LCK as a value
Val : HAL.UInt16;
when True =>
-- LCK as an array
Arr : LCKR_LCK_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for LCKR_LCK_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port configuration lock register
type LCKR_Register is record
-- Port x lock bit y (y= 0..15)
LCK : LCKR_LCK_Field := (As_Array => False, Val => 16#0#);
-- Port x lock bit y (y= 0..15)
LCKK : Boolean := False;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for LCKR_Register use record
LCK at 0 range 0 .. 15;
LCKK at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-- AFRL array element
subtype AFRL_Element is HAL.UInt4;
-- AFRL array
type AFRL_Field_Array is array (0 .. 7) of AFRL_Element
with Component_Size => 4, Size => 32;
-- GPIO alternate function low register
type AFRL_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AFRL as a value
Val : HAL.UInt32;
when True =>
-- AFRL as an array
Arr : AFRL_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for AFRL_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- AFRH array element
subtype AFRH_Element is HAL.UInt4;
-- AFRH array
type AFRH_Field_Array is array (8 .. 15) of AFRH_Element
with Component_Size => 4, Size => 32;
-- GPIO alternate function high register
type AFRH_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- AFRH as a value
Val : HAL.UInt32;
when True =>
-- AFRH as an array
Arr : AFRH_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for AFRH_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
-- BRR_BR array
type BRR_BR_Field_Array is array (0 .. 15) of Boolean
with Component_Size => 1, Size => 16;
-- Type definition for BRR_BR
type BRR_BR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BR as a value
Val : HAL.UInt16;
when True =>
-- BR as an array
Arr : BRR_BR_Field_Array;
end case;
end record
with Unchecked_Union, Size => 16;
for BRR_BR_Field use record
Val at 0 range 0 .. 15;
Arr at 0 range 0 .. 15;
end record;
-- GPIO port bit reset register
type BRR_Register is record
-- Port Reset bit
BR : BRR_BR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BRR_Register use record
BR at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- MODER array
type MODER_Field_Array_1 is array (0 .. 6) of MODER_Element
with Component_Size => 2, Size => 14;
-- Type definition for MODER
type MODER_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MODER as a value
Val : HAL.UInt14;
when True =>
-- MODER as an array
Arr : MODER_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 14;
for MODER_Field use record
Val at 0 range 0 .. 13;
Arr at 0 range 0 .. 13;
end record;
-- MODER array
type MODER_Field_Array_2 is array (13 .. 15) of MODER_Element
with Component_Size => 2, Size => 6;
-- Type definition for MODER
type MODER_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- MODER as a value
Val : HAL.UInt6;
when True =>
-- MODER as an array
Arr : MODER_Field_Array_2;
end case;
end record
with Unchecked_Union, Size => 6;
for MODER_Field_1 use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- GPIO port mode register
type MODER_Register_1 is record
-- Port x configuration bits (y = 0..15)
MODER : MODER_Field := (As_Array => False, Val => 16#3#);
-- unspecified
Reserved_14_25 : HAL.UInt12 := 16#0#;
-- Port x configuration bits (y = 0..15)
MODER_1 : MODER_Field_1 := (As_Array => False, Val => 16#3#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MODER_Register_1 use record
MODER at 0 range 0 .. 13;
Reserved_14_25 at 0 range 14 .. 25;
MODER_1 at 0 range 26 .. 31;
end record;
-- OTYPER_OT array
type OTYPER_OT_Field_Array_1 is array (0 .. 6) of Boolean
with Component_Size => 1, Size => 7;
-- Type definition for OTYPER_OT
type OTYPER_OT_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- OT as a value
Val : HAL.UInt7;
when True =>
-- OT as an array
Arr : OTYPER_OT_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 7;
for OTYPER_OT_Field_1 use record
Val at 0 range 0 .. 6;
Arr at 0 range 0 .. 6;
end record;
-- OTYPER_OT array
type OTYPER_OT_Field_Array_2 is array (13 .. 15) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for OTYPER_OT
type OTYPER_OT_Field_2
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- OT as a value
Val : HAL.UInt3;
when True =>
-- OT as an array
Arr : OTYPER_OT_Field_Array_2;
end case;
end record
with Unchecked_Union, Size => 3;
for OTYPER_OT_Field_2 use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- GPIO port output type register
type OTYPER_Register_1 is record
-- Port x configuration bits (y = 0..15)
OT : OTYPER_OT_Field_1 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_7_12 : HAL.UInt6 := 16#0#;
-- Port x configuration bits (y = 0..15)
OT_1 : OTYPER_OT_Field_2 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OTYPER_Register_1 use record
OT at 0 range 0 .. 6;
Reserved_7_12 at 0 range 7 .. 12;
OT_1 at 0 range 13 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- OSPEEDR array
type OSPEEDR_Field_Array_1 is array (0 .. 6) of OSPEEDR_Element
with Component_Size => 2, Size => 14;
-- Type definition for OSPEEDR
type OSPEEDR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- OSPEEDR as a value
Val : HAL.UInt14;
when True =>
-- OSPEEDR as an array
Arr : OSPEEDR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 14;
for OSPEEDR_Field use record
Val at 0 range 0 .. 13;
Arr at 0 range 0 .. 13;
end record;
-- OSPEEDR array
type OSPEEDR_Field_Array_2 is array (13 .. 15) of OSPEEDR_Element
with Component_Size => 2, Size => 6;
-- Type definition for OSPEEDR
type OSPEEDR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- OSPEEDR as a value
Val : HAL.UInt6;
when True =>
-- OSPEEDR as an array
Arr : OSPEEDR_Field_Array_2;
end case;
end record
with Unchecked_Union, Size => 6;
for OSPEEDR_Field_1 use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- GPIO port output speed register
type OSPEEDR_Register_1 is record
-- Port x configuration bits (y = 0..15)
OSPEEDR : OSPEEDR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_14_25 : HAL.UInt12 := 16#0#;
-- Port x configuration bits (y = 0..15)
OSPEEDR_1 : OSPEEDR_Field_1 := (As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OSPEEDR_Register_1 use record
OSPEEDR at 0 range 0 .. 13;
Reserved_14_25 at 0 range 14 .. 25;
OSPEEDR_1 at 0 range 26 .. 31;
end record;
-- PUPDR array
type PUPDR_Field_Array_1 is array (0 .. 6) of PUPDR_Element
with Component_Size => 2, Size => 14;
-- Type definition for PUPDR
type PUPDR_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PUPDR as a value
Val : HAL.UInt14;
when True =>
-- PUPDR as an array
Arr : PUPDR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 14;
for PUPDR_Field use record
Val at 0 range 0 .. 13;
Arr at 0 range 0 .. 13;
end record;
-- PUPDR array
type PUPDR_Field_Array_2 is array (13 .. 15) of PUPDR_Element
with Component_Size => 2, Size => 6;
-- Type definition for PUPDR
type PUPDR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- PUPDR as a value
Val : HAL.UInt6;
when True =>
-- PUPDR as an array
Arr : PUPDR_Field_Array_2;
end case;
end record
with Unchecked_Union, Size => 6;
for PUPDR_Field_1 use record
Val at 0 range 0 .. 5;
Arr at 0 range 0 .. 5;
end record;
-- GPIO port pull-up/pull-down register
type PUPDR_Register_1 is record
-- Port x configuration bits (y = 0..15)
PUPDR : PUPDR_Field := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_14_25 : HAL.UInt12 := 16#0#;
-- Port x configuration bits (y = 0..15)
PUPDR_1 : PUPDR_Field_1 := (As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PUPDR_Register_1 use record
PUPDR at 0 range 0 .. 13;
Reserved_14_25 at 0 range 14 .. 25;
PUPDR_1 at 0 range 26 .. 31;
end record;
-- IDR array
type IDR_Field_Array_1 is array (0 .. 6) of Boolean
with Component_Size => 1, Size => 7;
-- Type definition for IDR
type IDR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- IDR as a value
Val : HAL.UInt7;
when True =>
-- IDR as an array
Arr : IDR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 7;
for IDR_Field_1 use record
Val at 0 range 0 .. 6;
Arr at 0 range 0 .. 6;
end record;
-- IDR array
type IDR_Field_Array_2 is array (13 .. 15) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for IDR
type IDR_Field_2
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- IDR as a value
Val : HAL.UInt3;
when True =>
-- IDR as an array
Arr : IDR_Field_Array_2;
end case;
end record
with Unchecked_Union, Size => 3;
for IDR_Field_2 use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- GPIO port input data register
type IDR_Register_1 is record
-- Read-only. Port input data (y = 0..15)
IDR : IDR_Field_1;
-- unspecified
Reserved_7_12 : HAL.UInt6;
-- Read-only. Port input data (y = 0..15)
IDR_1 : IDR_Field_2;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IDR_Register_1 use record
IDR at 0 range 0 .. 6;
Reserved_7_12 at 0 range 7 .. 12;
IDR_1 at 0 range 13 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- ODR array
type ODR_Field_Array_1 is array (0 .. 6) of Boolean
with Component_Size => 1, Size => 7;
-- Type definition for ODR
type ODR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- ODR as a value
Val : HAL.UInt7;
when True =>
-- ODR as an array
Arr : ODR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 7;
for ODR_Field_1 use record
Val at 0 range 0 .. 6;
Arr at 0 range 0 .. 6;
end record;
-- ODR array
type ODR_Field_Array_2 is array (13 .. 15) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for ODR
type ODR_Field_2
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- ODR as a value
Val : HAL.UInt3;
when True =>
-- ODR as an array
Arr : ODR_Field_Array_2;
end case;
end record
with Unchecked_Union, Size => 3;
for ODR_Field_2 use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- GPIO port output data register
type ODR_Register_1 is record
-- Port output data (y = 0..15)
ODR : ODR_Field_1 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_7_12 : HAL.UInt6 := 16#0#;
-- Port output data (y = 0..15)
ODR_1 : ODR_Field_2 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ODR_Register_1 use record
ODR at 0 range 0 .. 6;
Reserved_7_12 at 0 range 7 .. 12;
ODR_1 at 0 range 13 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- BSRR_BS array
type BSRR_BS_Field_Array_1 is array (0 .. 6) of Boolean
with Component_Size => 1, Size => 7;
-- Type definition for BSRR_BS
type BSRR_BS_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BS as a value
Val : HAL.UInt7;
when True =>
-- BS as an array
Arr : BSRR_BS_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 7;
for BSRR_BS_Field_1 use record
Val at 0 range 0 .. 6;
Arr at 0 range 0 .. 6;
end record;
-- BSRR_BS array
type BSRR_BS_Field_Array_2 is array (13 .. 15) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for BSRR_BS
type BSRR_BS_Field_2
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BS as a value
Val : HAL.UInt3;
when True =>
-- BS as an array
Arr : BSRR_BS_Field_Array_2;
end case;
end record
with Unchecked_Union, Size => 3;
for BSRR_BS_Field_2 use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- BSRR_BR array
type BSRR_BR_Field_Array_1 is array (0 .. 6) of Boolean
with Component_Size => 1, Size => 7;
-- Type definition for BSRR_BR
type BSRR_BR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BR as a value
Val : HAL.UInt7;
when True =>
-- BR as an array
Arr : BSRR_BR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 7;
for BSRR_BR_Field_1 use record
Val at 0 range 0 .. 6;
Arr at 0 range 0 .. 6;
end record;
-- BSRR_BR array
type BSRR_BR_Field_Array_2 is array (13 .. 15) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for BSRR_BR
type BSRR_BR_Field_2
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BR as a value
Val : HAL.UInt3;
when True =>
-- BR as an array
Arr : BSRR_BR_Field_Array_2;
end case;
end record
with Unchecked_Union, Size => 3;
for BSRR_BR_Field_2 use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- GPIO port bit set/reset register
type BSRR_Register_1 is record
-- Write-only. Port x set bit y (y= 0..15)
BS : BSRR_BS_Field_1 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_7_12 : HAL.UInt6 := 16#0#;
-- Write-only. Port x set bit y (y= 0..15)
BS_1 : BSRR_BS_Field_2 := (As_Array => False, Val => 16#0#);
-- Write-only. Port x set bit y (y= 0..15)
BR : BSRR_BR_Field_1 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_23_28 : HAL.UInt6 := 16#0#;
-- Write-only. Port x reset bit y (y = 0..15)
BR_1 : BSRR_BR_Field_2 := (As_Array => False, Val => 16#0#);
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BSRR_Register_1 use record
BS at 0 range 0 .. 6;
Reserved_7_12 at 0 range 7 .. 12;
BS_1 at 0 range 13 .. 15;
BR at 0 range 16 .. 22;
Reserved_23_28 at 0 range 23 .. 28;
BR_1 at 0 range 29 .. 31;
end record;
-- LCKR_LCK array
type LCKR_LCK_Field_Array_1 is array (0 .. 6) of Boolean
with Component_Size => 1, Size => 7;
-- Type definition for LCKR_LCK
type LCKR_LCK_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- LCK as a value
Val : HAL.UInt7;
when True =>
-- LCK as an array
Arr : LCKR_LCK_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 7;
for LCKR_LCK_Field_1 use record
Val at 0 range 0 .. 6;
Arr at 0 range 0 .. 6;
end record;
-- LCKR_LCK array
type LCKR_LCK_Field_Array_2 is array (13 .. 15) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for LCKR_LCK
type LCKR_LCK_Field_2
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- LCK as a value
Val : HAL.UInt3;
when True =>
-- LCK as an array
Arr : LCKR_LCK_Field_Array_2;
end case;
end record
with Unchecked_Union, Size => 3;
for LCKR_LCK_Field_2 use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- GPIO port configuration lock register
type LCKR_Register_1 is record
-- Port x lock bit y (y= 0..15)
LCK : LCKR_LCK_Field_1 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_7_12 : HAL.UInt6 := 16#0#;
-- Port x lock bit y (y= 0..15)
LCK_1 : LCKR_LCK_Field_2 := (As_Array => False, Val => 16#0#);
-- Port x lock bit y (y= 0..15)
LCKK : Boolean := False;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for LCKR_Register_1 use record
LCK at 0 range 0 .. 6;
Reserved_7_12 at 0 range 7 .. 12;
LCK_1 at 0 range 13 .. 15;
LCKK at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-- BRR_BR array
type BRR_BR_Field_Array_1 is array (0 .. 6) of Boolean
with Component_Size => 1, Size => 7;
-- Type definition for BRR_BR
type BRR_BR_Field_1
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BR as a value
Val : HAL.UInt7;
when True =>
-- BR as an array
Arr : BRR_BR_Field_Array_1;
end case;
end record
with Unchecked_Union, Size => 7;
for BRR_BR_Field_1 use record
Val at 0 range 0 .. 6;
Arr at 0 range 0 .. 6;
end record;
-- BRR_BR array
type BRR_BR_Field_Array_2 is array (13 .. 15) of Boolean
with Component_Size => 1, Size => 3;
-- Type definition for BRR_BR
type BRR_BR_Field_2
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- BR as a value
Val : HAL.UInt3;
when True =>
-- BR as an array
Arr : BRR_BR_Field_Array_2;
end case;
end record
with Unchecked_Union, Size => 3;
for BRR_BR_Field_2 use record
Val at 0 range 0 .. 2;
Arr at 0 range 0 .. 2;
end record;
-- GPIO port bit reset register
type BRR_Register_1 is record
-- Port Reset bit
BR : BRR_BR_Field_1 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_7_12 : HAL.UInt6 := 16#0#;
-- Port Reset bit
BR_1 : BRR_BR_Field_2 := (As_Array => False, Val => 16#0#);
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BRR_Register_1 use record
BR at 0 range 0 .. 6;
Reserved_7_12 at 0 range 7 .. 12;
BR_1 at 0 range 13 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype MODER_MODER3_Field is HAL.UInt2;
-- GPIO port mode register
type MODER_Register_2 is record
-- unspecified
Reserved_0_5 : HAL.UInt6 := 16#0#;
-- Port x configuration bits (y = 0..15)
MODER3 : MODER_MODER3_Field := 16#3#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for MODER_Register_2 use record
Reserved_0_5 at 0 range 0 .. 5;
MODER3 at 0 range 6 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-- GPIO port output type register
type OTYPER_Register_2 is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Port x configuration bits (y = 0..15)
OT3 : Boolean := False;
-- unspecified
Reserved_4_31 : HAL.UInt28 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OTYPER_Register_2 use record
Reserved_0_2 at 0 range 0 .. 2;
OT3 at 0 range 3 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
subtype OSPEEDR_OSPEEDR3_Field is HAL.UInt2;
-- GPIO port output speed register
type OSPEEDR_Register_2 is record
-- unspecified
Reserved_0_5 : HAL.UInt6 := 16#0#;
-- Port x configuration bits (y = 0..15)
OSPEEDR3 : OSPEEDR_OSPEEDR3_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for OSPEEDR_Register_2 use record
Reserved_0_5 at 0 range 0 .. 5;
OSPEEDR3 at 0 range 6 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype PUPDR_PUPDR3_Field is HAL.UInt2;
-- GPIO port pull-up/pull-down register
type PUPDR_Register_2 is record
-- unspecified
Reserved_0_5 : HAL.UInt6 := 16#0#;
-- Port x configuration bits (y = 0..15)
PUPDR3 : PUPDR_PUPDR3_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PUPDR_Register_2 use record
Reserved_0_5 at 0 range 0 .. 5;
PUPDR3 at 0 range 6 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-- GPIO port input data register
type IDR_Register_2 is record
-- unspecified
Reserved_0_2 : HAL.UInt3;
-- Read-only. Port input data (y = 0..15)
IDR3 : Boolean;
-- unspecified
Reserved_4_31 : HAL.UInt28;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for IDR_Register_2 use record
Reserved_0_2 at 0 range 0 .. 2;
IDR3 at 0 range 3 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
-- GPIO port output data register
type ODR_Register_2 is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Port output data (y = 0..15)
ODR3 : Boolean := False;
-- unspecified
Reserved_4_31 : HAL.UInt28 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for ODR_Register_2 use record
Reserved_0_2 at 0 range 0 .. 2;
ODR3 at 0 range 3 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
-- GPIO port bit set/reset register
type BSRR_Register_2 is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Write-only. Port x set bit y (y= 0..15)
BS3 : Boolean := False;
-- unspecified
Reserved_4_18 : HAL.UInt15 := 16#0#;
-- Write-only. Port x reset bit y (y = 0..15)
BR3 : Boolean := False;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BSRR_Register_2 use record
Reserved_0_2 at 0 range 0 .. 2;
BS3 at 0 range 3 .. 3;
Reserved_4_18 at 0 range 4 .. 18;
BR3 at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- GPIO port configuration lock register
type LCKR_Register_2 is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Port x lock bit y (y= 0..15)
LCK3 : Boolean := False;
-- unspecified
Reserved_4_15 : HAL.UInt12 := 16#0#;
-- Port x lock bit y (y= 0..15)
LCKK : Boolean := False;
-- unspecified
Reserved_17_31 : HAL.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for LCKR_Register_2 use record
Reserved_0_2 at 0 range 0 .. 2;
LCK3 at 0 range 3 .. 3;
Reserved_4_15 at 0 range 4 .. 15;
LCKK at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
subtype AFRL_AFRL3_Field is HAL.UInt4;
-- GPIO alternate function low register
type AFRL_Register_1 is record
-- unspecified
Reserved_0_11 : HAL.UInt12 := 16#0#;
-- Alternate function selection for port x bit y (y = 0..7)
AFRL3 : AFRL_AFRL3_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for AFRL_Register_1 use record
Reserved_0_11 at 0 range 0 .. 11;
AFRL3 at 0 range 12 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- GPIO port bit reset register
type BRR_Register_2 is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- Port Reset bit
BR3 : Boolean := False;
-- unspecified
Reserved_4_31 : HAL.UInt28 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for BRR_Register_2 use record
Reserved_0_2 at 0 range 0 .. 2;
BR3 at 0 range 3 .. 3;
Reserved_4_31 at 0 range 4 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- General-purpose I/Os
type GPIOA_Peripheral is record
-- GPIO port mode register
MODER : aliased MODER_Register;
-- GPIO port output type register
OTYPER : aliased OTYPER_Register;
-- GPIO port output speed register
OSPEEDR : aliased OSPEEDR_Register;
-- GPIO port pull-up/pull-down register
PUPDR : aliased PUPDR_Register;
-- GPIO port input data register
IDR : aliased IDR_Register;
-- GPIO port output data register
ODR : aliased ODR_Register;
-- GPIO port bit set/reset register
BSRR : aliased BSRR_Register;
-- GPIO port configuration lock register
LCKR : aliased LCKR_Register;
-- GPIO alternate function low register
AFRL : aliased AFRL_Register;
-- GPIO alternate function high register
AFRH : aliased AFRH_Register;
-- GPIO port bit reset register
BRR : aliased BRR_Register;
end record
with Volatile;
for GPIOA_Peripheral use record
MODER at 16#0# range 0 .. 31;
OTYPER at 16#4# range 0 .. 31;
OSPEEDR at 16#8# range 0 .. 31;
PUPDR at 16#C# range 0 .. 31;
IDR at 16#10# range 0 .. 31;
ODR at 16#14# range 0 .. 31;
BSRR at 16#18# range 0 .. 31;
LCKR at 16#1C# range 0 .. 31;
AFRL at 16#20# range 0 .. 31;
AFRH at 16#24# range 0 .. 31;
BRR at 16#28# range 0 .. 31;
end record;
-- General-purpose I/Os
GPIOA_Periph : aliased GPIOA_Peripheral
with Import, Address => GPIOA_Base;
-- General-purpose I/Os
GPIOB_Periph : aliased GPIOA_Peripheral
with Import, Address => GPIOB_Base;
-- General-purpose I/Os
type GPIOC_Peripheral is record
-- GPIO port mode register
MODER : aliased MODER_Register_1;
-- GPIO port output type register
OTYPER : aliased OTYPER_Register_1;
-- GPIO port output speed register
OSPEEDR : aliased OSPEEDR_Register_1;
-- GPIO port pull-up/pull-down register
PUPDR : aliased PUPDR_Register_1;
-- GPIO port input data register
IDR : aliased IDR_Register_1;
-- GPIO port output data register
ODR : aliased ODR_Register_1;
-- GPIO port bit set/reset register
BSRR : aliased BSRR_Register_1;
-- GPIO port configuration lock register
LCKR : aliased LCKR_Register_1;
-- GPIO alternate function low register
AFRL : aliased AFRL_Register;
-- GPIO alternate function high register
AFRH : aliased AFRH_Register;
-- GPIO port bit reset register
BRR : aliased BRR_Register_1;
end record
with Volatile;
for GPIOC_Peripheral use record
MODER at 16#0# range 0 .. 31;
OTYPER at 16#4# range 0 .. 31;
OSPEEDR at 16#8# range 0 .. 31;
PUPDR at 16#C# range 0 .. 31;
IDR at 16#10# range 0 .. 31;
ODR at 16#14# range 0 .. 31;
BSRR at 16#18# range 0 .. 31;
LCKR at 16#1C# range 0 .. 31;
AFRL at 16#20# range 0 .. 31;
AFRH at 16#24# range 0 .. 31;
BRR at 16#28# range 0 .. 31;
end record;
-- General-purpose I/Os
GPIOC_Periph : aliased GPIOC_Peripheral
with Import, Address => GPIOC_Base;
-- General-purpose I/Os
type GPIOH_Peripheral is record
-- GPIO port mode register
MODER : aliased MODER_Register_2;
-- GPIO port output type register
OTYPER : aliased OTYPER_Register_2;
-- GPIO port output speed register
OSPEEDR : aliased OSPEEDR_Register_2;
-- GPIO port pull-up/pull-down register
PUPDR : aliased PUPDR_Register_2;
-- GPIO port input data register
IDR : aliased IDR_Register_2;
-- GPIO port output data register
ODR : aliased ODR_Register_2;
-- GPIO port bit set/reset register
BSRR : aliased BSRR_Register_2;
-- GPIO port configuration lock register
LCKR : aliased LCKR_Register_2;
-- GPIO alternate function low register
AFRL : aliased AFRL_Register_1;
-- GPIO alternate function high register
AFRH : aliased AFRH_Register;
-- GPIO port bit reset register
BRR : aliased BRR_Register_2;
end record
with Volatile;
for GPIOH_Peripheral use record
MODER at 16#0# range 0 .. 31;
OTYPER at 16#4# range 0 .. 31;
OSPEEDR at 16#8# range 0 .. 31;
PUPDR at 16#C# range 0 .. 31;
IDR at 16#10# range 0 .. 31;
ODR at 16#14# range 0 .. 31;
BSRR at 16#18# range 0 .. 31;
LCKR at 16#1C# range 0 .. 31;
AFRL at 16#20# range 0 .. 31;
AFRH at 16#24# range 0 .. 31;
BRR at 16#28# range 0 .. 31;
end record;
-- General-purpose I/Os
GPIOH_Periph : aliased GPIOH_Peripheral
with Import, Address => GPIOH_Base;
end STM32_SVD.GPIO;
|
-----------------------------------------------------------------------
-- servlet-server-tests - Unit tests for server requests
-- Copyright (C) 2018, 2020 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Test_Caller;
with Util.Files;
with Servlet.Tests;
with Servlet.Core.Files;
with Servlet.Core.Measures;
with Servlet.Core.Tests;
with Servlet.Filters.Dump;
with Servlet.Requests.Mockup;
with Servlet.Responses.Mockup;
package body Servlet.Server.Tests is
use Servlet.Tests;
use Util.Tests;
package Caller is new Util.Test_Caller (Test, "Server");
Except_Servlet : aliased Servlet.Core.Tests.Test_Servlet3;
Upload : aliased Servlet.Core.Tests.Test_Servlet2;
Files : aliased Servlet.Core.Files.File_Servlet;
Dump : aliased Servlet.Filters.Dump.Dump_Filter;
Measures : aliased Servlet.Core.Measures.Measure_Servlet;
All_Servlet : aliased Servlet.Core.Tests.Test_Servlet3;
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Servlet.Server.Service",
Test_Service'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (GET)",
Test_Get_File'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (GET 404)",
Test_Get_404'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (POST)",
Test_Post_File_Error'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (POST)",
Test_Post_Content'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (GET measures)",
Test_Get_Measures'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Service (GET with exception)",
Test_Get_With_Exception'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Register_Application",
Test_Register_Remove_Application'Access);
Caller.Add_Test (Suite, "Test Servlet.Server.Register_Application (all)",
Test_Register_Application'Access);
end Add_Tests;
-- ------------------------------
-- Initialize the test.
-- ------------------------------
overriding
procedure Set_Up (T : in out Test) is
pragma Unreferenced (T);
use type Servlet.Core.Servlet_Registry_Access;
App : Servlet.Core.Servlet_Registry_Access;
begin
if Servlet.Tests.Get_Application = null then
Servlet.Tests.Initialize (Util.Tests.Get_Properties);
App := Servlet.Tests.Get_Application;
App.Add_Servlet ("Except", Except_Servlet'Access);
App.Add_Mapping ("*.exc", "Except");
-- Register the servlets and filters
App.Add_Servlet (Name => "files", Server => Files'Access);
App.Add_Servlet (Name => "measures", Server => Measures'Access);
App.Add_Filter (Name => "dump", Filter => Dump'Access);
App.Add_Filter (Name => "measures",
Filter => Servlet.Filters.Filter'Class (Measures)'Access);
App.Add_Servlet ("Upload", Upload'Access);
App.Add_Mapping ("*.upload", "Upload");
-- Define servlet mappings
App.Add_Mapping (Name => "files", Pattern => "*.css");
App.Add_Mapping (Name => "files", Pattern => "*.js");
App.Add_Mapping (Name => "files", Pattern => "*.html");
App.Add_Mapping (Name => "files", Pattern => "*.txt");
App.Add_Mapping (Name => "files", Pattern => "*.png");
App.Add_Mapping (Name => "files", Pattern => "*.jpg");
App.Add_Mapping (Name => "files", Pattern => "*.gif");
App.Add_Mapping (Name => "files", Pattern => "*.pdf");
App.Add_Mapping (Name => "files", Pattern => "*.properties");
App.Add_Mapping (Name => "files", Pattern => "*.xhtml");
App.Add_Mapping (Name => "measures", Pattern => "stats.xml");
App.Add_Filter_Mapping (Name => "measures", Pattern => "*");
App.Add_Filter_Mapping (Name => "measures", Pattern => "/ajax/*");
App.Add_Filter_Mapping (Name => "measures", Pattern => "*.html");
App.Add_Filter_Mapping (Name => "measures", Pattern => "*.xhtml");
App.Add_Filter_Mapping (Name => "dump", Pattern => "*.html");
App.Add_Filter_Mapping (Name => "dump", Pattern => "*.css");
App.Add_Filter_Mapping (Name => "dump", Pattern => "/ajax/*");
end if;
Servlet.Tests.Get_Application.Start;
end Set_Up;
-- ------------------------------
-- Test the Service procedure.
-- ------------------------------
procedure Test_Service (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Request.Set_Method (Method => "GET");
Request.Set_Request_URI (URI => "tst", Split => True);
Request.Set_Protocol (Protocol => "HTTP/1.1");
Servlet.Tests.Get_Server.Service (Request, Reply);
Assert_Equals (T, Servlet.Responses.SC_NOT_FOUND, Reply.Get_Status, "Invalid response");
Assert_Matches (T, ".*servlet.error.status_code.*404.*", Reply, "Invalid 404 page returned",
Status => Servlet.Responses.SC_NOT_FOUND);
end Test_Service;
-- ------------------------------
-- Test a GET request on a static file served by the File_Servlet.
-- ------------------------------
procedure Test_Get_404 (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Do_Get (Request, Reply, "/file-does-not-exist.txt", "test-404.html");
Assert_Equals (T, Servlet.Responses.SC_NOT_FOUND, Reply.Get_Status, "Invalid response");
Assert_Matches (T, ".*servlet.error.status_code.*404.*", Reply, "Invalid 404 page returned",
Status => Servlet.Responses.SC_NOT_FOUND);
Do_Get (Request, Reply, "/file-does-not-exist.js", "test-404.html");
Assert_Equals (T, Servlet.Responses.SC_NOT_FOUND, Reply.Get_Status, "Invalid response");
Assert_Matches (T, ".*servlet.error.status_code.*404.*", Reply, "Invalid 404 page returned",
Status => Servlet.Responses.SC_NOT_FOUND);
end Test_Get_404;
-- ------------------------------
-- Test a GET request on a static file served by the File_Servlet.
-- ------------------------------
procedure Test_Get_File (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Do_Get (Request, Reply, "/tests/file.txt", "get-file.txt");
Assert_Contains (T, "A plain text file.", Reply, "Wrong content");
Assert_Header (T, "Content-Type", "text/plain", Reply, "Content-Type");
Do_Get (Request, Reply, "/tests/file.html", "get-file-set.html");
Assert_Matches (T, "<html></html>", Reply, "Wrong content");
Assert_Header (T, "Content-Type", "text/html", Reply, "Content-Type");
Do_Get (Request, Reply, "/tests/file.js", "get-file.js");
Assert_Matches (T, "^\s*var n = 0;.*", Reply, "Wrong content");
Assert_Header (T, "Content-Type", "text/javascript", Reply, "Content-Type");
Do_Get (Request, Reply, "/tests/file.css", "get-file.css");
Assert_Matches (T, "^\s*div { margin: 0 }.*", Reply, "Wrong content");
Assert_Header (T, "Content-Type", "text/css", Reply, "Content-Type");
end Test_Get_File;
-- ------------------------------
-- Test a GET request on the measure servlet
-- ------------------------------
procedure Test_Get_Measures (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Do_Get (Request, Reply, "/stats.xml", "stats.xml");
-- We must get at least one measure value (assuming the Test_Get_File test
-- was executed).
Assert_Matches (T, "<time count=""\d+"" time=""\d+.\d+ [um]s"" title="".*""/>",
Reply, "Wrong content");
end Test_Get_Measures;
-- ------------------------------
-- Test a POST on a file served by the File_Servlet.
-- ------------------------------
procedure Test_Post_File_Error (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Do_Post (Request, Reply, "/tests/file.css", "post-file.css");
Assert_Header (T, "Content-Type", "text/html", Reply, "Content-Type",
Status => Servlet.Responses.SC_METHOD_NOT_ALLOWED);
end Test_Post_File_Error;
-- ------------------------------
-- Test a POST with a part file to a test servlet.
-- ------------------------------
procedure Test_Post_Content (T : in out Test) is
Path : constant String := Util.Tests.Get_Test_Path ("upload.txt");
Request : Servlet.Requests.Mockup.Part_Request (1);
Reply : Servlet.Responses.Mockup.Response;
begin
Util.Files.Write_File (Path, "Some content");
Request.Set_Part (Position => 1,
Name => "file.txt",
Path => Path,
Content_Type => "text/plain");
Do_Post (Request, Reply, "/tests/file.upload", "post-file.upload");
Assert_Header (T, "Content-Type", "text/plain", Reply, "Content-Type",
Status => Servlet.Responses.SC_OK);
end Test_Post_Content;
-- ------------------------------
-- Test a GET request on servlet that raises an exception.
-- ------------------------------
procedure Test_Get_With_Exception (T : in out Test) is
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
Except_Servlet.Raise_Exception := True;
Do_Get (Request, Reply, "/exception-raised.exc", "exception-raised.exc");
Assert_Header (T, "Content-Type", "text/html", Reply, "Content-Type",
Status => Servlet.Responses.SC_INTERNAL_SERVER_ERROR);
Assert_Matches (T, ".*CONSTRAINT_ERROR.*",
Reply, "No exception reported",
Status => Servlet.Responses.SC_INTERNAL_SERVER_ERROR);
end Test_Get_With_Exception;
-- ------------------------------
-- Test a Register_Application and Remove_Application.
-- ------------------------------
procedure Test_Register_Remove_Application (T : in out Test) is
App1 : aliased Servlet.Core.Servlet_Registry;
begin
Servlet.Tests.Get_Server.Register_Application ("my-app", App1'Unchecked_Access);
T.Test_Get_File;
for I in 1 .. 2 loop
Servlet.Tests.Get_Server.Remove_Application (App1'Unchecked_Access);
T.Test_Get_File;
end loop;
exception
when others =>
Servlet.Tests.Get_Server.Remove_Application (App1'Unchecked_Access);
raise;
end Test_Register_Remove_Application;
-- ------------------------------
-- Test a Register_Application and Remove_Application.
-- ------------------------------
procedure Test_Register_Application (T : in out Test) is
App1 : aliased Servlet.Core.Servlet_Registry;
Request : Servlet.Requests.Mockup.Request;
Reply : Servlet.Responses.Mockup.Response;
begin
App1.Add_Servlet ("all", All_Servlet'Access);
App1.Add_Mapping ("/", "all");
App1.Add_Mapping ("/test", "all");
Servlet.Tests.Get_Server.Register_Application ("", App1'Unchecked_Access);
Servlet.Tests.Get_Server.Start;
Request.Set_Method (Method => "GET");
Request.Set_Request_URI (URI => "/test", Split => True);
Request.Set_Protocol (Protocol => "HTTP/1.1");
Servlet.Tests.Get_Server.Service (Request, Reply);
Assert_Equals (T, Servlet.Responses.SC_OK, Reply.Get_Status, "Invalid response");
T.Test_Get_File;
Servlet.Tests.Get_Server.Remove_Application (App1'Unchecked_Access);
end Test_Register_Application;
end Servlet.Server.Tests;
|
-- Copyright 2008-2021 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
My_Circle : Circle := (Pos => (1, 2), Radius => 3);
begin
Do_Nothing (My_Circle); -- STOP
end Foo;
|
-- --
-- package Strings_Edit Copyright (c) Dmitry A. Kazakov --
-- Implementation Luebeck --
-- Spring, 2000 --
-- --
-- Last revision : 10:24 26 Dec 2009 --
-- --
-- This library is free software; you can redistribute it and/or --
-- modify it under the terms of the GNU General Public License as --
-- published by the Free Software Foundation; either version 2 of --
-- the License, or (at your option) any later version. This library --
-- is distributed in the hope that it will be useful, but WITHOUT --
-- ANY WARRANTY; without even the implied warranty of --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU --
-- General Public License for more details. You should have --
-- received a copy of the GNU General Public License along with --
-- this library; if not, write to the Free Software Foundation, --
-- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from --
-- this unit, or you link this unit with other files to produce an --
-- executable, this unit does not by itself cause the resulting --
-- executable to be covered by the GNU General Public License. This --
-- exception does not however invalidate any other reasons why the --
-- executable file might be covered by the GNU Public License. --
--____________________________________________________________________--
with Ada.IO_Exceptions; use Ada.IO_Exceptions;
package body Strings_Edit is
function GetDigit (Symbol : Character) return Natural is
begin
case Symbol is
when '0' => return 0;
when '1' => return 1;
when '2' => return 2;
when '3' => return 3;
when '4' => return 4;
when '5' => return 5;
when '6' => return 6;
when '7' => return 7;
when '8' => return 8;
when '9' => return 9;
when 'A' | 'a' => return 10;
when 'B' | 'b' => return 11;
when 'C' | 'c' => return 12;
when 'D' | 'd' => return 13;
when 'E' | 'e' => return 14;
when 'F' | 'f' => return 15;
when others => return 16;
end case;
end GetDigit;
function Is_Prefix (Prefix, Source : String) return Boolean is
begin
return
( Prefix'Length = 0
or else
( Prefix'Length <= Source'Length
and then
( Prefix
= Source
( Source'First
.. Source'First + Prefix'Length - 1
) ) ) );
end Is_Prefix;
function Is_Prefix (Prefix, Source : String; Pointer : Integer)
return Boolean is
begin
return
( Pointer >= Source'First
and then
( Pointer <= Source'Last
or else
Pointer = Source'Last + 1
)
and then
Source'Last - Pointer + 1 >= Prefix'Length
and then
Prefix = Source (Pointer..Pointer + Prefix'Length - 1)
);
end Is_Prefix;
function Is_Prefix
( Prefix, Source : String;
Map : Character_Mapping
) return Boolean is
begin
if Prefix'Length = 0 then
return True;
elsif Prefix'Length > Source'Length then
return False;
end if;
declare
J : Integer := Source'First;
begin
for I in Prefix'First..Prefix'Last - 1 loop
if Value (Map, Prefix (I)) /= Value (Map, Source (J)) then
return False;
end if;
J := J + 1;
end loop;
return
Value (Map, Prefix (Prefix'Last)) = Value (Map, Source (J));
end;
end Is_Prefix;
function Is_Prefix
( Prefix, Source : String;
Pointer : Integer;
Map : Character_Mapping
) return Boolean is
begin
if ( Pointer < Source'First
or else
( Pointer > Source'Last
and then
Pointer /= Source'Last + 1
)
or else
Source'Last - Pointer + 1 < Prefix'Length
)
then
return False;
end if;
declare
J : Integer := Pointer;
begin
for I in Prefix'First..Prefix'Last - 1 loop
if Value (Map, Prefix (I)) /= Value (Map, Source (J)) then
return False;
end if;
J := J + 1;
end loop;
return
Value (Map, Prefix (Prefix'Last)) = Value (Map, Source (J));
end;
end Is_Prefix;
--
-- Text_Edit
--
-- This is an internal package containing implementation of all text
-- editing subprograms.
--
package Text_Edit is
function TrimCharacter
( Source : String;
Blank : Character := ' '
) return String;
function TrimSet
( Source : String;
Blanks : Character_Set
) return String;
procedure GetCharacter
( Source : String;
Pointer : in out Integer;
Blank : Character := ' '
);
procedure GetSet
( Source : String;
Pointer : in out Integer;
Blanks : Character_Set
);
procedure PutString
( Destination : in out String;
Pointer : in out Integer;
Value : String;
Field : Natural := 0;
Justify : Alignment := Left;
Fill : Character := ' '
);
procedure PutCharacter
( Destination : in out String;
Pointer : in out Integer;
Value : Character;
Field : Natural := 0;
Justify : Alignment := Left;
Fill : Character := ' '
);
end Text_Edit;
package body Text_Edit is separate;
function Trim
( Source : String;
Blank : Character := ' '
) return String renames Text_Edit.TrimCharacter;
function Trim
( Source : String;
Blanks : Character_Set
) return String renames Text_Edit.TrimSet;
procedure Get
( Source : String;
Pointer : in out Integer;
Blank : Character := ' '
) renames Text_Edit.GetCharacter;
procedure Get
( Source : String;
Pointer : in out Integer;
Blanks : Character_Set
) renames Text_Edit.GetSet;
procedure Put
( Destination : in out String;
Pointer : in out Integer;
Value : String;
Field : Natural := 0;
Justify : Alignment := Left;
Fill : Character := ' '
) renames Text_Edit.PutString;
procedure Put
( Destination : in out String;
Pointer : in out Integer;
Value : Character;
Field : Natural := 0;
Justify : Alignment := Left;
Fill : Character := ' '
) renames Text_Edit.PutCharacter;
end Strings_Edit;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
package body Program.Nodes.Loop_Parameter_Specifications is
function Create
(Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
In_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Reverse_Token : Program.Lexical_Elements.Lexical_Element_Access;
Definition : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Access)
return Loop_Parameter_Specification is
begin
return Result : Loop_Parameter_Specification :=
(Name => Name, In_Token => In_Token, Reverse_Token => Reverse_Token,
Definition => Definition, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Definition : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False;
Has_Reverse : Boolean := False)
return Implicit_Loop_Parameter_Specification is
begin
return Result : Implicit_Loop_Parameter_Specification :=
(Name => Name, Definition => Definition,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance,
Has_Reverse => Has_Reverse, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Name
(Self : Base_Loop_Parameter_Specification)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access is
begin
return Self.Name;
end Name;
overriding function Definition
(Self : Base_Loop_Parameter_Specification)
return not null Program.Elements.Discrete_Ranges.Discrete_Range_Access is
begin
return Self.Definition;
end Definition;
overriding function In_Token
(Self : Loop_Parameter_Specification)
return not null Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.In_Token;
end In_Token;
overriding function Reverse_Token
(Self : Loop_Parameter_Specification)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Reverse_Token;
end Reverse_Token;
overriding function Has_Reverse
(Self : Loop_Parameter_Specification)
return Boolean is
begin
return Self.Reverse_Token.Assigned;
end Has_Reverse;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Loop_Parameter_Specification)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Loop_Parameter_Specification)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Loop_Parameter_Specification)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
overriding function Has_Reverse
(Self : Implicit_Loop_Parameter_Specification)
return Boolean is
begin
return Self.Has_Reverse;
end Has_Reverse;
procedure Initialize
(Self : aliased in out Base_Loop_Parameter_Specification'Class) is
begin
Set_Enclosing_Element (Self.Name, Self'Unchecked_Access);
Set_Enclosing_Element (Self.Definition, Self'Unchecked_Access);
null;
end Initialize;
overriding function Is_Loop_Parameter_Specification_Element
(Self : Base_Loop_Parameter_Specification)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Loop_Parameter_Specification_Element;
overriding function Is_Declaration_Element
(Self : Base_Loop_Parameter_Specification)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Declaration_Element;
overriding procedure Visit
(Self : not null access Base_Loop_Parameter_Specification;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Loop_Parameter_Specification (Self);
end Visit;
overriding function To_Loop_Parameter_Specification_Text
(Self : aliased in out Loop_Parameter_Specification)
return Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Text_Access is
begin
return Self'Unchecked_Access;
end To_Loop_Parameter_Specification_Text;
overriding function To_Loop_Parameter_Specification_Text
(Self : aliased in out Implicit_Loop_Parameter_Specification)
return Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Loop_Parameter_Specification_Text;
end Program.Nodes.Loop_Parameter_Specifications;
|
-- Copyright 2014-2017 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with System;
package Pck is
type Packed_Array is array (Natural range <>) of Boolean;
pragma Pack (Packed_Array);
function Make (H, L : Natural) return Packed_Array;
procedure Do_Nothing (A : System.Address);
end Pck;
|
package Memory.Option is
type Option_Type is new Memory_Type with private;
type Option_Pointer is access all Option_Type'Class;
function Create_Option return Option_Pointer;
function Clone(mem : Option_Type) return Memory_Pointer;
procedure Permute(mem : in out Option_Type;
generator : in Distribution_Type;
max_cost : in Cost_Type);
procedure Add_Memory(mem : in out Option_Type;
other : access Memory_Type'Class);
overriding
function Done(mem : Option_Type) return Boolean;
overriding
procedure Reset(mem : in out Option_Type;
context : in Natural);
overriding
procedure Set_Port(mem : in out Option_Type;
port : in Natural;
ready : out Boolean);
overriding
procedure Read(mem : in out Option_Type;
address : in Address_Type;
size : in Positive);
overriding
procedure Write(mem : in out Option_Type;
address : in Address_Type;
size : in Positive);
overriding
procedure Idle(mem : in out Option_Type;
cycles : in Time_Type);
overriding
function Get_Time(mem : Option_Type) return Time_Type;
overriding
function Get_Writes(mem : Option_Type) return Long_Integer;
overriding
function To_String(mem : Option_Type) return Unbounded_String;
overriding
function Get_Cost(mem : Option_Type) return Cost_Type;
overriding
function Get_Word_Size(mem : Option_Type) return Positive;
overriding
procedure Generate(mem : in Option_Type;
sigs : in out Unbounded_String;
code : in out Unbounded_String);
overriding
function Get_Ports(mem : Option_Type) return Port_Vector_Type;
private
package Memory_Vectors is new Vectors(Natural, Memory_Pointer);
subtype Memory_Vector_Type is Memory_Vectors.Vector;
type Option_Type is new Memory_Type with record
memories : Memory_Vector_Type;
index : Natural := 0;
end record;
overriding
procedure Adjust(mem : in out Option_Type);
overriding
procedure Finalize(mem : in out Option_Type);
end Memory.Option;
|
-------------------------------------------------------------------------------
-- Copyright (c) 2019, Daniel King
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
-- * Redistributions of source code must retain the above copyright
-- notice, this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * The name of the copyright holder may not be used to endorse or promote
-- Products derived from this software without specific prior written
-- permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
-- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
package body Keccak.Generic_Duplex
is
------------
-- Init --
------------
procedure Init (Ctx : out Context;
Capacity : in Positive)
is
begin
Init_State (Ctx.State);
Ctx.Rate := State_Size_Bits - Capacity;
end Init;
--------------
-- Duplex --
--------------
procedure Duplex (Ctx : in out Context;
In_Data : in Keccak.Types.Byte_Array;
In_Data_Bit_Length : in Natural;
Out_Data : out Keccak.Types.Byte_Array;
Out_Data_Bit_Length : in Natural)
is
use type Keccak.Types.Byte;
Block : Keccak.Types.Byte_Array (0 .. (State_Size_Bits + 7) / 8 - 1) := (others => 0);
Num_Bytes : constant Natural := (In_Data_Bit_Length + 7) / 8;
begin
if Num_Bytes > 0 then
Block (0 .. Num_Bytes - 1)
:= In_Data (In_Data'First .. In_Data'First + (Num_Bytes - 1));
end if;
Pad (Block (0 .. ((Rate_Of (Ctx) + 7) / 8) - 1),
In_Data_Bit_Length,
Rate_Of (Ctx));
XOR_Bits_Into_State (Ctx.State,
Block (0 .. ((Ctx.Rate + 7) / 8) - 1),
Rate_Of (Ctx));
Permute (Ctx.State);
Extract_Bits (Ctx.State, Out_Data, Out_Data_Bit_Length);
end Duplex;
--------------------
-- Duplex_Blank --
--------------------
procedure Duplex_Blank (Ctx : in out Context;
Out_Data : out Keccak.Types.Byte_Array;
Out_Data_Bit_Length : in Natural)
is
use type Keccak.Types.Byte;
Block : Keccak.Types.Byte_Array (0 .. (State_Size_Bits + 7) / 8 - 1) := (others => 0);
begin
Pad (Block (0 .. ((Rate_Of (Ctx) + 7) / 8) - 1),
0,
Rate_Of (Ctx));
XOR_Bits_Into_State (Ctx.State,
Block (0 .. ((Ctx.Rate + 7) / 8) - 1),
Rate_Of (Ctx));
Permute (Ctx.State);
Extract_Bits (Ctx.State, Out_Data, Out_Data_Bit_Length);
end Duplex_Blank;
-------------------
-- Duplex_Mute --
-------------------
procedure Duplex_Mute (Ctx : in out Context;
In_Data : in Keccak.Types.Byte_Array;
In_Data_Bit_Length : in Natural)
is
Block : Keccak.Types.Byte_Array (0 .. (State_Size_Bits + 7) / 8 - 1) := (others => 0);
Nb_Bytes : constant Natural := (In_Data_Bit_Length + 7) / 8;
begin
Block (0 .. Nb_Bytes - 1) :=
In_Data (In_Data'First .. In_Data'First + Nb_Bytes - 1);
Pad (Block (0 .. ((Rate_Of (Ctx) + 7) / 8) - 1),
In_Data_Bit_Length,
Rate_Of (Ctx));
XOR_Bits_Into_State (Ctx.State,
Block (0 .. ((Ctx.Rate + 7) / 8) - 1),
Rate_Of (Ctx));
Permute (Ctx.State);
end Duplex_Mute;
end Keccak.Generic_Duplex;
|
------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Status --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Laurent Pautet <pautet@gnat.com>
-- Modified by: Juergen Pfeifer, 1997
-- Version Control
-- $Revision: 1.7 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- This package has been contributed by Laurent Pautet <pautet@gnat.com> --
-- --
package body Status is
protected body Process is
procedure Stop is
begin
Done := True;
end Stop;
function Continue return Boolean is
begin
return not Done;
end Continue;
end Process;
end Status;
|
-- { dg-do compile }
-- { dg-options "-O2 -gnatn" }
package body Opt23 is
procedure Proc (Driver : Rec) is
R : Path;
begin
for I in Driver.Step'Range loop
R := Get (Driver, 1, Driver.Step (I));
R := Get (Driver, 2, Driver.Step (I));
R := Get (Driver, 3, Driver.Step (I));
end loop;
end;
end Opt23;
|
-- This spec has been automatically generated from STM32WB55x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.COMP is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype COMP1_CSR_PWRMODE_Field is HAL.UInt2;
subtype COMP1_CSR_INMSEL_Field is HAL.UInt3;
subtype COMP1_CSR_INPSEL_Field is HAL.UInt2;
subtype COMP1_CSR_HYST_Field is HAL.UInt2;
subtype COMP1_CSR_BLANKING_Field is HAL.UInt3;
subtype COMP1_CSR_INMESEL_Field is HAL.UInt2;
type COMP1_CSR_Register is record
EN : Boolean := False;
-- unspecified
Reserved_1_1 : HAL.Bit := 16#0#;
PWRMODE : COMP1_CSR_PWRMODE_Field := 16#0#;
INMSEL : COMP1_CSR_INMSEL_Field := 16#0#;
INPSEL : COMP1_CSR_INPSEL_Field := 16#0#;
-- unspecified
Reserved_9_14 : HAL.UInt6 := 16#0#;
POLARITY : Boolean := False;
HYST : COMP1_CSR_HYST_Field := 16#0#;
BLANKING : COMP1_CSR_BLANKING_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
BRGEN : Boolean := False;
SCALEN : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
INMESEL : COMP1_CSR_INMESEL_Field := 16#0#;
-- unspecified
Reserved_27_29 : HAL.UInt3 := 16#0#;
VALUE : Boolean := False;
LOCK : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for COMP1_CSR_Register use record
EN at 0 range 0 .. 0;
Reserved_1_1 at 0 range 1 .. 1;
PWRMODE at 0 range 2 .. 3;
INMSEL at 0 range 4 .. 6;
INPSEL at 0 range 7 .. 8;
Reserved_9_14 at 0 range 9 .. 14;
POLARITY at 0 range 15 .. 15;
HYST at 0 range 16 .. 17;
BLANKING at 0 range 18 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
BRGEN at 0 range 22 .. 22;
SCALEN at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
INMESEL at 0 range 25 .. 26;
Reserved_27_29 at 0 range 27 .. 29;
VALUE at 0 range 30 .. 30;
LOCK at 0 range 31 .. 31;
end record;
subtype COMP2_CSR_PWRMODE_Field is HAL.UInt2;
subtype COMP2_CSR_INMSEL_Field is HAL.UInt3;
subtype COMP2_CSR_INPSEL_Field is HAL.UInt2;
subtype COMP2_CSR_HYST_Field is HAL.UInt2;
subtype COMP2_CSR_BLANKING_Field is HAL.UInt3;
subtype COMP2_CSR_INMESEL_Field is HAL.UInt2;
type COMP2_CSR_Register is record
EN : Boolean := False;
-- unspecified
Reserved_1_1 : HAL.Bit := 16#0#;
PWRMODE : COMP2_CSR_PWRMODE_Field := 16#0#;
INMSEL : COMP2_CSR_INMSEL_Field := 16#0#;
INPSEL : COMP2_CSR_INPSEL_Field := 16#0#;
WINMODE : Boolean := False;
-- unspecified
Reserved_10_14 : HAL.UInt5 := 16#0#;
POLARITY : Boolean := False;
HYST : COMP2_CSR_HYST_Field := 16#0#;
BLANKING : COMP2_CSR_BLANKING_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
BRGEN : Boolean := False;
SCALEN : Boolean := False;
-- unspecified
Reserved_24_24 : HAL.Bit := 16#0#;
INMESEL : COMP2_CSR_INMESEL_Field := 16#0#;
-- unspecified
Reserved_27_29 : HAL.UInt3 := 16#0#;
VALUE : Boolean := False;
LOCK : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for COMP2_CSR_Register use record
EN at 0 range 0 .. 0;
Reserved_1_1 at 0 range 1 .. 1;
PWRMODE at 0 range 2 .. 3;
INMSEL at 0 range 4 .. 6;
INPSEL at 0 range 7 .. 8;
WINMODE at 0 range 9 .. 9;
Reserved_10_14 at 0 range 10 .. 14;
POLARITY at 0 range 15 .. 15;
HYST at 0 range 16 .. 17;
BLANKING at 0 range 18 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
BRGEN at 0 range 22 .. 22;
SCALEN at 0 range 23 .. 23;
Reserved_24_24 at 0 range 24 .. 24;
INMESEL at 0 range 25 .. 26;
Reserved_27_29 at 0 range 27 .. 29;
VALUE at 0 range 30 .. 30;
LOCK at 0 range 31 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
type COMP_Peripheral is record
COMP1_CSR : aliased COMP1_CSR_Register;
COMP2_CSR : aliased COMP2_CSR_Register;
end record
with Volatile;
for COMP_Peripheral use record
COMP1_CSR at 16#0# range 0 .. 31;
COMP2_CSR at 16#4# range 0 .. 31;
end record;
COMP_Periph : aliased COMP_Peripheral
with Import, Address => System'To_Address (16#40010200#);
end STM32_SVD.COMP;
|
package body Problem_9 is
function Solution_1 return Int64 is
X_1 : Constant Float := (1.0 + Sqrt(1.0 - (4.0*(-500.0)))) / 2.0;
X_2 : Constant Float := (1.0 - Sqrt(1.0 - (4.0*(-500.0)))) / 2.0;
Max,Temp,A,B,C : Int64;
begin
if X_1 >= X_2 then
Max := Int64(X_1);
else
Max := Int64(X_2);
end if;
for M in reverse 1 .. Max loop
for N in reverse 1 .. M - 1 loop
Temp := 2*M*M + 2*N*M;
if Temp = 1000 then
A := M*M - N*N;
B := 2*M*N;
C := M*M + N*N;
return A*B*C;
end if;
end loop;
end loop;
return 0;
end Solution_1;
procedure Test_Solution_1 is
Solution : constant Int64 := 31875000;
begin
Assert( Solution_1 = Solution );
end Test_Solution_1;
function Get_Solutions return Solution_Case is
Ret : Solution_Case;
begin
Set_Name( Ret, "Problem 9");
Add_Test( Ret, Test_Solution_1'Access );
return Ret;
end Get_Solutions;
end Problem_9;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- Base data structure for internal representation of SOAP Message.
------------------------------------------------------------------------------
with Ada.Containers.Hashed_Sets;
with League.Strings;
with Web_Services.SOAP.Headers;
with Web_Services.SOAP.Payloads;
with Web_Services.SOAP.Reply_Streams;
package Web_Services.SOAP.Messages is
function Hash
(Item : Web_Services.SOAP.Headers.SOAP_Header_Access)
return Ada.Containers.Hash_Type;
package Header_Sets is
new Ada.Containers.Hashed_Sets
(Web_Services.SOAP.Headers.SOAP_Header_Access,
Hash,
Web_Services.SOAP.Headers."=",
Web_Services.SOAP.Headers."=");
type SOAP_Message is limited record
Action : League.Strings.Universal_String;
Namespace_URI : League.Strings.Universal_String;
Local_Name : League.Strings.Universal_String;
-- SOAP Action, namespace URI and local name of child element of SOAP
-- Body. These components are used by generated dispatcher to redirect
-- message to the appropriate handler.
Output : Web_Services.SOAP.Reply_Streams.Reply_Stream_Access;
Headers : Header_Sets.Set;
Payload : Web_Services.SOAP.Payloads.SOAP_Payload_Access;
end record;
type SOAP_Message_Access is access all SOAP_Message;
procedure Finalize (Self : in out SOAP_Message);
procedure Free (Message : in out SOAP_Message_Access);
end Web_Services.SOAP.Messages;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Source_Buffers;
private with Ada.Containers.Hashed_Maps;
package Program.Symbols.Tables is
pragma Preelaborate;
type Symbol_Table is tagged limited private;
procedure Initialize (Self : in out Symbol_Table);
-- Initialize given symbol table with predefinced symbols
function Find
(Self : Symbol_Table'Class;
Value : Program.Text) return Symbol;
-- Return symbol for given Text or No_Symbol if no such value in the table
procedure Find_Or_Create
(Self : in out Symbol_Table'Class;
Buffer : not null Program.Source_Buffers.Source_Buffer_Access;
Span : Program.Source_Buffers.Span;
Result : out Symbol);
private
type Symbol_Reference is record
Buffer : not null Program.Source_Buffers.Source_Buffer_Access;
Span : Program.Source_Buffers.Span;
end record;
function Equal (Left, Right : Symbol_Reference) return S.Boolean;
function Hash (Value : Symbol_Reference) return Ada.Containers.Hash_Type;
package Symbol_Maps is new Ada.Containers.Hashed_Maps
(Key_Type => Symbol_Reference,
Element_Type => Program.Symbols.Symbol,
Hash => Hash,
Equivalent_Keys => Equal,
"=" => Program.Symbols."=");
type Predefined_Source_Buffer is new Program.Source_Buffers.Source_Buffer
with null record;
overriding function Text
(Self : Predefined_Source_Buffer;
Span : Program.Source_Buffers.Span)
return Program.Text;
overriding procedure Read
(Self : in out Predefined_Source_Buffer;
Data : out Program.Source_Buffers.Character_Info_Array;
Last : out Natural) is null;
overriding procedure Rewind
(Self : in out Predefined_Source_Buffer) is null;
type Symbol_Table is tagged limited record
Map : Symbol_Maps.Map;
Buffer : aliased Predefined_Source_Buffer;
Last_Symbol : Program.Symbols.Symbol := Program.Symbols.X_Symbol'Last;
end record;
end Program.Symbols.Tables;
|
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2017 onox <denkpadje@gmail.com>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with System.Multiprocessors.Dispatching_Domains;
with Ada.Unchecked_Conversion;
with Ada.Unchecked_Deallocation;
with Ada.Exceptions;
with Orka.Futures;
with Orka.Loggers;
with Orka.Logging;
with Orka.Simulation;
with Orka.Simulation_Jobs;
package body Orka.Loops is
use all type Orka.Logging.Source;
use all type Orka.Logging.Severity;
use Orka.Logging;
package Messages is new Orka.Logging.Messages (Game_Loop);
function "+" (Value : Ada.Real_Time.Time_Span) return Duration
renames Ada.Real_Time.To_Duration;
procedure Free is new Ada.Unchecked_Deallocation
(Behaviors.Behavior_Array, Behaviors.Behavior_Array_Access);
function "<" (Left, Right : Behaviors.Behavior_Ptr) return Boolean is
function Convert is new Ada.Unchecked_Conversion
(Source => System.Address, Target => Long_Integer);
begin
return Convert (Left.all'Address) < Convert (Right.all'Address);
end "<";
protected body Handler is
procedure Stop is
begin
Stop_Flag := True;
end Stop;
procedure Set_Frame_Limit (Value : Time_Span) is
begin
Limit := Value;
end Set_Frame_Limit;
function Frame_Limit return Time_Span is (Limit);
procedure Enable_Limit (Enable : Boolean) is
begin
Limit_Flag := Enable;
end Enable_Limit;
function Limit_Enabled return Boolean is (Limit_Flag);
function Should_Stop return Boolean is (Stop_Flag);
end Handler;
protected body Scene is
procedure Add (Object : Behaviors.Behavior_Ptr) is
begin
Behaviors_Set.Insert (Object);
Modified_Flag := True;
end Add;
procedure Remove (Object : Behaviors.Behavior_Ptr) is
begin
Behaviors_Set.Delete (Object);
Modified_Flag := True;
end Remove;
procedure Replace_Array (Target : in out Behaviors.Behavior_Array_Access) is
pragma Assert (Modified);
Index : Positive := 1;
Count : constant Positive := Positive (Behaviors_Set.Length);
begin
Free (Target);
Target := new Behaviors.Behavior_Array'(1 .. Count => Behaviors.Null_Behavior);
-- Copy the elements from the set to the array
-- for faster iteration by the game loop
for Element of Behaviors_Set loop
Target (Index) := Element;
Index := Index + 1;
end loop;
Modified_Flag := False;
end Replace_Array;
function Modified return Boolean is
(Modified_Flag);
procedure Set_Camera (Camera : Cameras.Camera_Ptr) is
begin
Scene_Camera := Camera;
end Set_Camera;
function Camera return Cameras.Camera_Ptr is
(Scene_Camera);
end Scene;
package SJ renames Simulation_Jobs;
procedure Stop_Loop is
begin
Handler.Stop;
end Stop_Loop;
procedure Run_Game_Loop
(Fence : not null access SJ.Fences.Buffer_Fence;
Render : Simulation.Render_Ptr)
is
subtype Time is Ada.Real_Time.Time;
Previous_Time : Time := Clock;
Next_Time : Time := Previous_Time;
Lag : Time_Span := Time_Span_Zero;
Scene_Array : not null Behaviors.Behavior_Array_Access := Behaviors.Empty_Behavior_Array;
Batch_Length : constant := 10;
One_Second : constant Time_Span := Seconds (1);
Frame_Counter : Natural := 0;
Exceeded_Frame_Counter : Natural := 0;
Clock_FPS_Start : Time := Clock;
Stat_Sum : Time_Span := Time_Span_Zero;
Stat_Min : Duration := To_Duration (One_Second);
Stat_Max : Duration := To_Duration (-One_Second);
begin
Scene.Replace_Array (Scene_Array);
Messages.Log (Debug, "Simulation tick resolution: " & Trim (Image (+Tick)));
-- Based on http://gameprogrammingpatterns.com/game-loop.html
loop
declare
Current_Time : constant Time := Clock;
Elapsed : constant Time_Span := Current_Time - Previous_Time;
begin
Previous_Time := Current_Time;
Lag := Lag + Elapsed;
exit when Handler.Should_Stop;
declare
Iterations : constant Natural := Lag / Time_Step;
begin
Lag := Lag - Iterations * Time_Step;
Scene.Camera.Update (To_Duration (Lag));
declare
Fixed_Update_Job : constant Jobs.Job_Ptr
:= Jobs.Parallelize (SJ.Create_Fixed_Update_Job
(Scene_Array, Time_Step, Iterations),
SJ.Clone_Fixed_Update_Job'Access,
Scene_Array'Length, Batch_Length);
Finished_Job : constant Jobs.Job_Ptr := SJ.Create_Finished_Job
(Scene_Array, Time_Step, Scene.Camera.View_Position, Batch_Length);
Render_Scene_Job : constant Jobs.Job_Ptr
:= SJ.Create_Scene_Render_Job (Render, Scene_Array, Scene.Camera);
Render_Start_Job : constant Jobs.Job_Ptr
:= SJ.Create_Start_Render_Job (Fence);
Render_Finish_Job : constant Jobs.Job_Ptr
:= SJ.Create_Finish_Render_Job (Fence);
Handle : Futures.Pointers.Mutable_Pointer;
Status : Futures.Status;
begin
Orka.Jobs.Chain
((Render_Start_Job, Fixed_Update_Job, Finished_Job,
Render_Scene_Job, Render_Finish_Job));
Job_Manager.Queue.Enqueue (Render_Start_Job, Handle);
declare
Frame_Future : constant Orka.Futures.Future_Access := Handle.Get.Value;
begin
select
Frame_Future.Wait_Until_Done (Status);
or
delay until Current_Time + Maximum_Frame_Time;
raise Program_Error with
"Maximum frame time of " & Trim (Image (+Maximum_Frame_Time)) &
" exceeded";
end select;
end;
end;
end;
if Scene.Modified then
Scene.Replace_Array (Scene_Array);
end if;
declare
Total_Elapsed : constant Time_Span := Clock - Clock_FPS_Start;
Limit_Exceeded : constant Time_Span := Elapsed - Handler.Frame_Limit;
begin
Frame_Counter := Frame_Counter + 1;
if Limit_Exceeded > Time_Span_Zero then
Stat_Sum := Stat_Sum + Limit_Exceeded;
Stat_Min := Duration'Min (Stat_Min, To_Duration (Limit_Exceeded));
Stat_Max := Duration'Max (Stat_Max, To_Duration (Limit_Exceeded));
Exceeded_Frame_Counter := Exceeded_Frame_Counter + 1;
end if;
if Total_Elapsed > One_Second then
declare
Frame_Time : constant Time_Span := Total_Elapsed / Frame_Counter;
FPS : constant Integer := Integer (1.0 / To_Duration (Frame_Time));
begin
Messages.Log (Debug, Trim (FPS'Image) & " FPS, frame time: " &
Trim (Image (+Frame_Time)));
end;
if Exceeded_Frame_Counter > 0 then
declare
Stat_Avg : constant Duration := +(Stat_Sum / Exceeded_Frame_Counter);
begin
Messages.Log (Debug, " deadline missed: " &
Trim (Exceeded_Frame_Counter'Image) & " (limit is " &
Trim (Image (+Handler.Frame_Limit)) & ")");
Messages.Log (Debug, " avg/min/max: " &
Image (Stat_Avg) &
Image (Stat_Min) &
Image (Stat_Max));
end;
end if;
Clock_FPS_Start := Clock;
Frame_Counter := 0;
Exceeded_Frame_Counter := 0;
Stat_Sum := Time_Span_Zero;
Stat_Min := To_Duration (One_Second);
Stat_Max := To_Duration (Time_Span_Zero);
end if;
end;
if Handler.Limit_Enabled then
-- Do not sleep if Next_Time fell behind more than one frame
-- due to high workload (FPS dropping below limit), otherwise
-- the FPS will be exceeded during a subsequent low workload
-- until Next_Time has catched up
if Next_Time < Current_Time - Handler.Frame_Limit then
Next_Time := Current_Time;
else
Next_Time := Next_Time + Handler.Frame_Limit;
delay until Next_Time;
end if;
end if;
end;
end loop;
Job_Manager.Shutdown;
exception
when others =>
Job_Manager.Shutdown;
raise;
end Run_Game_Loop;
procedure Run_Loop
(Render : not null access procedure
(Scene : not null Behaviors.Behavior_Array_Access;
Camera : Cameras.Camera_Ptr))
is
Fence : aliased SJ.Fences.Buffer_Fence := SJ.Fences.Create_Buffer_Fence;
begin
declare
-- Create a separate task for the game loop. The current task
-- will be used to dequeue and execute GPU jobs.
task Simulation;
task body Simulation is
begin
System.Multiprocessors.Dispatching_Domains.Set_CPU (1);
Run_Game_Loop (Fence'Unchecked_Access, Render);
exception
when Error : others =>
Messages.Log (Loggers.Error, Ada.Exceptions.Exception_Information (Error));
end Simulation;
begin
System.Multiprocessors.Dispatching_Domains.Set_CPU (1);
-- Execute GPU jobs in the current task
Job_Manager.Execute_GPU_Jobs;
end;
end Run_Loop;
end Orka.Loops;
|
-----------------------------------------------------------------------
-- servlet-requests.mockup -- Servlet Requests mockup
-- Copyright (C) 2010, 2011, 2012, 2013, 2017, 2020 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package body Servlet.Requests.Mockup is
function Find (Map : in Util.Strings.Maps.Map;
Name : in String) return String;
-- ------------------------------
-- Find and return the string associated with a key in the map.
-- ------------------------------
function Find (Map : in Util.Strings.Maps.Map;
Name : in String) return String is
Pos : constant Util.Strings.Maps.Cursor := Map.Find (Name);
begin
if Util.Strings.Maps.Has_Element (Pos) then
return Util.Strings.Maps.Element (Pos);
else
return "";
end if;
end Find;
-- ------------------------------
-- Returns the value of a request parameter as a String, or null if the
-- parameter does not exist. Request parameters are extra information sent with
-- the request. For HTTP servlets, parameters are contained in the query string
-- or posted form data.
--
-- You should only use this method when you are sure the parameter has only one
-- value. If the parameter might have more than one value, use
-- Get_Parameter_Values(String).
--
-- If you use this method with a multivalued parameter, the value returned is
-- equal to the first value in the array returned by Get_Parameter_Values.
--
-- If the parameter data was sent in the request body, such as occurs with
-- an HTTP POST request, then reading the body directly via getInputStream()
-- or getReader() can interfere with the execution of this method.
-- ------------------------------
function Get_Parameter (Req : in Request;
Name : in String) return String is
begin
return Find (Req.Parameters, Name);
end Get_Parameter;
-- ------------------------------
-- Iterate over the request parameters and executes the <b>Process</b> procedure.
-- ------------------------------
procedure Iterate_Parameters (Req : in Request;
Process : not null access
procedure (Name : in String;
Value : in String)) is
procedure Process_Wrapper (Position : in Util.Strings.Maps.Cursor);
procedure Process_Wrapper (Position : in Util.Strings.Maps.Cursor) is
begin
Process.all (Name => Util.Strings.Maps.Key (Position),
Value => Util.Strings.Maps.Element (Position));
end Process_Wrapper;
begin
Req.Parameters.Iterate (Process => Process_Wrapper'Access);
end Iterate_Parameters;
-- ------------------------------
-- Set the parameter
-- ------------------------------
procedure Set_Parameter (Req : in out Request;
Name : in String;
Value : in String) is
begin
Req.Parameters.Include (Name, Value);
end Set_Parameter;
-- ------------------------------
-- Returns the name of the HTTP method with which this request was made,
-- for example, GET, POST, or PUT. Same as the value of the CGI variable
-- REQUEST_METHOD.
-- ------------------------------
function Get_Method (Req : in Request) return String is
begin
return To_String (Req.Method);
end Get_Method;
-- ------------------------------
-- Sets the HTTP method.
-- ------------------------------
procedure Set_Method (Req : in out Request;
Method : in String) is
begin
Req.Method := To_Unbounded_String (Method);
end Set_Method;
-- ------------------------------
-- Returns the name and version of the protocol the request uses in the form
-- protocol/majorVersion.minorVersion, for example, HTTP/1.1. For HTTP servlets,
-- the value returned is the same as the value of the CGI variable SERVER_PROTOCOL.
-- ------------------------------
function Get_Protocol (Req : in Request) return String is
begin
return To_String (Req.Protocol);
end Get_Protocol;
-- ------------------------------
-- Sets the protocol version
-- ------------------------------
procedure Set_Protocol (Req : in out Request;
Protocol : in String) is
begin
Req.Protocol := To_Unbounded_String (Protocol);
end Set_Protocol;
-- ------------------------------
-- Returns the part of this request's URL from the protocol name up to the query
-- string in the first line of the HTTP request. The web container does not decode
-- this String. For example:
-- First line of HTTP request Returned Value
-- POST /some/path.html HTTP/1.1 /some/path.html
-- GET http://foo.bar/a.html HTTP/1.0 /a.html
-- HEAD /xyz?a=b HTTP/1.1 /xyz
-- ------------------------------
function Get_Request_URI (Req : in Request) return String is
begin
return To_String (Req.URI);
end Get_Request_URI;
-- ------------------------------
-- Set the request URI. When <tt>Split</tt> is true, the request parameters are
-- cleared and initialized with the query parameters passed in the URI.
-- ------------------------------
procedure Set_Request_URI (Req : in out Request;
URI : in String;
Split : in Boolean := False) is
begin
if not Split then
Req.URI := To_Unbounded_String (URI);
else
Req.Parameters.Clear;
declare
Sep : Natural := Util.Strings.Index (URI, '?');
Sep2, Pos : Natural;
begin
if Sep = 0 then
Pos := URI'Last;
Req.URI := To_Unbounded_String (URI);
else
Pos := Sep + 1;
Req.URI := To_Unbounded_String (URI (URI'First .. Sep - 1));
end if;
-- Do a simple parameter identification and split.
-- Since this is for a mockup, we don't need full compliance.
while Pos < URI'Last loop
Sep := Util.Strings.Index (URI, '=', Pos);
if Sep = 0 then
Req.Set_Parameter (URI (Pos .. URI'Last), "");
exit;
end if;
Sep2 := Util.Strings.Index (URI, '&', Sep + 1);
if Sep2 = 0 then
Req.Set_Parameter (URI (Pos .. Sep - 1), URI (Sep + 1 .. URI'Last));
exit;
end if;
Req.Set_Parameter (URI (Pos .. Sep - 1), URI (Sep + 1 .. Sep2 - 1));
Pos := Sep2 + 1;
end loop;
end;
end if;
end Set_Request_URI;
-- ------------------------------
-- Returns the value of the specified request header as a String. If the request
-- did not include a header of the specified name, this method returns null.
-- If there are multiple headers with the same name, this method returns the
-- first head in the request. The header name is case insensitive. You can use
-- this method with any request header.
-- ------------------------------
function Get_Header (Req : in Request;
Name : in String) return String is
begin
return Find (Req.Headers, Name);
end Get_Header;
-- ------------------------------
-- Sets the header
-- ------------------------------
procedure Set_Header (Req : in out Request;
Name : in String;
Value : in String) is
begin
Req.Headers.Include (Name, Value);
end Set_Header;
-- ------------------------------
-- Returns all the values of the specified request header as an Enumeration
-- of String objects.
--
-- Some headers, such as Accept-Language can be sent by clients as several headers
-- each with a different value rather than sending the header as a comma
-- separated list.
--
-- If the request did not include any headers of the specified name, this method
-- returns an empty Enumeration. The header name is case insensitive. You can use
-- this method with any request header.
-- ------------------------------
function Get_Headers (Req : in Request;
Name : in String) return String is
begin
return Find (Req.Headers, Name);
end Get_Headers;
-- ------------------------------
-- Iterate over the request headers and executes the <b>Process</b> procedure.
-- ------------------------------
procedure Iterate_Headers (Req : in Request;
Process : not null access
procedure (Name : in String;
Value : in String)) is
procedure Process_Wrapper (Position : in Util.Strings.Maps.Cursor);
procedure Process_Wrapper (Position : in Util.Strings.Maps.Cursor) is
begin
Process.all (Name => Util.Strings.Maps.Key (Position),
Value => Util.Strings.Maps.Element (Position));
end Process_Wrapper;
begin
Req.Headers.Iterate (Process => Process_Wrapper'Access);
end Iterate_Headers;
-- ------------------------------
-- Returns the Internet Protocol (IP) address of the client or last proxy that
-- sent the request. For HTTP servlets, same as the value of the CGI variable
-- REMOTE_ADDR.
-- ------------------------------
function Get_Remote_Addr (Req : in Request) return String is
begin
return To_String (Req.Peer);
end Get_Remote_Addr;
-- ------------------------------
-- Sets the peer address
-- ------------------------------
procedure Set_Remote_Addr (Req : in out Request;
Addr : in String) is
begin
Req.Peer := To_Unbounded_String (Addr);
end Set_Remote_Addr;
-- ------------------------------
-- Get the number of parts included in the request.
-- ------------------------------
function Get_Part_Count (Req : in Request) return Natural is
begin
return 0;
end Get_Part_Count;
-- ------------------------------
-- Process the part at the given position and executes the <b>Process</b> operation
-- with the part object.
-- ------------------------------
procedure Process_Part (Req : in out Request;
Position : in Positive;
Process : not null access
procedure (Data : in Servlet.Parts.Part'Class)) is
begin
null;
end Process_Part;
-- ------------------------------
-- Process the part identifed by <b>Id</b> and executes the <b>Process</b> operation
-- with the part object.
-- ------------------------------
procedure Process_Part (Req : in out Request;
Id : in String;
Process : not null access
procedure (Data : in Servlet.Parts.Part'Class)) is
begin
null;
end Process_Part;
-- ------------------------------
-- Set the request cookie by using the cookie returned in the response.
-- ------------------------------
procedure Set_Cookie (Req : in out Request;
From : in Servlet.Responses.Mockup.Response'Class) is
C : constant String := From.Get_Header ("Set-Cookie");
begin
Req.Set_Header ("Cookie", C);
end Set_Cookie;
-- ------------------------------
-- Set the session associated with the request.
-- ------------------------------
procedure Set_Session (Req : in out Request;
Session : in Servlet.Sessions.Session) is
begin
Req.Info.Session := Session;
end Set_Session;
-- ------------------------------
-- Set a part to the request.
-- ------------------------------
procedure Set_Part (Req : in out Part_Request;
Position : in Positive;
Name : in String;
Path : in String;
Content_Type : in String) is
begin
Servlet.Parts.Mockup.Create (Req.Parts (Position), Name, Path, Content_Type);
end Set_Part;
-- ------------------------------
-- Get the number of parts included in the request.
-- ------------------------------
overriding
function Get_Part_Count (Req : in Part_Request) return Natural is
begin
return Req.Count;
end Get_Part_Count;
-- ------------------------------
-- Process the part at the given position and executes the <b>Process</b> operation
-- with the part object.
-- ------------------------------
overriding
procedure Process_Part (Req : in out Part_Request;
Position : in Positive;
Process : not null access
procedure (Data : in Servlet.Parts.Part'Class)) is
begin
Process (Req.Parts (Position));
end Process_Part;
-- ------------------------------
-- Process the part identifed by <b>Id</b> and executes the <b>Process</b> operation
-- with the part object.
-- ------------------------------
overriding
procedure Process_Part (Req : in out Part_Request;
Id : in String;
Process : not null access
procedure (Data : in Servlet.Parts.Part'Class)) is
begin
for I in 1 .. Req.Count loop
if Id = Req.Parts (I).Get_Name then
Process (Req.Parts (I));
end if;
end loop;
end Process_Part;
end Servlet.Requests.Mockup;
|
-- C41307D.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- CHECK THAT L.R IS ALLOWED INSIDE A PACKAGE, GENERIC PACKAGE,
-- SUBPROGRAM, GENERIC SUBPROGRAM, TASK, BLOCK, LOOP, OR AN ACCEPT
-- STATEMENT NAMED L, IF R IS DECLARED INSIDE THE UNIT.
-- TBN 12/15/86
WITH REPORT; USE REPORT;
PROCEDURE C41307D IS
BEGIN
TEST ("C41307D", "CHECK THAT L.R IS ALLOWED INSIDE A PACKAGE, " &
"GENERIC PACKAGE, SUBPROGRAM, GENERIC " &
"SUBPROGRAM, TASK, BLOCK, LOOP, OR AN ACCEPT " &
"STATEMENT NAMED L, IF R IS DECLARED INSIDE " &
"THE UNIT");
DECLARE
PACKAGE L IS
R : INTEGER := 5;
A : INTEGER := L.R;
END L;
PACKAGE BODY L IS
B : INTEGER := L.R + 1;
BEGIN
IF IDENT_INT(A) /= 5 OR IDENT_INT(B) /= 6 THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 1");
END IF;
END L;
GENERIC
S : INTEGER;
PACKAGE M IS
X : INTEGER := M.S;
END M;
PACKAGE BODY M IS
Y : INTEGER := M.S + 1;
BEGIN
IF IDENT_INT(X) /= 2 OR
IDENT_INT(Y) /= 3 OR
IDENT_INT(M.X) /= 2 THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 2");
END IF;
END M;
PACKAGE Q IS NEW M(2);
BEGIN
IF IDENT_INT(Q.X) /= 2 THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 3");
END IF;
END;
-------------------------------------------------------------------
DECLARE
CH : CHARACTER := '6';
PROCEDURE L (R : IN OUT CHARACTER) IS
A : CHARACTER := L.R;
BEGIN
IF IDENT_CHAR(L.A) /= '6' THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 4");
END IF;
L.R := IDENT_CHAR('7');
END L;
GENERIC
S : CHARACTER;
PROCEDURE M;
PROCEDURE M IS
T : CHARACTER := M.S;
BEGIN
IF IDENT_CHAR(T) /= '3' OR IDENT_CHAR(M.S) /= '3' THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 5");
END IF;
END M;
PROCEDURE P1 IS NEW M('3');
BEGIN
L (CH);
IF CH /= IDENT_CHAR('7') THEN
FAILED ("INCORRECT RESULTS RETURNED FROM PROCEDURE - 6");
END IF;
P1;
END;
-------------------------------------------------------------------
DECLARE
INT : INTEGER := 3;
FUNCTION L (R : INTEGER) RETURN INTEGER IS
A : INTEGER := L.R;
BEGIN
IF IDENT_INT(L.A) /= IDENT_INT(3) THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 7");
END IF;
RETURN IDENT_INT(4);
END L;
GENERIC
S : INTEGER;
FUNCTION M RETURN INTEGER;
FUNCTION M RETURN INTEGER IS
T : INTEGER := M.S;
BEGIN
IF IDENT_INT(M.T) /= 4 OR M.S /= IDENT_INT(4) THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - 8");
END IF;
RETURN IDENT_INT(1);
END M;
FUNCTION F1 IS NEW M(4);
BEGIN
IF L(INT) /= 4 OR F1 /= 1 THEN
FAILED ("INCORRECT RESULTS RETURNED FROM FUNCTION - 9");
END IF;
END;
-------------------------------------------------------------------
DECLARE
TASK L IS
ENTRY E (A : INTEGER);
END L;
TASK TYPE M IS
ENTRY E1 (A : INTEGER);
END M;
T1 : M;
TASK BODY L IS
X : INTEGER := IDENT_INT(1);
R : INTEGER RENAMES X;
Y : INTEGER := L.R;
BEGIN
X := X + L.R;
IF X /= IDENT_INT(2) OR Y /= IDENT_INT(1) THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - " &
"10");
END IF;
END L;
TASK BODY M IS
X : INTEGER := IDENT_INT(2);
R : INTEGER RENAMES X;
Y : INTEGER := M.R;
BEGIN
ACCEPT E1 (A : INTEGER) DO
X := X + M.R;
IF X /= IDENT_INT(4) OR Y /= IDENT_INT(2) THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED " &
"NAME - 11");
END IF;
IF E1.A /= IDENT_INT(3) THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED " &
"NAME - 12");
END IF;
END E1;
END M;
BEGIN
T1.E1 (3);
END;
-------------------------------------------------------------------
DECLARE
TASK T IS
ENTRY G (1..2) (A : INTEGER);
END T;
TASK BODY T IS
BEGIN
ACCEPT G (1) (A : INTEGER) DO
IF G.A /= IDENT_INT(2) THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED " &
"NAME - 13");
END IF;
BLK:
DECLARE
B : INTEGER := 7;
BEGIN
IF T.BLK.B /= IDENT_INT(7) THEN
FAILED ("INCORRECT RESULTS FROM " &
"EXPANDED NAME - 14");
END IF;
END BLK;
END G;
ACCEPT G (2) (A : INTEGER) DO
IF G.A /= IDENT_INT(1) THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED " &
"NAME - 15");
END IF;
END G;
END T;
BEGIN
T.G (1) (2);
T.G (2) (1);
END;
-------------------------------------------------------------------
SWAP:
DECLARE
VAR : CHARACTER := '*';
RENAME_VAR : CHARACTER RENAMES VAR;
NEW_VAR : CHARACTER;
BEGIN
IF EQUAL (3, 3) THEN
NEW_VAR := SWAP.RENAME_VAR;
END IF;
IF NEW_VAR /= IDENT_CHAR('*') THEN
FAILED ("INCORRECT RESULTS FROM EXPANDED NAME - " &
"16");
END IF;
LP: FOR I IN 1..2 LOOP
IF SWAP.LP.I = IDENT_INT(2) OR
LP.I = IDENT_INT(1) THEN
GOTO SWAP.LAB1;
END IF;
NEW_VAR := IDENT_CHAR('+');
<<LAB1>>
NEW_VAR := IDENT_CHAR('-');
END LOOP LP;
IF NEW_VAR /= IDENT_CHAR('-') THEN
FAILED ("INCORRECT RESULTS FROM FOR LOOP - 17");
END IF;
END SWAP;
RESULT;
END C41307D;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2017, Universidad Politécnica de Madrid --
-- --
-- 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. --
-- --
-------------------------------------------------------------------------------
-- Implementation of the user interface using GTK
with Gdk.Threads;
with Gtk.Main;
with Gtk.Window; use Gtk.Window;
with Gtk.Grid; use Gtk.Grid;
with Gtk.Enums; use Gtk.Enums;
with Gtk.Button; use Gtk.Button;
with Gtk.Label; use Gtk.Label;
with Gtk.Text_View; use Gtk.Text_View;
with Gtk.Text_Buffer; use Gtk.Text_Buffer;
with Gtk.Text_Iter; use Gtk.Text_Iter;
with Gtk.Scrolled_Window; use Gtk.Scrolled_Window;
with Gtk.Widget; use Gtk.Widget;
with Pango.Font; use Pango.Font;
with TC_Sender;
pragma Warnings(Off);
with System.IO;
pragma Warnings(On);
package body User_Interface is
----------------------
-- Graphic objects --
----------------------
Window : Gtk_Window;
Grid : Gtk_Grid;
Label : Gtk_Label;
Button : Gtk_Button;
Scrolled : Gtk_Scrolled_Window;
Text_Buffer : Gtk_Text_Buffer;
Text : Gtk_Text_View;
Iterator : Gtk_Text_Iter;
---------------
-- Callbacks --
---------------
-- quit GUI
procedure main_quit (Self : access Gtk_Widget_Record'Class) is
begin
Gtk.Main.Main_Quit;
end main_quit;
-- send a TC message
procedure button_clicked(Self : access Gtk_Button_Record'Class) is
begin
TC_Sender.Send;
end button_clicked;
----------
-- Init --
----------
procedure Init is
begin
-- use thread-aware gdk
Gdk.Threads.G_Init;
Gdk.Threads.Init;
Gtk.Main.Init;
-- create window
Gtk_New(Window);
Window.Set_Title("Toy Satellite Ground Station");
Window.Set_Border_Width (10);
Window.Set_Resizable (False);
Window.On_Destroy (main_quit'Access);
-- grid for placing widgets
Gtk_New (Grid);
Window.Add(Grid);
-- TM area
Gtk_New(Label, "Telemetry");
Grid.Attach(Label, 0, 0, 3, 1);
Gtk_New(Text_Buffer);
Gtk_New(Text, Text_Buffer);
Text.Set_Editable(False);
Text.Modify_Font(From_String("Menlo 14"));
Gtk_New(Scrolled);
Scrolled.Set_Policy(Policy_Automatic, Policy_Automatic);
Scrolled.Set_Size_Request(60,400);
Scrolled.Add(Text);
Grid.Attach(Scrolled, 0,1,3,12);
-- TC area
Gtk_New(Label, "Telecommands");
Grid.Attach(Label, 3, 0, 1, 1);
Gtk_New(Button, "Request HK");
Button.On_Clicked(button_clicked'Access);
Grid.Attach(Button, 3,1,1,1);
-- show window
Grid.Set_Column_Homogeneous(True);
Grid.Set_Column_Spacing(10);
Grid.Set_Row_Spacing(10);
Window.Show_All;
-- GTK main loop
Gdk.Threads.Enter;
Gtk.Main.Main;
Gdk.Threads.Leave;
end Init;
------------
-- Put_TM --
------------
procedure Put_TM (Message : String) is
begin
Gdk.Threads.Enter;
Text_Buffer.Insert_At_Cursor(" " & Message & ASCII.LF);
Text.Scroll_Mark_Onscreen(Text_Buffer.Get_Insert);
Text.Show;
Gdk.Threads.Leave;
end Put_TM;
end User_Interface;
|
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="15">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName></userIPName>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>jacobi2d_kernel</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>17</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>chan0bank0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>2</direction>
<if_type>4</if_type>
<array_size>0</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>chan0bank1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>2</direction>
<if_type>4</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_3">
<Value>
<Obj>
<type>1</type>
<id>3</id>
<name>chan0bank2</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>2</direction>
<if_type>4</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_4">
<Value>
<Obj>
<type>1</type>
<id>4</id>
<name>chan0bank3</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<direction>2</direction>
<if_type>4</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_5">
<Value>
<Obj>
<type>1</type>
<id>5</id>
<name>var_output_0_0_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_output_0_0.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_6">
<Value>
<Obj>
<type>1</type>
<id>6</id>
<name>var_output_0_1_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_output_0_1.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_7">
<Value>
<Obj>
<type>1</type>
<id>7</id>
<name>var_output_0_2_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_output_0_2.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_8">
<Value>
<Obj>
<type>1</type>
<id>8</id>
<name>var_output_0_3_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_output_0_3.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_9">
<Value>
<Obj>
<type>1</type>
<id>9</id>
<name>var_input_0_0_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_input_0_0.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_10">
<Value>
<Obj>
<type>1</type>
<id>10</id>
<name>var_input_0_1_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_input_0_1.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_11">
<Value>
<Obj>
<type>1</type>
<id>11</id>
<name>var_input_0_2_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_input_0_2.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_12">
<Value>
<Obj>
<type>1</type>
<id>12</id>
<name>var_input_0_3_V</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_input_0_3.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_13">
<Value>
<Obj>
<type>1</type>
<id>13</id>
<name>coalesced_data_num</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>coalesced_data_num</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_14">
<Value>
<Obj>
<type>1</type>
<id>14</id>
<name>tile_data_num</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>tile_data_num</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_15">
<Value>
<Obj>
<type>1</type>
<id>15</id>
<name>tile_num_dim_0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>tile_num_dim_0</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_16">
<Value>
<Obj>
<type>1</type>
<id>16</id>
<name>input_size_dim_0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>input_size_dim_0</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_17">
<Value>
<Obj>
<type>1</type>
<id>17</id>
<name>input_size_dim_1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>input_size_dim_1</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<direction>0</direction>
<if_type>0</if_type>
<array_size>0</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>45</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>18</id>
<name>coalesced_data_num_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>coalesced_data_num</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>144</item>
<item>145</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.00</m_delay>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>var_input_0_3_V_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_input_0_3.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>147</item>
<item>148</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.00</m_delay>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>20</id>
<name>var_input_0_2_V_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_input_0_2.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>149</item>
<item>150</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.00</m_delay>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>21</id>
<name>var_input_0_1_V_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_input_0_1.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>151</item>
<item>152</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.00</m_delay>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>var_input_0_0_V_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_input_0_0.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>153</item>
<item>154</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.00</m_delay>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name>var_output_0_3_V_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_output_0_3.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>155</item>
<item>156</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.00</m_delay>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>var_output_0_2_V_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_output_0_2.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>157</item>
<item>158</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.00</m_delay>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>var_output_0_1_V_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_output_0_1.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>159</item>
<item>160</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.00</m_delay>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>var_output_0_0_V_read</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>var_output_0_0.V</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>161</item>
<item>162</item>
</oprand_edges>
<opcode>read</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.00</m_delay>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>var_input_0_3_V_c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>164</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name>var_input_0_2_V_c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>165</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>29</id>
<name>var_input_0_1_V_c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>166</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>30</id>
<name>var_input_0_0_V_c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>167</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>31</id>
<name>var_output_0_3_V_c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>168</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name>var_output_0_2_V_c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>169</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name>var_output_0_1_V_c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>170</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name>var_output_0_0_V_c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>32</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>171</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name>coalesced_data_num_c19</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>172</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>40</id>
<name>coalesced_data_num_c18</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>173</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name>coalesced_data_num_c17</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>174</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>42</id>
<name>coalesced_data_num_c16</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>175</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>43</id>
<name>coalesced_data_num_c15</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>176</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>44</id>
<name>coalesced_data_num_c14</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>177</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name>coalesced_data_num_c13</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>178</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>46</id>
<name>coalesced_data_num_c12</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>179</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name>coalesced_data_num_c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>180</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name>input_stream_0_0_V_V</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9700</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="11" tracking_level="0" version="0">
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second class_id="12" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="13" tracking_level="0" version="0">
<first class_id="14" tracking_level="0" version="0">
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9700</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>input_stream_0_0.V.V</originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>181</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>58</id>
<name>input_stream_0_1_V_V</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9701</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9701</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>input_stream_0_1.V.V</originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>182</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_46">
<Value>
<Obj>
<type>0</type>
<id>61</id>
<name>input_stream_0_2_V_V</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9702</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9702</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>input_stream_0_2.V.V</originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>183</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_47">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name>input_stream_0_3_V_V</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9703</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9703</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>input_stream_0_3.V.V</originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>184</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_48">
<Value>
<Obj>
<type>0</type>
<id>67</id>
<name>output_stream_0_0_V_V</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9704</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9704</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>output_stream_0_0.V.V</originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>185</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_49">
<Value>
<Obj>
<type>0</type>
<id>70</id>
<name>output_stream_0_1_V_V</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9705</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9705</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>output_stream_0_1.V.V</originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>186</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_50">
<Value>
<Obj>
<type>0</type>
<id>73</id>
<name>output_stream_0_2_V_V</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9706</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9706</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>output_stream_0_2.V.V</originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>187</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_51">
<Value>
<Obj>
<type>0</type>
<id>76</id>
<name>output_stream_0_3_V_V</name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9707</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9707</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>output_stream_0_3.V.V</originalName>
<rtlName></rtlName>
<coreName>FIFO</coreName>
</Obj>
<bitwidth>512</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>188</item>
</oprand_edges>
<opcode>alloca</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_52">
<Value>
<Obj>
<type>0</type>
<id>121</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>22</count>
<item_version>0</item_version>
<item>190</item>
<item>191</item>
<item>192</item>
<item>193</item>
<item>194</item>
<item>195</item>
<item>196</item>
<item>197</item>
<item>198</item>
<item>199</item>
<item>200</item>
<item>201</item>
<item>202</item>
<item>203</item>
<item>204</item>
<item>205</item>
<item>206</item>
<item>207</item>
<item>208</item>
<item>209</item>
<item>210</item>
<item>211</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>1.21</m_delay>
</item>
<item class_id_reference="9" object_id="_53">
<Value>
<Obj>
<type>0</type>
<id>124</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>8</count>
<item_version>0</item_version>
<item>213</item>
<item>214</item>
<item>215</item>
<item>216</item>
<item>217</item>
<item>218</item>
<item>1488</item>
<item>1492</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_54">
<Value>
<Obj>
<type>0</type>
<id>125</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>220</item>
<item>221</item>
<item>222</item>
<item>223</item>
<item>224</item>
<item>1489</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_55">
<Value>
<Obj>
<type>0</type>
<id>126</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>226</item>
<item>227</item>
<item>228</item>
<item>229</item>
<item>230</item>
<item>1490</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_56">
<Value>
<Obj>
<type>0</type>
<id>127</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>232</item>
<item>233</item>
<item>234</item>
<item>235</item>
<item>236</item>
<item>1491</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_57">
<Value>
<Obj>
<type>0</type>
<id>136</id>
<name></name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9722</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9722</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>19</count>
<item_version>0</item_version>
<item>238</item>
<item>239</item>
<item>240</item>
<item>241</item>
<item>242</item>
<item>243</item>
<item>244</item>
<item>245</item>
<item>246</item>
<item>247</item>
<item>248</item>
<item>249</item>
<item>250</item>
<item>251</item>
<item>1484</item>
<item>1485</item>
<item>1486</item>
<item>1487</item>
<item>1493</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_58">
<Value>
<Obj>
<type>0</type>
<id>137</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>7</count>
<item_version>0</item_version>
<item>253</item>
<item>254</item>
<item>255</item>
<item>256</item>
<item>257</item>
<item>1480</item>
<item>1494</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_59">
<Value>
<Obj>
<type>0</type>
<id>138</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>259</item>
<item>260</item>
<item>261</item>
<item>262</item>
<item>263</item>
<item>1481</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_60">
<Value>
<Obj>
<type>0</type>
<id>139</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>265</item>
<item>266</item>
<item>267</item>
<item>268</item>
<item>269</item>
<item>1482</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_61">
<Value>
<Obj>
<type>0</type>
<id>140</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>6</count>
<item_version>0</item_version>
<item>271</item>
<item>272</item>
<item>273</item>
<item>274</item>
<item>275</item>
<item>1483</item>
</oprand_edges>
<opcode>call</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
<item class_id_reference="9" object_id="_62">
<Value>
<Obj>
<type>0</type>
<id>141</id>
<name></name>
<fileName>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</fileName>
<fileDirectory>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</fileDirectory>
<lineNumber>9727</lineNumber>
<contextFuncName>jacobi2d_kernel</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/einsx7/broadcast/vivado-hls-broadcast-optimization/ctrl_broadcast/eg2_stencil_computation/optimize</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>non_blocking_jacobi2d_kernel-tile8000-unroll64-4ddr-iterate8.cpp</first>
<second>jacobi2d_kernel</second>
</first>
<second>9727</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
<m_isOnCriticalPath>0</m_isOnCriticalPath>
<m_isLCDNode>0</m_isLCDNode>
<m_delay>0.00</m_delay>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>11</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_63">
<Value>
<Obj>
<type>2</type>
<id>163</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_64">
<Value>
<Obj>
<type>2</type>
<id>189</id>
<name>jacobi2d_kernel_entry118311</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:jacobi2d_kernel.entry118311></content>
</item>
<item class_id_reference="16" object_id="_65">
<Value>
<Obj>
<type>2</type>
<id>212</id>
<name>load35</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:load35></content>
</item>
<item class_id_reference="16" object_id="_66">
<Value>
<Obj>
<type>2</type>
<id>219</id>
<name>load36</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:load36></content>
</item>
<item class_id_reference="16" object_id="_67">
<Value>
<Obj>
<type>2</type>
<id>225</id>
<name>load37</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:load37></content>
</item>
<item class_id_reference="16" object_id="_68">
<Value>
<Obj>
<type>2</type>
<id>231</id>
<name>load</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:load></content>
</item>
<item class_id_reference="16" object_id="_69">
<Value>
<Obj>
<type>2</type>
<id>237</id>
<name>compute</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:compute></content>
</item>
<item class_id_reference="16" object_id="_70">
<Value>
<Obj>
<type>2</type>
<id>252</id>
<name>store38</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:store38></content>
</item>
<item class_id_reference="16" object_id="_71">
<Value>
<Obj>
<type>2</type>
<id>258</id>
<name>store39</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:store39></content>
</item>
<item class_id_reference="16" object_id="_72">
<Value>
<Obj>
<type>2</type>
<id>264</id>
<name>store40</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:store40></content>
</item>
<item class_id_reference="16" object_id="_73">
<Value>
<Obj>
<type>2</type>
<id>270</id>
<name>store</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<const_type>6</const_type>
<content><constant:store></content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_74">
<Obj>
<type>3</type>
<id>142</id>
<name>jacobi2d_kernel</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>45</count>
<item_version>0</item_version>
<item>18</item>
<item>19</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
<item>34</item>
<item>39</item>
<item>40</item>
<item>41</item>
<item>42</item>
<item>43</item>
<item>44</item>
<item>45</item>
<item>46</item>
<item>47</item>
<item>55</item>
<item>58</item>
<item>61</item>
<item>64</item>
<item>67</item>
<item>70</item>
<item>73</item>
<item>76</item>
<item>121</item>
<item>124</item>
<item>125</item>
<item>126</item>
<item>127</item>
<item>136</item>
<item>137</item>
<item>138</item>
<item>139</item>
<item>140</item>
<item>141</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>126</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_75">
<id>145</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>18</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_76">
<id>148</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>19</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_77">
<id>150</id>
<edge_type>1</edge_type>
<source_obj>11</source_obj>
<sink_obj>20</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_78">
<id>152</id>
<edge_type>1</edge_type>
<source_obj>10</source_obj>
<sink_obj>21</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_79">
<id>154</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>22</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_80">
<id>156</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>23</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_81">
<id>158</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>24</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_82">
<id>160</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>25</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_83">
<id>162</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>26</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_84">
<id>164</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>27</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_85">
<id>165</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>28</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_86">
<id>166</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>29</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_87">
<id>167</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>30</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_88">
<id>168</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>31</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_89">
<id>169</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>32</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_90">
<id>170</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>33</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_91">
<id>171</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>34</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_92">
<id>172</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>39</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_93">
<id>173</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>40</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_94">
<id>174</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>41</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_95">
<id>175</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>42</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_96">
<id>176</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>43</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_97">
<id>177</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>44</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_98">
<id>178</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>45</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_99">
<id>179</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>46</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_100">
<id>180</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>47</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_101">
<id>181</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>55</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_102">
<id>182</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>58</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_103">
<id>183</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>61</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_104">
<id>184</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>64</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_105">
<id>185</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>67</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_106">
<id>186</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>70</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_107">
<id>187</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>73</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_108">
<id>188</id>
<edge_type>1</edge_type>
<source_obj>163</source_obj>
<sink_obj>76</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_109">
<id>190</id>
<edge_type>1</edge_type>
<source_obj>189</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_110">
<id>191</id>
<edge_type>1</edge_type>
<source_obj>18</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_111">
<id>192</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_112">
<id>193</id>
<edge_type>1</edge_type>
<source_obj>46</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_113">
<id>194</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_114">
<id>195</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_115">
<id>196</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_116">
<id>197</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_117">
<id>198</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_118">
<id>199</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_119">
<id>200</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_120">
<id>201</id>
<edge_type>1</edge_type>
<source_obj>21</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_121">
<id>202</id>
<edge_type>1</edge_type>
<source_obj>20</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_122">
<id>203</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_123">
<id>204</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_124">
<id>205</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_125">
<id>206</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_126">
<id>207</id>
<edge_type>1</edge_type>
<source_obj>31</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_127">
<id>208</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_128">
<id>209</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_129">
<id>210</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_130">
<id>211</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>121</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_131">
<id>213</id>
<edge_type>1</edge_type>
<source_obj>212</source_obj>
<sink_obj>124</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_132">
<id>214</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>124</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_133">
<id>215</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>124</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_134">
<id>216</id>
<edge_type>1</edge_type>
<source_obj>30</source_obj>
<sink_obj>124</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_135">
<id>217</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>124</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_136">
<id>218</id>
<edge_type>1</edge_type>
<source_obj>43</source_obj>
<sink_obj>124</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_137">
<id>220</id>
<edge_type>1</edge_type>
<source_obj>219</source_obj>
<sink_obj>125</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_138">
<id>221</id>
<edge_type>1</edge_type>
<source_obj>58</source_obj>
<sink_obj>125</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_139">
<id>222</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>125</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_140">
<id>223</id>
<edge_type>1</edge_type>
<source_obj>29</source_obj>
<sink_obj>125</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_141">
<id>224</id>
<edge_type>1</edge_type>
<source_obj>46</source_obj>
<sink_obj>125</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_142">
<id>226</id>
<edge_type>1</edge_type>
<source_obj>225</source_obj>
<sink_obj>126</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_143">
<id>227</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>126</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_144">
<id>228</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>126</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_145">
<id>229</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>126</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_146">
<id>230</id>
<edge_type>1</edge_type>
<source_obj>45</source_obj>
<sink_obj>126</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_147">
<id>232</id>
<edge_type>1</edge_type>
<source_obj>231</source_obj>
<sink_obj>127</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_148">
<id>233</id>
<edge_type>1</edge_type>
<source_obj>64</source_obj>
<sink_obj>127</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_149">
<id>234</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>127</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_150">
<id>235</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>127</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_151">
<id>236</id>
<edge_type>1</edge_type>
<source_obj>44</source_obj>
<sink_obj>127</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_152">
<id>238</id>
<edge_type>1</edge_type>
<source_obj>237</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_153">
<id>239</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_154">
<id>240</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_155">
<id>241</id>
<edge_type>1</edge_type>
<source_obj>73</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_156">
<id>242</id>
<edge_type>1</edge_type>
<source_obj>76</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_157">
<id>243</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_158">
<id>244</id>
<edge_type>1</edge_type>
<source_obj>58</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_159">
<id>245</id>
<edge_type>1</edge_type>
<source_obj>61</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_160">
<id>246</id>
<edge_type>1</edge_type>
<source_obj>64</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_161">
<id>247</id>
<edge_type>1</edge_type>
<source_obj>43</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_162">
<id>248</id>
<edge_type>1</edge_type>
<source_obj>42</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_163">
<id>249</id>
<edge_type>1</edge_type>
<source_obj>41</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_164">
<id>250</id>
<edge_type>1</edge_type>
<source_obj>40</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_165">
<id>251</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_166">
<id>253</id>
<edge_type>1</edge_type>
<source_obj>252</source_obj>
<sink_obj>137</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_167">
<id>254</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>137</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_168">
<id>255</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>137</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_169">
<id>256</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>137</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_170">
<id>257</id>
<edge_type>1</edge_type>
<source_obj>42</source_obj>
<sink_obj>137</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_171">
<id>259</id>
<edge_type>1</edge_type>
<source_obj>258</source_obj>
<sink_obj>138</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_172">
<id>260</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>138</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_173">
<id>261</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>138</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_174">
<id>262</id>
<edge_type>1</edge_type>
<source_obj>70</source_obj>
<sink_obj>138</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_175">
<id>263</id>
<edge_type>1</edge_type>
<source_obj>41</source_obj>
<sink_obj>138</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_176">
<id>265</id>
<edge_type>1</edge_type>
<source_obj>264</source_obj>
<sink_obj>139</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_177">
<id>266</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>139</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_178">
<id>267</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>139</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_179">
<id>268</id>
<edge_type>1</edge_type>
<source_obj>73</source_obj>
<sink_obj>139</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_180">
<id>269</id>
<edge_type>1</edge_type>
<source_obj>40</source_obj>
<sink_obj>139</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_181">
<id>271</id>
<edge_type>1</edge_type>
<source_obj>270</source_obj>
<sink_obj>140</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_182">
<id>272</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>140</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_183">
<id>273</id>
<edge_type>1</edge_type>
<source_obj>31</source_obj>
<sink_obj>140</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_184">
<id>274</id>
<edge_type>1</edge_type>
<source_obj>76</source_obj>
<sink_obj>140</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_185">
<id>275</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>140</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_186">
<id>1480</id>
<edge_type>4</edge_type>
<source_obj>136</source_obj>
<sink_obj>137</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_187">
<id>1481</id>
<edge_type>4</edge_type>
<source_obj>136</source_obj>
<sink_obj>138</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_188">
<id>1482</id>
<edge_type>4</edge_type>
<source_obj>136</source_obj>
<sink_obj>139</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_189">
<id>1483</id>
<edge_type>4</edge_type>
<source_obj>136</source_obj>
<sink_obj>140</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_190">
<id>1484</id>
<edge_type>4</edge_type>
<source_obj>127</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_191">
<id>1485</id>
<edge_type>4</edge_type>
<source_obj>126</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_192">
<id>1486</id>
<edge_type>4</edge_type>
<source_obj>125</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_193">
<id>1487</id>
<edge_type>4</edge_type>
<source_obj>124</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_194">
<id>1488</id>
<edge_type>4</edge_type>
<source_obj>121</source_obj>
<sink_obj>124</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_195">
<id>1489</id>
<edge_type>4</edge_type>
<source_obj>121</source_obj>
<sink_obj>125</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_196">
<id>1490</id>
<edge_type>4</edge_type>
<source_obj>121</source_obj>
<sink_obj>126</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_197">
<id>1491</id>
<edge_type>4</edge_type>
<source_obj>121</source_obj>
<sink_obj>127</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_198">
<id>1492</id>
<edge_type>4</edge_type>
<source_obj>121</source_obj>
<sink_obj>124</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_199">
<id>1493</id>
<edge_type>4</edge_type>
<source_obj>124</source_obj>
<sink_obj>136</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
<item class_id_reference="20" object_id="_200">
<id>1494</id>
<edge_type>4</edge_type>
<source_obj>136</source_obj>
<sink_obj>137</sink_obj>
<is_back_edge>0</is_back_edge>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_201">
<mId>1</mId>
<mTag>jacobi2d_kernel</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>142</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>-1</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>1</mIsDfPipe>
<mDfPipe class_id="23" tracking_level="1" version="0" object_id="_202">
<port_list class_id="24" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port_list>
<process_list class_id="25" tracking_level="0" version="0">
<count>10</count>
<item_version>0</item_version>
<item class_id="26" tracking_level="1" version="0" object_id="_203">
<type>0</type>
<name>jacobi2d_kernel_entry118311_U0</name>
<ssdmobj_id>121</ssdmobj_id>
<pins class_id="27" tracking_level="0" version="0">
<count>21</count>
<item_version>0</item_version>
<item class_id="28" tracking_level="1" version="0" object_id="_204">
<port class_id="29" tracking_level="1" version="0" object_id="_205">
<name>coalesced_data_num</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id="30" tracking_level="1" version="0" object_id="_206">
<type>0</type>
<name>jacobi2d_kernel_entry118311_U0</name>
<ssdmobj_id>121</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_207">
<port class_id_reference="29" object_id="_208">
<name>coalesced_data_num_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_209">
<port class_id_reference="29" object_id="_210">
<name>coalesced_data_num_out1</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_211">
<port class_id_reference="29" object_id="_212">
<name>coalesced_data_num_out2</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_213">
<port class_id_reference="29" object_id="_214">
<name>coalesced_data_num_out3</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_215">
<port class_id_reference="29" object_id="_216">
<name>var_output_0_0_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_217">
<port class_id_reference="29" object_id="_218">
<name>var_output_0_1_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_219">
<port class_id_reference="29" object_id="_220">
<name>var_output_0_2_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_221">
<port class_id_reference="29" object_id="_222">
<name>var_output_0_3_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_223">
<port class_id_reference="29" object_id="_224">
<name>var_input_0_0_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_225">
<port class_id_reference="29" object_id="_226">
<name>var_input_0_1_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_227">
<port class_id_reference="29" object_id="_228">
<name>var_input_0_2_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_229">
<port class_id_reference="29" object_id="_230">
<name>var_input_0_3_V</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_231">
<port class_id_reference="29" object_id="_232">
<name>var_output_0_0_V_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_233">
<port class_id_reference="29" object_id="_234">
<name>var_output_0_1_V_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_235">
<port class_id_reference="29" object_id="_236">
<name>var_output_0_2_V_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_237">
<port class_id_reference="29" object_id="_238">
<name>var_output_0_3_V_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_239">
<port class_id_reference="29" object_id="_240">
<name>var_input_0_0_V_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_241">
<port class_id_reference="29" object_id="_242">
<name>var_input_0_1_V_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_243">
<port class_id_reference="29" object_id="_244">
<name>var_input_0_2_V_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
<item class_id_reference="28" object_id="_245">
<port class_id_reference="29" object_id="_246">
<name>var_input_0_3_V_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_247">
<type>0</type>
<name>load35_U0</name>
<ssdmobj_id>124</ssdmobj_id>
<pins>
<count>5</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_248">
<port class_id_reference="29" object_id="_249">
<name>input_stream_0_0_V_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id="_250">
<type>0</type>
<name>load35_U0</name>
<ssdmobj_id>124</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_251">
<port class_id_reference="29" object_id="_252">
<name>var_input_0_0_V</name>
<dir>1</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_250"></inst>
</item>
<item class_id_reference="28" object_id="_253">
<port class_id_reference="29" object_id="_254">
<name>var_input_0_0_V_offset</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_250"></inst>
</item>
<item class_id_reference="28" object_id="_255">
<port class_id_reference="29" object_id="_256">
<name>coalesced_data_num</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_250"></inst>
</item>
<item class_id_reference="28" object_id="_257">
<port class_id_reference="29" object_id="_258">
<name>coalesced_data_num_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_250"></inst>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_259">
<type>0</type>
<name>load36_U0</name>
<ssdmobj_id>125</ssdmobj_id>
<pins>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_260">
<port class_id_reference="29" object_id="_261">
<name>input_stream_0_1_V_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id="_262">
<type>0</type>
<name>load36_U0</name>
<ssdmobj_id>125</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_263">
<port class_id_reference="29" object_id="_264">
<name>var_input_0_1_V</name>
<dir>1</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_262"></inst>
</item>
<item class_id_reference="28" object_id="_265">
<port class_id_reference="29" object_id="_266">
<name>var_input_0_1_V_offset</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_262"></inst>
</item>
<item class_id_reference="28" object_id="_267">
<port class_id_reference="29" object_id="_268">
<name>coalesced_data_num</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_262"></inst>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_269">
<type>0</type>
<name>load37_U0</name>
<ssdmobj_id>126</ssdmobj_id>
<pins>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_270">
<port class_id_reference="29" object_id="_271">
<name>input_stream_0_2_V_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id="_272">
<type>0</type>
<name>load37_U0</name>
<ssdmobj_id>126</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_273">
<port class_id_reference="29" object_id="_274">
<name>var_input_0_2_V</name>
<dir>1</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_272"></inst>
</item>
<item class_id_reference="28" object_id="_275">
<port class_id_reference="29" object_id="_276">
<name>var_input_0_2_V_offset</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_272"></inst>
</item>
<item class_id_reference="28" object_id="_277">
<port class_id_reference="29" object_id="_278">
<name>coalesced_data_num</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_272"></inst>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_279">
<type>0</type>
<name>load_U0</name>
<ssdmobj_id>127</ssdmobj_id>
<pins>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_280">
<port class_id_reference="29" object_id="_281">
<name>to_V_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id="_282">
<type>0</type>
<name>load_U0</name>
<ssdmobj_id>127</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_283">
<port class_id_reference="29" object_id="_284">
<name>from_V</name>
<dir>1</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_282"></inst>
</item>
<item class_id_reference="28" object_id="_285">
<port class_id_reference="29" object_id="_286">
<name>from_V_offset</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_282"></inst>
</item>
<item class_id_reference="28" object_id="_287">
<port class_id_reference="29" object_id="_288">
<name>coalesced_data_num</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_282"></inst>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_289">
<type>0</type>
<name>compute_U0</name>
<ssdmobj_id>136</ssdmobj_id>
<pins>
<count>13</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_290">
<port class_id_reference="29" object_id="_291">
<name>to_chan_0_bank_0_V_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id="_292">
<type>0</type>
<name>compute_U0</name>
<ssdmobj_id>136</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_293">
<port class_id_reference="29" object_id="_294">
<name>to_chan_0_bank_1_V_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_295">
<port class_id_reference="29" object_id="_296">
<name>to_chan_0_bank_2_V_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_297">
<port class_id_reference="29" object_id="_298">
<name>to_chan_0_bank_3_V_V</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_299">
<port class_id_reference="29" object_id="_300">
<name>from_chan_0_bank_0_V_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_301">
<port class_id_reference="29" object_id="_302">
<name>from_chan_0_bank_1_V_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_303">
<port class_id_reference="29" object_id="_304">
<name>from_chan_0_bank_2_V_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_305">
<port class_id_reference="29" object_id="_306">
<name>from_chan_0_bank_3_V_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_307">
<port class_id_reference="29" object_id="_308">
<name>coalesced_data_num</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_309">
<port class_id_reference="29" object_id="_310">
<name>coalesced_data_num_out</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_311">
<port class_id_reference="29" object_id="_312">
<name>coalesced_data_num_out1</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_313">
<port class_id_reference="29" object_id="_314">
<name>coalesced_data_num_out2</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
<item class_id_reference="28" object_id="_315">
<port class_id_reference="29" object_id="_316">
<name>coalesced_data_num_out3</name>
<dir>0</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_317">
<type>0</type>
<name>store38_U0</name>
<ssdmobj_id>137</ssdmobj_id>
<pins>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_318">
<port class_id_reference="29" object_id="_319">
<name>var_output_0_0_V</name>
<dir>1</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id="_320">
<type>0</type>
<name>store38_U0</name>
<ssdmobj_id>137</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_321">
<port class_id_reference="29" object_id="_322">
<name>var_output_0_0_V_offset</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_320"></inst>
</item>
<item class_id_reference="28" object_id="_323">
<port class_id_reference="29" object_id="_324">
<name>output_stream_0_0_V_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_320"></inst>
</item>
<item class_id_reference="28" object_id="_325">
<port class_id_reference="29" object_id="_326">
<name>coalesced_data_num</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_320"></inst>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_327">
<type>0</type>
<name>store39_U0</name>
<ssdmobj_id>138</ssdmobj_id>
<pins>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_328">
<port class_id_reference="29" object_id="_329">
<name>var_output_0_1_V</name>
<dir>1</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id="_330">
<type>0</type>
<name>store39_U0</name>
<ssdmobj_id>138</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_331">
<port class_id_reference="29" object_id="_332">
<name>var_output_0_1_V_offset</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_330"></inst>
</item>
<item class_id_reference="28" object_id="_333">
<port class_id_reference="29" object_id="_334">
<name>output_stream_0_1_V_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_330"></inst>
</item>
<item class_id_reference="28" object_id="_335">
<port class_id_reference="29" object_id="_336">
<name>coalesced_data_num</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_330"></inst>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_337">
<type>0</type>
<name>store40_U0</name>
<ssdmobj_id>139</ssdmobj_id>
<pins>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_338">
<port class_id_reference="29" object_id="_339">
<name>var_output_0_2_V</name>
<dir>1</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id="_340">
<type>0</type>
<name>store40_U0</name>
<ssdmobj_id>139</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_341">
<port class_id_reference="29" object_id="_342">
<name>var_output_0_2_V_offset</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_340"></inst>
</item>
<item class_id_reference="28" object_id="_343">
<port class_id_reference="29" object_id="_344">
<name>output_stream_0_2_V_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_340"></inst>
</item>
<item class_id_reference="28" object_id="_345">
<port class_id_reference="29" object_id="_346">
<name>coalesced_data_num</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_340"></inst>
</item>
</pins>
</item>
<item class_id_reference="26" object_id="_347">
<type>0</type>
<name>store_U0</name>
<ssdmobj_id>140</ssdmobj_id>
<pins>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="28" object_id="_348">
<port class_id_reference="29" object_id="_349">
<name>to_V</name>
<dir>1</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id="_350">
<type>0</type>
<name>store_U0</name>
<ssdmobj_id>140</ssdmobj_id>
</inst>
</item>
<item class_id_reference="28" object_id="_351">
<port class_id_reference="29" object_id="_352">
<name>to_V_offset</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_350"></inst>
</item>
<item class_id_reference="28" object_id="_353">
<port class_id_reference="29" object_id="_354">
<name>from_V_V</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_350"></inst>
</item>
<item class_id_reference="28" object_id="_355">
<port class_id_reference="29" object_id="_356">
<name>coalesced_data_num</name>
<dir>0</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_350"></inst>
</item>
</pins>
</item>
</process_list>
<channel_list class_id="31" tracking_level="0" version="0">
<count>25</count>
<item_version>0</item_version>
<item class_id="32" tracking_level="1" version="0" object_id="_357">
<type>1</type>
<name>coalesced_data_num_c</name>
<ssdmobj_id>47</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>64</bitwidth>
<source class_id_reference="28" object_id="_358">
<port class_id_reference="29" object_id="_359">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_360">
<port class_id_reference="29" object_id="_361">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_250"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_362">
<type>1</type>
<name>coalesced_data_num_c12</name>
<ssdmobj_id>46</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>64</bitwidth>
<source class_id_reference="28" object_id="_363">
<port class_id_reference="29" object_id="_364">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_365">
<port class_id_reference="29" object_id="_366">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_262"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_367">
<type>1</type>
<name>coalesced_data_num_c13</name>
<ssdmobj_id>45</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>64</bitwidth>
<source class_id_reference="28" object_id="_368">
<port class_id_reference="29" object_id="_369">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_370">
<port class_id_reference="29" object_id="_371">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_272"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_372">
<type>1</type>
<name>coalesced_data_num_c14</name>
<ssdmobj_id>44</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>64</bitwidth>
<source class_id_reference="28" object_id="_373">
<port class_id_reference="29" object_id="_374">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_375">
<port class_id_reference="29" object_id="_376">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_282"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_377">
<type>1</type>
<name>var_output_0_0_V_c</name>
<ssdmobj_id>34</ssdmobj_id>
<ctype>0</ctype>
<depth>4</depth>
<bitwidth>32</bitwidth>
<source class_id_reference="28" object_id="_378">
<port class_id_reference="29" object_id="_379">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_380">
<port class_id_reference="29" object_id="_381">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_320"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_382">
<type>1</type>
<name>var_output_0_1_V_c</name>
<ssdmobj_id>33</ssdmobj_id>
<ctype>0</ctype>
<depth>4</depth>
<bitwidth>32</bitwidth>
<source class_id_reference="28" object_id="_383">
<port class_id_reference="29" object_id="_384">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_385">
<port class_id_reference="29" object_id="_386">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_330"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_387">
<type>1</type>
<name>var_output_0_2_V_c</name>
<ssdmobj_id>32</ssdmobj_id>
<ctype>0</ctype>
<depth>4</depth>
<bitwidth>32</bitwidth>
<source class_id_reference="28" object_id="_388">
<port class_id_reference="29" object_id="_389">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_390">
<port class_id_reference="29" object_id="_391">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_340"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_392">
<type>1</type>
<name>var_output_0_3_V_c</name>
<ssdmobj_id>31</ssdmobj_id>
<ctype>0</ctype>
<depth>4</depth>
<bitwidth>32</bitwidth>
<source class_id_reference="28" object_id="_393">
<port class_id_reference="29" object_id="_394">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_395">
<port class_id_reference="29" object_id="_396">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_350"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_397">
<type>1</type>
<name>var_input_0_0_V_c</name>
<ssdmobj_id>30</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>32</bitwidth>
<source class_id_reference="28" object_id="_398">
<port class_id_reference="29" object_id="_399">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_400">
<port class_id_reference="29" object_id="_401">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_250"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_402">
<type>1</type>
<name>var_input_0_1_V_c</name>
<ssdmobj_id>29</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>32</bitwidth>
<source class_id_reference="28" object_id="_403">
<port class_id_reference="29" object_id="_404">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_405">
<port class_id_reference="29" object_id="_406">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_262"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_407">
<type>1</type>
<name>var_input_0_2_V_c</name>
<ssdmobj_id>28</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>32</bitwidth>
<source class_id_reference="28" object_id="_408">
<port class_id_reference="29" object_id="_409">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_410">
<port class_id_reference="29" object_id="_411">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_272"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_412">
<type>1</type>
<name>var_input_0_3_V_c</name>
<ssdmobj_id>27</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>32</bitwidth>
<source class_id_reference="28" object_id="_413">
<port class_id_reference="29" object_id="_414">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_206"></inst>
</source>
<sink class_id_reference="28" object_id="_415">
<port class_id_reference="29" object_id="_416">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_282"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_417">
<type>1</type>
<name>input_stream_0_0_V_V</name>
<ssdmobj_id>55</ssdmobj_id>
<ctype>0</ctype>
<depth>32</depth>
<bitwidth>512</bitwidth>
<source class_id_reference="28" object_id="_418">
<port class_id_reference="29" object_id="_419">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_250"></inst>
</source>
<sink class_id_reference="28" object_id="_420">
<port class_id_reference="29" object_id="_421">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_422">
<type>1</type>
<name>coalesced_data_num_c15</name>
<ssdmobj_id>43</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>64</bitwidth>
<source class_id_reference="28" object_id="_423">
<port class_id_reference="29" object_id="_424">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_250"></inst>
</source>
<sink class_id_reference="28" object_id="_425">
<port class_id_reference="29" object_id="_426">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_427">
<type>1</type>
<name>input_stream_0_1_V_V</name>
<ssdmobj_id>58</ssdmobj_id>
<ctype>0</ctype>
<depth>32</depth>
<bitwidth>512</bitwidth>
<source class_id_reference="28" object_id="_428">
<port class_id_reference="29" object_id="_429">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_262"></inst>
</source>
<sink class_id_reference="28" object_id="_430">
<port class_id_reference="29" object_id="_431">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_432">
<type>1</type>
<name>input_stream_0_2_V_V</name>
<ssdmobj_id>61</ssdmobj_id>
<ctype>0</ctype>
<depth>32</depth>
<bitwidth>512</bitwidth>
<source class_id_reference="28" object_id="_433">
<port class_id_reference="29" object_id="_434">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_272"></inst>
</source>
<sink class_id_reference="28" object_id="_435">
<port class_id_reference="29" object_id="_436">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_437">
<type>1</type>
<name>input_stream_0_3_V_V</name>
<ssdmobj_id>64</ssdmobj_id>
<ctype>0</ctype>
<depth>32</depth>
<bitwidth>512</bitwidth>
<source class_id_reference="28" object_id="_438">
<port class_id_reference="29" object_id="_439">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_282"></inst>
</source>
<sink class_id_reference="28" object_id="_440">
<port class_id_reference="29" object_id="_441">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_442">
<type>1</type>
<name>output_stream_0_0_V_V</name>
<ssdmobj_id>67</ssdmobj_id>
<ctype>0</ctype>
<depth>32</depth>
<bitwidth>512</bitwidth>
<source class_id_reference="28" object_id="_443">
<port class_id_reference="29" object_id="_444">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</source>
<sink class_id_reference="28" object_id="_445">
<port class_id_reference="29" object_id="_446">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_320"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_447">
<type>1</type>
<name>output_stream_0_1_V_V</name>
<ssdmobj_id>70</ssdmobj_id>
<ctype>0</ctype>
<depth>32</depth>
<bitwidth>512</bitwidth>
<source class_id_reference="28" object_id="_448">
<port class_id_reference="29" object_id="_449">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</source>
<sink class_id_reference="28" object_id="_450">
<port class_id_reference="29" object_id="_451">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_330"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_452">
<type>1</type>
<name>output_stream_0_2_V_V</name>
<ssdmobj_id>73</ssdmobj_id>
<ctype>0</ctype>
<depth>32</depth>
<bitwidth>512</bitwidth>
<source class_id_reference="28" object_id="_453">
<port class_id_reference="29" object_id="_454">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</source>
<sink class_id_reference="28" object_id="_455">
<port class_id_reference="29" object_id="_456">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_340"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_457">
<type>1</type>
<name>output_stream_0_3_V_V</name>
<ssdmobj_id>76</ssdmobj_id>
<ctype>0</ctype>
<depth>32</depth>
<bitwidth>512</bitwidth>
<source class_id_reference="28" object_id="_458">
<port class_id_reference="29" object_id="_459">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</source>
<sink class_id_reference="28" object_id="_460">
<port class_id_reference="29" object_id="_461">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_350"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_462">
<type>1</type>
<name>coalesced_data_num_c16</name>
<ssdmobj_id>42</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>64</bitwidth>
<source class_id_reference="28" object_id="_463">
<port class_id_reference="29" object_id="_464">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</source>
<sink class_id_reference="28" object_id="_465">
<port class_id_reference="29" object_id="_466">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_320"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_467">
<type>1</type>
<name>coalesced_data_num_c17</name>
<ssdmobj_id>41</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>64</bitwidth>
<source class_id_reference="28" object_id="_468">
<port class_id_reference="29" object_id="_469">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</source>
<sink class_id_reference="28" object_id="_470">
<port class_id_reference="29" object_id="_471">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_330"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_472">
<type>1</type>
<name>coalesced_data_num_c18</name>
<ssdmobj_id>40</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>64</bitwidth>
<source class_id_reference="28" object_id="_473">
<port class_id_reference="29" object_id="_474">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</source>
<sink class_id_reference="28" object_id="_475">
<port class_id_reference="29" object_id="_476">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_340"></inst>
</sink>
</item>
<item class_id_reference="32" object_id="_477">
<type>1</type>
<name>coalesced_data_num_c19</name>
<ssdmobj_id>39</ssdmobj_id>
<ctype>0</ctype>
<depth>2</depth>
<bitwidth>64</bitwidth>
<source class_id_reference="28" object_id="_478">
<port class_id_reference="29" object_id="_479">
<name>in</name>
<dir>3</dir>
<type>0</type>
</port>
<inst class_id_reference="30" object_id_reference="_292"></inst>
</source>
<sink class_id_reference="28" object_id="_480">
<port class_id_reference="29" object_id="_481">
<name>out</name>
<dir>3</dir>
<type>1</type>
</port>
<inst class_id_reference="30" object_id_reference="_350"></inst>
</sink>
</item>
</channel_list>
<net_list class_id="33" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</net_list>
</mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="34" tracking_level="1" version="0" object_id="_482">
<states class_id="35" tracking_level="0" version="0">
<count>7</count>
<item_version>0</item_version>
<item class_id="36" tracking_level="1" version="0" object_id="_483">
<id>1</id>
<operations class_id="37" tracking_level="0" version="0">
<count>35</count>
<item_version>0</item_version>
<item class_id="38" tracking_level="1" version="0" object_id="_484">
<id>18</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_485">
<id>19</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_486">
<id>20</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_487">
<id>21</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_488">
<id>22</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_489">
<id>23</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_490">
<id>24</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_491">
<id>25</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_492">
<id>26</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_493">
<id>27</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_494">
<id>28</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_495">
<id>29</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_496">
<id>30</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_497">
<id>31</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_498">
<id>32</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_499">
<id>33</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_500">
<id>34</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_501">
<id>39</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_502">
<id>40</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_503">
<id>41</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_504">
<id>42</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_505">
<id>43</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_506">
<id>44</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_507">
<id>45</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_508">
<id>46</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_509">
<id>47</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_510">
<id>55</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_511">
<id>58</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_512">
<id>61</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_513">
<id>64</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_514">
<id>67</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_515">
<id>70</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_516">
<id>73</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_517">
<id>76</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_518">
<id>121</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_519">
<id>2</id>
<operations>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_520">
<id>124</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_521">
<id>125</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_522">
<id>126</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_523">
<id>127</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_524">
<id>3</id>
<operations>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_525">
<id>124</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_526">
<id>125</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_527">
<id>126</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_528">
<id>127</id>
<stage>1</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_529">
<id>4</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_530">
<id>136</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_531">
<id>5</id>
<operations>
<count>1</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_532">
<id>136</id>
<stage>1</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_533">
<id>6</id>
<operations>
<count>4</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_534">
<id>137</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_535">
<id>138</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_536">
<id>139</id>
<stage>2</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_537">
<id>140</id>
<stage>2</stage>
<latency>2</latency>
</item>
</operations>
</item>
<item class_id_reference="36" object_id="_538">
<id>7</id>
<operations>
<count>84</count>
<item_version>0</item_version>
<item class_id_reference="38" object_id="_539">
<id>35</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_540">
<id>36</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_541">
<id>37</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_542">
<id>38</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_543">
<id>48</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_544">
<id>49</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_545">
<id>50</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_546">
<id>51</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_547">
<id>52</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_548">
<id>53</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_549">
<id>54</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_550">
<id>56</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_551">
<id>57</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_552">
<id>59</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_553">
<id>60</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_554">
<id>62</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_555">
<id>63</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_556">
<id>65</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_557">
<id>66</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_558">
<id>68</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_559">
<id>69</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_560">
<id>71</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_561">
<id>72</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_562">
<id>74</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_563">
<id>75</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_564">
<id>77</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_565">
<id>78</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_566">
<id>79</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_567">
<id>80</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_568">
<id>81</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_569">
<id>82</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_570">
<id>83</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_571">
<id>84</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_572">
<id>85</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_573">
<id>86</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_574">
<id>87</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_575">
<id>88</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_576">
<id>89</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_577">
<id>90</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_578">
<id>91</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_579">
<id>92</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_580">
<id>93</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_581">
<id>94</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_582">
<id>95</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_583">
<id>96</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_584">
<id>97</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_585">
<id>98</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_586">
<id>99</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_587">
<id>100</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_588">
<id>101</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_589">
<id>102</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_590">
<id>103</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_591">
<id>104</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_592">
<id>105</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_593">
<id>106</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_594">
<id>107</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_595">
<id>108</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_596">
<id>109</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_597">
<id>110</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_598">
<id>111</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_599">
<id>112</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_600">
<id>113</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_601">
<id>114</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_602">
<id>115</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_603">
<id>116</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_604">
<id>117</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_605">
<id>118</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_606">
<id>119</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_607">
<id>120</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_608">
<id>122</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_609">
<id>123</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_610">
<id>128</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_611">
<id>129</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_612">
<id>130</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_613">
<id>131</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_614">
<id>132</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_615">
<id>133</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_616">
<id>134</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_617">
<id>135</id>
<stage>1</stage>
<latency>1</latency>
</item>
<item class_id_reference="38" object_id="_618">
<id>137</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_619">
<id>138</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_620">
<id>139</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_621">
<id>140</id>
<stage>1</stage>
<latency>2</latency>
</item>
<item class_id_reference="38" object_id="_622">
<id>141</id>
<stage>1</stage>
<latency>1</latency>
</item>
</operations>
</item>
</states>
<transitions class_id="39" tracking_level="0" version="0">
<count>6</count>
<item_version>0</item_version>
<item class_id="40" tracking_level="1" version="0" object_id="_623">
<inState>1</inState>
<outState>2</outState>
<condition class_id="41" tracking_level="0" version="0">
<id>0</id>
<sop class_id="42" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="43" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="40" object_id="_624">
<inState>2</inState>
<outState>3</outState>
<condition>
<id>1</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="40" object_id="_625">
<inState>3</inState>
<outState>4</outState>
<condition>
<id>2</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="40" object_id="_626">
<inState>4</inState>
<outState>5</outState>
<condition>
<id>3</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="40" object_id="_627">
<inState>5</inState>
<outState>6</outState>
<condition>
<id>4</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
<item class_id_reference="40" object_id="_628">
<inState>6</inState>
<outState>7</outState>
<condition>
<id>5</id>
<sop>
<count>1</count>
<item_version>0</item_version>
<item>
<count>0</count>
<item_version>0</item_version>
</item>
</sop>
</condition>
</item>
</transitions>
</fsm>
<res class_id="-1"></res>
<node_label_latency class_id="45" tracking_level="0" version="0">
<count>45</count>
<item_version>0</item_version>
<item class_id="46" tracking_level="0" version="0">
<first>18</first>
<second class_id="47" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>20</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>21</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>29</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>30</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>31</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>41</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>42</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>43</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>61</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>67</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>70</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>73</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>76</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>121</first>
<second>
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>124</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>125</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>126</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>127</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>136</first>
<second>
<first>3</first>
<second>1</second>
</second>
</item>
<item>
<first>137</first>
<second>
<first>5</first>
<second>1</second>
</second>
</item>
<item>
<first>138</first>
<second>
<first>5</first>
<second>1</second>
</second>
</item>
<item>
<first>139</first>
<second>
<first>5</first>
<second>1</second>
</second>
</item>
<item>
<first>140</first>
<second>
<first>5</first>
<second>1</second>
</second>
</item>
<item>
<first>141</first>
<second>
<first>6</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="48" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="49" tracking_level="0" version="0">
<first>142</first>
<second class_id="50" tracking_level="0" version="0">
<first>0</first>
<second>6</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="51" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="52" tracking_level="1" version="0" object_id="_629">
<region_name>jacobi2d_kernel</region_name>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>142</item>
</basic_blocks>
<nodes>
<count>124</count>
<item_version>0</item_version>
<item>18</item>
<item>19</item>
<item>20</item>
<item>21</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>29</item>
<item>30</item>
<item>31</item>
<item>32</item>
<item>33</item>
<item>34</item>
<item>35</item>
<item>36</item>
<item>37</item>
<item>38</item>
<item>39</item>
<item>40</item>
<item>41</item>
<item>42</item>
<item>43</item>
<item>44</item>
<item>45</item>
<item>46</item>
<item>47</item>
<item>48</item>
<item>49</item>
<item>50</item>
<item>51</item>
<item>52</item>
<item>53</item>
<item>54</item>
<item>55</item>
<item>56</item>
<item>57</item>
<item>58</item>
<item>59</item>
<item>60</item>
<item>61</item>
<item>62</item>
<item>63</item>
<item>64</item>
<item>65</item>
<item>66</item>
<item>67</item>
<item>68</item>
<item>69</item>
<item>70</item>
<item>71</item>
<item>72</item>
<item>73</item>
<item>74</item>
<item>75</item>
<item>76</item>
<item>77</item>
<item>78</item>
<item>79</item>
<item>80</item>
<item>81</item>
<item>82</item>
<item>83</item>
<item>84</item>
<item>85</item>
<item>86</item>
<item>87</item>
<item>88</item>
<item>89</item>
<item>90</item>
<item>91</item>
<item>92</item>
<item>93</item>
<item>94</item>
<item>95</item>
<item>96</item>
<item>97</item>
<item>98</item>
<item>99</item>
<item>100</item>
<item>101</item>
<item>102</item>
<item>103</item>
<item>104</item>
<item>105</item>
<item>106</item>
<item>107</item>
<item>108</item>
<item>109</item>
<item>110</item>
<item>111</item>
<item>112</item>
<item>113</item>
<item>114</item>
<item>115</item>
<item>116</item>
<item>117</item>
<item>118</item>
<item>119</item>
<item>120</item>
<item>121</item>
<item>122</item>
<item>123</item>
<item>124</item>
<item>125</item>
<item>126</item>
<item>127</item>
<item>128</item>
<item>129</item>
<item>130</item>
<item>131</item>
<item>132</item>
<item>133</item>
<item>134</item>
<item>135</item>
<item>136</item>
<item>137</item>
<item>138</item>
<item>139</item>
<item>140</item>
<item>141</item>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>16</region_type>
<interval>0</interval>
<pipe_depth>0</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="53" tracking_level="0" version="0">
<count>44</count>
<item_version>0</item_version>
<item class_id="54" tracking_level="0" version="0">
<first>510</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>514</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>518</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>522</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>526</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>530</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>534</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>538</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>542</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>546</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>550</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>554</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>558</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>562</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>44</item>
</second>
</item>
<item>
<first>566</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>570</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>574</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>578</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>582</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
<item>
<first>586</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>590</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>594</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>67</item>
</second>
</item>
<item>
<first>598</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>70</item>
</second>
</item>
<item>
<first>602</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>73</item>
</second>
</item>
<item>
<first>606</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>76</item>
</second>
</item>
<item>
<first>610</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>616</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>622</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>20</item>
</second>
</item>
<item>
<first>628</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>634</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>640</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
<item>
<first>646</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>652</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>658</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>664</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>136</item>
<item>136</item>
</second>
</item>
<item>
<first>681</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>137</item>
<item>137</item>
</second>
</item>
<item>
<first>690</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>138</item>
<item>138</item>
</second>
</item>
<item>
<first>699</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>139</item>
<item>139</item>
</second>
</item>
<item>
<first>708</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>140</item>
<item>140</item>
</second>
</item>
<item>
<first>717</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>124</item>
<item>124</item>
</second>
</item>
<item>
<first>727</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>125</item>
<item>125</item>
</second>
</item>
<item>
<first>736</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>126</item>
<item>126</item>
</second>
</item>
<item>
<first>745</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>127</item>
<item>127</item>
</second>
</item>
<item>
<first>754</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>121</item>
</second>
</item>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="56" tracking_level="0" version="0">
<count>25</count>
<item_version>0</item_version>
<item class_id="57" tracking_level="0" version="0">
<first>coalesced_data_num_c12_fu_570</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>coalesced_data_num_c13_fu_566</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>coalesced_data_num_c14_fu_562</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>44</item>
</second>
</item>
<item>
<first>coalesced_data_num_c15_fu_558</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>coalesced_data_num_c16_fu_554</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>coalesced_data_num_c17_fu_550</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>coalesced_data_num_c18_fu_546</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>coalesced_data_num_c19_fu_542</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>coalesced_data_num_c_fu_574</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>input_stream_0_0_V_V_fu_578</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>input_stream_0_1_V_V_fu_582</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
<item>
<first>input_stream_0_2_V_V_fu_586</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>input_stream_0_3_V_V_fu_590</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>output_stream_0_0_V_V_fu_594</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>67</item>
</second>
</item>
<item>
<first>output_stream_0_1_V_V_fu_598</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>70</item>
</second>
</item>
<item>
<first>output_stream_0_2_V_V_fu_602</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>73</item>
</second>
</item>
<item>
<first>output_stream_0_3_V_V_fu_606</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>76</item>
</second>
</item>
<item>
<first>var_input_0_0_V_c_fu_522</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>var_input_0_1_V_c_fu_518</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>var_input_0_2_V_c_fu_514</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>var_input_0_3_V_c_fu_510</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>var_output_0_0_V_c_fu_538</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>var_output_0_1_V_c_fu_534</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>var_output_0_2_V_c_fu_530</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>var_output_0_3_V_c_fu_526</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>10</count>
<item_version>0</item_version>
<item>
<first>StgValue_42_jacobi2d_kernel_entry118311_fu_754</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>121</item>
</second>
</item>
<item>
<first>grp_compute_fu_664</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>136</item>
<item>136</item>
</second>
</item>
<item>
<first>grp_load35_fu_717</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>124</item>
<item>124</item>
</second>
</item>
<item>
<first>grp_load36_fu_727</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>125</item>
<item>125</item>
</second>
</item>
<item>
<first>grp_load37_fu_736</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>126</item>
<item>126</item>
</second>
</item>
<item>
<first>grp_load_fu_745</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>127</item>
<item>127</item>
</second>
</item>
<item>
<first>grp_store38_fu_681</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>137</item>
<item>137</item>
</second>
</item>
<item>
<first>grp_store39_fu_690</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>138</item>
<item>138</item>
</second>
</item>
<item>
<first>grp_store40_fu_699</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>139</item>
<item>139</item>
</second>
</item>
<item>
<first>grp_store_fu_708</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>140</item>
<item>140</item>
</second>
</item>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>9</count>
<item_version>0</item_version>
<item>
<first>coalesced_data_num_read_read_fu_610</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
<item>
<first>var_input_0_0_V_read_read_fu_634</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
<item>
<first>var_input_0_1_V_read_read_fu_628</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
<item>
<first>var_input_0_2_V_read_read_fu_622</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>20</item>
</second>
</item>
<item>
<first>var_input_0_3_V_read_read_fu_616</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
<item>
<first>var_output_0_0_V_read_read_fu_658</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
<item>
<first>var_output_0_1_V_read_read_fu_652</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
<item>
<first>var_output_0_2_V_read_read_fu_646</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
<item>
<first>var_output_0_3_V_read_read_fu_640</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="58" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>25</count>
<item_version>0</item_version>
<item>
<first>788</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>794</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>800</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>806</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>812</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
<item>
<first>818</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>824</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>830</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>836</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>842</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>848</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>854</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>860</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>866</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>44</item>
</second>
</item>
<item>
<first>872</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>878</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>884</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>890</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>896</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
<item>
<first>902</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>908</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>914</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>67</item>
</second>
</item>
<item>
<first>920</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>70</item>
</second>
</item>
<item>
<first>926</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>73</item>
</second>
</item>
<item>
<first>932</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>76</item>
</second>
</item>
</dp_reg_nodes>
<dp_regname_nodes>
<count>25</count>
<item_version>0</item_version>
<item>
<first>coalesced_data_num_c12_reg_878</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>46</item>
</second>
</item>
<item>
<first>coalesced_data_num_c13_reg_872</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>45</item>
</second>
</item>
<item>
<first>coalesced_data_num_c14_reg_866</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>44</item>
</second>
</item>
<item>
<first>coalesced_data_num_c15_reg_860</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>43</item>
</second>
</item>
<item>
<first>coalesced_data_num_c16_reg_854</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>42</item>
</second>
</item>
<item>
<first>coalesced_data_num_c17_reg_848</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>41</item>
</second>
</item>
<item>
<first>coalesced_data_num_c18_reg_842</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>40</item>
</second>
</item>
<item>
<first>coalesced_data_num_c19_reg_836</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>39</item>
</second>
</item>
<item>
<first>coalesced_data_num_c_reg_884</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>47</item>
</second>
</item>
<item>
<first>input_stream_0_0_V_V_reg_890</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>55</item>
</second>
</item>
<item>
<first>input_stream_0_1_V_V_reg_896</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>58</item>
</second>
</item>
<item>
<first>input_stream_0_2_V_V_reg_902</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>61</item>
</second>
</item>
<item>
<first>input_stream_0_3_V_V_reg_908</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>64</item>
</second>
</item>
<item>
<first>output_stream_0_0_V_V_reg_914</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>67</item>
</second>
</item>
<item>
<first>output_stream_0_1_V_V_reg_920</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>70</item>
</second>
</item>
<item>
<first>output_stream_0_2_V_V_reg_926</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>73</item>
</second>
</item>
<item>
<first>output_stream_0_3_V_V_reg_932</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>76</item>
</second>
</item>
<item>
<first>var_input_0_0_V_c_reg_806</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>30</item>
</second>
</item>
<item>
<first>var_input_0_1_V_c_reg_800</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>29</item>
</second>
</item>
<item>
<first>var_input_0_2_V_c_reg_794</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>28</item>
</second>
</item>
<item>
<first>var_input_0_3_V_c_reg_788</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>27</item>
</second>
</item>
<item>
<first>var_output_0_0_V_c_reg_830</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>34</item>
</second>
</item>
<item>
<first>var_output_0_1_V_c_reg_824</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>33</item>
</second>
</item>
<item>
<first>var_output_0_2_V_c_reg_818</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>32</item>
</second>
</item>
<item>
<first>var_output_0_3_V_c_reg_812</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>31</item>
</second>
</item>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="59" tracking_level="0" version="0">
<count>17</count>
<item_version>0</item_version>
<item class_id="60" tracking_level="0" version="0">
<first>chan0bank0</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>124</item>
<item>137</item>
</second>
</item>
</second>
</item>
<item>
<first>chan0bank1</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>125</item>
<item>138</item>
</second>
</item>
</second>
</item>
<item>
<first>chan0bank2</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>126</item>
<item>139</item>
</second>
</item>
</second>
</item>
<item>
<first>chan0bank3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>call</first>
<second>
<count>2</count>
<item_version>0</item_version>
<item>127</item>
<item>140</item>
</second>
</item>
</second>
</item>
<item>
<first>coalesced_data_num</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>18</item>
</second>
</item>
</second>
</item>
<item>
<first>input_size_dim_0</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>input_size_dim_1</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>tile_data_num</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>tile_num_dim_0</first>
<second>
<count>0</count>
<item_version>0</item_version>
</second>
</item>
<item>
<first>var_input_0_0_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>22</item>
</second>
</item>
</second>
</item>
<item>
<first>var_input_0_1_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>21</item>
</second>
</item>
</second>
</item>
<item>
<first>var_input_0_2_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>20</item>
</second>
</item>
</second>
</item>
<item>
<first>var_input_0_3_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>19</item>
</second>
</item>
</second>
</item>
<item>
<first>var_output_0_0_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>26</item>
</second>
</item>
</second>
</item>
<item>
<first>var_output_0_1_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>25</item>
</second>
</item>
</second>
</item>
<item>
<first>var_output_0_2_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>24</item>
</second>
</item>
</second>
</item>
<item>
<first>var_output_0_3_V</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>read</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>23</item>
</second>
</item>
</second>
</item>
</dp_port_io_nodes>
<port2core class_id="61" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>25</count>
<item_version>0</item_version>
<item class_id="62" tracking_level="0" version="0">
<first>27</first>
<second>FIFO</second>
</item>
<item>
<first>28</first>
<second>FIFO</second>
</item>
<item>
<first>29</first>
<second>FIFO</second>
</item>
<item>
<first>30</first>
<second>FIFO</second>
</item>
<item>
<first>31</first>
<second>FIFO</second>
</item>
<item>
<first>32</first>
<second>FIFO</second>
</item>
<item>
<first>33</first>
<second>FIFO</second>
</item>
<item>
<first>34</first>
<second>FIFO</second>
</item>
<item>
<first>39</first>
<second>FIFO</second>
</item>
<item>
<first>40</first>
<second>FIFO</second>
</item>
<item>
<first>41</first>
<second>FIFO</second>
</item>
<item>
<first>42</first>
<second>FIFO</second>
</item>
<item>
<first>43</first>
<second>FIFO</second>
</item>
<item>
<first>44</first>
<second>FIFO</second>
</item>
<item>
<first>45</first>
<second>FIFO</second>
</item>
<item>
<first>46</first>
<second>FIFO</second>
</item>
<item>
<first>47</first>
<second>FIFO</second>
</item>
<item>
<first>55</first>
<second>FIFO</second>
</item>
<item>
<first>58</first>
<second>FIFO</second>
</item>
<item>
<first>61</first>
<second>FIFO</second>
</item>
<item>
<first>64</first>
<second>FIFO</second>
</item>
<item>
<first>67</first>
<second>FIFO</second>
</item>
<item>
<first>70</first>
<second>FIFO</second>
</item>
<item>
<first>73</first>
<second>FIFO</second>
</item>
<item>
<first>76</first>
<second>FIFO</second>
</item>
</node2core>
</syndb>
</boost_serialization>
|
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Element_Vectors;
with Program.Elements.Defining_Names;
with Program.Elements.Aspect_Specifications;
with Program.Elements.Expressions;
with Program.Elements.Generic_Package_Declarations;
with Program.Element_Visitors;
package Program.Nodes.Generic_Package_Declarations is
pragma Preelaborate;
type Generic_Package_Declaration is
new Program.Nodes.Node
and Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration
and Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration_Text
with private;
function Create
(Generic_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Formal_Parameters : Program.Element_Vectors.Element_Vector_Access;
Package_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Token : Program.Lexical_Elements.Lexical_Element_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return Generic_Package_Declaration;
type Implicit_Generic_Package_Declaration is
new Program.Nodes.Node
and Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration
with private;
function Create
(Formal_Parameters : Program.Element_Vectors.Element_Vector_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Generic_Package_Declaration
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Generic_Package_Declaration is
abstract new Program.Nodes.Node
and Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration
with record
Formal_Parameters : Program.Element_Vectors.Element_Vector_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
end record;
procedure Initialize (Self : in out Base_Generic_Package_Declaration'Class);
overriding procedure Visit
(Self : not null access Base_Generic_Package_Declaration;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Formal_Parameters
(Self : Base_Generic_Package_Declaration)
return Program.Element_Vectors.Element_Vector_Access;
overriding function Name
(Self : Base_Generic_Package_Declaration)
return not null Program.Elements.Defining_Names.Defining_Name_Access;
overriding function Aspects
(Self : Base_Generic_Package_Declaration)
return Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
overriding function Visible_Declarations
(Self : Base_Generic_Package_Declaration)
return Program.Element_Vectors.Element_Vector_Access;
overriding function Private_Declarations
(Self : Base_Generic_Package_Declaration)
return Program.Element_Vectors.Element_Vector_Access;
overriding function End_Name
(Self : Base_Generic_Package_Declaration)
return Program.Elements.Expressions.Expression_Access;
overriding function Is_Generic_Package_Declaration
(Self : Base_Generic_Package_Declaration)
return Boolean;
overriding function Is_Declaration
(Self : Base_Generic_Package_Declaration)
return Boolean;
type Generic_Package_Declaration is
new Base_Generic_Package_Declaration
and Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration_Text
with record
Generic_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Package_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Private_Token : Program.Lexical_Elements.Lexical_Element_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
end record;
overriding function To_Generic_Package_Declaration_Text
(Self : in out Generic_Package_Declaration)
return Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration_Text_Access;
overriding function Generic_Token
(Self : Generic_Package_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Package_Token
(Self : Generic_Package_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function With_Token
(Self : Generic_Package_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function Is_Token
(Self : Generic_Package_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Private_Token
(Self : Generic_Package_Declaration)
return Program.Lexical_Elements.Lexical_Element_Access;
overriding function End_Token
(Self : Generic_Package_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function Semicolon_Token
(Self : Generic_Package_Declaration)
return not null Program.Lexical_Elements.Lexical_Element_Access;
type Implicit_Generic_Package_Declaration is
new Base_Generic_Package_Declaration
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Generic_Package_Declaration_Text
(Self : in out Implicit_Generic_Package_Declaration)
return Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Generic_Package_Declaration)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Generic_Package_Declaration)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Generic_Package_Declaration)
return Boolean;
end Program.Nodes.Generic_Package_Declarations;
|
-- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <denkpadje@gmail.com>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
package Orka.SIMD.SSE2 is
pragma Pure;
end Orka.SIMD.SSE2;
|
pragma License (Unrestricted);
-- Ada 2012, specialized for Windows
package System.Multiprocessors is
pragma Preelaborate;
type CPU_Range is range 0 .. Integer'Last;
Not_A_Specific_CPU : constant CPU_Range := 0;
subtype CPU is CPU_Range range 1 .. CPU_Range'Last;
function Number_Of_CPUs return CPU;
end System.Multiprocessors;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
with AMF.Generic_Collections;
package AMF.UML.Part_Decompositions.Collections is
pragma Preelaborate;
package UML_Part_Decomposition_Collections is
new AMF.Generic_Collections
(UML_Part_Decomposition,
UML_Part_Decomposition_Access);
type Set_Of_UML_Part_Decomposition is
new UML_Part_Decomposition_Collections.Set with null record;
Empty_Set_Of_UML_Part_Decomposition : constant Set_Of_UML_Part_Decomposition;
type Ordered_Set_Of_UML_Part_Decomposition is
new UML_Part_Decomposition_Collections.Ordered_Set with null record;
Empty_Ordered_Set_Of_UML_Part_Decomposition : constant Ordered_Set_Of_UML_Part_Decomposition;
type Bag_Of_UML_Part_Decomposition is
new UML_Part_Decomposition_Collections.Bag with null record;
Empty_Bag_Of_UML_Part_Decomposition : constant Bag_Of_UML_Part_Decomposition;
type Sequence_Of_UML_Part_Decomposition is
new UML_Part_Decomposition_Collections.Sequence with null record;
Empty_Sequence_Of_UML_Part_Decomposition : constant Sequence_Of_UML_Part_Decomposition;
private
Empty_Set_Of_UML_Part_Decomposition : constant Set_Of_UML_Part_Decomposition
:= (UML_Part_Decomposition_Collections.Set with null record);
Empty_Ordered_Set_Of_UML_Part_Decomposition : constant Ordered_Set_Of_UML_Part_Decomposition
:= (UML_Part_Decomposition_Collections.Ordered_Set with null record);
Empty_Bag_Of_UML_Part_Decomposition : constant Bag_Of_UML_Part_Decomposition
:= (UML_Part_Decomposition_Collections.Bag with null record);
Empty_Sequence_Of_UML_Part_Decomposition : constant Sequence_Of_UML_Part_Decomposition
:= (UML_Part_Decomposition_Collections.Sequence with null record);
end AMF.UML.Part_Decompositions.Collections;
|
------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- Reference Implementation --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Richard Wai (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Ada.Streams.Stream_IO;
with Ada.Strings.Fixed;
with Ada.Characters.Latin_1;
with Ada.Characters.Handling;
with Ada.Characters.Conversions;
with Registrar.Registration;
separate (Repositories)
procedure Generate_Repo_Spec (Index: Repository_Index) is
use Unit_Names;
function To_Wide_Wide_String (Item: in String) return Wide_Wide_String
renames Ada.Characters.Conversions.To_Wide_Wide_String;
Repo: constant Repository := All_Repositories.Extract (Index);
Tab: constant String := (1 .. 4 => ' ');
Trimmed_Index: constant String
:= Ada.Strings.Fixed.Trim (Source => Repository_Index'Image(Index),
Side => Ada.Strings.Both);
File_Name: constant String
:= "aura-repository_" & Trimmed_Index & ".ads";
Format_Value: constant String
:= Ada.Characters.Handling.To_Lower
(Repository_Format'Image (Repo.Format));
generic
Stream: not null access Ada.Streams.Root_Stream_Type'Class;
procedure Generic_Generator;
procedure Generic_Generator is
procedure New_Line is
begin
Character'Write (Stream, Ada.Characters.Latin_1.LF);
end New_Line;
procedure Put_Line (Item: in String) is
begin
String'Write (Stream, Item);
New_Line;
end Put_Line;
begin
Put_Line
("-- This specification was automatically generated by the AURA CLI");
Put_Line
("-- DO NOT MODIFY THIS FILE MANUALLY");
New_Line;
Put_Line ("package AURA.Repository_" & Trimmed_Index & " with Pure is");
New_Line;
Put_Line (Tab & "Format : constant Repository_Format := "
& Format_Value & ';');
Put_Line (Tab & "Location: constant String := """
& UBS.To_String (Repo.Location) & """;");
if UBS.Length (Repo.Snapshot) > 0 then
Put_Line (Tab & "Snapshot: constant String := """
& UBS.To_String (Repo.Snapshot)
& """;");
end if;
case Repo.Format is
when System | Local =>
-- Nothing left to add
null;
when Git =>
if UBS.Length (Repo.Tracking_Branch) > 0 then
New_Line;
Put_Line (Tab & "Tracking_Branch: constant String := """
& UBS.To_String (Repo.Tracking_Branch)
& """;");
end if;
end case;
New_Line;
Put_Line ("end AURA.Repository_" & Trimmed_Index & ';');
end Generic_Generator;
Lookup_Name: Unit_Name;
begin
-- See if the repo spec has already been entered by the Registrar.
Lookup_Name.Set_Name
("AURA.Repository_" & To_Wide_Wide_String (Trimmed_Index));
if Reg_Qs.Unit_Entered (Lookup_Name) then
declare
use Registrar.Library_Units;
use Registrar.Source_Files;
Existing_Spec: constant Library_Unit
:= Reg_Qs.Lookup_Unit (Lookup_Name);
Spec_Source: aliased Source_Stream
:= Checkout_Write_Stream (Source => Existing_Spec.Spec_File,
Rewrite => True);
procedure Generate is new Generic_Generator (Spec_Source'Access);
begin
Generate;
end;
else
-- New repo from scratch
declare
use Ada.Streams.Stream_IO;
New_Spec: File_Type;
begin
Create (File => New_Spec,
Name => File_Name);
declare
procedure Generate is new Generic_Generator (Stream (New_Spec));
begin
Generate;
end;
Close (New_Spec);
end;
-- Now that the spec file has been created, we need to find the
-- directory entry to submit to Enter_Unit
declare
use Ada.Directories;
Search : Search_Type;
Specent: Directory_Entry_Type;
begin
Start_Search (Search => Search,
Directory => Current_Directory,
Pattern => File_Name);
Assert (Check => More_Entries (Search),
Message => "Error generating Repository spec - cannot find "
& "generated file!");
Get_Next_Entry (Search => Search, Directory_Entry => Specent);
Registrar.Registration.Enter_Unit (Specent);
End_Search (Search);
end;
end if;
end Generate_Repo_Spec;
|
-- Swagger Petstore
-- This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.
--
-- OpenAPI spec version: 1.0.0
-- Contact: apiteam@swagger.io
--
-- NOTE: This package is auto generated by the swagger code generator 1.5.0.
-- https://github.com/swagger-api/swagger-codegen.git
-- Do not edit the class manually.with IO.OpenAPI.Model.Default;
with Swagger.Streams;
with Ada.Containers.Vectors;
package IO.OpenAPI.Api.Models is
end IO.OpenAPI.Api.Models;
|
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- ADA.STRINGS.WIDE_UNBOUNDED.WIDE_TEXT_IO --
-- --
-- B o d y --
-- --
-- Copyright (C) 1997-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Ada.Wide_Text_IO; use Ada.Wide_Text_IO;
package body Ada.Strings.Wide_Unbounded.Wide_Text_IO is
--------------
-- Get_Line --
--------------
function Get_Line return Unbounded_Wide_String is
Buffer : Wide_String (1 .. 1000);
Last : Natural;
Str1 : Wide_String_Access;
Str2 : Wide_String_Access;
Result : Unbounded_Wide_String;
begin
Get_Line (Buffer, Last);
Str1 := new Wide_String'(Buffer (1 .. Last));
while Last = Buffer'Last loop
Get_Line (Buffer, Last);
Str2 := new Wide_String (1 .. Str1'Last + Last);
Str2 (Str1'Range) := Str1.all;
Str2 (Str1'Last + 1 .. Str2'Last) := Buffer (1 .. Last);
Free (Str1);
Str1 := Str2;
end loop;
Result.Reference := Str1;
Result.Last := Str1'Length;
return Result;
end Get_Line;
function Get_Line
(File : Ada.Wide_Text_IO.File_Type) return Unbounded_Wide_String
is
Buffer : Wide_String (1 .. 1000);
Last : Natural;
Str1 : Wide_String_Access;
Str2 : Wide_String_Access;
Result : Unbounded_Wide_String;
begin
Get_Line (File, Buffer, Last);
Str1 := new Wide_String'(Buffer (1 .. Last));
while Last = Buffer'Last loop
Get_Line (File, Buffer, Last);
Str2 := new Wide_String (1 .. Str1'Last + Last);
Str2 (Str1'Range) := Str1.all;
Str2 (Str1'Last + 1 .. Str2'Last) := Buffer (1 .. Last);
Free (Str1);
Str1 := Str2;
end loop;
Result.Reference := Str1;
Result.Last := Str1'Length;
return Result;
end Get_Line;
procedure Get_Line (Item : out Unbounded_Wide_String) is
begin
Get_Line (Current_Input, Item);
end Get_Line;
procedure Get_Line
(File : Ada.Wide_Text_IO.File_Type;
Item : out Unbounded_Wide_String)
is
begin
-- We are going to read into the string that is already there and
-- allocated. Hopefully it is big enough now, if not, we will extend
-- it in the usual manner using Realloc_For_Chunk.
-- Make sure we start with at least 80 characters
if Item.Reference'Last < 80 then
Realloc_For_Chunk (Item, 80);
end if;
-- Loop to read data, filling current string as far as possible.
-- Item.Last holds the number of characters read so far.
Item.Last := 0;
loop
Get_Line
(File,
Item.Reference (Item.Last + 1 .. Item.Reference'Last),
Item.Last);
-- If we hit the end of the line before the end of the buffer, then
-- we are all done, and the result length is properly set.
if Item.Last < Item.Reference'Last then
return;
end if;
-- If not enough room, double it and keep reading
Realloc_For_Chunk (Item, Item.Last);
end loop;
end Get_Line;
---------
-- Put --
---------
procedure Put (U : Unbounded_Wide_String) is
begin
Put (U.Reference (1 .. U.Last));
end Put;
procedure Put (File : File_Type; U : Unbounded_Wide_String) is
begin
Put (File, U.Reference (1 .. U.Last));
end Put;
--------------
-- Put_Line --
--------------
procedure Put_Line (U : Unbounded_Wide_String) is
begin
Put_Line (U.Reference (1 .. U.Last));
end Put_Line;
procedure Put_Line (File : File_Type; U : Unbounded_Wide_String) is
begin
Put_Line (File, U.Reference (1 .. U.Last));
end Put_Line;
end Ada.Strings.Wide_Unbounded.Wide_Text_IO;
|
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . C G I . C O O K I E --
-- --
-- S p e c --
-- --
-- Copyright (C) 2000-2010, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is a package to interface a GNAT program with a Web server via the
-- Common Gateway Interface (CGI). It exports services to deal with Web
-- cookies (piece of information kept in the Web client software).
-- The complete CGI Cookie specification can be found in the RFC2109 at:
-- http://www.ics.uci.edu/pub/ietf/http/rfc2109.txt
-- This package builds up data tables whose memory is not released. A CGI
-- program is expected to be a short lived program and so it is adequate to
-- have the underlying OS free the program on exit.
package GNAT.CGI.Cookie is
-- The package will initialize itself by parsing the HTTP_Cookie runtime
-- CGI environment variable during elaboration but we do not want to raise
-- an exception at this time, so the exception Data_Error is deferred and
-- will be raised when calling any services below (except for Ok).
Cookie_Not_Found : exception;
-- This exception is raised when a specific parameter is not found
procedure Put_Header
(Header : String := Default_Header;
Force : Boolean := False);
-- Output standard CGI header by default. This header must be returned
-- back to the server at the very beginning and will be output only for
-- the first call to Put_Header if Force is set to False. This procedure
-- also outputs the Cookies that have been defined. If the program uses
-- the GNAT.CGI.Put_Header service, cookies will not be set.
--
-- Cookies are passed back to the server in the header, the format is:
--
-- Set-Cookie: <key>=<value>; comment=<comment>; domain=<domain>;
-- max_age=<max_age>; path=<path>[; secured]
function Ok return Boolean;
-- Returns True if the CGI cookie environment is valid and False otherwise.
-- Every service used when the CGI environment is not valid will raise the
-- exception Data_Error.
function Count return Natural;
-- Returns the number of cookies received by the CGI
function Value
(Key : String;
Required : Boolean := False) return String;
-- Returns the cookie value associated with the cookie named Key. If cookie
-- does not exist, returns an empty string if Required is False and raises
-- the exception Cookie_Not_Found otherwise.
function Value (Position : Positive) return String;
-- Returns the value associated with the cookie number Position of the CGI.
-- It raises Cookie_Not_Found if there is no such cookie (i.e. Position >
-- Count)
function Exists (Key : String) return Boolean;
-- Returns True if the cookie named Key exist and False otherwise
function Key (Position : Positive) return String;
-- Returns the key associated with the cookie number Position of the CGI.
-- It raises Cookie_Not_Found if there is no such cookie (i.e. Position >
-- Count)
procedure Set
(Key : String;
Value : String;
Comment : String := "";
Domain : String := "";
Max_Age : Natural := Natural'Last;
Path : String := "/";
Secure : Boolean := False);
-- Add a cookie to the list of cookies. This will be sent back to the
-- server by the Put_Header service above.
generic
with procedure
Action
(Key : String;
Value : String;
Position : Positive;
Quit : in out Boolean);
procedure For_Every_Cookie;
-- Iterate through all cookies received from the server and call
-- the Action supplied procedure. The Key, Value parameters are set
-- appropriately, Position is the cookie order in the list, Quit is set to
-- True by default. Quit can be set to False to control the iterator
-- termination.
end GNAT.CGI.Cookie;
|
-- SPDX-FileCopyrightText: 2019 Max Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
-- Trivial implementation of library declarations
with Program.Library_Unit_Bodies;
with Program.Library_Unit_Declarations;
with Program.Compilation_Unit_Vectors;
with Program.Units.Vectors;
package Program.Units.Declarations is
pragma Preelaborate;
type Unit_Declaration is new Unit
and Program.Library_Unit_Declarations.Library_Unit_Declaration
with private;
procedure Initialize
(Self : in out Unit_Declaration;
Compilation : Program.Compilations.Compilation_Access;
Full_Name : Text;
Context_Clause : Program.Element_Vectors.Element_Vector_Access;
Declaration : not null Program.Elements.Element_Access;
Parent : Program.Library_Unit_Declarations
.Library_Unit_Declaration_Access);
procedure Append_Child
(Self : in out Unit_Declaration;
Value : Program.Compilation_Units.Compilation_Unit_Access);
procedure Set_Body
(Self : in out Unit_Declaration;
Value : Program.Library_Unit_Bodies.Library_Unit_Body_Access);
private
type Unit_Declaration is new Unit
and Program.Library_Unit_Declarations.Library_Unit_Declaration
with
record
Parent : Program.Library_Unit_Declarations
.Library_Unit_Declaration_Access;
Impl : Program.Library_Unit_Bodies.Library_Unit_Body_Access;
Childern : aliased Program.Units.Vectors.Unit_Vector;
end record;
overriding function Parent (Self : access Unit_Declaration)
return Program.Library_Unit_Declarations.Library_Unit_Declaration_Access;
overriding function Corresponding_Body (Self : access Unit_Declaration)
return Program.Library_Unit_Bodies.Library_Unit_Body_Access;
overriding function Corresponding_Childern
(Self : access Unit_Declaration)
return Program.Compilation_Unit_Vectors.Compilation_Unit_Vector_Access;
overriding function Is_Library_Unit_Declaration_Unit
(Self : Unit_Declaration) return Boolean;
end Program.Units.Declarations;
|
-- { dg-do run }
procedure Discr33 is
subtype Int is Integer range 1..100;
type T (D : Int := 1) is
record
A : Integer;
B : String (1..D);
C : aliased Integer;
end record;
Var : T := (D => 1, A => 1234, B => "x", C => 4567);
type Int_Ref is access all Integer;
Pointer_To_C : Int_Ref := Var.C'Access;
begin
if Pointer_To_C.all /= 4567 then
raise Program_Error;
end if;
Var := (D => 26, A => 1234, B => "abcdefghijklmnopqrstuvwxyz", C => 2345);
if Pointer_To_C.all /= 2345 then
raise Program_Error;
end if;
end Discr33;
|
-----------------------------------------------------------------------
-- AWA.Blogs.Models -- AWA.Blogs.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2017 Stephane Carrez
-- Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Beans.Objects.Time;
with ASF.Events.Faces.Actions;
with AWA.Events.Action_Method;
package body AWA.Blogs.Models is
use type ADO.Objects.Object_Record_Access;
use type ADO.Objects.Object_Ref;
use type ADO.Objects.Object_Record;
pragma Warnings (Off, "formal parameter * is not referenced");
function Blog_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => BLOG_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Blog_Key;
function Blog_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => BLOG_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Blog_Key;
function "=" (Left, Right : Blog_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Blog_Ref'Class;
Impl : out Blog_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Blog_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Blog_Ref) is
Impl : Blog_Access;
begin
Impl := new Blog_Impl;
Impl.Version := 0;
Impl.Create_Date := ADO.DEFAULT_TIME;
Impl.Update_Date := ADO.DEFAULT_TIME;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Blog
-- ----------------------------------------
procedure Set_Id (Object : in out Blog_Ref;
Value : in ADO.Identifier) is
Impl : Blog_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Blog_Ref)
return ADO.Identifier is
Impl : constant Blog_Access
:= Blog_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Name (Object : in out Blog_Ref;
Value : in String) is
Impl : Blog_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
procedure Set_Name (Object : in out Blog_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Blog_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
function Get_Name (Object : in Blog_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Name);
end Get_Name;
function Get_Name (Object : in Blog_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Blog_Access
:= Blog_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Name;
end Get_Name;
function Get_Version (Object : in Blog_Ref)
return Integer is
Impl : constant Blog_Access
:= Blog_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Uid (Object : in out Blog_Ref;
Value : in String) is
Impl : Blog_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 4, Impl.Uid, Value);
end Set_Uid;
procedure Set_Uid (Object : in out Blog_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Blog_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 4, Impl.Uid, Value);
end Set_Uid;
function Get_Uid (Object : in Blog_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Uid);
end Get_Uid;
function Get_Uid (Object : in Blog_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Blog_Access
:= Blog_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Uid;
end Get_Uid;
procedure Set_Create_Date (Object : in out Blog_Ref;
Value : in Ada.Calendar.Time) is
Impl : Blog_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 5, Impl.Create_Date, Value);
end Set_Create_Date;
function Get_Create_Date (Object : in Blog_Ref)
return Ada.Calendar.Time is
Impl : constant Blog_Access
:= Blog_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Create_Date;
end Get_Create_Date;
procedure Set_Update_Date (Object : in out Blog_Ref;
Value : in Ada.Calendar.Time) is
Impl : Blog_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 6, Impl.Update_Date, Value);
end Set_Update_Date;
function Get_Update_Date (Object : in Blog_Ref)
return Ada.Calendar.Time is
Impl : constant Blog_Access
:= Blog_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Update_Date;
end Get_Update_Date;
procedure Set_Url (Object : in out Blog_Ref;
Value : in String) is
Impl : Blog_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 7, Impl.Url, Value);
end Set_Url;
procedure Set_Url (Object : in out Blog_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Blog_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 7, Impl.Url, Value);
end Set_Url;
function Get_Url (Object : in Blog_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Url);
end Get_Url;
function Get_Url (Object : in Blog_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Blog_Access
:= Blog_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Url;
end Get_Url;
procedure Set_Workspace (Object : in out Blog_Ref;
Value : in AWA.Workspaces.Models.Workspace_Ref'Class) is
Impl : Blog_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 8, Impl.Workspace, Value);
end Set_Workspace;
function Get_Workspace (Object : in Blog_Ref)
return AWA.Workspaces.Models.Workspace_Ref'Class is
Impl : constant Blog_Access
:= Blog_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Workspace;
end Get_Workspace;
-- Copy of the object.
procedure Copy (Object : in Blog_Ref;
Into : in out Blog_Ref) is
Result : Blog_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Blog_Access
:= Blog_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Blog_Access
:= new Blog_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Name := Impl.Name;
Copy.Version := Impl.Version;
Copy.Uid := Impl.Uid;
Copy.Create_Date := Impl.Create_Date;
Copy.Update_Date := Impl.Update_Date;
Copy.Url := Impl.Url;
Copy.Workspace := Impl.Workspace;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Blog_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Blog_Access := new Blog_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Blog_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Blog_Access := new Blog_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Blog_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Blog_Access := new Blog_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Blog_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Blog_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Blog_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Blog_Impl) is
type Blog_Impl_Ptr is access all Blog_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Blog_Impl, Blog_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Blog_Impl_Ptr := Blog_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Blog_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, BLOG_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Blog_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Blog_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (BLOG_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_1_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_1_NAME, -- name
Value => Object.Name);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_1_NAME, -- uid
Value => Object.Uid);
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_1_NAME, -- create_date
Value => Object.Create_Date);
Object.Clear_Modified (5);
end if;
if Object.Is_Modified (6) then
Stmt.Save_Field (Name => COL_5_1_NAME, -- update_date
Value => Object.Update_Date);
Object.Clear_Modified (6);
end if;
if Object.Is_Modified (7) then
Stmt.Save_Field (Name => COL_6_1_NAME, -- url
Value => Object.Url);
Object.Clear_Modified (7);
end if;
if Object.Is_Modified (8) then
Stmt.Save_Field (Name => COL_7_1_NAME, -- workspace_id
Value => Object.Workspace);
Object.Clear_Modified (8);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Blog_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (BLOG_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_1_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_1_NAME, -- name
Value => Object.Name);
Query.Save_Field (Name => COL_2_1_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_3_1_NAME, -- uid
Value => Object.Uid);
Query.Save_Field (Name => COL_4_1_NAME, -- create_date
Value => Object.Create_Date);
Query.Save_Field (Name => COL_5_1_NAME, -- update_date
Value => Object.Update_Date);
Query.Save_Field (Name => COL_6_1_NAME, -- url
Value => Object.Url);
Query.Save_Field (Name => COL_7_1_NAME, -- workspace_id
Value => Object.Workspace);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Blog_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (BLOG_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Blog_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Blog_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Blog_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "name" then
return Util.Beans.Objects.To_Object (Impl.Name);
elsif Name = "uid" then
return Util.Beans.Objects.To_Object (Impl.Uid);
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (Impl.Create_Date);
elsif Name = "update_date" then
return Util.Beans.Objects.Time.To_Object (Impl.Update_Date);
elsif Name = "url" then
return Util.Beans.Objects.To_Object (Impl.Url);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
procedure List (Object : in out Blog_Vector;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, BLOG_DEF'Access);
begin
Stmt.Execute;
Blog_Vectors.Clear (Object);
while Stmt.Has_Elements loop
declare
Item : Blog_Ref;
Impl : constant Blog_Access := new Blog_Impl;
begin
Impl.Load (Stmt, Session);
ADO.Objects.Set_Object (Item, Impl.all'Access);
Object.Append (Item);
end;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Blog_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Name := Stmt.Get_Unbounded_String (1);
Object.Uid := Stmt.Get_Unbounded_String (3);
Object.Create_Date := Stmt.Get_Time (4);
Object.Update_Date := Stmt.Get_Time (5);
Object.Url := Stmt.Get_Unbounded_String (6);
if not Stmt.Is_Null (7) then
Object.Workspace.Set_Key_Value (Stmt.Get_Identifier (7), Session);
end if;
Object.Version := Stmt.Get_Integer (2);
ADO.Objects.Set_Created (Object);
end Load;
function Post_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => POST_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Post_Key;
function Post_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => POST_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Post_Key;
function "=" (Left, Right : Post_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Post_Ref'Class;
Impl : out Post_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Post_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Post_Ref) is
Impl : Post_Access;
begin
Impl := new Post_Impl;
Impl.Create_Date := ADO.DEFAULT_TIME;
Impl.Version := 0;
Impl.Publish_Date.Is_Null := True;
Impl.Status := AWA.Blogs.Models.Post_Status_Type'First;
Impl.Allow_Comments := False;
Impl.Read_Count := 0;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Post
-- ----------------------------------------
procedure Set_Id (Object : in out Post_Ref;
Value : in ADO.Identifier) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Post_Ref)
return ADO.Identifier is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Title (Object : in out Post_Ref;
Value : in String) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 2, Impl.Title, Value);
end Set_Title;
procedure Set_Title (Object : in out Post_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 2, Impl.Title, Value);
end Set_Title;
function Get_Title (Object : in Post_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Title);
end Get_Title;
function Get_Title (Object : in Post_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Title;
end Get_Title;
procedure Set_Text (Object : in out Post_Ref;
Value : in String) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Text, Value);
end Set_Text;
procedure Set_Text (Object : in out Post_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 3, Impl.Text, Value);
end Set_Text;
function Get_Text (Object : in Post_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Text);
end Get_Text;
function Get_Text (Object : in Post_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Text;
end Get_Text;
procedure Set_Create_Date (Object : in out Post_Ref;
Value : in Ada.Calendar.Time) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 4, Impl.Create_Date, Value);
end Set_Create_Date;
function Get_Create_Date (Object : in Post_Ref)
return Ada.Calendar.Time is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Create_Date;
end Get_Create_Date;
procedure Set_Uri (Object : in out Post_Ref;
Value : in String) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 5, Impl.Uri, Value);
end Set_Uri;
procedure Set_Uri (Object : in out Post_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 5, Impl.Uri, Value);
end Set_Uri;
function Get_Uri (Object : in Post_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Uri);
end Get_Uri;
function Get_Uri (Object : in Post_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Uri;
end Get_Uri;
function Get_Version (Object : in Post_Ref)
return Integer is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Publish_Date (Object : in out Post_Ref;
Value : in ADO.Nullable_Time) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 7, Impl.Publish_Date, Value);
end Set_Publish_Date;
function Get_Publish_Date (Object : in Post_Ref)
return ADO.Nullable_Time is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Publish_Date;
end Get_Publish_Date;
procedure Set_Status (Object : in out Post_Ref;
Value : in AWA.Blogs.Models.Post_Status_Type) is
procedure Set_Field_Enum is
new ADO.Objects.Set_Field_Operation (Post_Status_Type);
Impl : Post_Access;
begin
Set_Field (Object, Impl);
Set_Field_Enum (Impl.all, 8, Impl.Status, Value);
end Set_Status;
function Get_Status (Object : in Post_Ref)
return AWA.Blogs.Models.Post_Status_Type is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Status;
end Get_Status;
procedure Set_Allow_Comments (Object : in out Post_Ref;
Value : in Boolean) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Boolean (Impl.all, 9, Impl.Allow_Comments, Value);
ADO.Objects.Set_Field_Boolean (Impl.all, 9, Impl.Allow_Comments, Value);
end Set_Allow_Comments;
function Get_Allow_Comments (Object : in Post_Ref)
return Boolean is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Allow_Comments;
end Get_Allow_Comments;
procedure Set_Read_Count (Object : in out Post_Ref;
Value : in Integer) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 10, Impl.Read_Count, Value);
end Set_Read_Count;
function Get_Read_Count (Object : in Post_Ref)
return Integer is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Read_Count;
end Get_Read_Count;
procedure Set_Author (Object : in out Post_Ref;
Value : in AWA.Users.Models.User_Ref'Class) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 11, Impl.Author, Value);
end Set_Author;
function Get_Author (Object : in Post_Ref)
return AWA.Users.Models.User_Ref'Class is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Author;
end Get_Author;
procedure Set_Blog (Object : in out Post_Ref;
Value : in AWA.Blogs.Models.Blog_Ref'Class) is
Impl : Post_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 12, Impl.Blog, Value);
end Set_Blog;
function Get_Blog (Object : in Post_Ref)
return AWA.Blogs.Models.Blog_Ref'Class is
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Blog;
end Get_Blog;
-- Copy of the object.
procedure Copy (Object : in Post_Ref;
Into : in out Post_Ref) is
Result : Post_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Post_Access
:= Post_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Post_Access
:= new Post_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Title := Impl.Title;
Copy.Text := Impl.Text;
Copy.Create_Date := Impl.Create_Date;
Copy.Uri := Impl.Uri;
Copy.Version := Impl.Version;
Copy.Publish_Date := Impl.Publish_Date;
Copy.Status := Impl.Status;
Copy.Allow_Comments := Impl.Allow_Comments;
Copy.Read_Count := Impl.Read_Count;
Copy.Author := Impl.Author;
Copy.Blog := Impl.Blog;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Post_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Post_Access := new Post_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Post_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Post_Access := new Post_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Post_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Post_Access := new Post_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Post_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Post_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Post_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Post_Impl) is
type Post_Impl_Ptr is access all Post_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Post_Impl, Post_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Post_Impl_Ptr := Post_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Post_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, POST_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Post_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Post_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (POST_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_2_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_2_NAME, -- title
Value => Object.Title);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_2_NAME, -- text
Value => Object.Text);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_2_NAME, -- create_date
Value => Object.Create_Date);
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_2_NAME, -- uri
Value => Object.Uri);
Object.Clear_Modified (5);
end if;
if Object.Is_Modified (7) then
Stmt.Save_Field (Name => COL_6_2_NAME, -- publish_date
Value => Object.Publish_Date);
Object.Clear_Modified (7);
end if;
if Object.Is_Modified (8) then
Stmt.Save_Field (Name => COL_7_2_NAME, -- status
Value => Integer (Post_Status_Type'Pos (Object.Status)));
Object.Clear_Modified (8);
end if;
if Object.Is_Modified (9) then
Stmt.Save_Field (Name => COL_8_2_NAME, -- allow_comments
Value => Object.Allow_Comments);
Object.Clear_Modified (9);
end if;
if Object.Is_Modified (10) then
Stmt.Save_Field (Name => COL_9_2_NAME, -- read_count
Value => Object.Read_Count);
Object.Clear_Modified (10);
end if;
if Object.Is_Modified (11) then
Stmt.Save_Field (Name => COL_10_2_NAME, -- author_id
Value => Object.Author);
Object.Clear_Modified (11);
end if;
if Object.Is_Modified (12) then
Stmt.Save_Field (Name => COL_11_2_NAME, -- blog_id
Value => Object.Blog);
Object.Clear_Modified (12);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Post_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (POST_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_2_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_2_NAME, -- title
Value => Object.Title);
Query.Save_Field (Name => COL_2_2_NAME, -- text
Value => Object.Text);
Query.Save_Field (Name => COL_3_2_NAME, -- create_date
Value => Object.Create_Date);
Query.Save_Field (Name => COL_4_2_NAME, -- uri
Value => Object.Uri);
Query.Save_Field (Name => COL_5_2_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_6_2_NAME, -- publish_date
Value => Object.Publish_Date);
Query.Save_Field (Name => COL_7_2_NAME, -- status
Value => Integer (Post_Status_Type'Pos (Object.Status)));
Query.Save_Field (Name => COL_8_2_NAME, -- allow_comments
Value => Object.Allow_Comments);
Query.Save_Field (Name => COL_9_2_NAME, -- read_count
Value => Object.Read_Count);
Query.Save_Field (Name => COL_10_2_NAME, -- author_id
Value => Object.Author);
Query.Save_Field (Name => COL_11_2_NAME, -- blog_id
Value => Object.Blog);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Post_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (POST_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Post_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Post_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Post_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "title" then
return Util.Beans.Objects.To_Object (Impl.Title);
elsif Name = "text" then
return Util.Beans.Objects.To_Object (Impl.Text);
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (Impl.Create_Date);
elsif Name = "uri" then
return Util.Beans.Objects.To_Object (Impl.Uri);
elsif Name = "publish_date" then
if Impl.Publish_Date.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.Time.To_Object (Impl.Publish_Date.Value);
end if;
elsif Name = "status" then
return AWA.Blogs.Models.Post_Status_Type_Objects.To_Object (Impl.Status);
elsif Name = "allow_comments" then
return Util.Beans.Objects.To_Object (Impl.Allow_Comments);
elsif Name = "read_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Read_Count));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Post_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Title := Stmt.Get_Unbounded_String (1);
Object.Text := Stmt.Get_Unbounded_String (2);
Object.Create_Date := Stmt.Get_Time (3);
Object.Uri := Stmt.Get_Unbounded_String (4);
Object.Publish_Date := Stmt.Get_Time (6);
Object.Status := Post_Status_Type'Val (Stmt.Get_Integer (7));
Object.Allow_Comments := Stmt.Get_Boolean (8);
Object.Allow_Comments := Stmt.Get_Boolean (8);
Object.Read_Count := Stmt.Get_Integer (9);
if not Stmt.Is_Null (10) then
Object.Author.Set_Key_Value (Stmt.Get_Identifier (10), Session);
end if;
if not Stmt.Is_Null (11) then
Object.Blog.Set_Key_Value (Stmt.Get_Identifier (11), Session);
end if;
Object.Version := Stmt.Get_Integer (5);
ADO.Objects.Set_Created (Object);
end Load;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Admin_Post_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "title" then
return Util.Beans.Objects.To_Object (From.Title);
elsif Name = "uri" then
return Util.Beans.Objects.To_Object (From.Uri);
elsif Name = "date" then
return Util.Beans.Objects.Time.To_Object (From.Date);
elsif Name = "status" then
return AWA.Blogs.Models.Post_Status_Type_Objects.To_Object (From.Status);
elsif Name = "read_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Read_Count));
elsif Name = "username" then
return Util.Beans.Objects.To_Object (From.Username);
elsif Name = "comment_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Comment_Count));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Admin_Post_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "title" then
Item.Title := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "uri" then
Item.Uri := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "date" then
Item.Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "status" then
Item.Status := AWA.Blogs.Models.Post_Status_Type_Objects.To_Value (Value);
elsif Name = "read_count" then
Item.Read_Count := Util.Beans.Objects.To_Integer (Value);
elsif Name = "username" then
Item.Username := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "comment_count" then
Item.Comment_Count := Util.Beans.Objects.To_Integer (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out Admin_Post_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The Admin_Post_Info describes a post in the administration interface.
-- --------------------
procedure List (Object : in out Admin_Post_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out Admin_Post_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Natural := 0;
procedure Read (Into : in out Admin_Post_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Title := Stmt.Get_Unbounded_String (1);
Into.Uri := Stmt.Get_Unbounded_String (2);
Into.Date := Stmt.Get_Time (3);
Into.Status := AWA.Blogs.Models.Post_Status_Type'Val (Stmt.Get_Integer (4));
Into.Read_Count := Stmt.Get_Natural (5);
Into.Username := Stmt.Get_Unbounded_String (6);
Into.Comment_Count := Stmt.Get_Natural (7);
end Read;
begin
Stmt.Execute;
Admin_Post_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Blog_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "title" then
return Util.Beans.Objects.To_Object (From.Title);
elsif Name = "uid" then
return Util.Beans.Objects.To_Object (From.Uid);
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (From.Create_Date);
elsif Name = "post_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Post_Count));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Blog_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "title" then
Item.Title := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "uid" then
Item.Uid := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "create_date" then
Item.Create_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "post_count" then
Item.Post_Count := Util.Beans.Objects.To_Integer (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out Blog_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The list of blogs.
-- --------------------
procedure List (Object : in out Blog_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out Blog_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Natural := 0;
procedure Read (Into : in out Blog_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Title := Stmt.Get_Unbounded_String (1);
Into.Uid := Stmt.Get_Unbounded_String (2);
Into.Create_Date := Stmt.Get_Time (3);
Into.Post_Count := Stmt.Get_Integer (4);
end Read;
begin
Stmt.Execute;
Blog_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Comment_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "post_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Post_Id));
elsif Name = "title" then
return Util.Beans.Objects.To_Object (From.Title);
elsif Name = "author" then
return Util.Beans.Objects.To_Object (From.Author);
elsif Name = "email" then
return Util.Beans.Objects.To_Object (From.Email);
elsif Name = "date" then
return Util.Beans.Objects.Time.To_Object (From.Date);
elsif Name = "status" then
return AWA.Comments.Models.Status_Type_Objects.To_Object (From.Status);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Comment_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "post_id" then
Item.Post_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "title" then
Item.Title := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "author" then
Item.Author := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "email" then
Item.Email := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "date" then
Item.Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "status" then
Item.Status := AWA.Comments.Models.Status_Type_Objects.To_Value (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out Comment_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The comment information.
-- --------------------
procedure List (Object : in out Comment_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out Comment_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Natural := 0;
procedure Read (Into : in out Comment_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Post_Id := Stmt.Get_Identifier (1);
Into.Title := Stmt.Get_Unbounded_String (2);
Into.Author := Stmt.Get_Unbounded_String (3);
Into.Email := Stmt.Get_Unbounded_String (4);
Into.Date := Stmt.Get_Time (5);
Into.Status := AWA.Comments.Models.Status_Type'Val (Stmt.Get_Integer (6));
end Read;
begin
Stmt.Execute;
Comment_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Month_Stat_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "year" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Year));
elsif Name = "month" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Month));
elsif Name = "count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Count));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Month_Stat_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "year" then
Item.Year := Util.Beans.Objects.To_Integer (Value);
elsif Name = "month" then
Item.Month := Util.Beans.Objects.To_Integer (Value);
elsif Name = "count" then
Item.Count := Util.Beans.Objects.To_Integer (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out Month_Stat_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The month statistics.
-- --------------------
procedure List (Object : in out Month_Stat_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out Month_Stat_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Natural := 0;
procedure Read (Into : in out Month_Stat_Info) is
begin
Into.Year := Stmt.Get_Natural (0);
Into.Month := Stmt.Get_Natural (1);
Into.Count := Stmt.Get_Natural (2);
end Read;
begin
Stmt.Execute;
Month_Stat_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Post_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "title" then
return Util.Beans.Objects.To_Object (From.Title);
elsif Name = "uri" then
return Util.Beans.Objects.To_Object (From.Uri);
elsif Name = "date" then
return Util.Beans.Objects.Time.To_Object (From.Date);
elsif Name = "username" then
return Util.Beans.Objects.To_Object (From.Username);
elsif Name = "text" then
return Util.Beans.Objects.To_Object (From.Text);
elsif Name = "allow_comments" then
return Util.Beans.Objects.To_Object (From.Allow_Comments);
elsif Name = "comment_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Comment_Count));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Post_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "title" then
Item.Title := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "uri" then
Item.Uri := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "date" then
Item.Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "username" then
Item.Username := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "text" then
Item.Text := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "allow_comments" then
Item.Allow_Comments := Util.Beans.Objects.To_Boolean (Value);
elsif Name = "comment_count" then
Item.Comment_Count := Util.Beans.Objects.To_Integer (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out Post_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The Post_Info describes a post to be displayed in the blog page
-- --------------------
procedure List (Object : in out Post_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out Post_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Natural := 0;
procedure Read (Into : in out Post_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Title := Stmt.Get_Unbounded_String (1);
Into.Uri := Stmt.Get_Unbounded_String (2);
Into.Date := Stmt.Get_Time (3);
Into.Username := Stmt.Get_Unbounded_String (4);
Into.Text := Stmt.Get_Unbounded_String (5);
Into.Allow_Comments := Stmt.Get_Boolean (6);
Into.Comment_Count := Stmt.Get_Natural (7);
end Read;
begin
Stmt.Execute;
Post_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
procedure Op_Create (Bean : in out Blog_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Create (Bean : in out Blog_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Blog_Bean'Class (Bean).Create (Outcome);
end Op_Create;
package Binding_Blog_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Blog_Bean,
Method => Op_Create,
Name => "create");
procedure Op_Create_Default (Bean : in out Blog_Bean;
Event : in AWA.Events.Module_Event'Class);
procedure Op_Create_Default (Bean : in out Blog_Bean;
Event : in AWA.Events.Module_Event'Class) is
begin
Blog_Bean'Class (Bean).Create_Default (Event);
end Op_Create_Default;
package Binding_Blog_Bean_2 is
new AWA.Events.Action_Method.Bind (Bean => Blog_Bean,
Method => Op_Create_Default,
Name => "create_default");
procedure Op_Load (Bean : in out Blog_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Blog_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Blog_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Blog_Bean_3 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Blog_Bean,
Method => Op_Load,
Name => "load");
Binding_Blog_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Blog_Bean_1.Proxy'Access,
2 => Binding_Blog_Bean_2.Proxy'Access,
3 => Binding_Blog_Bean_3.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Blog_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Blog_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Blog_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "name" then
Item.Set_Name (Util.Beans.Objects.To_String (Value));
elsif Name = "uid" then
Item.Set_Uid (Util.Beans.Objects.To_String (Value));
elsif Name = "create_date" then
Item.Set_Create_Date (Util.Beans.Objects.Time.To_Time (Value));
elsif Name = "update_date" then
Item.Set_Update_Date (Util.Beans.Objects.Time.To_Time (Value));
elsif Name = "url" then
Item.Set_Url (Util.Beans.Objects.To_String (Value));
end if;
end Set_Value;
procedure Op_Save (Bean : in out Post_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Save (Bean : in out Post_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Post_Bean'Class (Bean).Save (Outcome);
end Op_Save;
package Binding_Post_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Post_Bean,
Method => Op_Save,
Name => "save");
procedure Op_Delete (Bean : in out Post_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Delete (Bean : in out Post_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Post_Bean'Class (Bean).Delete (Outcome);
end Op_Delete;
package Binding_Post_Bean_2 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Post_Bean,
Method => Op_Delete,
Name => "delete");
procedure Op_Load (Bean : in out Post_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Post_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Post_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Post_Bean_3 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Post_Bean,
Method => Op_Load,
Name => "load");
procedure Op_Load_Admin (Bean : in out Post_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load_Admin (Bean : in out Post_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Post_Bean'Class (Bean).Load_Admin (Outcome);
end Op_Load_Admin;
package Binding_Post_Bean_4 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Post_Bean,
Method => Op_Load_Admin,
Name => "load_admin");
Binding_Post_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Post_Bean_1.Proxy'Access,
2 => Binding_Post_Bean_2.Proxy'Access,
3 => Binding_Post_Bean_3.Proxy'Access,
4 => Binding_Post_Bean_4.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Post_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Post_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Post_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "title" then
Item.Set_Title (Util.Beans.Objects.To_String (Value));
elsif Name = "text" then
Item.Set_Text (Util.Beans.Objects.To_String (Value));
elsif Name = "create_date" then
Item.Set_Create_Date (Util.Beans.Objects.Time.To_Time (Value));
elsif Name = "uri" then
Item.Set_Uri (Util.Beans.Objects.To_String (Value));
elsif Name = "publish_date" then
if Util.Beans.Objects.Is_Null (Value) then
Item.Set_Publish_Date (ADO.Nullable_Time '(Is_Null => True, others => <>));
else
Item.Set_Publish_Date (ADO.Nullable_Time '(Is_Null => False,
Value => Util.Beans.Objects.Time.To_Time (Value)));
end if;
elsif Name = "status" then
Item.Set_Status (Post_Status_Type_Objects.To_Value (Value));
elsif Name = "allow_comments" then
Item.Set_Allow_Comments (Util.Beans.Objects.To_Boolean (Value));
elsif Name = "read_count" then
Item.Set_Read_Count (Util.Beans.Objects.To_Integer (Value));
end if;
end Set_Value;
procedure Op_Load (Bean : in out Post_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Post_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Post_List_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Post_List_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Post_List_Bean,
Method => Op_Load,
Name => "load");
Binding_Post_List_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Post_List_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Post_List_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Post_List_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Post_List_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "tag" then
return Util.Beans.Objects.To_Object (From.Tag);
elsif Name = "page" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page));
elsif Name = "count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Count));
elsif Name = "page_size" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page_Size));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Post_List_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "tag" then
Item.Tag := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "page" then
Item.Page := Util.Beans.Objects.To_Integer (Value);
elsif Name = "count" then
Item.Count := Util.Beans.Objects.To_Integer (Value);
elsif Name = "page_size" then
Item.Page_Size := Util.Beans.Objects.To_Integer (Value);
end if;
end Set_Value;
procedure Op_Load (Bean : in out Stat_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Stat_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Stat_List_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Stat_List_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Stat_List_Bean,
Method => Op_Load,
Name => "load");
Binding_Stat_List_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Stat_List_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Stat_List_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Stat_List_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Stat_List_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "blog_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Blog_Id));
elsif Name = "post_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Post_Id));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Stat_List_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "blog_id" then
Item.Blog_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "post_id" then
Item.Post_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
end if;
end Set_Value;
end AWA.Blogs.Models;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2015, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Asis.Definitions;
with Asis.Expressions;
package body Properties.Definitions.Discriminant_Constraint is
----------
-- Code --
----------
function Code
(Engine : access Engines.Contexts.Context;
Element : Asis.Definition;
Name : Engines.Text_Property)
return League.Strings.Universal_String
is
List : constant Asis.Discriminant_Association_List :=
Asis.Definitions.Discriminant_Associations (Element);
Text : League.Strings.Universal_String;
Expr : Asis.Expression;
begin
for J in List'Range loop
Expr := Asis.Expressions.Discriminant_Expression (List (J));
Text.Append (Engine.Text.Get_Property (Expr, Name));
if J /= List'Last then
Text.Append (",");
end if;
end loop;
return Text;
end Code;
end Properties.Definitions.Discriminant_Constraint;
|
with Libadalang.Analysis; use Libadalang.Analysis;
with Rejuvenation.Navigation; use Rejuvenation.Navigation;
package Rewriters_Context_Utils is
function Combine_Contexts (C1, C2 : Ada_Node) return Ada_Node
with Pre =>
Is_Reflexive_Ancestor (C1, C2)
or else Is_Reflexive_Ancestor (C2, C1),
Post =>
Is_Reflexive_Ancestor (Combine_Contexts'Result, C1)
and then Is_Reflexive_Ancestor (Combine_Contexts'Result, C2);
end Rewriters_Context_Utils;
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2014, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.CLDR.Collation_Rules_Parser;
package body Matreshka.CLDR.LDML_Parsers is
use type League.Strings.Universal_String;
Collation_Tag : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("collation");
Collations_Tag : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("collations");
Cr_Tag : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("cr");
Generation_Tag : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("generation");
Identity_Tag : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("identity");
Language_Tag : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("language");
LDML_Tag : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("ldml");
Settings_Tag : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("settings");
Suppress_Contractions_Tag : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("suppress_contractions");
Version_Tag : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("version");
Type_Attribute : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("type");
Standard_Image : constant League.Strings.Universal_String
:= League.Strings.To_Universal_String ("standard");
----------------
-- Characters --
----------------
overriding procedure Characters
(Self : in out LDML_Parser;
Text : League.Strings.Universal_String;
Success : in out Boolean) is
begin
Self.Text.Append (Text);
end Characters;
-----------------
-- End_Element --
-----------------
overriding procedure End_Element
(Self : in out LDML_Parser;
Namespace_URI : League.Strings.Universal_String;
Local_Name : League.Strings.Universal_String;
Qualified_Name : League.Strings.Universal_String;
Success : in out Boolean) is
begin
if Self.Ignore_Depth /= 0 then
Self.Ignore_Depth := Self.Ignore_Depth - 1;
elsif Qualified_Name = Cr_Tag then
Collation_Rules_Parser.Parse_Collation_Rules
(Self.Collations.all, Self.Text.To_Wide_Wide_String);
Self.Collect_Text := False;
elsif Qualified_Name = Suppress_Contractions_Tag then
for J in 2 .. Self.Text.Length - 1 loop
-- XXX This field must be parsed as Unicode Set.
Matreshka.CLDR.Collation_Data.Suppress_Contractions
(Self.Collations.all,
Wide_Wide_Character'Pos (Self.Text (J).To_Wide_Wide_Character));
end loop;
Self.Collect_Text := False;
end if;
end End_Element;
------------------
-- Error_String --
------------------
overriding function Error_String
(Self : LDML_Parser) return League.Strings.Universal_String is
begin
return League.Strings.Empty_Universal_String;
end Error_String;
-------------------
-- Start_Element --
-------------------
overriding procedure Start_Element
(Self : in out LDML_Parser;
Namespace_URI : League.Strings.Universal_String;
Local_Name : League.Strings.Universal_String;
Qualified_Name : League.Strings.Universal_String;
Attributes : XML.SAX.Attributes.SAX_Attributes;
Success : in out Boolean) is
begin
if Self.Ignore_Depth /= 0 then
Self.Ignore_Depth := Self.Ignore_Depth + 1;
elsif Qualified_Name = Collations_Tag then
null;
elsif Qualified_Name = Collation_Tag then
if Attributes.Value (Type_Attribute) /= Standard_Image then
-- Ignore all collations except 'standard'.
Self.Ignore_Depth := 1;
end if;
elsif Qualified_Name = Cr_Tag then
Self.Collect_Text := True;
Self.Text.Clear;
elsif Qualified_Name = Generation_Tag then
null;
elsif Qualified_Name = Identity_Tag then
null;
elsif Qualified_Name = Language_Tag then
null;
elsif Qualified_Name = LDML_Tag then
null;
elsif Qualified_Name = Settings_Tag then
null;
elsif Qualified_Name = Suppress_Contractions_Tag then
Self.Collect_Text := True;
Self.Text.Clear;
elsif Qualified_Name = Version_Tag then
null;
else
raise Program_Error;
end if;
end Start_Element;
end Matreshka.CLDR.LDML_Parsers;
|
------------------------------------------------------------------------------
-- --
-- GNAT LIBRARY COMPONENTS --
-- --
-- A D A . C O N T A I N E R S . B O U N D E D _ H O L D E R S --
-- --
-- B o d y --
-- --
-- Copyright (C) 2015-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
------------------------------------------------------------------------------
with Unchecked_Conversion;
with System.Put_Images;
package body Ada.Containers.Bounded_Holders is
function Size_In_Storage_Elements (Element : Element_Type) return Natural;
-- This returns the size of Element in storage units. It raises an
-- exception if the size is not a multiple of Storage_Unit, or if the size
-- is too big.
------------------------------
-- Size_In_Storage_Elements --
------------------------------
function Size_In_Storage_Elements (Element : Element_Type) return Natural is
Max_Size : Natural renames Max_Size_In_Storage_Elements;
begin
return S : constant Natural := Element'Size / System.Storage_Unit do
pragma Assert
(Element'Size mod System.Storage_Unit = 0,
"Size must be a multiple of Storage_Unit");
pragma Assert
(S <= Max_Size, "Size is too big:" & S'Img & " >" & Max_Size'Img);
end return;
end Size_In_Storage_Elements;
function Cast is new
Unchecked_Conversion (System.Address, Element_Access);
---------
-- "=" --
---------
function "=" (Left, Right : Holder) return Boolean is
begin
return Get (Left) = Get (Right);
end "=";
------------------------
-- Constant_Reference --
------------------------
function Constant_Reference
(Container : aliased Holder) return not null access constant Element_Type
is
begin
return Cast (Container'Address);
end Constant_Reference;
---------
-- Get --
---------
function Get (Container : Holder) return Element_Type is
begin
return Cast (Container'Address).all;
end Get;
---------------
-- Put_Image --
---------------
procedure Put_Image
(S : in out Ada.Strings.Text_Buffers.Root_Buffer_Type'Class; V : Holder)
is
use System.Put_Images;
begin
Array_Before (S);
Element_Type'Put_Image (S, Get (V));
Array_After (S);
end Put_Image;
---------------
-- Reference --
---------------
function Reference
(Container : not null access Holder) return not null access Element_Type
is
begin
return Cast (Container.all'Address);
end Reference;
---------
-- Set --
---------
procedure Set (Container : in out Holder; New_Item : Element_Type) is
Storage : Storage_Array
(1 .. Size_In_Storage_Elements (New_Item)) with
Address => New_Item'Address;
begin
Container.Data (Storage'Range) := Storage;
end Set;
---------------
-- To_Holder --
---------------
function To_Holder (New_Item : Element_Type) return Holder is
begin
return Result : Holder do
Set (Result, New_Item);
end return;
end To_Holder;
end Ada.Containers.Bounded_Holders;
|
pragma License (Unrestricted);
-- extended unit
with Ada.References.Strings;
with Ada.Streams.Block_Transmission.Strings;
with Ada.Strings.Generic_Unbounded;
package Ada.Strings.Unbounded_Strings is
new Generic_Unbounded (
Character,
String,
Streams.Block_Transmission.Strings.Read,
Streams.Block_Transmission.Strings.Write,
References.Strings.Slicing);
pragma Preelaborate (Ada.Strings.Unbounded_Strings);
|
------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2009-2015, Vadim Godunko <vgodunko@gmail.com> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
package Matreshka.Internals.Unicode.Ucd is
pragma Preelaborate;
type First_Stage_Index is mod 16#1100#;
type Second_Stage_Index is mod 16#100#;
type Sequence_Count is range 0 .. 2 ** 16 - 1;
for Sequence_Count'Size use 16;
subtype Sequence_Index is Sequence_Count range 1 .. Sequence_Count'Last;
type Code_Point_Sequence is array (Sequence_Index range <>) of Code_Point;
type Code_Point_Sequence_Access is access constant Code_Point_Sequence;
---------------------
-- Core properties --
---------------------
type General_Category is
(Control,
Format,
Unassigned,
Private_Use,
Surrogate,
Lowercase_Letter,
Titlecase_Letter,
Uppercase_Letter,
Modifier_Letter,
Other_Letter,
Spacing_Mark,
Enclosing_Mark,
Nonspacing_Mark,
Decimal_Number,
Letter_Number,
Other_Number,
Connector_Punctuation,
Dash_Punctuation,
Close_Punctuation,
Final_Punctuation,
Initial_Punctuation,
Other_Punctuation,
Open_Punctuation,
Currency_Symbol,
Modifier_Symbol,
Math_Symbol,
Other_Symbol,
Line_Separator,
Paragraph_Separator,
Space_Separator);
for General_Category'Size use 8;
type Boolean_Properties is
(Composition_Exclusion, -- XXX
Expands_On_NFC, -- Derived
Expands_On_NFD, -- Derived
Expands_On_NFKC, -- Derived
Expands_On_NFKD, -- Derived
Full_Composition_Exclusion, -- Derived
ASCII_Hex_Digit,
Bidi_Control,
Dash,
Deprecated,
Diacritic,
Extender,
Hex_Digit,
Hyphen,
Ideographic,
IDS_Binary_Operator,
IDS_Trinary_Operator,
Join_Control,
Logical_Order_Exception,
Noncharacter_Code_Point,
Other_Alphabetic,
Other_Default_Ignorable_Code_Point,
Other_Grapheme_Extend,
Other_ID_Continue,
Other_ID_Start,
Other_Lowercase,
Other_Math,
Other_Uppercase,
Pattern_Syntax,
Pattern_White_Space,
Quotation_Mark,
Radical,
Soft_Dotted,
STerm,
Terminal_Punctuation,
Unified_Ideograph,
Variation_Selector,
White_Space,
-- Bidi_Mirrored, -- XXX
-- Derived core properties. This list must include only properties
-- from DerivedCoreProperties.txt file.
Alphabetic, -- Derived
Cased, -- Derived
Case_Ignorable, -- Derived
Changes_When_Lowercased, -- Derived
Changes_When_Uppercased, -- Derived
Changes_When_Titlecased, -- Derived
Changes_When_Casefolded, -- Derived
Changes_When_Casemapped, -- Derived
Default_Ignorable_Code_Point, -- Derived
Grapheme_Base, -- Derived
Grapheme_Extend, -- Derived
Grapheme_Link, -- Deprecated, derived
ID_Continue, -- Derived
ID_Start, -- Derived
Lowercase, -- Derived
Math, -- Derived
Uppercase, -- Derived
XID_Continue, -- Derived
XID_Start, -- Derived
-- Derived normalization properties.
Changes_When_NFKC_Casefolded); -- Derived
subtype Overridable_Boolean_Properties is Boolean_Properties
range ASCII_Hex_Digit .. Changes_When_NFKC_Casefolded;
type Boolean_Values is array (Overridable_Boolean_Properties) of Boolean;
for Boolean_Values'Component_Size use 1;
for Boolean_Values'Size use 64; -- 52 bits used for now
type East_Asian_Width is
(Ambiguous,
Fullwidth,
Halfwidth,
Neutral,
Narrow,
Wide);
for East_Asian_Width'Size use 8;
type Grapheme_Cluster_Break is
(Control,
CR,
Extend,
L,
LF,
LV,
LVT,
Prepend,
Regional_Indicator,
Spacing_Mark,
T,
V,
Other);
for Grapheme_Cluster_Break'Size use 8;
type Word_Break is
(CR,
LF,
Newline,
Extend,
Regional_Indicator,
Format,
Katakana,
Hebrew_Letter,
A_Letter,
Single_Quote,
Double_Quote,
Mid_Num_Let,
Mid_Letter,
Mid_Num,
Numeric,
Extend_Num_Let,
Other);
for Word_Break'Size use 8;
type Sentence_Break is
(Other,
CR,
LF,
Sep,
Sp,
Lower,
Upper,
O_Letter,
Numeric,
A_Term,
S_Term,
Close,
S_Continue,
Format,
Extend);
for Sentence_Break'Size use 8;
type Line_Break is
(Ambiguous,
Alphabetic,
Break_Both,
Break_After,
Break_Before,
Mandatory_Break,
Contingent_Break,
Conditional_Japanese_Starter,
Close_Punctuation,
Combining_Mark,
Close_Parenthesis,
Carriage_Return,
Exclamation,
Glue,
H2,
H3,
Hebrew_Letter,
Hyphen,
Ideographic,
Inseparable,
Infix_Numeric,
JL,
JT,
JV,
Line_Feed,
Next_Line,
Nonstarter,
Numeric,
Open_Punctuation,
Postfix_Numeric,
Prefix_Numeric,
Quotation,
Regional_Indicator,
Complex_Context,
Surrogate,
Space,
Break_Symbols,
Word_Joiner,
Unknown,
ZW_Space);
for Line_Break'Size use 8;
type Core_Values is record
GC : General_Category; -- 8 (5) bits
EA : East_Asian_Width; -- 8 (3) bits
GCB : Grapheme_Cluster_Break; -- 8 (4) bits
WB : Word_Break; -- 8 (4) bits
SB : Sentence_Break; -- 8 (4) bits
LB : Line_Break; -- 8 (6) bits
B : Boolean_Values; -- 64 (52) bits
end record;
for Core_Values'Size use 128;
for Core_Values use record
B at 0 range 0 .. 63;
GC at 0 range 64 .. 71;
GCB at 0 range 72 .. 79;
WB at 0 range 80 .. 87;
SB at 0 range 88 .. 95;
LB at 0 range 96 .. 103;
EA at 0 range 104 .. 111;
end record;
type Core_Second_Stage is array (Second_Stage_Index) of Core_Values;
type Core_Second_Stage_Access is not null access constant Core_Second_Stage;
type Core_First_Stage is
array (First_Stage_Index) of Core_Second_Stage_Access;
type Core_First_Stage_Access is not null access constant Core_First_Stage;
------------
-- Casing --
------------
type Casing_Context is
(Final_Sigma,
After_Soft_Dotted,
More_Above,
Before_Dot,
After_I);
type Case_Mapping_Range is record
First : Sequence_Count;
Last : Sequence_Count;
end record;
type Case_Mapping_Kinds is (Lower, Upper, Title, Folding);
type Case_Mapping_Ranges is
array (Case_Mapping_Kinds) of Case_Mapping_Range;
type Simple_Case_Mappings is
array (Case_Mapping_Kinds) of Code_Point;
type Casing_Context_Mapping_Ranges is
array (Case_Mapping_Kinds range Lower .. Title) of Case_Mapping_Range;
type Case_Mapping is record
Simple : Simple_Case_Mappings;
Ranges : Case_Mapping_Ranges;
Context_First : Sequence_Count;
Context_Last : Sequence_Count;
end record;
type Casing_Context_Mapping is record
Context : Casing_Context;
Negative : Boolean;
Ranges : Casing_Context_Mapping_Ranges;
end record;
type Case_Mapping_Second_Stage is
array (Second_Stage_Index) of Case_Mapping;
type Case_Mapping_Second_Stage_Access is
not null access constant Case_Mapping_Second_Stage;
type Case_Mapping_First_Stage is
array (First_Stage_Index) of Case_Mapping_Second_Stage_Access;
type Case_Mapping_First_Stage_Access is
access constant Case_Mapping_First_Stage;
type Casing_Context_Mapping_Sequence is
array (Sequence_Index range <>) of Casing_Context_Mapping;
type Casing_Context_Mapping_Sequence_Access is
access constant Casing_Context_Mapping_Sequence;
-------------------
-- Normalization --
-------------------
type Canonical_Combining_Class is mod 256;
Not_Reordered : constant Canonical_Combining_Class := 0;
Overlay : constant Canonical_Combining_Class := 1;
Nukta : constant Canonical_Combining_Class := 7;
Kana_Voicing : constant Canonical_Combining_Class := 8;
Virama : constant Canonical_Combining_Class := 9;
Attached_Below_Left : constant Canonical_Combining_Class := 200;
Attached_Below : constant Canonical_Combining_Class := 202;
Attached_Above_Right : constant Canonical_Combining_Class := 216;
Below_Left : constant Canonical_Combining_Class := 218;
Below : constant Canonical_Combining_Class := 220;
Below_Right : constant Canonical_Combining_Class := 222;
Left : constant Canonical_Combining_Class := 224;
Right : constant Canonical_Combining_Class := 226;
Above_Left : constant Canonical_Combining_Class := 228;
Above : constant Canonical_Combining_Class := 230;
Above_Right : constant Canonical_Combining_Class := 232;
Double_Below : constant Canonical_Combining_Class := 233;
Double_Above : constant Canonical_Combining_Class := 234;
Iota_Subscript : constant Canonical_Combining_Class := 240;
type Decomposition_Type is
(None,
Canonical,
Font,
No_Break,
Initial,
Medial,
Final,
Isolated,
Circle,
Super,
Sub,
Vertical,
Wide,
Narrow,
Small,
Square,
Fraction,
Compat);
for Decomposition_Type'Size use 8;
subtype Not_Overridable_Boolean_Properties is Boolean_Properties
range Composition_Exclusion .. Full_Composition_Exclusion;
type Non_Overridable_Boolean_Values is
array (Not_Overridable_Boolean_Properties) of Boolean;
for Non_Overridable_Boolean_Values'Component_Size use 1;
for Non_Overridable_Boolean_Values'Size use 8; -- 6 bits used for now
type Normalization_Quick_Check is (No, Maybe, Yes);
for Normalization_Quick_Check'Size use 2;
type Normalization_Form is (NFC, NFD, NFKC, NFKD);
type Normalization_Quick_Checks is
array (Normalization_Form) of Normalization_Quick_Check;
for Normalization_Quick_Checks'Size use 8;
for Normalization_Quick_Checks'Component_Size
use Normalization_Quick_Check'Size;
type Normalization_Mapping_Range is record
First : Sequence_Count;
Last : Sequence_Count;
end record;
type Decomposition_Kinds is (Canonical, Compatibility);
type Decomposition_Mapping is
array (Decomposition_Kinds) of Normalization_Mapping_Range;
type Normalization_Mapping is record
Decomposition : Decomposition_Mapping;
Composition : Normalization_Mapping_Range;
CCC : Canonical_Combining_Class; -- 8 bits
NQC : Normalization_Quick_Checks; -- 8 bits
DT : Decomposition_Type; -- 8 (5) bits
B : Non_Overridable_Boolean_Values;
end record;
for Normalization_Mapping'Size use 128;
type Normalization_Mapping_Second_Stage is
array (Second_Stage_Index) of Normalization_Mapping;
type Normalization_Mapping_Second_Stage_Access is
not null access constant Normalization_Mapping_Second_Stage;
type Normalization_Mapping_First_Stage is
array (First_Stage_Index) of Normalization_Mapping_Second_Stage_Access;
type Composition_Mapping is
array (Sequence_Index range <>, Sequence_Index range <>) of Code_Point;
---------------
-- Collation --
---------------
type Collation_Weight is mod 2**16;
for Collation_Weight'Size use 16;
pragma Assert (Code_Unit_16'Size = Collation_Weight'Size);
-- Note: collation algoriphm in identical strength level adds copy of the
-- source string in NFD form at the end of produced sorting key, thus it is
-- important that Code_Unit_16 and Collation_Weight types have equal size.
type Collation_Element is record
Primary : Collation_Weight;
Secondary : Collation_Weight;
Trinary : Collation_Weight;
end record;
type Collation_Element_Sequence is
array (Sequence_Index range <>) of Collation_Element;
type Collation_Element_Sequence_Access is
access constant Collation_Element_Sequence;
type Contractor_Record is record
Code : Code_Point;
Contractor_First : Sequence_Count;
Contractor_Last : Sequence_Count;
Expansion_First : Sequence_Count;
Expansion_Last : Sequence_Count;
end record;
type Contractor_Array is
array (Sequence_Index range <>) of Contractor_Record;
type Contractor_Array_Access is access constant Contractor_Array;
type Collation_Record is record
Contractor_First : Sequence_Count;
Contractor_Last : Sequence_Count;
Expansion_First : Sequence_Count;
Expansion_Last : Sequence_Count;
end record;
type Collation_Second_Stage is
array (Second_Stage_Index) of Collation_Record;
type Collation_Second_Stage_Access is
not null access constant Collation_Second_Stage;
type Collation_First_Stage is
array (First_Stage_Index) of Collation_Second_Stage_Access;
type Collation_First_Stage_Access is access constant Collation_First_Stage;
-------------------------------
-- Two stage table utilities --
-------------------------------
generic
type Element_Type is private;
type Second_Stage_Array is
array (Second_Stage_Index) of Element_Type;
type Second_Stage_Array_Access is
not null access constant Second_Stage_Array;
type First_Stage_Array is
array (First_Stage_Index) of Second_Stage_Array_Access;
function Generic_Element (Data : First_Stage_Array; Code : Code_Point)
return Element_Type;
end Matreshka.Internals.Unicode.Ucd;
|
with Ada.Directories;
with Ahven.Framework;
with Annotation.Api;
package Test_Null_Annotation.Write is
package Skill renames Annotation.Api;
use Annotation;
use Annotation.Api;
type Test is new Ahven.Framework.Test_Case with null record;
procedure Initialize (T : in out Test);
procedure Set_Up (T : in out Test);
procedure Tear_Down (T : in out Test);
procedure Read_Written (T : in out Ahven.Framework.Test_Case'Class);
procedure Null_Annotation (T : in out Ahven.Framework.Test_Case'Class);
end Test_Null_Annotation.Write;
|
-- print_ada.adb
with Ada.Text_IO; use Ada.Text_IO;
procedure print_ada is
begin
Put_Line("###############################################################");
Put_Line("###############################################################");
Put_Line("## ##");
Put_Line("## 00000000000 0000000000 00000000000 ##");
Put_Line("## 00 00 00 00 00 00 ##");
Put_Line("## 00 00 00 00 00 00 ##");
Put_Line("## 00000000000 00 00 00000000000 ##");
Put_Line("## 00 00 00 00 00 00 ##");
Put_Line("## 00 00 00 00 00 00 ##");
Put_Line("## 00 00 0000000000 00 00 ##");
Put_Line("## ##");
Put_Line("###############################################################");
Put_Line("###############################################################");
end print_ada;
|
------------------------------------------------------------------------------
-- --
-- GNAT EXAMPLE --
-- --
-- Copyright (C) 2013, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package Config is
procedure Disp_Start;
-- Configuration specific procedure called before the user command loop.
-- Can be used to display a banner.
end Config;
|
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Program.Lexical_Elements;
with Program.Elements.Expressions;
with Program.Elements.Raise_Expressions;
with Program.Element_Visitors;
package Program.Nodes.Raise_Expressions is
pragma Preelaborate;
type Raise_Expression is
new Program.Nodes.Node
and Program.Elements.Raise_Expressions.Raise_Expression
and Program.Elements.Raise_Expressions.Raise_Expression_Text
with private;
function Create
(Raise_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Exception_Name : not null Program.Elements.Expressions
.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Associated_Message : Program.Elements.Expressions.Expression_Access)
return Raise_Expression;
type Implicit_Raise_Expression is
new Program.Nodes.Node
and Program.Elements.Raise_Expressions.Raise_Expression
with private;
function Create
(Exception_Name : not null Program.Elements.Expressions
.Expression_Access;
Associated_Message : Program.Elements.Expressions.Expression_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False)
return Implicit_Raise_Expression
with Pre =>
Is_Part_Of_Implicit or Is_Part_Of_Inherited or Is_Part_Of_Instance;
private
type Base_Raise_Expression is
abstract new Program.Nodes.Node
and Program.Elements.Raise_Expressions.Raise_Expression
with record
Exception_Name : not null Program.Elements.Expressions
.Expression_Access;
Associated_Message : Program.Elements.Expressions.Expression_Access;
end record;
procedure Initialize (Self : aliased in out Base_Raise_Expression'Class);
overriding procedure Visit
(Self : not null access Base_Raise_Expression;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class);
overriding function Exception_Name
(Self : Base_Raise_Expression)
return not null Program.Elements.Expressions.Expression_Access;
overriding function Associated_Message
(Self : Base_Raise_Expression)
return Program.Elements.Expressions.Expression_Access;
overriding function Is_Raise_Expression_Element
(Self : Base_Raise_Expression)
return Boolean;
overriding function Is_Expression_Element
(Self : Base_Raise_Expression)
return Boolean;
type Raise_Expression is
new Base_Raise_Expression
and Program.Elements.Raise_Expressions.Raise_Expression_Text
with record
Raise_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
end record;
overriding function To_Raise_Expression_Text
(Self : aliased in out Raise_Expression)
return Program.Elements.Raise_Expressions.Raise_Expression_Text_Access;
overriding function Raise_Token
(Self : Raise_Expression)
return not null Program.Lexical_Elements.Lexical_Element_Access;
overriding function With_Token
(Self : Raise_Expression)
return Program.Lexical_Elements.Lexical_Element_Access;
type Implicit_Raise_Expression is
new Base_Raise_Expression
with record
Is_Part_Of_Implicit : Boolean;
Is_Part_Of_Inherited : Boolean;
Is_Part_Of_Instance : Boolean;
end record;
overriding function To_Raise_Expression_Text
(Self : aliased in out Implicit_Raise_Expression)
return Program.Elements.Raise_Expressions.Raise_Expression_Text_Access;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Raise_Expression)
return Boolean;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Raise_Expression)
return Boolean;
overriding function Is_Part_Of_Instance
(Self : Implicit_Raise_Expression)
return Boolean;
end Program.Nodes.Raise_Expressions;
|
------------------------------------------------------------------------------
-- --
-- Copyright (C) 2019, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
package body AdaFruit.CharlieWing is
-----------------
-- LED_Address --
-----------------
overriding
function LED_Address (This : Device;
X : IS31FL3731.X_Coord;
Y : IS31FL3731.Y_Coord)
return IS31FL3731.LED_Id
is
pragma Unreferenced (This);
X2 : Natural := X;
Y2 : Natural := Y;
begin
if X2 > 7 then
X2 := 15 - X2;
Y2 := Y2 + 8;
else
Y2 := 7 - Y2;
end if;
return IS31FL3731.LED_Id (X2 * 16 + Y2);
end LED_Address;
end AdaFruit.CharlieWing;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.