content
stringlengths
23
1.05M
with System.Address_To_Access_Conversions; with System.Storage_Elements; with C.errno; with C.iconv; with C.string; with iconv.Inside; package body iconv is use type Ada.Streams.Stream_Element_Offset; use type System.Address; use type C.signed_int; use type C.size_t; package char_ptr_Conv is new System.Address_To_Access_Conversions (C.char); -- implementation function Version return String renames Inside.Version; procedure Iterate (Process : not null access procedure (Name : in String)) renames Inside.Iterate; procedure Open (Object : in out Converter; To : in String; From : in String) is pragma Check (Dynamic_Predicate, Check => not Is_Open (Object) or else raise Status_Error); begin Do_Open (Object, To => To, From => From); end Open; function Open (To : String; From : String) return Converter is begin return Result : Converter do Do_Open (Result, To => To, From => From); end return; end Open; function Is_Open (Object : Converter) return Boolean is NC_Object : Non_Controlled_Converter renames Controlled.Constant_Reference (Object).all; begin return NC_Object.Handle /= System.Null_Address; end Is_Open; function Min_Size_In_From_Stream_Elements ( Object : Converter) return Ada.Streams.Stream_Element_Offset is pragma Check (Dynamic_Predicate, Check => Is_Open (Object) or else raise Status_Error); NC_Object : Non_Controlled_Converter renames Controlled.Constant_Reference (Object).all; begin return NC_Object.Min_Size_In_From_Stream_Elements; end Min_Size_In_From_Stream_Elements; function Substitute ( Object : Converter) return Ada.Streams.Stream_Element_Array is pragma Check (Dynamic_Predicate, Check => Is_Open (Object) or else raise Status_Error); NC_Object : Non_Controlled_Converter renames Controlled.Constant_Reference (Object).all; begin return NC_Object.Substitute (1 .. NC_Object.Substitute_Length); end Substitute; procedure Set_Substitute ( Object : in out Converter; Substitute : in Ada.Streams.Stream_Element_Array) is pragma Check (Dynamic_Predicate, Check => Is_Open (Object) or else raise Status_Error); NC_Object : Non_Controlled_Converter renames Controlled.Reference (Object).all; begin if Substitute'Length > NC_Object.Substitute'Length then raise Constraint_Error; end if; NC_Object.Substitute_Length := Substitute'Length; NC_Object.Substitute (1 .. NC_Object.Substitute_Length) := Substitute; end Set_Substitute; procedure Convert ( Object : in Converter; In_Item : in Ada.Streams.Stream_Element_Array; In_Last : out Ada.Streams.Stream_Element_Offset; Out_Item : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Finish : in Boolean; Status : out Subsequence_Status_Type) is Continuing_Status : Continuing_Status_Type; Finishing_Status : Finishing_Status_Type; begin Convert ( Object, -- Status_Error would be raised if Object is not open In_Item, In_Last, Out_Item, Out_Last, Status => Continuing_Status); Status := Subsequence_Status_Type (Continuing_Status); if Finish and then Status = Success and then In_Last = In_Item'Last then Convert ( Object, Out_Item (Out_Last + 1 .. Out_Item'Last), Out_Last, Finish => True, Status => Finishing_Status); Status := Subsequence_Status_Type (Finishing_Status); end if; end Convert; procedure Convert ( Object : in Converter; In_Item : in Ada.Streams.Stream_Element_Array; In_Last : out Ada.Streams.Stream_Element_Offset; Out_Item : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Status : out Continuing_Status_Type) is pragma Check (Dynamic_Predicate, Check => Is_Open (Object) or else raise Status_Error); pragma Suppress (All_Checks); NC_Object : Non_Controlled_Converter renames Controlled.Constant_Reference (Object).all; In_Pointer : aliased C.char_const_ptr := C.char_const_ptr (char_ptr_Conv.To_Pointer (In_Item (In_Item'First)'Address)); In_Size : aliased C.size_t := In_Item'Length; Out_Pointer : aliased C.char_ptr := C.char_ptr (char_ptr_Conv.To_Pointer (Out_Item (Out_Item'First)'Address)); Out_Size : aliased C.size_t := Out_Item'Length; errno : C.signed_int; begin if C.iconv.iconv ( C.iconv.iconv_t (NC_Object.Handle), In_Pointer'Access, In_Size'Access, Out_Pointer'Access, Out_Size'Access) = C.size_t'Last then errno := C.errno.errno; case errno is when C.errno.E2BIG => Status := Overflow; when C.errno.EINVAL -- dirty hack for OSX | -1601902748 | -1603246236 | -1609021596 | -1610246300 => Status := Truncated; when C.errno.EILSEQ => Status := Illegal_Sequence; when others => raise Use_Error with "iconv failed (errno =" & C.signed_int'Image (errno) & ")"; end case; else Status := Success; end if; In_Last := In_Item'First + (In_Item'Length - Ada.Streams.Stream_Element_Offset (In_Size)) - 1; Out_Last := Out_Item'First + (Out_Item'Length - Ada.Streams.Stream_Element_Offset (Out_Size)) - 1; end Convert; procedure Convert ( Object : in Converter; Out_Item : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Finish : in True_Only; Status : out Finishing_Status_Type) is pragma Unreferenced (Finish); pragma Check (Dynamic_Predicate, Check => Is_Open (Object) or else raise Status_Error); NC_Object : Non_Controlled_Converter renames Controlled.Constant_Reference (Object).all; Out_Pointer : aliased C.char_ptr := C.char_ptr (char_ptr_Conv.To_Pointer (Out_Item'Address)); Out_Size : aliased C.size_t := Out_Item'Length; errno : C.signed_int; begin if C.iconv.iconv ( C.iconv.iconv_t (NC_Object.Handle), C.char_const_ptr_ptr'(null), null, Out_Pointer'Access, Out_Size'Access) = C.size_t'Last then errno := C.errno.errno; case errno is when C.errno.E2BIG => Status := Overflow; when others => -- unknown raise Use_Error with "iconv failed (errno =" & C.signed_int'Image (errno) & ")"; end case; else Status := Finished; end if; Out_Last := Out_Item'First + (Out_Item'Length - Ada.Streams.Stream_Element_Offset (Out_Size)) - 1; end Convert; procedure Convert ( Object : in Converter; In_Item : in Ada.Streams.Stream_Element_Array; In_Last : out Ada.Streams.Stream_Element_Offset; Out_Item : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Finish : in True_Only; Status : out Status_Type) is begin In_Last := In_Item'First - 1; Out_Last := Out_Item'First - 1; loop declare Subsequence_Status : Subsequence_Status_Type; begin Convert ( Object, -- Status_Error would be raised if Object is not open In_Item (In_Last + 1 .. In_Item'Last), In_Last, Out_Item (Out_Last + 1 .. Out_Item'Last), Out_Last, Finish => Finish, Status => Subsequence_Status); pragma Assert ( Subsequence_Status in Subsequence_Status_Type (Status_Type'First) .. Subsequence_Status_Type (Status_Type'Last)); case Status_Type (Subsequence_Status) is when Finished => Status := Finished; return; when Success => Status := Success; return; when Overflow => Status := Overflow; return; when Illegal_Sequence => declare Is_Overflow : Boolean; begin Put_Substitute ( Object, Out_Item (Out_Last + 1 .. Out_Item'Last), Out_Last, Is_Overflow); if Is_Overflow then Status := Overflow; return; -- wait a next try end if; end; declare New_Last : Ada.Streams.Stream_Element_Offset := In_Last + Min_Size_In_From_Stream_Elements (Object); begin if New_Last > In_Item'Last or else New_Last < In_Last -- overflow then New_Last := In_Item'Last; end if; In_Last := New_Last; end; end case; end; end loop; end Convert; procedure Convert ( Object : in Converter; In_Item : in Ada.Streams.Stream_Element_Array; In_Last : out Ada.Streams.Stream_Element_Offset; Out_Item : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Finish : in True_Only; Status : out Substituting_Status_Type) is begin In_Last := In_Item'First - 1; Out_Last := Out_Item'First - 1; loop declare Subsequence_Status : Subsequence_Status_Type; begin Convert ( Object, -- Status_Error would be raised if Object is not open In_Item (In_Last + 1 .. In_Item'Last), In_Last, Out_Item (Out_Last + 1 .. Out_Item'Last), Out_Last, Finish => Finish, Status => Subsequence_Status); pragma Assert ( Subsequence_Status in Subsequence_Status_Type (Status_Type'First) .. Subsequence_Status_Type (Status_Type'Last)); case Status_Type (Subsequence_Status) is when Finished => Status := Finished; return; when Success => Status := Success; return; when Overflow => Status := Overflow; return; when Illegal_Sequence => declare Is_Overflow : Boolean; begin Put_Substitute ( Object, Out_Item (Out_Last + 1 .. Out_Item'Last), Out_Last, Is_Overflow); if Is_Overflow then raise Constraint_Error; end if; end; declare New_Last : Ada.Streams.Stream_Element_Offset := In_Last + Min_Size_In_From_Stream_Elements (Object); begin if New_Last > In_Item'Last or else New_Last < In_Last -- overflow then New_Last := In_Item'Last; end if; In_Last := New_Last; end; end case; end; end loop; end Convert; package body Controlled is function Variable_View (Object : Converter) return not null access Converter is begin return Object.Variable_View; end Variable_View; function Reference (Object : in out iconv.Converter) return not null access Non_Controlled_Converter is begin return Converter (Object).Variable_View.Data'Access; end Reference; function Constant_Reference (Object : iconv.Converter) return not null access constant Non_Controlled_Converter is begin return Converter (Object).Data'Unchecked_Access; end Constant_Reference; procedure Finalize (Object : in out Converter) is begin if Object.Data.Handle /= System.Null_Address -- for glibc and then C.iconv.iconv_close (C.iconv.iconv_t (Object.Data.Handle)) /= 0 then null; end if; end Finalize; end Controlled; procedure Do_Open (Object : out Converter; To : in String; From : in String) is NC_Object : Non_Controlled_Converter renames Controlled.Reference (Object).all; C_To : aliased C.char_array (0 .. To'Length); C_From : aliased C.char_array (0 .. From'Length); Invalid : constant System.Address := System.Storage_Elements.To_Address ( System.Storage_Elements.Integer_Address'Mod (-1)); Handle : System.Address; begin declare Dummy : C.void_ptr; begin Dummy := C.string.memcpy ( C.void_ptr (C_To'Address), C.void_const_ptr (To'Address), C_To'Last); end; C_To (C_To'Last) := C.char'Val (0); declare Dummy : C.void_ptr; begin Dummy := C.string.memcpy ( C.void_ptr (C_From'Address), C.void_const_ptr (From'Address), C_From'Last); end; C_From (C_From'Last) := C.char'Val (0); -- open Handle := System.Address (C.iconv.iconv_open (C_To (0)'Access, C_From (0)'Access)); if Handle = Invalid then raise Name_Error; end if; NC_Object.Handle := Handle; -- about "From" NC_Object.Min_Size_In_From_Stream_Elements := 1; -- fallback declare In_Buffer : aliased constant C.char_array (0 .. Max_Length_Of_Single_Character - 1) := (others => C.char'Val (0)); begin for I in C.size_t'(1) .. Max_Length_Of_Single_Character loop declare In_Pointer : aliased C.char_const_ptr := In_Buffer (0)'Unchecked_Access; In_Size : aliased C.size_t := I; Out_Buffer : aliased C.char_array (0 .. Max_Length_Of_Single_Character - 1); Out_Pointer : aliased C.char_ptr := Out_Buffer (0)'Unchecked_Access; Out_Size : aliased C.size_t := Max_Length_Of_Single_Character; begin if C.iconv.iconv ( C.iconv.iconv_t (Handle), In_Pointer'Access, In_Size'Access, Out_Pointer'Access, Out_Size'Access) /= C.size_t'Last then NC_Object.Min_Size_In_From_Stream_Elements := Ada.Streams.Stream_Element_Offset (I); exit; end if; end; end loop; end; -- about "To" NC_Object.Substitute_Length := 0; end Do_Open; procedure Put_Substitute ( Object : in Converter; Out_Item : out Ada.Streams.Stream_Element_Array; Out_Last : out Ada.Streams.Stream_Element_Offset; Is_Overflow : out Boolean) is NC_Object : Non_Controlled_Converter renames Controlled.Constant_Reference (Object).all; begin Out_Last := Out_Item'First - 1; Is_Overflow := Out_Item'Length < NC_Object.Substitute_Length; if not Is_Overflow then Out_Last := Out_Last + NC_Object.Substitute_Length; Out_Item (Out_Item'First .. Out_Last) := NC_Object.Substitute (1 .. NC_Object.Substitute_Length); end if; end Put_Substitute; end iconv;
with Worlds; use Worlds; with Entities; use Entities; with Materials; use Materials; with Menus; use Menus; with Vectors2D; use Vectors2D; with Links; use Links; package DemoLogic is Hold : Natural := 0; LastX, LastY : Integer := 0; GlobalGravity : Vec2D := (0.0, 0.0); MaxHold : constant Natural := 40; EntCreatorMat : Materials.Material := Materials.RUBBER; EntEditorMat : Materials.Material := Materials.VACUUM; EntLinkerType : LinkTypes := LTRope; EntLinkerSelected : EntityClassAcc := null; type Modes is (M_Frozen, M_Disabled, M_Circle, M_Rectangle, M_Edit, M_Link); Mode : Modes := M_Disabled; CurWorld : World; Quit : Boolean := False; type VisualCue is record X, Y, R : Integer; EntType : EntityTypes; Mat : Material; Selected : EntityClassAcc := null; end record; function Inputs(W : in out World; Frozen : in out Boolean; Cooldown : Integer; Cue : in out VisualCue) return Boolean; procedure ModeActions(Frozen : in out Boolean); procedure CreateEntity(W : in out World; X, Y : Integer; H : Natural) with Pre => X >= 0 and X <= 240 and Y >= 0 and Y <= 320 and H <= MaxHold; procedure DisplayEntity(X, Y : Integer; H : Natural; Cue : in out VisualCue) with Pre => X >= 0 and X <= 240 and Y >= 0 and Y <= 320 and H <= MaxHold; procedure CreateCircle(W : in out World; X, Y : Integer; H : Natural) with Pre => X >= 0 and X <= 240 and Y >= 0 and Y <= 320 and H <= MaxHold; procedure CreateRectangle(W : in out World; X, Y : Integer; H : Natural) with Pre => X >= 0 and X <= 240 and Y >= 0 and Y <= 320 and H <= MaxHold; procedure ShowActionMenu; procedure ToggleGravity(This : in out Menu); function GetMatName(This : Material) return String; function GetLinkTypeName(This : LinkTypes) return String; procedure GotoNextSolidMat(This : in out Menu) with Post => IsSolidMaterial(EntCreatorMat); procedure GotoNextMat(This : in out Menu); procedure GotoNextLinkType(This : in out Menu); function GetGravityStr return String; procedure QuitDemo(This : in out Menu); private procedure SetLEDs(R, G : Boolean); procedure TryToEditAt(W : in out World; X, Y : Integer); procedure TryToLinkAt(W : in out World; X, Y : Integer); end DemoLogic;
with system.Storage_Elements; package Counter with SPARK_Mode => On -- Small external state tutorial exercise -- -- This package uses an external counter which is incremented -- by one every time: -- A. its clock ticks, -- B. it is read. -- -- It has one query procedure Bump_And_Monitor to check if the -- counter has reached its limit. is Port : Integer with volatile, async_writers, effective_reads, address => system.storage_elements.to_address ( 16#1234ABCD# ); Limit : constant Integer := 3_000_000; procedure Bump_And_Monitor (Alarm : out Boolean) with Global => (in_out => port), depends => (alarm => port, port => port); end Counter;
with Tarmi.Environments; use Tarmi.Environments; package Tarmi.Evaluation is function Eval (Form : Datum; Env : Environment) return Datum ; end Tarmi.Evaluation;
-- -- Raytracer implementation in Ada -- by John Perry (github: johnperry-math) -- 2021 -- -- implementation for Colors, both RGB ("Color_Type") -- and RGBA ("Transparent_Color_Type") -- package body Colors is function Create_Color(Red, Green, Blue: Float15) return Color_Type is ( Red => Red, Green => Green, Blue => Blue ); function Scale( Color: Color_Type; K: Float15 ) return Color_Type is ( Red => K * Color.Red, Green => K * Color.Green, Blue => K * Color.Blue ); procedure Scale_Self( Color: in out Color_Type; K: Float15 ) is begin Color.Red := K * Color.Red; Color.Green := K * Color.Green; Color.Blue := K * Color.Blue; end Scale_Self; function "*"(First, Second: Color_Type) return Color_Type is ( Red => First.Red * Second.Red, Green => First.Green * Second.Green, Blue => First.Blue * Second.Blue ); procedure Color_Multiply_Self(First: in out Color_Type; Second: Color_Type) is begin First.Red := First.Red * Second.Red; First.Green := First.Green * Second.Green; First.Blue := First.Blue * Second.Blue; end Color_Multiply_Self; function "+"(First, Second: Color_Type) return Color_Type is ( Red => First.Red + Second.Red, Green => First.Green + Second.Green, Blue => First.Blue + Second.Blue ); function Legalize(C: Float15) return UInt8 is ( ( if C < 0.0 then 0 elsif C > 1.0 then 255 else UInt8(C * 255.0) ) ); function To_Drawing_Color(C: Color_Type) return Color_With_Transparency_Type is ( Red => Legalize(C.Red), Green => Legalize(C.Green), Blue => Legalize(C.Blue), Alpha => 255 ); end Colors;
-- AOC, Day 6 with Ada.Text_IO; use Ada.Text_IO; with Day; use Day; procedure main is ol : Orbit_List.Vector; begin ol := Day.load_orbits("input.txt"); put_line("Part 1: " & Orbit_Checksum'Image(Day.orbit_count_checksum(ol))); -- put_line("Part 2: " & Day1.Mass'Image(Day1.total_fuel)); end main;
package RCP.Control is protected Controller is entry Demand (Res : out Resource_T; Req : Request_T); procedure Release (Res : Resource_T); function Query return Request_T; private -- we use a private typed channel -- not visibile from the outside of this object -- COMPATIBLE with Demand entry Assign (Res : out Resource_T; Req : Request_T); -- initially all resourses are free Free : Request_T := Request_T'Last; -- the lowest unsatisfied request -- used to condition the opening of the guard to Assign Min_Request : Request_T := Request_T'Last; -- this Boolean tells us whether there -- are pending requests while there are -- some, but not enough, resources Available : Boolean := False; -- this counter tells us how may pending -- requests we have at present Considered : Natural := 0; end Controller; end RCP.Control;
------------------------------------------------------------------------------ -- -- -- JSON Parser/Constructor -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2017-2021, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This package contains all of the formal character and character sets -- that are defined in the JSON standard (IETF RFD 8259/STD 90) with Ada.Strings.Wide_Wide_Maps; use Ada.Strings.Wide_Wide_Maps; package JSON.Standards is -- Whitespace Space : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_0020#); Horizontal_Tab : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_0009#); Line_Feed : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_000A#); Carriage_Return: constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_000D#); -- Whitespace set Whitespace: constant Wide_Wide_Character_Set := To_Set (Wide_Wide_Character_Sequence'(1 => Space, 2 => Horizontal_Tab, 3 => Line_Feed, 4 => Carriage_Return)); -- Structural Begin_Array : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_005B#); -- '[' End_Array : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_005D#); -- ']' Begin_Object : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_007B#); -- '{' End_Object : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_007D#); -- '}' Name_Separator : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_003A#); -- ':' Value_Separator: constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_002C#); -- ',' Structural: constant Wide_Wide_Character_Set := To_Set (Wide_Wide_String'(1 => Begin_Array, 2 => End_Array, 3 => Begin_Object, 4 => End_Object, 5 => Name_Separator, 6 => Value_Separator)); -- Nesting down set Nesting_Down : constant Wide_Wide_Character_Set := To_Set(Wide_Wide_String'(1 => Begin_Object, 2 => Begin_Array)); Nesting_Up : constant Wide_Wide_Character_Set := To_Set(Wide_Wide_String'(1 => End_Object, 2 => End_Array)); -- Literals Literal_False_Start: constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_0066#); -- 'f' Literal_False : constant Wide_Wide_String := (1 => Literal_False_Start, -- 'f' 2 => Wide_Wide_Character'Val(16#0000_0061#), -- 'a' 3 => Wide_Wide_Character'Val(16#0000_006C#), -- 'l' 4 => Wide_Wide_Character'Val(16#0000_0073#), -- 's' 5 => Wide_Wide_Character'Val(16#0000_0065#)); -- 'e' Literal_True_Start: constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_0074#); -- 't' Literal_True : constant Wide_Wide_String := (1 => Literal_True_Start, -- 't' 2 => Wide_Wide_Character'Val(16#0000_0072#), -- 'r' 3 => Wide_Wide_Character'Val(16#0000_0075#), -- 'u' 4 => Wide_Wide_Character'Val(16#0000_0065#)); -- 'e' Literal_Null_Start: constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_006E#); -- 'n' Literal_Null : constant Wide_Wide_String := (1 => Literal_Null_Start, -- 'n' 2 => Wide_Wide_Character'Val(16#0000_0075#), -- 'u' 3 => Wide_Wide_Character'Val(16#0000_006C#), -- 'l' 4 => Wide_Wide_Character'Val(16#0000_006C#)); -- 'l' -- Numerics Decimal_Point: constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_002E#); -- '.' Minus_Sign : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_002D#); -- '-' Plus_Sign : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_002B#); -- '+' Exponent_Upper: constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_0045#); -- 'E' Exponent_Lower: constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_0065#); -- 'e' Exponent_Set : constant Wide_Wide_Character_Set := To_Set (Wide_Wide_String'(1 => Exponent_Upper, 2 => Exponent_Lower)); Integer_Terminator: constant Wide_Wide_Character_Set := To_Set (Decimal_Point & To_Sequence (Exponent_Set)); -- Values that follow the first set of contigious digits that make-up the -- (required) "int" portion of a json number value. Num_Zero : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_0030#); -- '0' Digit_1_9_Range : constant Wide_Wide_Character_Range := (Low => Wide_Wide_Character'Val(16#0000_0031#), -- '1' High => Wide_Wide_Character'Val(16#0000_0039#)); -- '9' Digit_1_9_Set: constant Wide_Wide_Character_Set := To_Set (Digit_1_9_Range); Digit_Range: constant Wide_Wide_Character_Range := (Low => Num_Zero, High => Digit_1_9_Range.High); Digit_Set : constant Wide_Wide_Character_Set := To_Set (Digit_Range); Numeric_Begin_Set: constant Wide_Wide_Character_Set := To_Set (Num_Zero & To_Sequence (Digit_1_9_Set) & Minus_Sign); -- Valid beginning to Numeric values Numeric_Continue_Set: constant Wide_Wide_Character_Set := To_Set (To_Sequence (Digit_Set) & To_Sequence (Exponent_Set) & Decimal_Point); Number_Termination_Set: constant Wide_Wide_Character_Set := To_Set (End_Object & End_Array & Value_Separator & To_Sequence (Whitespace)); -- All valid character to indicate the end of a number value -- Strings Quotation_Mark : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_0022#); -- '"' Reverse_Solidus : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_005C#); -- '\' Escape_Symbol : Wide_Wide_Character renames Reverse_Solidus; Universal_Code : constant Wide_Wide_Character := Wide_Wide_Character'Val(16#0000_0075#); -- 'u' -- Little problem here with maps - the sets from which the maps are derrived -- will be re-rodered by their character value, in ascending order! that -- means "abc" and "CBA" to a map will still translate from "abc" to "ABC", -- not "CBA". So we can't use maps to translate from escape codes to the -- actual stand-ins, instead we will use the indexting from a match in -- Escape_Code_List to the actual stand-in in the Escape_Actual_List -- Characters that may follow Escape_Symbol in a string Escape_Code_List : constant Wide_Wide_String := (1 => Quotation_Mark, -- '"' 2 => Reverse_Solidus, -- '\' 3 => Wide_Wide_Character'Val(16#0000_002F#), -- '/' 4 => Wide_Wide_Character'Val(16#0000_0062#), -- 'b' 5 => Wide_Wide_Character'Val(16#0000_0066#), -- 'f' 6 => Wide_Wide_Character'Val(16#0000_006E#), -- 'n' 7 => Wide_Wide_Character'Val(16#0000_0072#), -- 'r' 8 => Wide_Wide_Character'Val(16#0000_0074#), -- 't' 9 => Universal_Code); -- 'uXXXX' Escape_Code_Set : constant Wide_Wide_Character_Set := To_Set (Escape_Code_List); -- Characters that should replace the matching escape sequence Escape_Actual_List : constant Wide_Wide_String := (1 => Quotation_Mark, -- '"' 2 => Reverse_Solidus, -- '\' 3 => Wide_Wide_Character'Val(16#0000_002F#), -- '/' 4 => Wide_Wide_Character'Val(16#0000_0008#), -- %backspace% 5 => Wide_Wide_Character'Val(16#0000_000C#), -- %FF% 6 => Wide_Wide_Character'Val(16#0000_000A#), -- %LF% 7 => Wide_Wide_Character'Val(16#0000_000D#), -- %CR% 8 => Wide_Wide_Character'Val(16#0000_0009#), -- %TAB% 9 => Universal_Code); -- 'uXXXX' Escape_Actual_Set: constant Wide_Wide_Character_Set := To_Set (Escape_Actual_List); Escape_Serialize_Set: constant Wide_Wide_Character_Set := To_Set (Escape_Actual_List (1 .. 8)); -- The list except for universal codes. This is used by the serializer to -- insert necessary escapes for string values. It doesn't need to re-encode -- uXXXX values, since it just encodes everything as utf_8. If the uXXXX -- encodes, for example, \u0008 (backpace), the serializer will just output -- "\/". Escape_Code_Map: constant Wide_Wide_Character_Mapping := To_Mapping (From => Escape_Code_List, To => Escape_Actual_List); Escape_Code_Reverse_Map: constant Wide_Wide_Character_Mapping := To_Mapping (From => Escape_Actual_List, To => Escape_Code_List); -- Valid values for \uXXXX hex values Escape_Hex_Set : constant Wide_Wide_Character_Set := To_Set(Wide_Wide_Character_Ranges'((Low => '0', High => '9'), (Low => 'a', High => 'f'), (Low => 'A', High => 'F'))); -- These characters MUST be escaped, and connot appear on their own -- inside of a string. Escape_Imparative: constant Wide_Wide_Character_Set := To_Set (Wide_Wide_Character_Ranges' ((Low => Wide_Wide_Character'Val(16#0000_0000#), High => Wide_Wide_Character'Val(16#0000_001F#)), (Low => Quotation_Mark, High => Quotation_Mark), (Low => Reverse_Solidus, High => Reverse_Solidus))); end JSON.Standards;
with bcm2835_h; with Interfaces.C; use Interfaces.C; package body Raspio is procedure Initialize is Error_Code : constant Interfaces.C.int := bcm2835_h.bcm2835_init; begin if Error_Code /= 1 then raise Initialization_Error with "BCM2835 initialization failed"; end if; end Initialize; end Raspio;
-- { dg-do compile } with Ada.Text_IO; use Ada.Text_IO; procedure Rep_Clause1 is type Int_16 is range 0 .. 65535; for Int_16'Size use 16; ---------------------------------------------- type Rec_A is record Int_1 : Int_16; Int_2 : Int_16; Int_3 : Int_16; Int_4 : Int_16; end record; for Rec_A use record Int_1 at 0 range 0 .. 15; Int_2 at 2 range 0 .. 15; Int_3 at 4 range 0 .. 15; Int_4 at 6 range 0 .. 15; end record; Rec_A_Size : constant := 4 * 16; for Rec_A'Size use Rec_A_Size; ---------------------------------------------- type Rec_B_Version_1 is record Rec_1 : Rec_A; Rec_2 : Rec_A; Int_1 : Int_16; end record; for Rec_B_Version_1 use record Rec_1 at 0 range 0 .. 63; Rec_2 at 8 range 0 .. 63; Int_1 at 16 range 0 .. 15; end record; Rec_B_Size : constant := 2 * Rec_A_Size + 16; for Rec_B_Version_1'Size use Rec_B_Size; for Rec_B_Version_1'Alignment use 2; ---------------------------------------------- type Rec_B_Version_2 is record Int_1 : Int_16; Rec_1 : Rec_A; Rec_2 : Rec_A; end record; for Rec_B_Version_2 use record Int_1 at 0 range 0 .. 15; Rec_1 at 2 range 0 .. 63; Rec_2 at 10 range 0 .. 63; end record; for Rec_B_Version_2'Size use Rec_B_Size; ---------------------------------------------- Arr_A_Length : constant := 2; Arr_A_Size : constant := Arr_A_Length * Rec_B_Size; type Arr_A_Version_1 is array (1 .. Arr_A_Length) of Rec_B_Version_1; type Arr_A_Version_2 is array (1 .. Arr_A_Length) of Rec_B_Version_2; pragma Pack (Arr_A_Version_1); pragma Pack (Arr_A_Version_2); for Arr_A_Version_1'Size use Arr_A_Size; for Arr_A_Version_2'Size use Arr_A_Size; ---------------------------------------------- begin -- Put_Line ("Arr_A_Size =" & Arr_A_Size'Img); if Arr_A_Version_1'Size /= Arr_A_Size then Ada.Text_IO.Put_Line ("Version 1 Size mismatch! " & "Arr_A_Version_1'Size =" & Arr_A_Version_1'Size'Img); end if; if Arr_A_Version_2'Size /= Arr_A_Size then Ada.Text_IO.Put_Line ("Version 2 Size mismatch! " & "Arr_A_Version_2'Size =" & Arr_A_Version_2'Size'Img); end if; end;
-------------------------------------------------------------------------------- -- Copyright (c) 2013, Felix Krause <contact@flyx.org> -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -------------------------------------------------------------------------------- package body CL.Vector_Set is function CL_Vector (X, Y : Base) return R2 is Value : R2; begin Value.S := (X, Y); return Value; end CL_Vector; function CL_Vector (V : V2.Vector) return R2 is Value : R2; begin Value.S := V; return Value; end CL_Vector; function CL_Vector (X, Y, Z : Base) return R3 is Value : R3; begin Value.S := (X, Y, Z); return Value; end CL_Vector; function CL_Vector (V : V3.Vector) return R3 is Value : R3; begin Value.S := V; return Value; end CL_Vector; function CL_Vector (X, Y, Z, W : Base) return R4 is Value : R4; begin Value.S := (X, Y, Z, W); return Value; end CL_Vector; function CL_Vector (V : V4.Vector) return R4 is Value : R4; begin Value.S := V; return Value; end CL_Vector; function CL_Vector (S0, S1, S2, S3, S4, S5, S6, S7 : Base) return R8 is Value : R8; begin Value.S := (S0, S1, S2, S3, S4, S5, S6, S7); return Value; end CL_Vector; function CL_Vector (V : V8.Vector) return R8 is Value : R8; begin Value.S := V; return Value; end CL_Vector; function CL_Vector (S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF : Base) return R16 is Value : R16; begin Value.S := (S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF); return Value; end CL_Vector; function CL_Vector (V : V16.Vector) return R16 is Value : R16; begin Value.S := V; return Value; end CL_Vector; function Vector2_Array (List : V2.Vector_Array) return Record_Array is Value : Record_Array (List'Range); begin for I in List'Range loop Value (I) := CL_Vector (List (I)); end loop; return Value; end Vector2_Array; function Vector3_Array (List : V3.Vector_Array) return Record_Array is Value : Record_Array (List'Range); begin for I in List'Range loop Value (I) := CL_Vector (List (I)); end loop; return Value; end Vector3_Array; function Vector4_Array (List : V4.Vector_Array) return Record_Array is Value : Record_Array (List'Range); begin for I in List'Range loop Value (I) := CL_Vector (List (I)); end loop; return Value; end Vector4_Array; function Vector8_Array (List : V8.Vector_Array) return Record_Array is Value : Record_Array (List'Range); begin for I in List'Range loop Value (I) := CL_Vector (List (I)); end loop; return Value; end Vector8_Array; function Vector16_Array (List : V16.Vector_Array) return Record_Array is Value : Record_Array (List'Range); begin for I in List'Range loop Value (I) := CL_Vector (List (I)); end loop; return Value; end Vector16_Array; function To_String (Value : R2) return String is begin return V2.To_String (Value.S); end To_String; function To_String (Value : R3) return String is begin return V3.To_String (Value.S); end To_String; function To_String (Value : R4) return String is begin return V4.To_String (Value.S); end To_String; function To_String (Value : R8) return String is begin return V8.To_String (Value.S); end To_String; function To_String (Value : R16) return String is begin return V16.To_String (Value.S); end To_String; end CL.Vector_Set;
with AAA.Strings; with CLIC.Subcommand; with CLIC.TTY; package Commands.Topics.Issues is package TT renames CLIC.TTY; type Topic is new CLIC.Subcommand.Help_Topic with null record; overriding function Name (This : Topic) return CLIC.Subcommand.Identifier is ("issues"); overriding function Title (This : Topic) return String is ("Reporting bugs and feature requests and other issues."); overriding function Content (This : Topic) return AAA.Strings.Vector is (AAA.Strings.Empty_Vector.Append ("Please create issues on the Glad-cli project's GitHub page: ") .Append (TT.Url ("https://github.com/GLADORG/glad-cli/issues"))); end Commands.Topics.Issues;
with System.Machine_Code; use System.Machine_Code; package body Atomic.Critical_Section is ----------- -- Enter -- ----------- procedure Enter (State : out Interrupt_State) is NL : constant String := ASCII.CR & ASCII.LF; begin System.Machine_Code.Asm (Template => "dsb" & NL & -- Ensure completion of memory accesses "mrs %0, PRIMASK" & NL & -- Save PRIMASK State "cpsid i", -- Clear PRIMASK Outputs => Interrupt_State'Asm_Output ("=r", State), Inputs => No_Input_Operands, Clobber => "", Volatile => True); end Enter; ----------- -- Leave -- ----------- procedure Leave (State : Interrupt_State) is NL : constant String := ASCII.CR & ASCII.LF; begin System.Machine_Code.Asm (Template => "dsb" & NL & -- Ensure completion of memory accesses "msr PRIMASK, %0", -- restore PRIMASK Outputs => No_Output_Operands, Inputs => Interrupt_State'Asm_Input ("r", State), Clobber => "", Volatile => True); end Leave; end Atomic.Critical_Section;
-- This file is generated by SWIG. Do *not* modify by hand. -- with Interfaces.C.Extensions; package llvm is -- LLVMCtxt -- type LLVMCtxt is new Interfaces.C.Extensions.opaque_structure_def; type LLVMCtxt_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMCtxt; type LLVMCtxt_view is access all llvm.LLVMCtxt; -- LLVMContextRef -- type LLVMContextRef is access all llvm.LLVMCtxt; type LLVMContextRef_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMContextRef; type LLVMContextRef_view is access all llvm.LLVMContextRef; -- LLVMOpaqueModule -- type LLVMOpaqueModule is new Interfaces.C.Extensions.opaque_structure_def; type LLVMOpaqueModule_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueModule; type LLVMOpaqueModule_view is access all llvm.LLVMOpaqueModule; -- LLVMModuleRef -- type LLVMModuleRef is access all llvm.LLVMOpaqueModule; type LLVMModuleRef_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMModuleRef; type LLVMModuleRef_view is access all llvm.LLVMModuleRef; -- LLVMOpaqueType -- type LLVMOpaqueType is new Interfaces.C.Extensions.opaque_structure_def; type LLVMOpaqueType_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueType; type LLVMOpaqueType_view is access all llvm.LLVMOpaqueType; -- LLVMTypeRef -- type LLVMTypeRef is access all llvm.LLVMOpaqueType; type LLVMTypeRef_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMTypeRef; type LLVMTypeRef_view is access all llvm.LLVMTypeRef; -- LLVMOpaqueTypeHandle -- type LLVMOpaqueTypeHandle is new Interfaces.C.Extensions.opaque_structure_def; type LLVMOpaqueTypeHandle_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueTypeHandle; type LLVMOpaqueTypeHandle_view is access all llvm.LLVMOpaqueTypeHandle; -- LLVMTypeHandleRef -- type LLVMTypeHandleRef is access all llvm.LLVMOpaqueTypeHandle; type LLVMTypeHandleRef_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMTypeHandleRef; type LLVMTypeHandleRef_view is access all llvm.LLVMTypeHandleRef; -- LLVMOpaqueValue -- type LLVMOpaqueValue is new Interfaces.C.Extensions.opaque_structure_def; type LLVMOpaqueValue_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueValue; type LLVMOpaqueValue_view is access all llvm.LLVMOpaqueValue; -- LLVMValueRef -- type LLVMValueRef is access all llvm.LLVMOpaqueValue; type LLVMValueRef_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMValueRef; type LLVMValueRef_view is access all llvm.LLVMValueRef; -- LLVMOpaqueBasicBlock -- type LLVMOpaqueBasicBlock is new Interfaces.C.Extensions.opaque_structure_def; type LLVMOpaqueBasicBlock_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueBasicBlock; type LLVMOpaqueBasicBlock_view is access all llvm.LLVMOpaqueBasicBlock; -- LLVMBasicBlockRef -- type LLVMBasicBlockRef is access all llvm.LLVMOpaqueBasicBlock; type LLVMBasicBlockRef_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMBasicBlockRef; type LLVMBasicBlockRef_view is access all llvm.LLVMBasicBlockRef; -- LLVMOpaqueBuilder -- type LLVMOpaqueBuilder is new Interfaces.C.Extensions.opaque_structure_def; type LLVMOpaqueBuilder_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueBuilder; type LLVMOpaqueBuilder_view is access all llvm.LLVMOpaqueBuilder; -- LLVMBuilderRef -- type LLVMBuilderRef is access all llvm.LLVMOpaqueBuilder; type LLVMBuilderRef_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMBuilderRef; type LLVMBuilderRef_view is access all llvm.LLVMBuilderRef; -- LLVMOpaqueModuleProvider -- type LLVMOpaqueModuleProvider is new Interfaces.C.Extensions.opaque_structure_def; type LLVMOpaqueModuleProvider_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueModuleProvider; type LLVMOpaqueModuleProvider_view is access all llvm.LLVMOpaqueModuleProvider; -- LLVMModuleProviderRef -- type LLVMModuleProviderRef is access all llvm.LLVMOpaqueModuleProvider; type LLVMModuleProviderRef_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMModuleProviderRef; type LLVMModuleProviderRef_view is access all llvm.LLVMModuleProviderRef; -- LLVMOpaqueMemoryBuffer -- type LLVMOpaqueMemoryBuffer is new Interfaces.C.Extensions.opaque_structure_def; type LLVMOpaqueMemoryBuffer_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaqueMemoryBuffer; type LLVMOpaqueMemoryBuffer_view is access all llvm.LLVMOpaqueMemoryBuffer; -- LLVMMemoryBufferRef -- type LLVMMemoryBufferRef is access all llvm.LLVMOpaqueMemoryBuffer; type LLVMMemoryBufferRef_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMMemoryBufferRef; type LLVMMemoryBufferRef_view is access all llvm.LLVMMemoryBufferRef; -- LLVMOpaquePassManager -- type LLVMOpaquePassManager is new Interfaces.C.Extensions.opaque_structure_def; type LLVMOpaquePassManager_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMOpaquePassManager; type LLVMOpaquePassManager_view is access all llvm.LLVMOpaquePassManager; -- LLVMPassManagerRef -- type LLVMPassManagerRef is access all llvm.LLVMOpaquePassManager; type LLVMPassManagerRef_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMPassManagerRef; type LLVMPassManagerRef_view is access all llvm.LLVMPassManagerRef; -- LLVMAttribute -- type LLVMAttribute is ( LLVMZExtAttribute, LLVMSExtAttribute, LLVMNoReturnAttribute, LLVMInRegAttribute, LLVMStructRetAttribute, LLVMNoUnwindAttribute, LLVMNoAliasAttribute, LLVMByValAttribute, LLVMNestAttribute, LLVMReadNoneAttribute, LLVMReadOnlyAttribute, LLVMNoInlineAttribute, LLVMAlwaysInlineAttribute, LLVMOptimizeForSizeAttribute, LLVMStackProtectAttribute, LLVMStackProtectReqAttribute, LLVMNoCaptureAttribute, LLVMNoRedZoneAttribute, LLVMNoImplicitFloatAttribute, LLVMNakedAttribute); for LLVMAttribute use (LLVMZExtAttribute => 1, LLVMSExtAttribute => 2, LLVMNoReturnAttribute => 4, LLVMInRegAttribute => 8, LLVMStructRetAttribute => 16, LLVMNoUnwindAttribute => 32, LLVMNoAliasAttribute => 64, LLVMByValAttribute => 128, LLVMNestAttribute => 256, LLVMReadNoneAttribute => 512, LLVMReadOnlyAttribute => 1024, LLVMNoInlineAttribute => 2048, LLVMAlwaysInlineAttribute => 4096, LLVMOptimizeForSizeAttribute => 8192, LLVMStackProtectAttribute => 16384, LLVMStackProtectReqAttribute => 32768, LLVMNoCaptureAttribute => 2097152, LLVMNoRedZoneAttribute => 4194304, LLVMNoImplicitFloatAttribute => 8388608, LLVMNakedAttribute => 16777216); pragma Convention (C, LLVMAttribute); type LLVMAttribute_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMAttribute; type LLVMAttribute_view is access all llvm.LLVMAttribute; -- LLVMTypeKind -- type LLVMTypeKind is ( LLVMVoidTypeKind, LLVMFloatTypeKind, LLVMDoubleTypeKind, LLVMX86_FP80TypeKind, LLVMFP128TypeKind, LLVMPPC_FP128TypeKind, LLVMLabelTypeKind, LLVMIntegerTypeKind, LLVMFunctionTypeKind, LLVMStructTypeKind, LLVMArrayTypeKind, LLVMPointerTypeKind, LLVMOpaqueTypeKind, LLVMVectorTypeKind, LLVMMetadataTypeKind); for LLVMTypeKind use (LLVMVoidTypeKind => 0, LLVMFloatTypeKind => 1, LLVMDoubleTypeKind => 2, LLVMX86_FP80TypeKind => 3, LLVMFP128TypeKind => 4, LLVMPPC_FP128TypeKind => 5, LLVMLabelTypeKind => 6, LLVMIntegerTypeKind => 7, LLVMFunctionTypeKind => 8, LLVMStructTypeKind => 9, LLVMArrayTypeKind => 10, LLVMPointerTypeKind => 11, LLVMOpaqueTypeKind => 12, LLVMVectorTypeKind => 13, LLVMMetadataTypeKind => 14); pragma Convention (C, LLVMTypeKind); type LLVMTypeKind_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMTypeKind; type LLVMTypeKind_view is access all llvm.LLVMTypeKind; -- LLVMLinkage -- type LLVMLinkage is ( LLVMExternalLinkage, LLVMAvailableExternallyLinkage, LLVMLinkOnceAnyLinkage, LLVMLinkOnceODRLinkage, LLVMWeakAnyLinkage, LLVMWeakODRLinkage, LLVMAppendingLinkage, LLVMInternalLinkage, LLVMPrivateLinkage, LLVMDLLImportLinkage, LLVMDLLExportLinkage, LLVMExternalWeakLinkage, LLVMGhostLinkage, LLVMCommonLinkage, LLVMLinkerPrivateLinkage); for LLVMLinkage use (LLVMExternalLinkage => 0, LLVMAvailableExternallyLinkage => 1, LLVMLinkOnceAnyLinkage => 2, LLVMLinkOnceODRLinkage => 3, LLVMWeakAnyLinkage => 4, LLVMWeakODRLinkage => 5, LLVMAppendingLinkage => 6, LLVMInternalLinkage => 7, LLVMPrivateLinkage => 8, LLVMDLLImportLinkage => 9, LLVMDLLExportLinkage => 10, LLVMExternalWeakLinkage => 11, LLVMGhostLinkage => 12, LLVMCommonLinkage => 13, LLVMLinkerPrivateLinkage => 14); pragma Convention (C, LLVMLinkage); type LLVMLinkage_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMLinkage; type LLVMLinkage_view is access all llvm.LLVMLinkage; -- LLVMVisibility -- type LLVMVisibility is ( LLVMDefaultVisibility, LLVMHiddenVisibility, LLVMProtectedVisibility); for LLVMVisibility use (LLVMDefaultVisibility => 0, LLVMHiddenVisibility => 1, LLVMProtectedVisibility => 2); pragma Convention (C, LLVMVisibility); type LLVMVisibility_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMVisibility; type LLVMVisibility_view is access all llvm.LLVMVisibility; -- LLVMCallConv -- type LLVMCallConv is ( LLVMCCallConv, LLVMFastCallConv, LLVMColdCallConv, LLVMX86StdcallCallConv, LLVMX86FastcallCallConv); for LLVMCallConv use (LLVMCCallConv => 0, LLVMFastCallConv => 8, LLVMColdCallConv => 9, LLVMX86StdcallCallConv => 64, LLVMX86FastcallCallConv => 65); pragma Convention (C, LLVMCallConv); type LLVMCallConv_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMCallConv; type LLVMCallConv_view is access all llvm.LLVMCallConv; -- LLVMIntPredicate -- type LLVMIntPredicate is ( LLVMIntEQ, LLVMIntNE, LLVMIntUGT, LLVMIntUGE, LLVMIntULT, LLVMIntULE, LLVMIntSGT, LLVMIntSGE, LLVMIntSLT, LLVMIntSLE); for LLVMIntPredicate use (LLVMIntEQ => 32, LLVMIntNE => 33, LLVMIntUGT => 34, LLVMIntUGE => 35, LLVMIntULT => 36, LLVMIntULE => 37, LLVMIntSGT => 38, LLVMIntSGE => 39, LLVMIntSLT => 40, LLVMIntSLE => 41); pragma Convention (C, LLVMIntPredicate); type LLVMIntPredicate_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMIntPredicate; type LLVMIntPredicate_view is access all llvm.LLVMIntPredicate; -- LLVMRealPredicate -- type LLVMRealPredicate is ( LLVMRealPredicateFalse, LLVMRealOEQ, LLVMRealOGT, LLVMRealOGE, LLVMRealOLT, LLVMRealOLE, LLVMRealONE, LLVMRealORD, LLVMRealUNO, LLVMRealUEQ, LLVMRealUGT, LLVMRealUGE, LLVMRealULT, LLVMRealULE, LLVMRealUNE, LLVMRealPredicateTrue); for LLVMRealPredicate use (LLVMRealPredicateFalse => 0, LLVMRealOEQ => 1, LLVMRealOGT => 2, LLVMRealOGE => 3, LLVMRealOLT => 4, LLVMRealOLE => 5, LLVMRealONE => 6, LLVMRealORD => 7, LLVMRealUNO => 8, LLVMRealUEQ => 9, LLVMRealUGT => 10, LLVMRealUGE => 11, LLVMRealULT => 12, LLVMRealULE => 13, LLVMRealUNE => 14, LLVMRealPredicateTrue => 15); pragma Convention (C, LLVMRealPredicate); type LLVMRealPredicate_array is array (Interfaces.C.size_t range <>) of aliased llvm.LLVMRealPredicate; type LLVMRealPredicate_view is access all llvm.LLVMRealPredicate; -- ModuleProvider -- type ModuleProvider is new Interfaces.C.Extensions.incomplete_class_def; type ModuleProvider_array is array (Interfaces.C.size_t range <>) of aliased llvm.ModuleProvider; type ModuleProvider_view is access all llvm.ModuleProvider; -- MemoryBuffer -- type MemoryBuffer is new Interfaces.C.Extensions.incomplete_class_def; type MemoryBuffer_array is array (Interfaces.C.size_t range <>) of aliased llvm.MemoryBuffer; type MemoryBuffer_view is access all llvm.MemoryBuffer; -- PassManagerBase -- type PassManagerBase is new Interfaces.C.Extensions.incomplete_class_def; type PassManagerBase_array is array (Interfaces.C.size_t range <>) of aliased llvm.PassManagerBase; type PassManagerBase_view is access all llvm.PassManagerBase; end llvm;
----------------------------------------------------------------------- -- keystore-files -- Ada keystore files -- Copyright (C) 2019, 2020 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Keystore.Passwords.Keys; private with Keystore.Containers; package Keystore.Files is type Wallet_File is limited new Wallet with private; -- Open the keystore file and unlock the wallet using the given password. -- Raises the Bad_Password exception if no key slot match the password. procedure Open (Container : in out Wallet_File; Password : in Secret_Key; Path : in String; Data_Path : in String := ""; Config : in Wallet_Config := Secure_Config) with Pre => not Container.Is_Open, Post => Container.Is_Open; -- Open the keystore file without unlocking the wallet but get some information -- from the header section. procedure Open (Container : in out Wallet_File; Path : in String; Data_Path : in String := ""; Config : in Wallet_Config := Secure_Config; Info : out Wallet_Info) with Pre => not Container.Is_Open, Post => Container.State = S_PROTECTED; -- Create the keystore file and protect it with the given password. -- The key slot #1 is used. procedure Create (Container : in out Wallet_File; Password : in Secret_Key; Path : in String; Data_Path : in String := ""; Config : in Wallet_Config := Secure_Config) with Pre => not Container.Is_Open, Post => Container.Is_Open; procedure Create (Container : in out Wallet_File; Password : in out Keystore.Passwords.Provider'Class; Path : in String; Data_Path : in String := ""; Config : in Wallet_Config := Secure_Config) with Pre => not Container.Is_Open, Post => Container.Is_Open; -- Set the keystore master key before creating or opening the keystore. procedure Set_Master_Key (Container : in out Wallet_File; Password : in out Keystore.Passwords.Keys.Key_Provider'Class) with Pre => not Container.Is_Open; -- Unlock the wallet with the password. -- Raises the Bad_Password exception if no key slot match the password. procedure Unlock (Container : in out Wallet_File; Password : in Secret_Key) with Pre => Container.State = S_PROTECTED, Post => Container.Is_Open; procedure Unlock (Container : in out Wallet_File; Password : in out Keystore.Passwords.Provider'Class; Slot : out Key_Slot) with Pre => Container.State = S_PROTECTED, Post => Container.Is_Open; -- Close the keystore file. procedure Close (Container : in out Wallet_File) with Pre => Container.Is_Open, Post => not Container.Is_Open; -- Set some header data in the keystore file. procedure Set_Header_Data (Container : in out Wallet_File; Index : in Header_Slot_Index_Type; Kind : in Header_Slot_Type; Data : in Ada.Streams.Stream_Element_Array) with Pre => Container.State in S_OPEN | S_PROTECTED and Data'Length <= 1024; -- Get the header data information from the keystore file. procedure Get_Header_Data (Container : in out Wallet_File; Index : in Header_Slot_Index_Type; Kind : out Header_Slot_Type; Data : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset) with Pre => Container.State = S_PROTECTED; -- Add in the wallet the named entry and associate it the children wallet. -- The children wallet meta data is protected by the container. -- The children wallet has its own key to protect the named entries it manages. procedure Add (Container : in out Wallet_File; Name : in String; Password : in out Keystore.Passwords.Provider'Class; Wallet : in out Wallet_File'Class) with Pre => Container.Is_Open and not Wallet.Is_Open, Post => Container.Is_Open and Wallet.Is_Open; procedure Add (Container : in out Wallet_File; Name : in String; Password : in Keystore.Secret_Key; Wallet : in out Wallet_File'Class) with Pre => Container.Is_Open and not Wallet.Is_Open, Post => Container.Is_Open and Wallet.Is_Open; -- Load from the container the named children wallet. procedure Open (Container : in out Wallet_File; Name : in String; Password : in out Keystore.Passwords.Provider'Class; Wallet : in out Wallet_File'Class) with Pre => Container.Is_Open and not Wallet.Is_Open, Post => Container.Is_Open and Wallet.Is_Open; procedure Open (Container : in out Wallet_File; Name : in String; Password : in Secret_Key; Wallet : in out Wallet_File'Class) with Pre => Container.Is_Open and not Wallet.Is_Open, Post => Container.Is_Open and Wallet.Is_Open; -- Return True if the container was configured. overriding function Is_Configured (Container : in Wallet_File) return Boolean; -- Return True if the container can be accessed. overriding function Is_Open (Container : in Wallet_File) return Boolean; -- Get the wallet state. overriding function State (Container : in Wallet_File) return State_Type; -- Set the key to encrypt and decrypt the container meta data. overriding procedure Set_Key (Container : in out Wallet_File; Password : in Secret_Key; New_Password : in Secret_Key; Config : in Wallet_Config; Mode : in Mode_Type) with Pre => Container.Is_Open; procedure Set_Key (Container : in out Wallet_File; Password : in out Keystore.Passwords.Provider'Class; New_Password : in out Keystore.Passwords.Provider'Class; Config : in Wallet_Config := Secure_Config; Mode : in Mode_Type := KEY_REPLACE) with Pre'Class => Container.Is_Open; -- Remove the key from the key slot identified by `Slot`. The password is necessary to -- make sure a valid password is available. The `Remove_Current` must be set to remove -- the slot when it corresponds to the used password. procedure Remove_Key (Container : in out Wallet_File; Password : in out Keystore.Passwords.Provider'Class; Slot : in Key_Slot; Force : in Boolean); -- Return True if the container contains the given named entry. overriding function Contains (Container : in Wallet_File; Name : in String) return Boolean with Pre => Container.Is_Open; -- Add in the wallet the named entry and associate it the content. -- The content is encrypted in AES-CBC with a secret key and an IV vector -- that is created randomly for the new named entry. overriding procedure Add (Container : in out Wallet_File; Name : in String; Kind : in Entry_Type := T_BINARY; Content : in Ada.Streams.Stream_Element_Array) with Pre => Container.Is_Open, Post => Container.Contains (Name); overriding procedure Add (Container : in out Wallet_File; Name : in String; Kind : in Entry_Type := T_BINARY; Input : in out Util.Streams.Input_Stream'Class) with Pre'Class => Container.Is_Open, Post'Class => Container.Contains (Name); -- Add or update in the wallet the named entry and associate it the content. -- The content is encrypted in AES-CBC with a secret key and an IV vector -- that is created randomly for the new or updated named entry. overriding procedure Set (Container : in out Wallet_File; Name : in String; Kind : in Entry_Type := T_BINARY; Content : in Ada.Streams.Stream_Element_Array) with Pre => Container.Is_Open, Post => Container.Contains (Name); overriding procedure Set (Container : in out Wallet_File; Name : in String; Kind : in Entry_Type := T_BINARY; Input : in out Util.Streams.Input_Stream'Class) with Pre => Container.Is_Open, Post => Container.Contains (Name); -- Update in the wallet the named entry and associate it the new content. -- The secret key and IV vectors are not changed. procedure Update (Container : in out Wallet_File; Name : in String; Kind : in Entry_Type := T_BINARY; Content : in Ada.Streams.Stream_Element_Array) with Pre => Container.Is_Open, Post => Container.Contains (Name); -- Read from the wallet the named entry starting at the given position. -- Upon successful completion, Last will indicate the last valid position of -- the Content array. overriding procedure Read (Container : in out Wallet_File; Name : in String; Offset : in Ada.Streams.Stream_Element_Offset; Content : out Ada.Streams.Stream_Element_Array; Last : out Ada.Streams.Stream_Element_Offset) with Pre => Container.Is_Open, Post => Container.Contains (Name); -- Write in the wallet the named entry starting at the given position. -- The existing content is overwritten or new content is appended. overriding procedure Write (Container : in out Wallet_File; Name : in String; Offset : in Ada.Streams.Stream_Element_Offset; Content : in Ada.Streams.Stream_Element_Array) with Pre => Container.Is_Open, Post => Container.Contains (Name); -- Delete from the wallet the named entry. overriding procedure Delete (Container : in out Wallet_File; Name : in String) with Pre => Container.Is_Open, Post => not Container.Contains (Name); overriding procedure Get (Container : in out Wallet_File; Name : in String; Info : out Entry_Info; Content : out Ada.Streams.Stream_Element_Array) with Pre => Container.Is_Open; -- Write in the output stream the named entry value from the wallet. overriding procedure Get (Container : in out Wallet_File; Name : in String; Output : in out Util.Streams.Output_Stream'Class) with Pre => Container.Is_Open; -- Get the list of entries contained in the wallet that correspond to the optional filter. overriding procedure List (Container : in out Wallet_File; Filter : in Filter_Type := (others => True); Content : out Entry_Map) with Pre => Container.Is_Open; -- Get the list of entries contained in the wallet that correspond to the optiona filter -- and whose name matches the pattern. procedure List (Container : in out Wallet_File; Pattern : in GNAT.Regpat.Pattern_Matcher; Filter : in Filter_Type := (others => True); Content : out Entry_Map) with Pre => Container.Is_Open; overriding function Find (Container : in out Wallet_File; Name : in String) return Entry_Info; -- Get wallet file information and statistics. procedure Get_Stats (Container : in out Wallet_File; Stats : out Wallet_Stats); procedure Set_Work_Manager (Container : in out Wallet_File; Workers : in Keystore.Task_Manager_Access); private type Wallet_File is limited new Wallet with record Container : Keystore.Containers.Wallet_Container; end record; overriding procedure Initialize (Wallet : in out Wallet_File); overriding procedure Finalize (Wallet : in out Wallet_File); end Keystore.Files;
-- Copyright (c) 2020 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package body Torrent.Contexts is ----------------------- -- Add_Metainfo_File -- ----------------------- procedure Add_Metainfo_File (Self : in out Context'Class; File : not null Torrent.Metainfo_Files.Metainfo_File_Access) is File_Count : constant Ada.Containers.Count_Type := Ada.Containers.Count_Type (File.File_Count); Job : constant Downloader_Access := new Torrent.Downloaders.Downloader (Context => Self'Unchecked_Access, Meta => File, File_Count => File_Count, Piece_Count => File.Piece_Count); begin Job.Initialize (Self.Peer_Id, Self.Path); Self.Downloaders.Insert (File.Info_Hash, Job); end Add_Metainfo_File; ------------- -- Connect -- ------------- procedure Connect (Self : Context'Class; Job : Torrent.Downloaders.Downloader_Access; Address : GNAT.Sockets.Sock_Addr_Type) is begin Self.Initiator.Connect (Job, Address); end Connect; --------------- -- Connected -- --------------- procedure Connected (Self : Context'Class; Value : Torrent.Connections.Connection_Access) is begin Self.Manager.Connected (Value); end Connected; ------------------- -- Find_Download -- ------------------- function Find_Download (Self : Context'Class; Hash : SHA1) return Torrent.Downloaders.Downloader_Access is Cursor : constant Downloader_Maps.Cursor := Self.Downloaders.Find (Hash); begin if Downloader_Maps.Has_Element (Cursor) then return Torrent.Downloaders.Downloader_Access (Downloader_Maps.Element (Cursor)); else return null; end if; end Find_Download; ---------------- -- Initialize -- ---------------- procedure Initialize (Self : in out Context'Class; Id : Torrent.SHA1; Path : League.Strings.Universal_String) is begin Self.Path := Path; Self.Peer_Id := Id; end Initialize; ----------- -- Start -- ----------- procedure Start (Self : in out Context'Class; Next_Update : out Ada.Calendar.Time) is use type Ada.Calendar.Time; begin Next_Update := Ada.Calendar.Clock + 3600.0; for J of Self.Downloaders loop J.Start; end loop; end Start; ---------- -- Stop -- ---------- procedure Stop (Self : in out Context'Class) is begin for J of Self.Downloaders loop J.Stop; end loop; Self.Manager.Complete; Self.Initiator.Stop; end Stop; ------------ -- Update -- ------------ procedure Update (Self : in out Context'Class; Next_Update : out Ada.Calendar.Time) is use type Ada.Calendar.Time; begin Next_Update := Ada.Calendar.Clock + 3600.0; for J of Self.Downloaders loop J.Update; end loop; end Update; end Torrent.Contexts;
----------------------------------------------------------------------- -- awa-blogs-tests -- Unit tests for blogs module -- Copyright (C) 2017, 2018, 2019, 2020 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Test_Caller; with ASF.Requests.Mockup; with ASF.Responses.Mockup; with ASF.Tests; with AWA.Tests.Helpers.Users; package body AWA.Blogs.Tests is use Ada.Strings.Unbounded; use AWA.Tests; package Caller is new Util.Test_Caller (Test, "Blogs.Beans"); procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is begin Caller.Add_Test (Suite, "Test AWA.Blogs.Beans.List_Post (Anonymous)", Test_Anonymous_Access'Access); Caller.Add_Test (Suite, "Test AWA.Blogs.Beans.Create_Blog", Test_Create_Blog'Access); Caller.Add_Test (Suite, "Test AWA.Blogs.Beans.Update_Post", Test_Update_Post'Access); Caller.Add_Test (Suite, "Test AWA.Blogs.Beans.List_Post (Admin)", Test_Admin_List_Posts'Access); Caller.Add_Test (Suite, "Test AWA.Blogs.Beans.List_Comments (Admin)", Test_Admin_List_Comments'Access); Caller.Add_Test (Suite, "Test AWA.Blogs.Beans.Stats (Admin)", Test_Admin_Blog_Stats'Access); Caller.Add_Test (Suite, "Test AWA.Blogs.Beans.Update_Post (Publish_Date)", Test_Update_Publish_Date'Access); end Add_Tests; -- ------------------------------ -- Get some access on the blog as anonymous users. -- ------------------------------ procedure Verify_Anonymous (T : in out Test; Post : in String) is Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; begin ASF.Tests.Do_Get (Request, Reply, "/blogs/view.html", "blog-view.html"); ASF.Tests.Assert_Contains (T, "Blog posts", Reply, "Blog view page is invalid"); ASF.Tests.Do_Get (Request, Reply, "/blogs/tagged.html?tag=test", "blog-tagged.html"); ASF.Tests.Assert_Contains (T, "Tag - test", Reply, "Blog tag page is invalid"); ASF.Tests.Do_Get (Request, Reply, "/blogs/post.html?post=missing", "blog-missing.html"); ASF.Tests.Assert_Matches (T, "The post you are looking for does not exist", Reply, "Blog post missing page is invalid", ASF.Responses.SC_NOT_FOUND); if Post = "" then return; end if; ASF.Tests.Do_Get (Request, Reply, "/blogs/post.html?post=" & Post, "blog-post.html"); ASF.Tests.Assert_Matches (T, ".*The blog post.*content.*", Reply, "Blog post page is invalid" ); end Verify_Anonymous; -- ------------------------------ -- Test access to the blog as anonymous user. -- ------------------------------ procedure Test_Anonymous_Access (T : in out Test) is begin T.Verify_Anonymous (""); end Test_Anonymous_Access; -- ------------------------------ -- Test creation of blog by simulating web requests. -- ------------------------------ procedure Test_Create_Blog (T : in out Test) is Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; Uuid : constant String := Util.Tests.Get_Uuid; begin AWA.Tests.Helpers.Users.Login ("test-wiki@test.com", Request); ASF.Tests.Do_Get (Request, Reply, "/blogs/admin/create-blog.html", "create-blog-get.html"); T.Assert (Reply.Get_Status = ASF.Responses.SC_OK, "Invalid response after getting blog creation page"); ASF.Tests.Assert_Matches (T, "<dl id=.title.*<dt><label for=.title.*" & "<dd><input type=.text.*", Reply, "Blog post admin page is missing input field"); Request.Set_Parameter ("title", "The Blog Title"); Request.Set_Parameter ("create-blog", "1"); Request.Set_Parameter ("create", "1"); ASF.Tests.Do_Post (Request, Reply, "/blogs/admin/create-blog.html", "create-blog.html"); T.Assert (Reply.Get_Status = ASF.Responses.SC_MOVED_TEMPORARILY, "Invalid response after blog creation"); declare Ident : constant String := Helpers.Extract_Redirect (Reply, "/asfunit/blogs/admin/create.html?id="); begin Util.Tests.Assert_Matches (T, "^[0-9]+$", Ident, "Invalid blog identifier in the response"); T.Blog_Ident := To_Unbounded_String (Ident); Request.Set_Parameter ("post-blog-id", Ident); Request.Set_Parameter ("post", "1"); Request.Set_Parameter ("post-title", "Post title"); Request.Set_Parameter ("text", "The blog post content."); Request.Set_Parameter ("uri", Uuid); Request.Set_Parameter ("save", "1"); Request.Set_Parameter ("post-status", "1"); Request.Set_Parameter ("allow-comment", "0"); Request.Set_Parameter ("post-format", "dotclear"); ASF.Tests.Do_Post (Request, Reply, "/blogs/admin/create.html", "create-post.html"); T.Post_Ident := Helpers.Extract_Redirect (Reply, "/asfunit/blogs/admin/" & Ident & "/preview/"); Util.Tests.Assert_Matches (T, "^[0-9]+$", To_String (T.Post_Ident), "Invalid post identifier in the response"); end; -- Check public access to the post. T.Post_Uri := To_Unbounded_String (Uuid); T.Verify_Anonymous (Uuid); end Test_Create_Blog; -- ------------------------------ -- Test updating a post by simulating web requests. -- ------------------------------ procedure Test_Update_Post (T : in out Test) is Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; Uuid : constant String := Util.Tests.Get_Uuid; Ident : constant String := To_String (T.Blog_Ident); Post_Ident : Unbounded_String; begin AWA.Tests.Helpers.Users.Login ("test-wiki@test.com", Request); Request.Set_Parameter ("post-blog-id", Ident); Request.Set_Parameter ("post-id", To_String (T.Post_Ident)); Request.Set_Parameter ("post", "1"); Request.Set_Parameter ("post-title", "New post title"); Request.Set_Parameter ("text", "The blog post new content."); Request.Set_Parameter ("uri", Uuid); Request.Set_Parameter ("save", "1"); Request.Set_Parameter ("post-status", "POST_PUBLISHED"); Request.Set_Parameter ("post-format", "dotclear"); Request.Set_Parameter ("allow-comment", "0"); ASF.Tests.Do_Post (Request, Reply, "/blogs/admin/edit.html", "edit-post.html"); Post_Ident := Helpers.Extract_Redirect (Reply, "/asfunit/blogs/admin/" & Ident & "/preview/"); Util.Tests.Assert_Equals (T, To_String (T.Post_Ident), To_String (Post_Ident), "Invalid post identifier returned after post update"); T.Verify_Anonymous (Uuid); end Test_Update_Post; -- ------------------------------ -- Test updating the publication date by simulating web requests. -- ------------------------------ procedure Test_Update_Publish_Date (T : in out Test) is Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; Uuid : constant String := Util.Tests.Get_Uuid; Ident : constant String := To_String (T.Blog_Ident); Post_Ident : Unbounded_String; begin AWA.Tests.Helpers.Users.Login ("test-wiki@test.com", Request); Request.Set_Parameter ("post_id", To_String (T.Post_Ident)); Request.Set_Parameter ("blog_id", Ident); ASF.Tests.Do_Get (Request, Reply, "/blogs/admin/edit.html", "edit-post-form.html"); Request.Set_Parameter ("post-blog-id", Ident); Request.Set_Parameter ("post-id", To_String (T.Post_Ident)); Request.Set_Parameter ("post", "1"); Request.Set_Parameter ("post-title", "New post title"); Request.Set_Parameter ("text", "The blog post new content."); Request.Set_Parameter ("uri", Uuid); Request.Set_Parameter ("save", "POST_PUBLISHED"); Request.Set_Parameter ("post-format", "dotclear"); Request.Set_Parameter ("post-status", "1"); Request.Set_Parameter ("allow-comment", "0"); Request.Set_Parameter ("publish-date", ""); ASF.Tests.Do_Post (Request, Reply, "/blogs/admin/edit.html", "edit-post.html"); Post_Ident := Helpers.Extract_Redirect (Reply, "/asfunit/blogs/admin/" & Ident & "/preview/"); Util.Tests.Assert_Equals (T, To_String (T.Post_Ident), To_String (Post_Ident), "Invalid post identifier returned after post update"); T.Verify_Anonymous (Uuid); end Test_Update_Publish_Date; -- ------------------------------ -- Test listing the blog posts. -- ------------------------------ procedure Test_Admin_List_Posts (T : in out Test) is Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; Ident : constant String := To_String (T.Blog_Ident); begin AWA.Tests.Helpers.Users.Login ("test-wiki@test.com", Request); ASF.Tests.Do_Get (Request, Reply, "/blogs/admin/list.html?id=" & Ident, "blog-list.html"); ASF.Tests.Assert_Contains (T, "blog-post-list-header", Reply, "Blog admin page is invalid"); end Test_Admin_List_Posts; -- ------------------------------ -- Test listing the blog comments. -- ------------------------------ procedure Test_Admin_List_Comments (T : in out Test) is Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; Ident : constant String := To_String (T.Blog_Ident); begin AWA.Tests.Helpers.Users.Login ("test-wiki@test.com", Request); ASF.Tests.Do_Get (Request, Reply, "/blogs/admin/list-comments.html?id=" & Ident, "blog-list-comments.html"); ASF.Tests.Assert_Contains (T, "blog-comment-list-header", Reply, "Blog admin comments page is invalid"); end Test_Admin_List_Comments; -- ------------------------------ -- Test getting the JSON blog stats (for graphs). -- ------------------------------ procedure Test_Admin_Blog_Stats (T : in out Test) is Request : ASF.Requests.Mockup.Request; Reply : ASF.Responses.Mockup.Response; Ident : constant String := To_String (T.Blog_Ident); begin AWA.Tests.Helpers.Users.Login ("test-wiki@test.com", Request); ASF.Tests.Do_Get (Request, Reply, "/blogs/admin/" & Ident & "/stats", "blog-stats.html"); ASF.Tests.Assert_Contains (T, "data", Reply, "Blog admin stats page is invalid"); end Test_Admin_Blog_Stats; end AWA.Blogs.Tests;
package Invariant_Index is Name_Buffer : String (1 .. 100); Name_Len : Natural; procedure Proc (S : String); end Invariant_Index;
with Ada.Containers.Vectors; with Items; use Items; package Gilded_Rose is package Item_Vecs is new Ada.Containers.Vectors ( Element_Type => Item, Index_Type => Positive ); type Gilded_Rose is record Items : Item_Vecs.Vector; end record; procedure Update_Quality(Self : in out Gilded_Rose); end Gilded_Rose;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- XML Processor -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010-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$ ------------------------------------------------------------------------------ pragma Ada_2012; private package XML.SAX.Simple_Readers.Parser.Actions is procedure On_Attribute_Default_Declaration (Self : in out Simple_Reader'Class; Default : Matreshka.Internals.Strings.Shared_String_Access); -- Handles declaration of default value of the attribute. procedure On_CDATA_Attribute_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Process attribute declaration of CDATA type. procedure On_CDATA_Open (Self : in out Simple_Reader'Class); -- Process open of CDATA section. procedure On_CDATA_Close (Self : in out Simple_Reader'Class); -- Process close of CDATA section. procedure On_Character_Data (Self : in out Simple_Reader'Class; Text : not null Matreshka.Internals.Strings.Shared_String_Access; Is_Whitespace : Boolean); -- Process segment of character data. procedure On_Element_Attribute (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier; Value : not null Matreshka.Internals.Strings.Shared_String_Access); -- Handles attribute of the element. procedure On_Element_Attribute_Name (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Handles name of the attribute in the element. Now it olny switch scanner -- into appopriate attribute value normalization mode. procedure On_End_Of_Document (Self : in out Simple_Reader'Class); -- Handles end of document. procedure On_End_Of_Document_Type_Declaration (Self : in out Simple_Reader'Class); -- Handles end of document type declaration. procedure On_End_Tag (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Handles end tag, rule [42]. procedure On_Empty_Element_Tag (Self : in out Simple_Reader'Class); -- Process start tag, rule [44]. procedure On_Entity_Attribute_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Process attribute declaration of CDATA type. procedure On_Entities_Attribute_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Process attribute declaration of CDATA type. procedure On_Enumeration_Attribute_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Process attribute declaration of enumeration type. procedure On_Fixed_Attribute_Default_Declaration (Self : in out Simple_Reader'Class; Default : Matreshka.Internals.Strings.Shared_String_Access); -- Handles declaration of fixed value of the attribute. procedure On_General_Entity_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier; Is_External : Boolean; Value : League.Strings.Universal_String; Notation : Matreshka.Internals.XML.Symbol_Identifier); -- Process general entity declaration, rule [71]. procedure On_Id_Attribute_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Process attribute declaration of CDATA type. procedure On_IdRef_Attribute_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Process attribute declaration of CDATA type. procedure On_IdRefs_Attribute_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Process attribute declaration of CDATA type. procedure On_Implied_Attribute_Default_Declaration (Self : in out Simple_Reader'Class); -- Handles declaration of implied value of the attribute. procedure On_Empty_Declaration (Self : in out Simple_Reader'Class); -- Handles declaration of empty of the element. procedure On_Any_Declaration (Self : in out Simple_Reader'Class); -- Handles declaration of any of the element. procedure On_Mixed_Content_Declaration (Self : in out Simple_Reader'Class; Is_Any : Boolean); -- Handles declaration of mixed content of the element. procedure On_Name_In_Mixed_Content_Declaration (Self : in out Simple_Reader'Class); -- Handles element name in the list of children element in mixed content -- declration. procedure On_NmToken_Attribute_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Process attribute declaration of CDATA type. procedure On_NmTokens_Attribute_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Process attribute declaration of CDATA type. procedure On_No_Document_Type_Declaration (Self : in out Simple_Reader'Class); -- Handles case when document type declaration is missing. procedure On_Notation_Attribute_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Process attribute declaration of NOTATION type. procedure On_Notation_Declaration (Self : in out Simple_Reader'Class; Name : Matreshka.Internals.XML.Symbol_Identifier; Public_Id : not null Matreshka.Internals.Strings.Shared_String_Access; System_Id : not null Matreshka.Internals.Strings.Shared_String_Access); -- Handles declaration of notation. procedure On_Open_Of_Tag (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Handles open of element's tag. The only purpose now is to resolve -- element and set identifier of the declaration of currently -- processed element. procedure On_Parameter_Entity_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier; Is_External : Boolean; Value : League.Strings.Universal_String); -- Process parameter entity declaration, rule [72]. procedure On_Required_Attribute_Default_Declaration (Self : in out Simple_Reader'Class); -- Handles declaration of required value of the attribute. procedure On_Start_Of_Attribute_List_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Handles start of attribute list declaration. procedure On_Start_Of_Document (Self : in out Simple_Reader'Class); -- Handles start of document. procedure On_Start_Of_Document_Type_Declaration (Self : in out Simple_Reader'Class; Name : Matreshka.Internals.XML.Symbol_Identifier; External : Boolean); -- Handles start of document type declaration. procedure On_Start_Of_Element_Declaration (Self : in out Simple_Reader'Class; Symbol : Matreshka.Internals.XML.Symbol_Identifier); -- Handles start of element declaration. procedure On_Start_Tag (Self : in out Simple_Reader'Class); -- Handles start tag of element. procedure On_XML_Declaration (Self : in out Simple_Reader'Class; Version : not null Matreshka.Internals.Strings.Shared_String_Access; Encoding : not null Matreshka.Internals.Strings.Shared_String_Access); -- Handles XML version information and entity's encoding by switching -- scanner to the corresponding processing mode. procedure On_Text_Declaration (Self : in out Simple_Reader'Class; Version : not null Matreshka.Internals.Strings.Shared_String_Access; Encoding : not null Matreshka.Internals.Strings.Shared_String_Access); -- Handles XML version information and entity's encoding in external -- entity. procedure On_Standalone (Self : in out Simple_Reader'Class; Text : not null Matreshka.Internals.Strings.Shared_String_Access); -- Handles 'standalone' element of XML declaration. procedure On_Processing_Instruction (Self : in out Simple_Reader'Class; Target : Matreshka.Internals.XML.Symbol_Identifier; Data : not null Matreshka.Internals.Strings.Shared_String_Access); -- Process processing instruction. end XML.SAX.Simple_Readers.Parser.Actions;
with Ada.Characters.Handling, Ada.Strings.Fixed; package body ARM_Format.Data is -- -- Ada reference manual formatter (ARM_Form). -- -- This package contains various data used by the input file parser. -- -- --------------------------------------- -- Copyright 2011, 2012 AXE Consultants. All rights reserved. -- P.O. Box 1512, Madison WI 53701 -- E-Mail: randy@rrsoftware.com -- -- ARM_Form is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License version 3 -- as published by the Free Software Foundation. -- -- AXE CONSULTANTS MAKES THIS TOOL AND SOURCE CODE AVAILABLE ON AN "AS IS" -- BASIS AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE ACCURACY, -- CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR FUNCTIONING OF THIS TOOL. -- IN NO EVENT WILL AXE CONSULTANTS BE LIABLE FOR ANY GENERAL, -- CONSEQUENTIAL, INDIRECT, INCIDENTAL, EXEMPLARY, OR SPECIAL DAMAGES, -- EVEN IF AXE CONSULTANTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -- DAMAGES. -- -- A copy of the GNU General Public License is available in the file -- gpl-3-0.txt in the standard distribution of the ARM_Form tool. -- Otherwise, see <http://www.gnu.org/licenses/>. -- -- If the GPLv3 license is not satisfactory for your needs, a commercial -- use license is available for this tool. Contact Randy at AXE Consultants -- for more information. -- -- --------------------------------------- -- -- Edit History: -- -- 8/ 8/11 - RLB - Split from base package, mainly to reduce the -- size of that package. -- - RLB - Added aspect index commands. -- 10/18/11 - RLB - Changed to GPLv3 license. -- 10/19/11 - RLB - Added AspectDefn command. -- 10/20/11 - RLB - Added DeletedPragmaSyn command. -- 10/26/11 - RLB - Added versioned break commands. -- 3/27/12 - RLB - Added more versioned break commands. -- 12/17/12 - RLB - Added Ada 2012 AARM headings. function Command (Name : in ARM_Input.Command_Name_Type) return Command_Type is -- Return the command value for a particular command name: Canonical_Name : constant String := Ada.Characters.Handling.To_Lower (Ada.Strings.Fixed.Trim (Name, Ada.Strings.Right)); begin if Canonical_Name = "begin" then return Text_Begin; elsif Canonical_Name = "end" then return Text_End; elsif Canonical_Name = "redundant" then return Redundant; elsif Canonical_Name = "comment" then return Comment; elsif Canonical_Name = "noprefix" then return No_Prefix; elsif Canonical_Name = "noparanum" then return No_Para_Num; elsif Canonical_Name = "keepnext" then return Keep_with_Next; elsif Canonical_Name = "leading" then return Leading; elsif Canonical_Name = "trailing" then return Trailing; elsif Canonical_Name = "+" then -- Can't happen directly, but can happen through stacking. return Up; elsif Canonical_Name = "-" then -- Can't happen directly, but can happen through stacking. return Down; elsif Canonical_Name = "thinline" then return Thin_Line; elsif Canonical_Name = "thickline" then return Thick_Line; elsif Canonical_Name = "tabclear" then return Tab_Clear; elsif Canonical_Name = "tabset" then return Tab_Set; elsif Canonical_Name = "table" then return Table; elsif Canonical_Name = "picturealone" then return Picture_Alone; elsif Canonical_Name = "pictureinline" then return Picture_Inline; elsif Canonical_Name = "last" then return Table_Last; elsif Canonical_Name = "part" then return Part; elsif Canonical_Name = "newpage" then return New_Page; elsif Canonical_Name = "rmnewpage" then return RM_New_Page; elsif Canonical_Name = "softpage" then return Soft_Page; elsif Canonical_Name = "newcolumn" then return New_Column; elsif Canonical_Name = "newpagever" then return New_Page_for_Version; elsif Canonical_Name = "rmnewpagever" then return RM_New_Page_for_Version; elsif Canonical_Name = "notisormnewpagever" then return Not_Iso_RM_New_Page_for_Version; elsif Canonical_Name = "isoonlyrmnewpagever" then return Iso_Only_RM_New_Page_for_Version; elsif Canonical_Name = "newcolumnver" then return New_Column_for_Version; elsif Canonical_Name = "b" or else Canonical_Name = "bold" then return Bold; elsif Canonical_Name = "i" or else Canonical_Name = "italics" then return Italic; elsif Canonical_Name = "r" or else Canonical_Name = "roman" then return Roman; elsif Canonical_Name = "s" or else Canonical_Name = "swiss" then return Swiss; elsif Canonical_Name = "f" or else Canonical_Name = "fixed" then return Fixed; elsif Canonical_Name = "ri" then return Roman_Italic; elsif Canonical_Name = "shrink" then return Shrink; elsif Canonical_Name = "grow" then return Grow; elsif Canonical_Name = "black" then return Black; elsif Canonical_Name = "red" then return Red; elsif Canonical_Name = "green" then return Green; elsif Canonical_Name = "blue" then return Blue; elsif Canonical_Name = "key" then return Keyword; elsif Canonical_Name = "nt" then return Non_Terminal; elsif Canonical_Name = "ntf" then return Non_Terminal_Format; elsif Canonical_Name = "exam" then return Example_Text; elsif Canonical_Name = "examcom" then return Example_Comment; elsif Canonical_Name = "indexlist" then return Index_List; elsif Canonical_Name = "defn" then return Defn; elsif Canonical_Name = "defn2" then return Defn2; elsif Canonical_Name = "rootdefn" then return RootDefn; elsif Canonical_Name = "rootdefn2" then return RootDefn2; elsif Canonical_Name = "pdefn" then return PDefn; elsif Canonical_Name = "pdefn2" then return PDefn2; elsif Canonical_Name = "indexsee" then return Index_See; elsif Canonical_Name = "indexseealso" then return Index_See_Also; elsif Canonical_Name = "seeother" then return See_Other; elsif Canonical_Name = "seealso" then return See_Also; elsif Canonical_Name = "rootlibunit" then return Index_Root_Unit; elsif Canonical_Name = "childunit" then return Index_Child_Unit; elsif Canonical_Name = "subchildunit" then return Index_Subprogram_Child_Unit; elsif Canonical_Name = "adatypedefn" then return Index_Type; elsif Canonical_Name = "adasubtypedefn" then return Index_Subtype; elsif Canonical_Name = "adasubdefn" then return Index_Subprogram; elsif Canonical_Name = "adaexcdefn" then return Index_Exception; elsif Canonical_Name = "adaobjdefn" then return Index_Object; elsif Canonical_Name = "adapackdefn" then return Index_Package; elsif Canonical_Name = "adadefn" then return Index_Other; elsif Canonical_Name = "indexcheck" then return Index_Check; elsif Canonical_Name = "attr" then return Index_Attr; elsif Canonical_Name = "prag" then return Index_Pragma; elsif Canonical_Name = "aspectdefn" then return Index_Aspect; elsif Canonical_Name = "syn" then return Syntax_Rule; elsif Canonical_Name = "syn2" then return Syntax_Term; elsif Canonical_Name = "synf" then return Syntax_Term_Undefined; elsif Canonical_Name = "syni" then return Syntax_Prefix; elsif Canonical_Name = "syntaxsummary" then return Syntax_Summary; elsif Canonical_Name = "syntaxxref" then return Syntax_Xref; elsif Canonical_Name = "addedsyn" then return Added_Syntax_Rule; elsif Canonical_Name = "deletedsyn" then return Deleted_Syntax_Rule; elsif Canonical_Name = "toglossary" then return To_Glossary; elsif Canonical_Name = "toglossaryalso" then return To_Glossary_Also; elsif Canonical_Name = "chgtoglossary" then return Change_To_Glossary; elsif Canonical_Name = "chgtoglossaryalso" then return Change_To_Glossary_Also; elsif Canonical_Name = "glossarylist" then return Glossary_List; elsif Canonical_Name = "prefixtype" then return Prefix_Type; elsif Canonical_Name = "chgprefixtype" then return Change_Prefix_Type; elsif Canonical_Name = "endprefixtype" then return Reset_Prefix_Type; elsif Canonical_Name = "attribute" then return Attribute; elsif Canonical_Name = "attributeleading" then return Attribute_Leading; elsif Canonical_Name = "chgattribute" then return Change_Attribute; elsif Canonical_Name = "attributelist" then return Attribute_List; elsif Canonical_Name = "pragmasyn" then return Pragma_Syntax; elsif Canonical_Name = "pragmalist" then return Pragma_List; elsif Canonical_Name = "addedpragmasyn" then return Added_Pragma_Syntax; elsif Canonical_Name = "deletedpragmasyn" then return Deleted_Pragma_Syntax; elsif Canonical_Name = "impldef" then return Implementation_Defined; elsif Canonical_Name = "chgimpldef" then return Change_Implementation_Defined; elsif Canonical_Name = "impldeflist" then return Implementation_Defined_List; elsif Canonical_Name = "chgimpladvice" then return Change_Implementation_Advice; elsif Canonical_Name = "addedimpladvicelist" then return Added_Implementation_Advice_List; elsif Canonical_Name = "chgdocreq" then return Change_Documentation_Requirement; elsif Canonical_Name = "addeddocreqlist" then return Added_Documentation_Requirements_List; elsif Canonical_Name = "chgaspectdesc" then return Change_Aspect_Description; elsif Canonical_Name = "addedaspectlist" then return Added_Aspect_Description_List; elsif Canonical_Name = "packagelist" then return Package_List; elsif Canonical_Name = "typelist" then return Type_List; elsif Canonical_Name = "subprogramlist" then return Subprogram_List; elsif Canonical_Name = "exceptionlist" then return Exception_List; elsif Canonical_Name = "objectlist" then return Object_List; elsif Canonical_Name = "labeledsection" then return Labeled_Section; elsif Canonical_Name = "labeledsectionnobreak" then return Labeled_Section_No_Break; elsif Canonical_Name = "labeledclause" then return Labeled_Clause; elsif Canonical_Name = "labeledsubclause" then return Labeled_Subclause; elsif Canonical_Name = "labeledsubsubclause" then return Labeled_Subsubclause; elsif Canonical_Name = "labeledannex" then return Labeled_Annex; elsif Canonical_Name = "labeledinformativeannex" then return Labeled_Informative_Annex; elsif Canonical_Name = "labelednormativeannex" then return Labeled_Normative_Annex; elsif Canonical_Name = "unnumberedsection" then return Unnumbered_Section; elsif Canonical_Name = "labeledrevisedannex" then return Labeled_Revised_Annex; elsif Canonical_Name = "labeledrevisedinformativeannex" then return Labeled_Revised_Informative_Annex; elsif Canonical_Name = "labeledrevisednormativeannex" then return Labeled_Revised_Normative_Annex; elsif Canonical_Name = "labeledaddedannex" then return Labeled_Added_Annex; elsif Canonical_Name = "labeledaddedinformativeannex" then return Labeled_Added_Informative_Annex; elsif Canonical_Name = "labeledaddednormativeannex" then return Labeled_Added_Normative_Annex; elsif Canonical_Name = "labeledrevisedsection" then return Labeled_Revised_Section; elsif Canonical_Name = "labeledrevisedclause" then return Labeled_Revised_Clause; elsif Canonical_Name = "labeledrevisedsubclause" then return Labeled_Revised_Subclause; elsif Canonical_Name = "labeledrevisedsubsubclause" then return Labeled_Revised_Subsubclause; elsif Canonical_Name = "labeledaddedsection" then return Labeled_Added_Section; elsif Canonical_Name = "labeledaddedclause" then return Labeled_Added_Clause; elsif Canonical_Name = "labeledaddedsubclause" then return Labeled_Added_Subclause; elsif Canonical_Name = "labeledaddedsubsubclause" then return Labeled_Added_Subsubclause; elsif Canonical_Name = "labeleddeletedclause" then return Labeled_Deleted_Clause; elsif Canonical_Name = "labeleddeletedsubclause" then return Labeled_Deleted_Subclause; elsif Canonical_Name = "labeleddeletedsubsubclause" then return Labeled_Deleted_Subsubclause; elsif Canonical_Name = "subheading" then return Subheading; elsif Canonical_Name = "addedsubheading" then return Added_Subheading; elsif Canonical_Name = "heading" then return Heading; elsif Canonical_Name = "center" then return Center; elsif Canonical_Name = "right" then return Right; elsif Canonical_Name = "prefacesection" then return Preface_Section; elsif Canonical_Name = "refsec" then return Ref_Section; elsif Canonical_Name = "refsecnum" then return Ref_Section_Number; elsif Canonical_Name = "refsecbynum" then return Ref_Section_By_Number; elsif Canonical_Name = "locallink" then return Local_Link; elsif Canonical_Name = "localtarget" then return Local_Target; elsif Canonical_Name = "urllink" then return URL_Link; elsif Canonical_Name = "ailink" then return AI_Link; elsif Canonical_Name = "chg" then return Change; elsif Canonical_Name = "chgadded" then return Change_Added; elsif Canonical_Name = "chgdeleted" then return Change_Deleted; elsif Canonical_Name = "chgref" then return Change_Reference; elsif Canonical_Name = "chgnote" then return Change_Note; elsif Canonical_Name = "introname" then return Intro_Name; elsif Canonical_Name = "syntaxname" then return Syntax_Name; elsif Canonical_Name = "resolutionname" then return Resolution_Name; elsif Canonical_Name = "legalityname" then return Legality_Name; elsif Canonical_Name = "staticsemname" then return Static_Name; elsif Canonical_Name = "linktimename" then return Link_Name; elsif Canonical_Name = "runtimename" then return Run_Name; elsif Canonical_Name = "boundedname" then return Bounded_Name; elsif Canonical_Name = "erronname" then return Erroneous_Name; elsif Canonical_Name = "implreqname" then return Req_Name; elsif Canonical_Name = "docreqname" then return Doc_Name; elsif Canonical_Name = "metricsname" then return Metrics_Name; elsif Canonical_Name = "implpermname" then return Permission_Name; elsif Canonical_Name = "impladvicename" then return Advice_Name; elsif Canonical_Name = "notesname" then return Notes_Name; elsif Canonical_Name = "singlenotename" then return Single_Note_Name; elsif Canonical_Name = "examplesname" then return Examples_Name; elsif Canonical_Name = "metarulesname" then return Meta_Name; elsif Canonical_Name = "inconsistent83name" then return Inconsistent83_Name; elsif Canonical_Name = "incompatible83name" then return Incompatible83_Name; elsif Canonical_Name = "extend83name" then return Extend83_Name; elsif Canonical_Name = "diffword83name" then return Wording83_Name; elsif Canonical_Name = "inconsistent95name" then return Inconsistent95_Name; elsif Canonical_Name = "incompatible95name" then return Incompatible95_Name; elsif Canonical_Name = "extend95name" then return Extend95_Name; elsif Canonical_Name = "diffword95name" then return Wording95_Name; elsif Canonical_Name = "inconsistent2005name" then return Inconsistent2005_Name; elsif Canonical_Name = "incompatible2005name" then return Incompatible2005_Name; elsif Canonical_Name = "extend2005name" then return Extend2005_Name; elsif Canonical_Name = "diffword2005name" then return Wording2005_Name; elsif Canonical_Name = "inconsistent2012name" then return Inconsistent2012_Name; elsif Canonical_Name = "incompatible2012name" then return Incompatible2012_Name; elsif Canonical_Name = "extend2012name" then return Extend2012_Name; elsif Canonical_Name = "diffword2012name" then return Wording2012_Name; elsif Canonical_Name = "syntaxtitle" then return Syntax_Title; elsif Canonical_Name = "resolutiontitle" then return Resolution_Title; elsif Canonical_Name = "legalitytitle" then return Legality_Title; elsif Canonical_Name = "staticsemtitle" then return Static_Title; elsif Canonical_Name = "linktimetitle" then return Link_Title; elsif Canonical_Name = "runtimetitle" then return Run_Title; elsif Canonical_Name = "boundedtitle" then return Bounded_Title; elsif Canonical_Name = "errontitle" then return Erroneous_Title; elsif Canonical_Name = "implreqtitle" then return Req_Title; elsif Canonical_Name = "docreqtitle" then return Doc_Title; elsif Canonical_Name = "metricstitle" then return Metrics_Title; elsif Canonical_Name = "implpermtitle" then return Permission_Title; elsif Canonical_Name = "impladvicetitle" then return Advice_Title; elsif Canonical_Name = "notestitle" then return Notes_Title; elsif Canonical_Name = "singlenotetitle" then return Single_Note_Title; elsif Canonical_Name = "examplestitle" then return Examples_Title; elsif Canonical_Name = "metarulestitle" then return Meta_Title; elsif Canonical_Name = "inconsistent83title" then return Inconsistent83_Title; elsif Canonical_Name = "incompatible83title" then return Incompatible83_Title; elsif Canonical_Name = "extend83title" then return Extend83_Title; elsif Canonical_Name = "diffword83title" then return Wording83_Title; elsif Canonical_Name = "inconsistent95title" then return Inconsistent95_Title; elsif Canonical_Name = "incompatible95title" then return Incompatible95_Title; elsif Canonical_Name = "extend95title" then return Extend95_Title; elsif Canonical_Name = "diffword95title" then return Wording95_Title; elsif Canonical_Name = "inconsistent2005title" then return Inconsistent2005_Title; elsif Canonical_Name = "incompatible2005title" then return Incompatible2005_Title; elsif Canonical_Name = "extend2005title" then return Extend2005_Title; elsif Canonical_Name = "diffword2005title" then return Wording2005_Title; elsif Canonical_Name = "inconsistent2012title" then return Inconsistent2012_Title; elsif Canonical_Name = "incompatible2012title" then return Incompatible2012_Title; elsif Canonical_Name = "extend2012title" then return Extend2012_Title; elsif Canonical_Name = "diffword2012title" then return Wording2012_Title; elsif Canonical_Name = "em" then return EM_Dash; elsif Canonical_Name = "en" then return EN_Dash; elsif Canonical_Name = "lt" then return LT; elsif Canonical_Name = "leq" then return LE; elsif Canonical_Name = "gt" then return GT; elsif Canonical_Name = "geq" then return GE; elsif Canonical_Name = "neq" then return NE; elsif Canonical_Name = "pi" then return PI; elsif Canonical_Name = "times" then return Times; elsif Canonical_Name = "porm" then return PorM; elsif Canonical_Name = "singlequote" then return Single_Quote; elsif Canonical_Name = "latin1" then return LATIN_1; elsif Canonical_Name = "unicode" then return Unicode; elsif Canonical_Name = "ceiling" then return Ceiling; elsif Canonical_Name = "floor" then return Floor; elsif Canonical_Name = "abs" then return Absolute; elsif Canonical_Name = "log" then return Log; elsif Canonical_Name = "thin" then return Thin_Space; elsif Canonical_Name = "lquote" then return Left_Quote; elsif Canonical_Name = "lquotes" then return Left_Quote_Pair; elsif Canonical_Name = "ldquote" then return Left_Double_Quote; elsif Canonical_Name = "rquote" then return Right_Quote; elsif Canonical_Name = "rquotes" then return Right_Quote_Pair; elsif Canonical_Name = "rdquote" then return Right_Double_Quote; elsif Canonical_Name = "smldotlessi" then return Small_Dotless_I; elsif Canonical_Name = "capdottedi" then return Capital_Dotted_I; else return Unknown; end if; end Command; end ARM_Format.Data;
package body getter is procedure push (getter : getter_type) is begin getters_stack.append(getter); current_getter := getter; end push; procedure pop is begin getters_stack.delete_last; if not getters_stack_t.is_empty(getters_stack) then current_getter := getters_stack_t.last_element(getters_stack); end if; end pop; function get (lf2space : boolean := true) return character is c : character; begin if getters_stack_t.is_empty(getters_stack) then raise ERROR_NO_GETTERS; end if; c := current_getter.all; if c = ascii.nul then getters_stack.delete_last; if getters_stack_t.is_empty(getters_stack) then return ascii.nul; end if; current_getter := getters_stack_t.last_element(getters_stack); return get; end if; if lf2space and c = ascii.lf then return ' '; end if; return c; end get; procedure set_line (cnt : pos_count) is begin current_line := cnt; end set_line; function get_line return pos_count is begin return current_line; end get_line; end getter;
-- -- Provides the ability to create a configuration to be used when creating a -- Kafka handle -- package Kafka.Config is -- -- Creates a new kafka config object -- -- librdkafka equivalent: rd_kafka_conf_new -- function Create return Config_Type with Import => True, Convention => C, External_Name => "rd_kafka_conf_new"; -- -- Destroys a kafka config object -- -- librdkafka equivalent: rd_kafka_conf_destroy -- -- @param Config configuration to destroy -- procedure Destroy(Config : Config_Type) with Import => True, Convention => C, External_Name => "rd_kafka_conf_destroy"; -- -- Duplicates a kafka config object -- -- librdkafka equivalent: rd_kafka_conf_dup -- -- @param Config configuration to duplicate -- function Duplicate(Config : Config_Type) return Config_Type with Import => True, Convention => C, External_Name => "rd_kafka_conf_dup"; -- -- Sets a kafka config property for a given kafka config. -- -- librdkafka equivalent: rd_kafka_conf_set -- -- @param Config configuration to set the property in -- @param Name name of property to set -- @param Value value of property to set -- @raises Kafka_Error on error -- procedure Set(Config : Config_Type; Name : String; Value : String); private function rd_kafka_conf_set(conf : Config_Type; name : chars_ptr; value : chars_ptr; errstr : chars_ptr; errstr_size : size_t) return Integer with Import => True, Convention => C, External_Name => "rd_kafka_conf_set"; end Kafka.Config;
pragma Ada_2005; pragma Style_Checks (Off); pragma Warnings (Off); with Interfaces.C; use Interfaces.C; with glib; package GStreamer.GST_Low_Level.gstreamer_0_10_gst_pbutils_pbutils_enumtypes_h is -- unsupported macro: GST_TYPE_INSTALL_PLUGINS_RETURN (gst_install_plugins_return_get_type()) -- unsupported macro: GST_TYPE_DISCOVERER_RESULT (gst_discoverer_result_get_type()) -- enumerations from "install-plugins.h" function gst_install_plugins_return_get_type return GLIB.GType; -- gst/pbutils/pbutils-enumtypes.h:12 pragma Import (C, gst_install_plugins_return_get_type, "gst_install_plugins_return_get_type"); -- enumerations from "gstdiscoverer.h" function gst_discoverer_result_get_type return GLIB.GType; -- gst/pbutils/pbutils-enumtypes.h:16 pragma Import (C, gst_discoverer_result_get_type, "gst_discoverer_result_get_type"); end GStreamer.GST_Low_Level.gstreamer_0_10_gst_pbutils_pbutils_enumtypes_h;
----------------------------------------------------------------------- -- search-fields -- Document fields -- Copyright (C) 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.Streams; with Ada.Containers; -- == Fields == -- The field describe an element of a document that can be indexed. package Search.Fields is type Field_Kind is (F_META, F_TOKEN, F_PATH, F_CONTENT); type Field_Type is private; -- Get the field name. function Get_Name (Field : in Field_Type) return String; -- Get the field value for the meta field. function Get_Value (Field : in Field_Type) return String; -- Returns True if this field is indexable. function Is_Indexable (Field : in Field_Type) return Boolean; -- Returns True if this field is composed of multiple tokens. function Is_Tokenized (Field : in Field_Type) return Boolean; -- Returns True if this field is stored in the index. function Is_Stored (Field : in Field_Type) return Boolean; -- Create a field with the given name and content. function Create (Name : in String; Value : in String; Kind : in Field_Kind := F_TOKEN) return Field_Type; -- Stream the content of the field to the procedure. procedure Stream (Field : in Field_Type; Into : not null access procedure (S : in out Util.Streams.Input_Stream'Class)); -- Create a hash on the field on its name only. function Hash (Field : in Field_Type) return Ada.Containers.Hash_Type; private type Field_Type is record Kind : Field_Kind; Name : UString; Value : UString; end record; end Search.Fields;
-- 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. with GL.Types; with Orka.Containers.Bounded_Vectors; with Orka.Transforms.Singles.Vectors; package Orka.glTF.Accessors is pragma Preelaborate; subtype Stride_Natural is Natural range Natural'First .. 255; type Component_Kind is (Byte, Unsigned_Byte, Short, Unsigned_Short, Unsigned_Int, Float); type Attribute_Kind is (Scalar, Vector2, Vector3, Vector4, Matrix2, Matrix3, Matrix4); Bytes_Element : constant array (Component_Kind) of Positive := (Byte => 1, Unsigned_Byte => 1, Short => 2, Unsigned_Short => 2, Unsigned_Int => 4, Float => 4); Attribute_Length : constant array (Attribute_Kind) of Positive := (Scalar => 1, Vector2 => 2, Vector3 => 3, Vector4 => 4, Matrix2 => 4, Matrix3 => 9, Matrix4 => 16); Numeric_Type : constant array (Component_Kind) of GL.Types.Numeric_Type := (Byte => GL.Types.Byte_Type, Unsigned_Byte => GL.Types.UByte_Type, Short => GL.Types.Short_Type, Unsigned_Short => GL.Types.UShort_Type, Unsigned_Int => GL.Types.UInt_Type, Float => GL.Types.Single_Type); function Unsigned_Type (Value : Component_Kind) return GL.Types.Index_Type; package Transforms renames Orka.Transforms.Singles.Vectors; type Accessor (Bounds : Boolean := False) is record View : Natural; Offset : Natural; Component : Component_Kind; Normalized : Boolean; Count : Positive; Kind : Attribute_Kind; case Bounds is when True => Min_Bounds : Transforms.Vector4; Max_Bounds : Transforms.Vector4; when False => null; end case; end record; package Accessor_Vectors is new Orka.Containers.Bounded_Vectors (Natural, Accessor); function Get_Accessors (Accessors : Types.JSON_Value) return Accessor_Vectors.Vector; end Orka.glTF.Accessors;
-- Copyright (c) 2019 Maxim Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- separate (Program.Scanners) package body Tables is type Second_Stage_Array is array (Second_Stage_Index) of Character_Class; type Second_Stage_Array_Access is not null access constant Second_Stage_Array with Storage_Size => 0; type First_Stage_Array is array (First_Stage_Index) of Second_Stage_Array_Access; S_0 : aliased constant Second_Stage_Array := (34, 34, 34, 34, 34, 34, 34, 34, 34, 25, 24, 32, 32, 23, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 22, 17, 20, 28, 31, 21, 8, 9, 10, 11, 3, 12, 13, 14, 2, 5, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 4, 15, 7, 1, 6, 31, 31, 30, 30, 30, 30, 18, 30, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 26, 31, 30, 30, 30, 30, 18, 30, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 16, 31, 31, 34, 34, 34, 34, 34, 34, 32, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 22, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 31, 31, 22, 31, 31, 31, 31, 31, 31, 31, 33, 31, 31, 31, 31, 33, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33); S_1 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_2 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 33, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_3 : aliased constant Second_Stage_Array := (27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 31, 33, 33, 31, 31, 33, 33, 33, 33, 31, 33, 31, 31, 31, 31, 31, 31, 33, 31, 33, 33, 33, 31, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_4 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 27, 27, 27, 27, 27, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_5 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 27, 31, 27, 27, 31, 27, 27, 31, 27, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_6 : aliased constant Second_Stage_Array := (22, 22, 22, 22, 22, 22, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 22, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 33, 33, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 27, 27, 27, 27, 27, 27, 27, 22, 31, 27, 27, 27, 27, 27, 27, 33, 33, 27, 27, 31, 27, 27, 27, 27, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 31, 31, 33); S_7 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 22, 33, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 31, 31, 31, 31, 33, 31, 31, 31, 31, 31); S_8 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 27, 27, 27, 33, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27); S_9 : aliased constant Second_Stage_Array := (27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 31, 31, 31, 33, 33, 33, 33, 31, 31, 27, 33, 27, 27, 27, 27, 27, 27, 27, 31, 31, 27, 27, 31, 31, 27, 27, 27, 33, 31, 31, 31, 31, 31, 31, 31, 31, 27, 31, 31, 31, 31, 33, 33, 31, 33, 33, 33, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_10 : aliased constant Second_Stage_Array := (31, 27, 27, 27, 31, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 31, 33, 33, 31, 33, 33, 31, 31, 27, 31, 27, 27, 27, 27, 27, 31, 31, 31, 31, 27, 27, 31, 31, 27, 27, 27, 31, 31, 31, 27, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 31, 33, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 31, 33, 33, 33, 33, 33, 31, 31, 27, 33, 27, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 27, 31, 27, 27, 27, 31, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_11 : aliased constant Second_Stage_Array := (31, 27, 27, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 31, 33, 33, 33, 33, 33, 31, 31, 27, 33, 27, 27, 27, 27, 27, 27, 27, 31, 31, 27, 27, 31, 31, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 31, 31, 31, 31, 33, 33, 31, 33, 33, 33, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 33, 31, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 33, 33, 31, 33, 33, 33, 33, 31, 31, 31, 33, 33, 31, 33, 31, 33, 33, 31, 31, 31, 33, 33, 31, 31, 31, 33, 33, 33, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 27, 27, 27, 27, 27, 31, 31, 31, 27, 27, 27, 31, 27, 27, 27, 27, 31, 31, 33, 31, 31, 31, 31, 31, 31, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_12 : aliased constant Second_Stage_Array := (27, 27, 27, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 27, 31, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 27, 27, 31, 33, 33, 31, 31, 31, 31, 31, 31, 33, 33, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 31, 31, 27, 33, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 27, 31, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 27, 27, 31, 31, 31, 31, 31, 31, 31, 33, 31, 33, 33, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_13 : aliased constant Second_Stage_Array := (31, 27, 27, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 27, 31, 27, 27, 27, 27, 33, 31, 31, 31, 31, 31, 31, 31, 31, 27, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 31, 31, 27, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 27, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 31, 27, 31, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_14 : aliased constant Second_Stage_Array := (31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 33, 33, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 31, 33, 31, 31, 33, 33, 31, 33, 31, 31, 33, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 31, 33, 31, 33, 31, 31, 33, 33, 31, 33, 33, 33, 33, 27, 33, 33, 27, 27, 27, 27, 27, 27, 31, 27, 27, 33, 31, 31, 33, 33, 33, 33, 33, 31, 33, 31, 27, 27, 27, 27, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_15 : aliased constant Second_Stage_Array := (33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 31, 27, 31, 27, 31, 31, 31, 31, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_16 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 33, 33, 33, 33, 27, 27, 27, 33, 27, 27, 27, 33, 33, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 31, 31, 31, 31, 31, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33); S_17 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 31, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 31, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_18 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_19 : aliased constant Second_Stage_Array := (31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_20 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 22, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31); S_21 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 31, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 33, 31, 31, 31, 31, 33, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_22 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 22, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 33, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_23 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 27, 27, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_24 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_25 : aliased constant Second_Stage_Array := (27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_26 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 27, 33, 33, 33, 33, 27, 27, 27, 33, 33, 31, 27, 27, 31, 31, 31, 31, 31, 31); S_27 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27); S_28 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 31, 33, 31, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 31, 31, 31, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31); S_29 : aliased constant Second_Stage_Array := (22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 32, 22, 22, 22, 22, 22, 22, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 29, 29, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 29, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 22, 22, 22, 22, 22, 22, 31, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 27, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_30 : aliased constant Second_Stage_Array := (31, 31, 33, 31, 31, 31, 31, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 31, 31, 31, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 33, 31, 33, 31, 33, 31, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 31, 31, 31, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_31 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_32 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 27, 27, 27, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_33 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 31, 31, 31, 31, 31, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27); S_34 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_35 : aliased constant Second_Stage_Array := (22, 31, 31, 31, 31, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 31, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 27, 27, 31, 31, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33); S_36 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_37 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_38 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_39 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31); S_40 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_41 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_42 : aliased constant Second_Stage_Array := (33, 33, 27, 33, 33, 33, 27, 33, 33, 33, 33, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 31, 31, 31, 31); S_43 : aliased constant Second_Stage_Array := (27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 33, 31); S_44 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 27, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 33, 27, 27, 27, 33, 33, 27, 27, 33, 33, 33, 33, 33, 27, 27, 33, 27, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 31, 31, 33, 33, 33, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_45 : aliased constant Second_Stage_Array := (31, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 31, 31, 31, 31, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31); S_46 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31); S_47 : aliased constant Second_Stage_Array := (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); S_48 : aliased constant Second_Stage_Array := (34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34); S_49 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_50 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 33, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 31, 33, 31, 33, 33, 31, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_51 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31); S_52 : aliased constant Second_Stage_Array := (27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 29, 29, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 29, 29, 29, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 22); S_53 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 29, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 22, 22, 22, 31, 31, 34, 34); S_54 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31); S_55 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 31, 31); S_56 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_57 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_58 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_59 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_60 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_61 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 31, 31, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 31, 31, 31, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_62 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_63 : aliased constant Second_Stage_Array := (33, 27, 27, 27, 31, 27, 27, 31, 31, 31, 31, 31, 27, 27, 27, 27, 33, 33, 33, 33, 31, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 27, 27, 27, 31, 31, 31, 31, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_64 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_65 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_66 : aliased constant Second_Stage_Array := (27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 22, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31); S_67 : aliased constant Second_Stage_Array := (27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 31, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_68 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31); S_69 : aliased constant Second_Stage_Array := (31, 27, 27, 27, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 31, 33, 33, 33, 33, 33, 31, 31, 27, 33, 27, 27, 27, 27, 27, 27, 27, 31, 31, 27, 27, 31, 31, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_70 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 33, 33, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_71 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_72 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_73 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33); S_74 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31); S_75 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_76 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_77 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_78 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_79 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_80 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_81 : aliased constant Second_Stage_Array := (33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_82 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 27, 27, 31, 22, 22, 22, 22, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_83 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 31, 31, 31, 27, 27, 27, 27, 27, 27, 22, 22, 22, 22, 22, 22, 22, 22, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_84 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_85 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 31, 31, 33, 31, 31, 33, 33, 31, 31, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_86 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 31, 33, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_87 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33); S_88 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27); S_89 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_90 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 31, 33, 31, 31, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 31, 33, 31, 33, 31, 31, 31, 31, 31, 31, 33, 31, 31, 31, 31, 33, 31, 33, 31, 33, 31, 33, 33, 33, 31, 33, 33, 31, 33, 31, 31, 33, 31, 33, 31, 33, 31, 33, 31, 33, 31, 33, 33, 31, 33, 31, 31, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 31, 33, 33, 33, 33, 31, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 33, 33, 33, 31, 33, 33, 33, 33, 33, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_91 : aliased constant Second_Stage_Array := (31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 34, 34); S_92 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_93 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33); S_94 : aliased constant Second_Stage_Array := (33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_95 : aliased constant Second_Stage_Array := (31, 22, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); S_96 : aliased constant Second_Stage_Array := (27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31); First : constant First_Stage_Array := (S_0'Access, S_1'Access, S_2'Access, S_3'Access, S_4'Access, S_5'Access, S_6'Access, S_7'Access, S_8'Access, S_9'Access, S_10'Access, S_11'Access, S_12'Access, S_13'Access, S_14'Access, S_15'Access, S_16'Access, S_1'Access, S_17'Access, S_18'Access, S_19'Access, S_1'Access, S_20'Access, S_21'Access, S_22'Access, S_23'Access, S_24'Access, S_25'Access, S_26'Access, S_27'Access, S_1'Access, S_28'Access, S_29'Access, S_30'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_32'Access, S_33'Access, S_34'Access, S_31'Access, S_35'Access, S_36'Access, S_31'Access, S_31'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_37'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_38'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_39'Access, S_1'Access, S_40'Access, S_41'Access, S_42'Access, S_43'Access, S_44'Access, S_45'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_46'Access, S_47'Access, S_47'Access, S_47'Access, S_47'Access, S_47'Access, S_47'Access, S_47'Access, S_47'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_1'Access, S_49'Access, S_50'Access, S_1'Access, S_51'Access, S_52'Access, S_53'Access, S_54'Access, S_55'Access, S_56'Access, S_57'Access, S_58'Access, S_59'Access, S_1'Access, S_60'Access, S_61'Access, S_62'Access, S_63'Access, S_64'Access, S_65'Access, S_31'Access, S_31'Access, S_31'Access, S_66'Access, S_67'Access, S_68'Access, S_69'Access, S_70'Access, S_71'Access, S_72'Access, S_31'Access, S_73'Access, S_31'Access, S_74'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_1'Access, S_1'Access, S_1'Access, S_75'Access, S_76'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_77'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_1'Access, S_1'Access, S_78'Access, S_79'Access, S_31'Access, S_31'Access, S_31'Access, S_80'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_81'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_82'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_83'Access, S_84'Access, S_31'Access, S_85'Access, S_86'Access, S_87'Access, S_88'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_89'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_90'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_92'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_1'Access, S_93'Access, S_94'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_1'Access, S_1'Access, S_94'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_95'Access, S_96'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_31'Access, S_91'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access, S_48'Access); Switch_Table : constant array (State range 0 .. 63, Character_Class range 0 .. 34) of State := (0 => (1 => 36, 2 => 37, 3 => 38, 4 => 39, 5 => 40, 6 => 41, 7 => 42, 8 => 64, 9 => 43, 10 => 65, 11 => 66, 12 => 67, 13 => 68, 14 => 44, 15 => 69, 16 => 70, 17 => 71, 18 | 30 | 33 => 45, 19 => 46, 20 => 1, 21 => 2, 22 | 25 => 47, 23 => 3, 24 | 32 => 72, others => 85), 36 => (6 => 75, others => 85), 37 => (2 => 81, others => 85), 38 => (3 => 82, others => 85), 39 => (1 => 79, others => 85), 40 => (1 => 80, others => 85), 41 => (1 => 73, 6 => 74, others => 85), 42 => (1 => 76, 7 => 77, 6 => 78, others => 85), 43 => (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 33 => 34, others => 85), 44 => (14 => 63, others => 85), 45 => (26 | 29 => 23, 18 | 27 | 30 | 33 => 45, 19 => 58, others => 85), 46 => (26 => 5, 19 => 46, 2 => 6, 18 => 50, 28 => 7, 4 => 8, 30 | 33 => 51 , others => 85), 1 => (20 => 49, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 33 => 1, others => 85), 2 => (20 => 4, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 33 => 2, 21 => 48, others => 85), 47 => (22 | 25 => 47, others => 85), 3 => (24 => 72, others => 85), 4 => (20 => 2, others => 85), 48 => (20 => 4, 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 26 | 27 | 28 | 29 | 30 | 31 | 33 => 2, 21 => 48, others => 85), 49 => (20 => 1, others => 85), 5 => (26 => 5, 19 => 46, others => 85), 6 => (19 => 54, others => 85), 50 => (12 => 14, 19 => 55, 14 => 15, 26 | 29 => 13, 18 | 27 | 30 | 33 => 51 , others => 85), 7 => (18 | 19 | 30 => 11, others => 85), 8 => (18 | 19 | 30 => 9, others => 85), 51 => (26 | 29 => 13, 18 | 19 | 27 | 30 | 33 => 51, others => 85), 9 => (26 => 10, 18 | 19 | 30 => 9, 2 => 8, 4 => 52, others => 85), 10 => (26 => 10, 18 | 19 | 30 => 9, others => 85), 52 => (18 => 16, others => 85), 11 => (26 => 12, 18 | 19 | 30 => 11, 2 => 7, 28 => 53, others => 85), 12 => (26 => 12, 18 | 19 | 30 => 11, others => 85), 53 => (18 => 50, 30 | 33 => 51, others => 85), 54 => (2 => 6, 26 => 21, 19 => 54, 18 => 50, 30 | 33 => 51, others => 85) , 13 => (26 | 29 => 13, 18 | 19 | 27 | 30 | 33 => 51, others => 85), 14 => (12 => 14, 19 => 56, others => 85), 55 => (18 => 50, 26 => 22, 19 => 55, 27 | 30 | 33 => 51, 29 => 13 , others => 85), 15 => (19 => 56, others => 85), 56 => (18 => 50, 26 => 20, 19 => 56, 30 | 33 => 51, others => 85), 16 => (12 => 17, 19 => 57, 14 => 18, others => 85), 17 => (12 => 17, 19 => 57, others => 85), 57 => (18 => 16, 26 => 19, 19 => 57, others => 85), 18 => (19 => 57, others => 85), 19 => (26 => 19, 19 => 57, others => 85), 20 => (26 => 20, 19 => 56, others => 85), 21 => (26 => 21, 19 => 54, others => 85), 22 => (26 => 22, 19 => 55, 29 => 13, 18 | 27 | 30 | 33 => 51, others => 85 ), 23 => (26 | 29 => 23, 18 | 19 | 27 | 30 | 33 => 45, others => 85), 58 => (26 => 24, 18 => 59, 19 => 58, 27 | 30 | 33 => 45, 29 => 23, 2 => 25 , 28 => 26, others => 85), 24 => (26 => 24, 18 | 27 | 30 | 33 => 45, 19 => 58, 29 => 23, others => 85 ), 59 => (26 | 29 => 23, 18 | 27 | 30 | 33 => 45, 19 => 58, 12 => 30, 14 => 31 , others => 85), 25 => (19 => 61, others => 85), 26 => (18 | 19 | 30 => 27, others => 85), 27 => (26 => 28, 18 | 19 | 30 => 27, 2 => 26, 28 => 60, others => 85), 28 => (26 => 28, 18 | 19 | 30 => 27, others => 85), 60 => (18 => 29, others => 85), 61 => (2 => 25, 26 => 33, 19 => 61, 18 => 29, others => 85), 29 => (12 => 30, 19 => 62, 14 => 31, others => 85), 30 => (12 => 30, 19 => 62, others => 85), 62 => (18 => 29, 26 => 32, 19 => 62, others => 85), 31 => (19 => 62, others => 85), 32 => (26 => 32, 19 => 62, others => 85), 33 => (26 => 33, 19 => 61, others => 85), 63 => (1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 34 => 63, others => 85), 34 => (9 => 83, others => 85), 35 => (1 => 36, 2 => 37, 3 => 38, 4 => 39, 5 => 40, 6 => 41, 7 => 42, 8 => 64, 9 => 84, 10 => 65, 11 => 66, 12 => 67, 13 => 68, 14 => 44, 15 => 69, 16 => 70, 17 => 71, 18 | 30 | 33 => 45, 19 => 46, 20 => 1, 21 => 2, 22 | 25 => 47, 23 => 3, 24 | 32 => 72, others => 85)); Rule_Table : constant array (State range 36 .. 84) of Rule_Index := (36 => 24, 37 => 19, 38 => 15, 39 => 21, 40 => 20, 41 => 25, 42 => 23, 64 => 11, 43 => 12, 65 => 13, 66 => 14, 67 => 16, 68 => 17, 44 => 18, 69 => 22, 70 => 26, 71 => 27, 45 => 28, 46 => 29, 47 => 35, 72 => 36, 48 => 33, 49 => 32, 50 => 38, 51 => 38, 52 => 30, 53 => 29, 54 => 29, 55 => 29, 56 => 29, 57 => 30, 58 => 28, 59 => 28, 60 => 37, 61 => 37, 62 => 37, 73 => 6, 74 => 9, 75 => 1, 76 => 7, 77 => 8, 78 => 10, 79 => 4, 80 => 5, 81 => 2, 63 => 34, 82 => 3, 83 => 31, 84 => 12); function Rule (S : State) return Rule_Index is begin return Rule_Table (S); end Rule; function Switch (S : State; Class : Character_Class) return State is begin return Switch_Table (S, Class); end Switch; function To_Class (Value : Code_Point) return Character_Class is function Element is new Generic_Element (Character_Class, Second_Stage_Array, Second_Stage_Array_Access, First_Stage_Array); begin return Element (First, Value); end To_Class; end Tables;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . E X C E P T I O N _ T A B L E -- -- -- -- S p e c -- -- -- -- Copyright (C) 1996-2021, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package implements the interface used to maintain a table of -- registered exception names, for the implementation of the mapping -- of names to exceptions (used for exception streams and attributes) pragma Compiler_Unit_Warning; with System.Standard_Library; package System.Exception_Table is pragma Elaborate_Body; package SSL renames System.Standard_Library; procedure Register_Exception (X : SSL.Exception_Data_Ptr); pragma Inline (Register_Exception); -- Register an exception in the hash table mapping. This function is -- called during elaboration of library packages. For exceptions that -- are declared within subprograms, the registration occurs the first -- time that an exception is elaborated during a call of the subprogram. -- -- Note: all calls to Register_Exception other than those to register the -- predefined exceptions are suppressed if the application is compiled -- with pragma Restrictions (No_Exception_Registration). function Internal_Exception (X : String; Create_If_Not_Exist : Boolean := True) return SSL.Exception_Data_Ptr; -- Given an exception_name X, returns a pointer to the actual internal -- exception data. A new entry is created in the table if X does not -- exist yet and Create_If_Not_Exist is True. If it is false and X -- does not exist yet, null is returned. function Registered_Exceptions_Count return Natural; -- Return the number of currently registered exceptions type Exception_Data_Array is array (Natural range <>) of SSL.Exception_Data_Ptr; procedure Get_Registered_Exceptions (List : out Exception_Data_Array; Last : out Integer); -- Return the list of registered exceptions end System.Exception_Table;
with Ada.Text_IO; use Ada.Text_IO; with Ada.Numerics.Elementary_Functions; use Ada.Numerics.Elementary_Functions; procedure Quadratic_Equation is type Roots is array (1..2) of Float; function Solve (A, B, C : Float) return Roots is SD : constant Float := sqrt (B**2 - 4.0 * A * C); X : Float; begin if B < 0.0 then X := (- B + SD) / 2.0 * A; return (X, C / (A * X)); else X := (- B - SD) / 2.0 * A; return (C / (A * X), X); end if; end Solve; R : constant Roots := Solve (1.0, -10.0E5, 1.0); begin Put_Line ("X1 =" & Float'Image (R (1)) & " X2 =" & Float'Image (R (2))); end Quadratic_Equation;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . T H R E A D S -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2020, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides facilities to register a thread to the runtime, -- and allocate its task specific datas. -- This package is currently implemented for: -- VxWorks AE653 rts-cert -- VxWorks AE653 rts-full (not rts-kernel) with Ada.Exceptions; with Ada.Unchecked_Conversion; with Interfaces.C; with System.Secondary_Stack; with System.Soft_Links; package System.Threads is package SST renames System.Secondary_Stack; type ATSD is limited private; -- Type of the Ada thread specific data. It contains datas needed -- by the GNAT runtime. type ATSD_Access is access ATSD; function From_Address is new Ada.Unchecked_Conversion (Address, ATSD_Access); subtype STATUS is Interfaces.C.int; -- Equivalent of the C type STATUS type t_id is new Interfaces.C.long; subtype Thread_Id is t_id; function Register (T : Thread_Id) return STATUS; -- Create the task specific data necessary for Ada language support -------------------------- -- Thread Body Handling -- -------------------------- -- The subprograms in this section are called from the process body -- wrapper in the APEX process registration package. procedure Thread_Body_Enter (Sec_Stack_Ptr : SST.SS_Stack_Ptr; Process_ATSD_Address : System.Address); -- Enter thread body, see above for details procedure Thread_Body_Leave; -- Leave thread body (normally), see above for details procedure Thread_Body_Exceptional_Exit (EO : Ada.Exceptions.Exception_Occurrence); -- Leave thread body (abnormally on exception), see above for details private type ATSD is new System.Soft_Links.TSD; end System.Threads;
pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; with bits_types_h; package bits_types_struct_timeval_h is -- A time value that is accurate to the nearest -- microsecond but also has a range of years. -- Seconds. type timeval is record tv_sec : aliased bits_types_h.uu_time_t; -- /usr/include/bits/types/struct_timeval.h:10 tv_usec : aliased bits_types_h.uu_suseconds_t; -- /usr/include/bits/types/struct_timeval.h:11 end record with Convention => C_Pass_By_Copy; -- /usr/include/bits/types/struct_timeval.h:8 -- Microseconds. end bits_types_struct_timeval_h;
------------------------------------------------------------------------------ -- -- -- Ada User Repository Annex (AURA) -- -- ANNEXI-STRAYLINE Reference Implementation -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2019-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. -- -- -- ------------------------------------------------------------------------------ -- This package presents a high-level, (mostly) platform independent access -- to child processes - such as compilation, auto_configure execution, and -- SCM back-ends with Ada.Streams; use Ada.Streams; with Ada.Finalization; package Child_Processes is Spawn_Failure: exception; -- Raised if a child process cannot be initialy created (not if the child -- itself fails) type IO_Stream_Selector is (Standard_Input, Standard_Output, Standard_Error); -- In the perspective of the launched process type Exit_Status is (Success, Failure); type Child_Process is limited interface; ------------------ -- Standard I/O -- ------------------ -- All standard output streams are non-blocking, and will raise an -- End_Error if the stream operation cannot be satisfied. -- -- All standard output streams are also buffered. Failed reads are -- lossless. -- -- Any reads to the output streams will also refil the buffer as much as -- possible. function IO_Stream (Process : in out Child_Process; Selector: in IO_Stream_Selector) return not null access Root_Stream_Type'Class is abstract; -- Returns a Stream access for the selected stream procedure Set_Stream_Timeout (Process : in out Child_Process; Selector: in IO_Stream_Selector; Timeout : in Duration) is abstract; -- Sets the timeout period for reads/writes on the selected IO stream. -- -- If Read times-out, any elements that had been successfully read are -- returned through the underlying Read operation of the Stream Type. -- (No exception is raised). -- -- If Write times-out (generally rare), this indicates that the platform's -- buffer is full, and thus Storage_Error is raised. Some of the data may -- have been written. -- -- A Timeout of 0.0 indicates an indefinite timeout. This is the default -- value for all streams function Terminated (Process: Child_Process) return Boolean is abstract; -- True if the process has terminated procedure Wait_Terminated (Process : in Child_Process; Timeout : in Duration; Timed_Out: out Boolean; Status : out Exit_Status) is abstract; -- Waits until Terminated is true or else the Timeout expires. -- If the timeout expires, Timed_Out is True. -- Status is only valid if Timed_Out is False. -- -- If Timeout = 0.0, Wait_Terminated waits forever procedure Kill (Process: in out Child_Process) is abstract; -- Commands the process to terminate. (eg SIGTERM) procedure Nuke (Process: in out Child_Process) is abstract; -- Obliterates the process immediately. (eg SIGKILL) ---------------------- -- Process Creation -- ---------------------- function Spawn_Process (Image_Path : String; Arguments : String; Working_Directory : String) return Child_Process'Class; -- Starts a new process that executes the image at Image_Path, and receives -- the arguments specified by Arguments. -- -- Standard_Out and Standard_Error each have a buffer of Buffer_Size. -- -- Under rare circumstances, a new process could not be created at all, in -- which case Launch_Failure is raised. -- -- Normally the new process can be created, but may fail at launch. This -- will result in termination of the process. Error information may be -- avilabile on the Standard_Error stream. end Child_Processes;
package body impact.d2.Joint.gear is procedure dummy is begin null; end dummy; -- #include <Box2D/Dynamics/Joints/b2GearJoint.h> -- #include <Box2D/Dynamics/Joints/b2RevoluteJoint.h> -- #include <Box2D/Dynamics/Joints/b2PrismaticJoint.h> -- #include <Box2D/Dynamics/b2Body.h> -- #include <Box2D/Dynamics/b2TimeStep.h> -- -- // Gear Joint: -- // C0 = (coordinate1 + ratio * coordinate2)_initial -- // C = C0 - (cordinate1 + ratio * coordinate2) = 0 -- // Cdot = -(Cdot1 + ratio * Cdot2) -- // J = -[J1 ratio * J2] -- // K = J * invM * JT -- // = J1 * invM1 * J1T + ratio * ratio * J2 * invM2 * J2T -- // -- // Revolute: -- // coordinate = rotation -- // Cdot = angularVelocity -- // J = [0 0 1] -- // K = J * invM * JT = invI -- // -- // Prismatic: -- // coordinate = dot(p - pg, ug) -- // Cdot = dot(v + cross(w, r), ug) -- // J = [ug cross(r, ug)] -- // K = J * invM * JT = invMass + invI * cross(r, ug)^2 -- -- b2GearJoint::b2GearJoint(const b2GearJointDef* def) -- : b2Joint(def) -- { -- b2JointType type1 = def->joint1->GetType(); -- b2JointType type2 = def->joint2->GetType(); -- -- b2Assert(type1 == e_revoluteJoint || type1 == e_prismaticJoint); -- b2Assert(type2 == e_revoluteJoint || type2 == e_prismaticJoint); -- b2Assert(def->joint1->GetBodyA()->GetType() == b2_staticBody); -- b2Assert(def->joint2->GetBodyA()->GetType() == b2_staticBody); -- -- m_revolute1 = NULL; -- m_prismatic1 = NULL; -- m_revolute2 = NULL; -- m_prismatic2 = NULL; -- -- float32 coordinate1, coordinate2; -- -- m_ground1 = def->joint1->GetBodyA(); -- m_bodyA = def->joint1->GetBodyB(); -- if (type1 == e_revoluteJoint) -- { -- m_revolute1 = (b2RevoluteJoint*)def->joint1; -- m_groundAnchor1 = m_revolute1->m_localAnchor1; -- m_localAnchor1 = m_revolute1->m_localAnchor2; -- coordinate1 = m_revolute1->GetJointAngle(); -- } -- else -- { -- m_prismatic1 = (b2PrismaticJoint*)def->joint1; -- m_groundAnchor1 = m_prismatic1->m_localAnchor1; -- m_localAnchor1 = m_prismatic1->m_localAnchor2; -- coordinate1 = m_prismatic1->GetJointTranslation(); -- } -- -- m_ground2 = def->joint2->GetBodyA(); -- m_bodyB = def->joint2->GetBodyB(); -- if (type2 == e_revoluteJoint) -- { -- m_revolute2 = (b2RevoluteJoint*)def->joint2; -- m_groundAnchor2 = m_revolute2->m_localAnchor1; -- m_localAnchor2 = m_revolute2->m_localAnchor2; -- coordinate2 = m_revolute2->GetJointAngle(); -- } -- else -- { -- m_prismatic2 = (b2PrismaticJoint*)def->joint2; -- m_groundAnchor2 = m_prismatic2->m_localAnchor1; -- m_localAnchor2 = m_prismatic2->m_localAnchor2; -- coordinate2 = m_prismatic2->GetJointTranslation(); -- } -- -- m_ratio = def->ratio; -- -- m_constant = coordinate1 + m_ratio * coordinate2; -- -- m_impulse = 0.0f; -- } -- -- void b2GearJoint::InitVelocityConstraints(const b2TimeStep& step) -- { -- b2Body* g1 = m_ground1; -- b2Body* g2 = m_ground2; -- b2Body* b1 = m_bodyA; -- b2Body* b2 = m_bodyB; -- -- float32 K = 0.0f; -- m_J.SetZero(); -- -- if (m_revolute1) -- { -- m_J.angularA = -1.0f; -- K += b1->m_invI; -- } -- else -- { -- b2Vec2 ug = b2Mul(g1->GetTransform().R, m_prismatic1->m_localXAxis1); -- b2Vec2 r = b2Mul(b1->GetTransform().R, m_localAnchor1 - b1->GetLocalCenter()); -- float32 crug = b2Cross(r, ug); -- m_J.linearA = -ug; -- m_J.angularA = -crug; -- K += b1->m_invMass + b1->m_invI * crug * crug; -- } -- -- if (m_revolute2) -- { -- m_J.angularB = -m_ratio; -- K += m_ratio * m_ratio * b2->m_invI; -- } -- else -- { -- b2Vec2 ug = b2Mul(g2->GetTransform().R, m_prismatic2->m_localXAxis1); -- b2Vec2 r = b2Mul(b2->GetTransform().R, m_localAnchor2 - b2->GetLocalCenter()); -- float32 crug = b2Cross(r, ug); -- m_J.linearB = -m_ratio * ug; -- m_J.angularB = -m_ratio * crug; -- K += m_ratio * m_ratio * (b2->m_invMass + b2->m_invI * crug * crug); -- } -- -- // Compute effective mass. -- m_mass = K > 0.0f ? 1.0f / K : 0.0f; -- -- if (step.warmStarting) -- { -- // Warm starting. -- b1->m_linearVelocity += b1->m_invMass * m_impulse * m_J.linearA; -- b1->m_angularVelocity += b1->m_invI * m_impulse * m_J.angularA; -- b2->m_linearVelocity += b2->m_invMass * m_impulse * m_J.linearB; -- b2->m_angularVelocity += b2->m_invI * m_impulse * m_J.angularB; -- } -- else -- { -- m_impulse = 0.0f; -- } -- } -- -- void b2GearJoint::SolveVelocityConstraints(const b2TimeStep& step) -- { -- B2_NOT_USED(step); -- -- b2Body* b1 = m_bodyA; -- b2Body* b2 = m_bodyB; -- -- float32 Cdot = m_J.Compute( b1->m_linearVelocity, b1->m_angularVelocity, -- b2->m_linearVelocity, b2->m_angularVelocity); -- -- float32 impulse = m_mass * (-Cdot); -- m_impulse += impulse; -- -- b1->m_linearVelocity += b1->m_invMass * impulse * m_J.linearA; -- b1->m_angularVelocity += b1->m_invI * impulse * m_J.angularA; -- b2->m_linearVelocity += b2->m_invMass * impulse * m_J.linearB; -- b2->m_angularVelocity += b2->m_invI * impulse * m_J.angularB; -- } -- -- bool b2GearJoint::SolvePositionConstraints(float32 baumgarte) -- { -- B2_NOT_USED(baumgarte); -- -- float32 linearError = 0.0f; -- -- b2Body* b1 = m_bodyA; -- b2Body* b2 = m_bodyB; -- -- float32 coordinate1, coordinate2; -- if (m_revolute1) -- { -- coordinate1 = m_revolute1->GetJointAngle(); -- } -- else -- { -- coordinate1 = m_prismatic1->GetJointTranslation(); -- } -- -- if (m_revolute2) -- { -- coordinate2 = m_revolute2->GetJointAngle(); -- } -- else -- { -- coordinate2 = m_prismatic2->GetJointTranslation(); -- } -- -- float32 C = m_constant - (coordinate1 + m_ratio * coordinate2); -- -- float32 impulse = m_mass * (-C); -- -- b1->m_sweep.c += b1->m_invMass * impulse * m_J.linearA; -- b1->m_sweep.a += b1->m_invI * impulse * m_J.angularA; -- b2->m_sweep.c += b2->m_invMass * impulse * m_J.linearB; -- b2->m_sweep.a += b2->m_invI * impulse * m_J.angularB; -- -- b1->SynchronizeTransform(); -- b2->SynchronizeTransform(); -- -- // TODO_ERIN not implemented -- return linearError < b2_linearSlop; -- } -- -- b2Vec2 b2GearJoint::GetAnchorA() const -- { -- return m_bodyA->GetWorldPoint(m_localAnchor1); -- } -- -- b2Vec2 b2GearJoint::GetAnchorB() const -- { -- return m_bodyB->GetWorldPoint(m_localAnchor2); -- } -- -- b2Vec2 b2GearJoint::GetReactionForce(float32 inv_dt) const -- { -- // TODO_ERIN not tested -- b2Vec2 P = m_impulse * m_J.linearB; -- return inv_dt * P; -- } -- -- float32 b2GearJoint::GetReactionTorque(float32 inv_dt) const -- { -- // TODO_ERIN not tested -- b2Vec2 r = b2Mul(m_bodyB->GetTransform().R, m_localAnchor2 - m_bodyB->GetLocalCenter()); -- b2Vec2 P = m_impulse * m_J.linearB; -- float32 L = m_impulse * m_J.angularB - b2Cross(r, P); -- return inv_dt * L; -- } -- -- void b2GearJoint::SetRatio(float32 ratio) -- { -- b2Assert(b2IsValid(ratio)); -- m_ratio = ratio; -- } -- -- float32 b2GearJoint::GetRatio() const -- { -- return m_ratio; -- } end impact.d2.Joint.gear;
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- XML Processor -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 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 League.Characters.Latin; package body XML.SAX.HTML5_Writers is use type League.Characters.Universal_Character; use type League.Strings.Universal_String; HTML_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/1999/xhtml"); MathML_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/1998/Math/MathML"); SVG_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/2000/svg"); XLink_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/1999/xlink"); XML_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/XML/1998/namespace"); XMLNS_URI : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("http://www.w3.org/2000/xmlns/"); A_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("a"); Address_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("address"); Area_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("area"); Article_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("article"); Aside_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("aside"); Base_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("base"); Blockquote_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("blockquote"); Body_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("body"); Br_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("br"); Col_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("col"); Colgroup_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("colgroup"); Dd_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("dd"); Dir_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("dir"); Div_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("div"); Dl_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("dl"); Dt_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("dt"); Embed_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("embed"); Fieldset_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("fieldset"); Footer_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("footer"); Form_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("form"); H1_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h1"); H2_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h2"); H3_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h3"); H4_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h4"); H5_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h5"); H6_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("h6"); Head_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("head"); Header_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("header"); Hgroup_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("hgroup"); Hr_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("hr"); HTML_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("html"); Img_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("img"); Input_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("input"); Keygen_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("keygen"); Li_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("li"); Link_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("link"); Main_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("main"); Meta_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("meta"); Nav_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("nav"); Ol_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("ol"); Optgroup_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("optgroup"); Option_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("option"); P_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("p"); Param_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("param"); Pre_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("pre"); Rp_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("rp"); Rt_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("rt"); Script_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("script"); Section_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("section"); Source_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("source"); Style_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("style"); Table_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("table"); Tbody_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("tbody"); Td_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("td"); Textarea_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("textarea"); Tfoot_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("tfoot"); Th_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("th"); Thead_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("thead"); Title_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("title"); Tr_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("tr"); Track_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("track"); Ul_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("ul"); Wbr_Tag : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("wbr"); Actuate_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("actuate"); Arcrole_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("arcrole"); Async_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("async"); Autofocus_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("autofocus"); Autoplay_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("autoplay"); Base_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("base"); Checked_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("checked"); Controls_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("controls"); Default_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("default"); Defer_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("defer"); Disabled_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("disabled"); Formnovalidate_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("formnovalidate"); Hidden_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("hidden"); Href_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("href"); Ismap_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("ismap"); Lang_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("lang"); Loop_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("loop"); Multiple_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("multiple"); Muted_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("muted"); Novalidate_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("novalidate"); Open_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("open"); Readonly_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("readonly"); Required_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("required"); Reversed_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("reversed"); Role_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("role"); Scoped_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("scoped"); Seamless_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("seamless"); Selected_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("selected"); Show_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("show"); Space_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("space"); Title_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("title"); Type_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("type"); Typemustmatch_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("typemustmatch"); XLink_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink"); XLink_Actuate_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:actuate"); XLink_Arcrole_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:arcrole"); XLink_Href_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:href"); XLink_Role_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:role"); XLink_Show_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:show"); XLink_Title_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:title"); XLink_Type_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xlink:type"); XML_Base_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xml:base"); XML_Lang_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xml:lang"); XML_Space_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xml:space"); XMLNS_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xmlns"); XMLNS_XLink_Attribute : constant League.Strings.Universal_String := League.Strings.To_Universal_String ("xmlns:xlink"); type Attribute_Value_Syntax is (Empty, Unquoted, Single_Quoted, Double_Quoted); function Is_Space (Item : League.Strings.Universal_String) return Boolean; -- Returns True when specified string contains only space characters as -- defined by HTML5 specification. -- -- [HTML5] "The space characters, for the purposes of this specification, -- are U+0020 SPACE, "tab" (U+0009), "LF" (U+000A), "FF" (U+000C), and "CR" -- (U+000D)." procedure Write_DOCTYPE (Self : in out HTML5_Writer'Class); -- Outputs DOCTYPE declaration. procedure Write_Attributes (Self : in out HTML5_Writer'Class; Attributes : XML.SAX.Attributes.SAX_Attributes; Success : in out Boolean); -- Output attributes. function Is_Boolean_Attribute (Name : League.Strings.Universal_String) return Boolean; -- Returns True when attribute is boolean attribute in HTML5. function Is_Void_Element (Tag : League.Strings.Universal_String) return Boolean; -- Returns True when specified tag refernce to void element of HTML5. function Is_Raw_Text_Element (Tag : League.Strings.Universal_String) return Boolean; -- Returns True when specified tag refernce to raw text element of HTML5. function Is_Escapable_Raw_Text_Element (Tag : League.Strings.Universal_String) return Boolean; -- Returns True when specified tag refernce to escapable raw text element -- of HTML5. procedure Escape_Attribute_Value (Value : League.Strings.Universal_String; Text : out League.Strings.Universal_String; Syntax : out Attribute_Value_Syntax); -- Detects optimal attribute value syntax and escape attribute value. ---------------- -- Characters -- ---------------- overriding procedure Characters (Self : in out HTML5_Writer; Text : League.Strings.Universal_String; Success : in out Boolean) is Escaped_Text : League.Strings.Universal_String; C : League.Characters.Universal_Character; begin case Self.Omit is when None => null; when Foreign => Self.Output.Put ('>'); when HTML_Start_Tag => -- [HTML5] "An html element's start tag may be omitted if the -- first thing inside the html element is not a comment." null; when HTML_End_Tag => -- [HTML5] "An html element's end tag may be omitted if the html -- element is not immediately followed by a comment." null; when Head_Start_Tag => -- [HTML5] "A head element's start tag may be omitted if the -- element is empty, or if the first thing inside the head element -- is an element." Self.Output.Put ("<head>"); when Head_End_Tag => -- [HTML5] "A head element's end tag may be omitted if the head -- element is not immediately followed by a space character or a -- comment." if not Text.Is_Empty and then Is_Space (Text.Slice (1, 1)) then Self.Output.Put ("</head>"); end if; when Body_Start_Tag => -- [HTML5] "A body element's start tag may be omitted if the -- element is empty, or if the first thing inside the body element -- is not a space character or a comment, except if the first -- thing inside the body element is a script or style element." if not Text.Is_Empty and then Is_Space (Text.Slice (1, 1)) then Self.Output.Put ("<body>"); end if; when Body_End_Tag => -- [HTML5] "A body element's end tag may be omitted if the body -- element is not immediately followed by a comment." null; when Li_End_Tag => -- [HTML5] "An li element's end tag may be omitted if the li -- element is immediately followed by another li element or if -- there is no more content in the parent element." Self.Output.Put ("</li>"); when Dt_End_Tag => -- [HTML5] "A dt element's end tag may be omitted if the dt -- element is immediately followed by another dt element or a dd -- element." Self.Output.Put ("</dt>"); when Dd_End_Tag => -- [HTML5] "A dd element's end tag may be omitted if the dd -- element is immediately followed by another dd element or a dt -- element, or if there is no more content in the parent element." Self.Output.Put ("</dd>"); when Rt_End_Tag => -- [HTML5] "An rt element's end tag may be omitted if the rt -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." Self.Output.Put ("</rt>"); when Rp_End_Tag => -- [HTML5] "An rp element's end tag may be omitted if the rp -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." Self.Output.Put ("</rp>"); when Optgroup_End_Tag => -- [HTML5] "An optgroup element's end tag may be omitted if the -- optgroup element is immediately followed by another optgroup -- element, or if there is no more content in the parent element." Self.Output.Put ("</optgroup>"); when Option_End_Tag => -- [HTML5] "An option element's end tag may be omitted if the -- option element is immediately followed by another option -- element, or if it is immediately followed by an optgroup -- element, or if there is no more content in the parent element." Self.Output.Put ("</option>"); when Colgroup_Start_Tag => -- [HTML5] "A colgroup element's start tag may be omitted if the -- first thing inside the colgroup element is a col element, and -- if the element is not immediately preceded by another colgroup -- element whose end tag has been omitted. (It can't be omitted if -- the element is empty.)" Self.Output.Put ("<colgroup>"); when Colgroup_End_Tag => -- [HTML5] "A colgroup element's end tag may be omitted if the -- colgroup element is not immediately followed by a space -- character or a comment." if not Text.Is_Empty and then Is_Space (Text.Slice (1, 1)) then Self.Output.Put ("</colgroup>"); else Self.History := Colgroup_End_Tag; end if; when Thead_End_Tag => -- [HTML5] "A thead element's end tag may be omitted if the thead -- element is immediately followed by a tbody or tfoot element." Self.Output.Put ("</thead>"); when Tbody_Start_Tag => -- [HTML5] "A tbody element's start tag may be omitted if the -- first thing inside the tbody element is a tr element, and if -- the element is not immediately preceded by a tbody, thead, or -- tfoot element whose end tag has been omitted. (It can't be -- omitted if the element is empty.)" Self.Output.Put ("<tbody>"); when Tbody_End_Tag => -- [HTML5] "A tbody element's end tag may be omitted if the tbody -- element is immediately followed by a tbody or tfoot element, or -- if there is no more content in the parent element." Self.Output.Put ("</tbody>"); when Tfoot_End_Tag => -- [HTML5] "A tfoot element's end tag may be omitted if the tfoot -- element is immediately followed by a tbody element, or if there -- is no more content in the parent element." Self.Output.Put ("</tfoot>"); when Tr_End_Tag => -- [HTML5] "A tr element's end tag may be omitted if the tr -- element is immediately followed by another tr element, or if -- there is no more content in the parent element." Self.Output.Put ("</tr>"); when Td_End_Tag => -- [HTML5] "A td element's end tag may be omitted if the td -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." Self.Output.Put ("</td>"); when Th_End_Tag => -- [HTML5] "A th element's end tag may be omitted if the th -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." Self.Output.Put ("</th>"); when P_End_Tag => -- [HTML5] "A p element's end tag may be omitted if the p element -- is immediately followed by an address, article, aside, -- blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, -- h4, h5, h6, header, hgroup, hr, main, nav, ol, p, pre, section, -- table, or ul, element, or if there is no more content in the -- parent element and the parent element is not an a element." Self.Output.Put ("</p>"); end case; Self.Omit := None; Self.History := None; if not Self.Document_Start or else not Is_Space (Text) then case Self.State.Element_Kind is when Void => -- [HTML5] "Void elements can't have any contents (since -- there's no end tag, no content can be put between the start -- tag and the end tag)." Self.Diagnosis := League.Strings.To_Universal_String ("void element can't have any contents"); Success := False; return; when Raw_Text => -- XXX Verification of the text content can be done here. -- -- [HTML5] "The text in raw text and escapable raw text -- elements must not contain any occurrences of the string "</" -- (U+003C LESS-THAN SIGN, U+002F SOLIDUS) followed by -- characters that case-insensitively match the tag name of the -- element followed by one of "tab" (U+0009), "LF" (U+000A), -- "FF" (U+000C), "CR" (U+000D), U+0020 SPACE, ">" (U+003E), or -- "/" (U+002F)." Self.Output.Put (Text); when Escapable_Raw_Text => for J in 1 .. Text.Length loop C := Text (J); if C = League.Characters.Latin.Less_Than_Sign and then J < Text.Length and then Text (J + 1) = League.Characters.Latin.Solidus then -- XXX This check can be even more improved: -- -- [HTML5] "The text in raw text and escapable raw text -- elements must not contain any occurrences of the -- string "</" (U+003C LESS-THAN SIGN, U+002F SOLIDUS) -- followed by characters that case-insensitively match -- the tag name of the element followed by one of "tab" -- (U+0009), "LF" (U+000A), "FF" (U+000C), "CR" (U+000D), -- U+0020 SPACE, ">" (U+003E), or "/" (U+002F)." Escaped_Text.Append ("&lt;"); elsif C = League.Characters.Latin.Ampersand then Escaped_Text.Append ("&amp;"); else Escaped_Text.Append (C); end if; end loop; Self.Output.Put (Escaped_Text); when Normal | Foreign => if Self.State.Element_Kind = Foreign and Self.CDATA_Mode then Self.Output.Put (Text); else for J in 1 .. Text.Length loop C := Text (J); if C = League.Characters.Latin.Less_Than_Sign then Escaped_Text.Append ("&lt;"); elsif C = League.Characters.Latin.Ampersand then Escaped_Text.Append ("&amp;"); else Escaped_Text.Append (C); end if; end loop; Self.Output.Put (Escaped_Text); end if; end case; end if; end Characters; ------------- -- Comment -- ------------- overriding procedure Comment (Self : in out HTML5_Writer; Text : League.Strings.Universal_String; Success : in out Boolean) is pragma Unreferenced (Success); begin -- XXX Content of Text must be checked here to be conformant to HTML5 -- definition of comment. -- -- [HTML5] "Comments must start with the four character sequence U+003C -- LESS-THAN SIGN, U+0021 EXCLAMATION MARK, U+002D HYPHEN-MINUS, U+002D -- HYPHEN-MINUS (<!--). Following this sequence, the comment may have -- text, with the additional restriction that the text must not start -- with a single ">" (U+003E) character, nor start with a "-" (U+002D) -- character followed by a ">" (U+003E) character, nor contain two -- consecutive U+002D HYPHEN-MINUS characters (--), nor end with a "-" -- (U+002D) character. Finally, the comment must be ended by the three -- character sequence U+002D HYPHEN-MINUS, U+002D HYPHEN-MINUS, U+003E -- GREATER-THAN SIGN (-->)." case Self.Omit is when None => null; when Foreign => Self.Output.Put ('>'); when HTML_Start_Tag => -- [HTML5] "An html element's start tag may be omitted if the -- first thing inside the html element is not a comment." Self.Output.Put ("<html>"); if Self.Stack.Is_Empty then -- [HTML5] "It is suggested that newlines be inserted after -- the DOCTYPE, after any comments that are before the root -- element, after the html element's start tag (if it is not -- omitted), and after any comments that are inside the html -- element but before the head element." Self.Output.Put (League.Characters.Latin.Line_Feed); end if; when HTML_End_Tag => -- [HTML5] "An html element's end tag may be omitted if the -- html element is not immediately followed by a comment." Self.Output.Put ("</html>"); when Head_Start_Tag => -- [HTML5] "A head element's start tag may be omitted if the -- element is empty, or if the first thing inside the head -- element is an element." Self.Output.Put ("<head>"); when Head_End_Tag => -- [HTML5] "A head element's end tag may be omitted if the head -- element is not immediately followed by a space character or a -- comment." Self.Output.Put ("</head>"); when Body_Start_Tag => -- [HTML5] "A body element's start tag may be omitted if the -- element is empty, or if the first thing inside the body element -- is not a space character or a comment, except if the first -- thing inside the body element is a script or style element." Self.Output.Put ("<body>"); when Body_End_Tag => -- [HTML5] "A body element's end tag may be omitted if the body -- element is not immediately followed by a comment." Self.Output.Put ("</body>"); when Li_End_Tag => -- [HTML5] "An li element's end tag may be omitted if the li -- element is immediately followed by another li element or if -- there is no more content in the parent element." Self.Output.Put ("</li>"); when Dt_End_Tag => -- [HTML5] "A dt element's end tag may be omitted if the dt -- element is immediately followed by another dt element or a dd -- element." Self.Output.Put ("</dt>"); when Dd_End_Tag => -- [HTML5] "A dd element's end tag may be omitted if the dd -- element is immediately followed by another dd element or a dt -- element, or if there is no more content in the parent element." Self.Output.Put ("</dd>"); when Rt_End_Tag => -- [HTML5] "An rt element's end tag may be omitted if the rt -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." Self.Output.Put ("</rt>"); when Rp_End_Tag => -- [HTML5] "An rp element's end tag may be omitted if the rp -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." Self.Output.Put ("</rp>"); when Optgroup_End_Tag => -- [HTML5] "An optgroup element's end tag may be omitted if the -- optgroup element is immediately followed by another optgroup -- element, or if there is no more content in the parent element." Self.Output.Put ("</optgroup>"); when Option_End_Tag => -- [HTML5] "An option element's end tag may be omitted if the -- option element is immediately followed by another option -- element, or if it is immediately followed by an optgroup -- element, or if there is no more content in the parent element." Self.Output.Put ("</option>"); when Colgroup_Start_Tag => -- [HTML5] "A colgroup element's start tag may be omitted if the -- first thing inside the colgroup element is a col element, and -- if the element is not immediately preceded by another colgroup -- element whose end tag has been omitted. (It can't be omitted if -- the element is empty.)" Self.Output.Put ("<colgroup>"); when Colgroup_End_Tag => -- [HTML5] "A colgroup element's end tag may be omitted if the -- colgroup element is not immediately followed by a space -- character or a comment." Self.Output.Put ("</colgroup>"); when Thead_End_Tag => -- [HTML5] "A thead element's end tag may be omitted if the thead -- element is immediately followed by a tbody or tfoot element." Self.Output.Put ("</thead>"); when Tbody_Start_Tag => -- [HTML5] "A tbody element's start tag may be omitted if the -- first thing inside the tbody element is a tr element, and if -- the element is not immediately preceded by a tbody, thead, or -- tfoot element whose end tag has been omitted. (It can't be -- omitted if the element is empty.)" Self.Output.Put ("<tbody>"); when Tbody_End_Tag => -- [HTML5] "A tbody element's end tag may be omitted if the tbody -- element is immediately followed by a tbody or tfoot element, or -- if there is no more content in the parent element." Self.Output.Put ("</tbody>"); when Tfoot_End_Tag => -- [HTML5] "A tfoot element's end tag may be omitted if the tfoot -- element is immediately followed by a tbody element, or if there -- is no more content in the parent element." Self.Output.Put ("</tfoot>"); when Tr_End_Tag => -- [HTML5] "A tr element's end tag may be omitted if the tr -- element is immediately followed by another tr element, or if -- there is no more content in the parent element." Self.Output.Put ("</tr>"); when Td_End_Tag => -- [HTML5] "A td element's end tag may be omitted if the td -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." Self.Output.Put ("</td>"); when Th_End_Tag => -- [HTML5] "A th element's end tag may be omitted if the th -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." Self.Output.Put ("</th>"); when P_End_Tag => -- [HTML5] "A p element's end tag may be omitted if the p element -- is immediately followed by an address, article, aside, -- blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, -- h4, h5, h6, header, hgroup, hr, main, nav, ol, p, pre, section, -- table, or ul, element, or if there is no more content in the -- parent element and the parent element is not an a element." Self.Output.Put ("</p>"); end case; Self.Omit := None; Self.History := None; Self.Output.Put ("<!--"); Self.Output.Put (Text); Self.Output.Put ("-->"); if Self.Document_Start then -- [HTML5] "It is suggested that newlines be inserted after the -- DOCTYPE, after any comments that are before the root element, -- after the html element's start tag (if it is not omitted), and -- after any comments that are inside the html element but before the -- head element." Self.Output.Put (League.Characters.Latin.Line_Feed); end if; end Comment; --------------- -- End_CDATA -- --------------- overriding procedure End_CDATA (Self : in out HTML5_Writer; Success : in out Boolean) is pragma Unreferenced (Success); begin Self.CDATA_Mode := False; if Self.State.Element_Kind = Foreign then -- [HTML5] "CDATA sections can only be used in foreign content -- (MathML or SVG)." Self.Output.Put ("]]>"); end if; end End_CDATA; ----------------- -- End_Element -- ----------------- overriding procedure End_Element (Self : in out HTML5_Writer; Namespace_URI : League.Strings.Universal_String; Local_Name : League.Strings.Universal_String; Qualified_Name : League.Strings.Universal_String; Success : in out Boolean) is pragma Unreferenced (Qualified_Name); pragma Unreferenced (Success); Foreign_Closed : Boolean := False; History : Omit_History_Kinds := None; begin case Self.Omit is when None => null; when Foreign => Self.Output.Put ("/>"); Foreign_Closed := True; when HTML_Start_Tag => -- [HTML5] "An html element's start tag may be omitted if the -- first thing inside the html element is not a comment." null; when HTML_End_Tag => -- [HTML5] "An html element's end tag may be omitted if the html -- element is not immediately followed by a comment." null; when Head_Start_Tag => -- [HTML5] "A head element's start tag may be omitted if the -- element is empty, or if the first thing inside the head element -- is an element." null; when Head_End_Tag => -- [HTML5] "A head element's end tag may be omitted if the head -- element is not immediately followed by a space character or a -- comment." null; when Body_Start_Tag => -- [HTML5] "A body element's start tag may be omitted if the -- element is empty, or if the first thing inside the body element -- is not a space character or a comment, except if the first -- thing inside the body element is a script or style element." null; when Body_End_Tag => -- [HTML5] "A body element's end tag may be omitted if the body -- element is not immediately followed by a comment." null; when Li_End_Tag => -- [HTML5] "An li element's end tag may be omitted if the li -- element is immediately followed by another li element or if -- there is no more content in the parent element." null; when Dt_End_Tag => -- [HTML5] "A dt element's end tag may be omitted if the dt -- element is immediately followed by another dt element or a dd -- element." Self.Output.Put ("</dt>"); when Dd_End_Tag => -- [HTML5] "A dd element's end tag may be omitted if the dd -- element is immediately followed by another dd element or a dt -- element, or if there is no more content in the parent element." null; when Rt_End_Tag => -- [HTML5] "An rt element's end tag may be omitted if the rt -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." null; when Rp_End_Tag => -- [HTML5] "An rp element's end tag may be omitted if the rp -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." null; when Optgroup_End_Tag => -- [HTML5] "An optgroup element's end tag may be omitted if the -- optgroup element is immediately followed by another optgroup -- element, or if there is no more content in the parent element." null; when Option_End_Tag => -- [HTML5] "An option element's end tag may be omitted if the -- option element is immediately followed by another option -- element, or if it is immediately followed by an optgroup -- element, or if there is no more content in the parent element." null; when Colgroup_Start_Tag => -- [HTML5] "A colgroup element's start tag may be omitted if the -- first thing inside the colgroup element is a col element, and -- if the element is not immediately preceded by another colgroup -- element whose end tag has been omitted. (It can't be omitted if -- the element is empty.)" Self.Output.Put ("<colgroup>"); when Colgroup_End_Tag => -- [HTML5] "A colgroup element's end tag may be omitted if the -- colgroup element is not immediately followed by a space -- character or a comment." History := Colgroup_End_Tag; when Thead_End_Tag => -- [HTML5] "A thead element's end tag may be omitted if the thead -- element is immediately followed by a tbody or tfoot element." Self.Output.Put ("</thead>"); when Tbody_Start_Tag => -- [HTML5] "A tbody element's start tag may be omitted if the -- first thing inside the tbody element is a tr element, and if -- the element is not immediately preceded by a tbody, thead, or -- tfoot element whose end tag has been omitted. (It can't be -- omitted if the element is empty.)" Self.Output.Put ("<tbody>"); when Tbody_End_Tag => -- [HTML5] "A tbody element's end tag may be omitted if the tbody -- element is immediately followed by a tbody or tfoot element, or -- if there is no more content in the parent element." History := Tbody_End_Tag; when Tfoot_End_Tag => -- [HTML5] "A tfoot element's end tag may be omitted if the tfoot -- element is immediately followed by a tbody element, or if there -- is no more content in the parent element." History := Tfoot_End_Tag; when Tr_End_Tag => -- [HTML5] "A tr element's end tag may be omitted if the tr -- element is immediately followed by another tr element, or if -- there is no more content in the parent element." null; when Td_End_Tag => -- [HTML5] "A td element's end tag may be omitted if the td -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." null; when Th_End_Tag => -- [HTML5] "A th element's end tag may be omitted if the th -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." null; when P_End_Tag => -- [HTML5] "A p element's end tag may be omitted if the p element -- is immediately followed by an address, article, aside, -- blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, -- h4, h5, h6, header, hgroup, hr, main, nav, ol, p, pre, section, -- table, or ul, element, or if there is no more content in the -- parent element and the parent element is not an a element." if Namespace_URI = HTML_URI and Local_Name = A_Tag then Self.Output.Put ("</p>"); end if; end case; Self.Omit := None; Self.History := History; case Self.State.Element_Kind is when Normal | Raw_Text | Escapable_Raw_Text => if Local_Name = Body_Tag then Self.Omit := Body_End_Tag; elsif Local_Name = Dd_Tag then Self.Omit := Dd_End_Tag; elsif Local_Name = Dt_Tag then Self.Omit := Dt_End_Tag; elsif Local_Name = Head_Tag then Self.Omit := Head_End_Tag; elsif Local_Name = HTML_Tag then Self.Omit := HTML_End_Tag; elsif Local_Name = Li_Tag then Self.Omit := Li_End_Tag; elsif Local_Name = Optgroup_Tag then Self.Omit := Optgroup_End_Tag; elsif Local_Name = Option_Tag then Self.Omit := Option_End_Tag; elsif Local_Name = Rp_Tag then Self.Omit := Rp_End_Tag; elsif Local_Name = Rt_Tag then Self.Omit := Rt_End_Tag; elsif Local_Name = Colgroup_Tag then Self.Omit := Colgroup_End_Tag; elsif Local_Name = Thead_Tag then Self.Omit := Thead_End_Tag; elsif Local_Name = Tbody_Tag then Self.Omit := Tbody_End_Tag; elsif Local_Name = Tfoot_Tag then Self.Omit := Tfoot_End_Tag; elsif Local_Name = Tr_Tag then Self.Omit := Tr_End_Tag; elsif Local_Name = Td_Tag then Self.Omit := Td_End_Tag; elsif Local_Name = Th_Tag then Self.Omit := Th_End_Tag; elsif Local_Name = P_Tag then Self.Omit := P_End_Tag; else Self.Output.Put ("</"); Self.Output.Put (Local_Name); Self.Output.Put ('>'); end if; when Void => -- Don't generate close tag for void elements. -- -- [HTML5] "Then, if the element is one of the void elements, or -- if the element is a foreign element, then there may be a single -- U+002F SOLIDUS character (/). This character has no effect on -- void elements, but on foreign elements it marks the start tag -- as self-closing." null; when Foreign => if not Foreign_Closed then Self.Output.Put ("</"); Self.Output.Put (Local_Name); Self.Output.Put ('>'); end if; end case; Self.State := Self.Stack.Last_Element; Self.Stack.Delete_Last; end End_Element; ------------------ -- Error_String -- ------------------ overriding function Error_String (Self : HTML5_Writer) return League.Strings.Universal_String is begin return Self.Diagnosis; end Error_String; ---------------------------- -- Escape_Attribute_Value -- ---------------------------- procedure Escape_Attribute_Value (Value : League.Strings.Universal_String; Text : out League.Strings.Universal_String; Syntax : out Attribute_Value_Syntax) is C : League.Characters.Universal_Character; Unquoted_Syntax : Boolean := True; Apostrophes : Natural := 0; Quotation_Marks : Natural := 0; Aux : League.Strings.Universal_String; First : Positive := 1; Index : Natural; begin Text.Clear; if Value.Is_Empty then Syntax := Empty; else for J in 1 .. Value.Length loop C := Value (J); if C = League.Characters.Latin.Space or C = League.Characters.Latin.Character_Tabulation or C = League.Characters.Latin.Line_Feed or C = League.Characters.Latin.Form_Feed or C = League.Characters.Latin.Carriage_Return or C = League.Characters.Latin.Equals_Sign or C = League.Characters.Latin.Less_Than_Sign or C = League.Characters.Latin.Greater_Than_Sign or C = League.Characters.Latin.Grave_Accent then -- Space characters, '=', '<', '>', '`' are prohibited in -- unquoted attribute value syntax. Unquoted_Syntax := False; elsif C = League.Characters.Latin.Apostrophe then -- ''' is prohibited in unquoted attribute value syntax. Unquoted_Syntax := False; Apostrophes := Apostrophes + 1; elsif C = League.Characters.Latin.Quotation_Mark then -- '"' is prohibited in unquoted attribute value syntax. Unquoted_Syntax := False; Quotation_Marks := Quotation_Marks + 1; end if; if C = League.Characters.Latin.Ampersand then -- Replace '&' by character reference in result string. Text.Append ("&amp;"); else -- Copy other characters to result string. Text.Append (C); end if; end loop; if Unquoted_Syntax then -- Use unquoted attribute value syntax then actual attribute value -- doesn't violate its restrictions. Syntax := Unquoted; elsif Apostrophes <= Quotation_Marks then -- Number of apostrophes is less than number of quotation marks, -- use single-quoted attribute value syntax. Syntax := Single_Quoted; -- Escape ''' characters Aux := Text; Text.Clear; while First <= Aux.Length loop Index := Aux.Index (First, '''); if Index = 0 then Text.Append (Aux.Slice (First, Aux.Length)); First := Aux.Length + 1; else Text.Append (Aux.Slice (First, Index - 1)); Text.Append ("&apos;"); First := Index + 1; end if; end loop; else -- Number of apostrophes is greater than number of quotation -- marks, use single-quoted attribute value syntax. Syntax := Double_Quoted; -- Escape '"' characters Aux := Text; Text.Clear; while First <= Aux.Length loop Index := Aux.Index (First, '"'); if Index = 0 then Text.Append (Aux.Slice (First, Aux.Length)); First := Aux.Length + 1; else Text.Append (Aux.Slice (First, Index - 1)); Text.Append ("&quot;"); First := Index + 1; end if; end loop; end if; end if; end Escape_Attribute_Value; -------------------------- -- Is_Boolean_Attribute -- -------------------------- function Is_Boolean_Attribute (Name : League.Strings.Universal_String) return Boolean is begin return Name = Async_Attribute or Name = Autofocus_Attribute or Name = Autoplay_Attribute or Name = Checked_Attribute or Name = Controls_Attribute or Name = Default_Attribute or Name = Defer_Attribute or Name = Disabled_Attribute or Name = Formnovalidate_Attribute or Name = Hidden_Attribute or Name = Ismap_Attribute or Name = Loop_Attribute or Name = Multiple_Attribute or Name = Muted_Attribute or Name = Novalidate_Attribute or Name = Open_Attribute or Name = Readonly_Attribute or Name = Required_Attribute or Name = Reversed_Attribute or Name = Scoped_Attribute or Name = Seamless_Attribute or Name = Selected_Attribute or Name = Typemustmatch_Attribute; end Is_Boolean_Attribute; ----------------------------------- -- Is_Escapable_Raw_Text_Element -- ----------------------------------- function Is_Escapable_Raw_Text_Element (Tag : League.Strings.Universal_String) return Boolean is begin return Tag = Textarea_Tag or Tag = Title_Tag; end Is_Escapable_Raw_Text_Element; ------------------------- -- Is_Raw_Text_Element -- ------------------------- function Is_Raw_Text_Element (Tag : League.Strings.Universal_String) return Boolean is begin return Tag = Script_Tag or Tag = Style_Tag; end Is_Raw_Text_Element; -------------- -- Is_Space -- -------------- function Is_Space (Item : League.Strings.Universal_String) return Boolean is C : League.Characters.Universal_Character; begin -- [HTML5] "The space characters, for the purposes of this -- specification, are U+0020 SPACE, "tab" (U+0009), "LF" (U+000A), "FF" -- (U+000C), and "CR" (U+000D)." for J in 1 .. Item.Length loop C := Item (J); if C /= League.Characters.Latin.Space and C /= League.Characters.Latin.Character_Tabulation and C /= League.Characters.Latin.Line_Feed and C /= League.Characters.Latin.Form_Feed and C /= League.Characters.Latin.Carriage_Return then return False; end if; end loop; return True; end Is_Space; --------------------- -- Is_Void_Element -- --------------------- function Is_Void_Element (Tag : League.Strings.Universal_String) return Boolean is begin return Tag = Area_Tag or Tag = Base_Tag or Tag = Br_Tag or Tag = Col_Tag or Tag = Embed_Tag or Tag = Hr_Tag or Tag = Img_Tag or Tag = Input_Tag or Tag = Keygen_Tag or Tag = Link_Tag or Tag = Meta_Tag or Tag = Param_Tag or Tag = Source_Tag or Tag = Track_Tag or Tag = Wbr_Tag; end Is_Void_Element; ---------------------------- -- Set_Output_Destination -- ---------------------------- procedure Set_Output_Destination (Self : in out HTML5_Writer'Class; Output : not null SAX_Output_Destination_Access) is begin Self.Output := Output; end Set_Output_Destination; ----------------- -- Start_CDATA -- ----------------- overriding procedure Start_CDATA (Self : in out HTML5_Writer; Success : in out Boolean) is pragma Unreferenced (Success); begin if Self.Omit = Foreign then Self.Output.Put ('>'); Self.Omit := None; end if; Self.CDATA_Mode := True; if Self.State.Element_Kind = Foreign then -- [HTML5] "CDATA sections can only be used in foreign content -- (MathML or SVG)." Self.Output.Put ("<![CDATA["); end if; end Start_CDATA; -------------------- -- Start_Document -- -------------------- overriding procedure Start_Document (Self : in out HTML5_Writer; Success : in out Boolean) is pragma Unreferenced (Success); begin Self.Diagnosis.Clear; Self.State := (Element_Kind => Normal); Self.Omit := None; Self.History := None; Self.Stack.Clear; Self.DOCTYPE_Written := False; Self.Document_Start := True; Self.CDATA_Mode := False; end Start_Document; --------------- -- Start_DTD -- --------------- overriding procedure Start_DTD (Self : in out HTML5_Writer; Name : League.Strings.Universal_String; Public_Id : League.Strings.Universal_String; System_Id : League.Strings.Universal_String; Success : in out Boolean) is pragma Unreferenced (Name); pragma Unreferenced (Public_Id); pragma Unreferenced (System_Id); pragma Unreferenced (Success); begin Self.Write_DOCTYPE; end Start_DTD; ------------------- -- Start_Element -- ------------------- overriding procedure Start_Element (Self : in out HTML5_Writer; 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 pragma Unreferenced (Qualified_Name); History : Omit_History_Kinds := None; begin Self.Stack.Append (Self.State); if not Self.DOCTYPE_Written then -- DOCTYPE is required by HTML5 but it is optional in XHTML5. Self.Write_DOCTYPE; end if; case Self.Omit is when None => null; when Foreign => Self.Output.Put ('>'); when HTML_Start_Tag => -- [HTML5] "An html element's start tag may be omitted if the -- first thing inside the html element is not a comment." null; when HTML_End_Tag => -- [HTML5] "An html element's end tag may be omitted if the html -- element is not immediately followed by a comment." null; when Head_Start_Tag => -- [HTML5] "A head element's start tag may be omitted if the -- element is empty, or if the first thing inside the head element -- is an element." null; when Head_End_Tag => -- [HTML5] "A head element's end tag may be omitted if the head -- element is not immediately followed by a space character or a -- comment." null; when Body_Start_Tag => -- [HTML5] "A body element's start tag may be omitted if the -- element is empty, or if the first thing inside the body element -- is not a space character or a comment, except if the first -- thing inside the body element is a script or style element." if Namespace_URI = HTML_URI and (Local_Name = Script_Tag or Local_Name = Style_Tag) then Self.Output.Put ("<body>"); end if; when Body_End_Tag => -- [HTML5] "A body element's end tag may be omitted if the body -- element is not immediately followed by a comment." null; when Li_End_Tag => -- [HTML5] "An li element's end tag may be omitted if the li -- element is immediately followed by another li element or if -- there is no more content in the parent element." if Namespace_URI = HTML_URI and Local_Name /= Li_Tag then Self.Output.Put ("</li>"); end if; when Dt_End_Tag => -- [HTML5] "A dt element's end tag may be omitted if the dt -- element is immediately followed by another dt element or a dd -- element." if Namespace_URI /= HTML_URI or (Local_Name /= Dt_Tag and Local_Name /= Dd_Tag) then Self.Output.Put ("</dt>"); end if; when Dd_End_Tag => -- [HTML5] "A dd element's end tag may be omitted if the dd -- element is immediately followed by another dd element or a dt -- element, or if there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Dt_Tag and Local_Name /= Dd_Tag) then Self.Output.Put ("</dd>"); end if; when Rt_End_Tag => -- [HTML5] "An rt element's end tag may be omitted if the rt -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Rt_Tag and Local_Name /= Rp_Tag) then Self.Output.Put ("</rt>"); end if; when Rp_End_Tag => -- [HTML5] "An rp element's end tag may be omitted if the rp -- element is immediately followed by an rt or rp element, or if -- there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Rt_Tag and Local_Name /= Rp_Tag) then Self.Output.Put ("</rp>"); end if; when Optgroup_End_Tag => -- [HTML5] "An optgroup element's end tag may be omitted if the -- optgroup element is immediately followed by another optgroup -- element, or if there is no more content in the parent element." if Namespace_URI /= HTML_URI or Local_Name /= Optgroup_Tag then Self.Output.Put ("</optgroup>"); end if; when Option_End_Tag => -- [HTML5] "An option element's end tag may be omitted if the -- option element is immediately followed by another option -- element, or if it is immediately followed by an optgroup -- element, or if there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Option_Tag and Local_Name /= Optgroup_Tag) then Self.Output.Put ("</option>"); end if; when Colgroup_Start_Tag => -- [HTML5] "A colgroup element's start tag may be omitted if the -- first thing inside the colgroup element is a col element, and -- if the element is not immediately preceded by another colgroup -- element whose end tag has been omitted. (It can't be omitted if -- the element is empty.)" if Namespace_URI /= HTML_URI or Local_Name /= Col_Tag or Self.History = Colgroup_End_Tag then Self.Output.Put ("<colgroup>"); end if; when Colgroup_End_Tag => -- [HTML5] "A colgroup element's end tag may be omitted if the -- colgroup element is not immediately followed by a space -- character or a comment." History := Colgroup_End_Tag; when Thead_End_Tag => -- [HTML5] "A thead element's end tag may be omitted if the thead -- element is immediately followed by a tbody or tfoot element." if Namespace_URI /= HTML_URI or (Local_Name /= Tbody_Tag and Local_Name /= Tfoot_Tag) then Self.Output.Put ("</thead>"); else History := Thead_End_Tag; end if; when Tbody_Start_Tag => -- [HTML5] "A tbody element's start tag may be omitted if the -- first thing inside the tbody element is a tr element, and if -- the element is not immediately preceded by a tbody, thead, or -- tfoot element whose end tag has been omitted. (It can't be -- omitted if the element is empty.)" if Namespace_URI /= HTML_URI or Local_Name /= Tr_Tag or Self.History = Thead_End_Tag or Self.History = Tbody_End_Tag or Self.History = Tfoot_End_Tag then Self.Output.Put ("<tbody>"); end if; when Tbody_End_Tag => -- [HTML5] "A tbody element's end tag may be omitted if the tbody -- element is immediately followed by a tbody or tfoot element, or -- if there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Tbody_Tag and Local_Name /= Tfoot_Tag) then Self.Output.Put ("</tbody>"); else History := Tbody_End_Tag; end if; when Tfoot_End_Tag => -- [HTML5] "A tfoot element's end tag may be omitted if the tfoot -- element is immediately followed by a tbody element, or if there -- is no more content in the parent element." if Namespace_URI /= HTML_URI or Local_Name /= Tbody_Tag then Self.Output.Put ("</tfoot>"); else History := Tfoot_End_Tag; end if; when Tr_End_Tag => -- [HTML5] "A tr element's end tag may be omitted if the tr -- element is immediately followed by another tr element, or if -- there is no more content in the parent element." if Namespace_URI /= HTML_URI or Local_Name /= Tr_Tag then Self.Output.Put ("</tr>"); end if; when Td_End_Tag => -- [HTML5] "A td element's end tag may be omitted if the td -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Td_Tag and Local_Name /= Th_Tag) then Self.Output.Put ("</td>"); end if; when Th_End_Tag => -- [HTML5] "A th element's end tag may be omitted if the th -- element is immediately followed by a td or th element, or if -- there is no more content in the parent element." if Namespace_URI /= HTML_URI or (Local_Name /= Td_Tag and Local_Name /= Th_Tag) then Self.Output.Put ("</th>"); end if; when P_End_Tag => -- [HTML5] "A p element's end tag may be omitted if the p element -- is immediately followed by an address, article, aside, -- blockquote, dir, div, dl, fieldset, footer, form, h1, h2, h3, -- h4, h5, h6, header, hgroup, hr, main, nav, ol, p, pre, section, -- table, or ul, element, or if there is no more content in the -- parent element and the parent element is not an a element." if Namespace_URI /= HTML_URI or (Local_Name /= Address_Tag and Local_Name /= Article_Tag and Local_Name /= Aside_Tag and Local_Name /= Blockquote_Tag and Local_Name /= Dir_Tag and Local_Name /= Div_Tag and Local_Name /= Dl_Tag and Local_Name /= Fieldset_Tag and Local_Name /= Footer_Tag and Local_Name /= Form_Tag and Local_Name /= H1_Tag and Local_Name /= H2_Tag and Local_Name /= H3_Tag and Local_Name /= H4_Tag and Local_Name /= H5_Tag and Local_Name /= H6_Tag and Local_Name /= Header_Tag and Local_Name /= Hgroup_Tag and Local_Name /= Hr_Tag and Local_Name /= Main_Tag and Local_Name /= Nav_Tag and Local_Name /= Ol_Tag and Local_Name /= P_Tag and Local_Name /= Pre_Tag and Local_Name /= Section_Tag and Local_Name /= Table_Tag and Local_Name /= Ul_Tag) then Self.Output.Put ("</p>"); end if; end case; Self.Omit := None; Self.History := History; if Namespace_URI = HTML_URI then if Is_Void_Element (Local_Name) then Self.State.Element_Kind := Void; elsif Is_Raw_Text_Element (Local_Name) then Self.State.Element_Kind := Raw_Text; elsif Is_Escapable_Raw_Text_Element (Local_Name) then Self.State.Element_Kind := Escapable_Raw_Text; else Self.State.Element_Kind := Normal; end if; if Local_Name = Body_Tag then -- For convinience recognize <body> tag as start of the document's -- content. Self.Document_Start := False; if Attributes.Is_Empty then Self.Omit := Body_Start_Tag; end if; elsif Local_Name = Head_Tag then Self.Document_Start := False; if Attributes.Is_Empty then Self.Omit := Head_Start_Tag; end if; elsif Local_Name = HTML_Tag then if Attributes.Is_Empty then Self.Omit := HTML_Start_Tag; end if; elsif Local_Name = Colgroup_Tag then if Attributes.Is_Empty and Self.History /= Colgroup_End_Tag then Self.Omit := Colgroup_Start_Tag; end if; elsif Local_Name = Tbody_Tag then if Attributes.Is_Empty and (Self.History /= Tbody_End_Tag or Self.History /= Thead_End_Tag or Self.History /= Tfoot_End_Tag) then Self.Omit := Tbody_Start_Tag; end if; end if; if Self.Omit = None then Self.Output.Put ('<'); Self.Output.Put (Local_Name); Self.Write_Attributes (Attributes, Success); if not Success then return; end if; Self.Output.Put ('>'); if Local_Name = HTML_Tag then -- [HTML5] "It is suggested that newlines be inserted after the -- DOCTYPE, after any comments that are before the root -- element, after the html element's start tag (if it is not -- omitted), and after any comments that are inside the html -- element but before the head element." Self.Output.Put (League.Characters.Latin.Line_Feed); end if; end if; elsif Namespace_URI = MathML_URI or Namespace_URI = SVG_URI then Self.State.Element_Kind := Foreign; Self.Omit := Foreign; Self.Output.Put ('<'); Self.Output.Put (Local_Name); Self.Write_Attributes (Attributes, Success); if not Success then return; end if; else -- Other namespaces can't be used in HTML5. Success := False; Self.Diagnosis := League.Strings.To_Universal_String ("namespace is not supported by HTML5"); end if; end Start_Element; ---------------------- -- Write_Attributes -- ---------------------- procedure Write_Attributes (Self : in out HTML5_Writer'Class; Attributes : XML.SAX.Attributes.SAX_Attributes; Success : in out Boolean) is procedure Write_Attribute (Qualified_Name : League.Strings.Universal_String; Value : League.Strings.Universal_String); --------------------- -- Write_Attribute -- --------------------- procedure Write_Attribute (Qualified_Name : League.Strings.Universal_String; Value : League.Strings.Universal_String) is Escaped_Value : League.Strings.Universal_String; Syntax : Attribute_Value_Syntax; begin Escape_Attribute_Value (Value, Escaped_Value, Syntax); if Syntax = Empty or else (Self.State.Element_Kind /= Foreign and then Is_Boolean_Attribute (Qualified_Name)) then Self.Output.Put (' '); Self.Output.Put (Qualified_Name); elsif Syntax = Unquoted then Self.Output.Put (' '); Self.Output.Put (Qualified_Name); Self.Output.Put ('='); Self.Output.Put (Escaped_Value); elsif Syntax = Single_Quoted then Self.Output.Put (' '); Self.Output.Put (Qualified_Name); Self.Output.Put ('='); Self.Output.Put ('''); Self.Output.Put (Escaped_Value); Self.Output.Put ('''); else Self.Output.Put (' '); Self.Output.Put (Qualified_Name); Self.Output.Put ('='); Self.Output.Put ('"'); Self.Output.Put (Escaped_Value); Self.Output.Put ('"'); end if; end Write_Attribute; Namespace_URI : League.Strings.Universal_String; Local_Name : League.Strings.Universal_String; Qualified_Name : League.Strings.Universal_String; Value : League.Strings.Universal_String; begin for J in 1 .. Attributes.Length loop Namespace_URI := Attributes.Namespace_URI (J); Local_Name := Attributes.Local_Name (J); Qualified_Name := Attributes.Qualified_Name (J); Value := Attributes (J); if Namespace_URI.Is_Empty then Write_Attribute (Qualified_Name, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Actuate_Attribute then Write_Attribute (XLink_Actuate_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Arcrole_Attribute then Write_Attribute (XLink_Arcrole_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Href_Attribute then Write_Attribute (XLink_Href_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Role_Attribute then Write_Attribute (XLink_Role_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Show_Attribute then Write_Attribute (XLink_Show_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Title_Attribute then Write_Attribute (XLink_Title_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XLink_URI and Local_Name = Type_Attribute then Write_Attribute (XLink_Type_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XML_URI and Local_Name = Base_Attribute then Write_Attribute (XML_Base_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XML_URI and Local_Name = Lang_Attribute then Write_Attribute (XML_Lang_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XML_URI and Local_Name = Space_Attribute then Write_Attribute (XML_Space_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XMLNS_URI and Local_Name = XMLNS_Attribute then Write_Attribute (XMLNS_Attribute, Value); elsif Self.State.Element_Kind = Foreign and Namespace_URI = XMLNS_URI and Local_Name = XLink_Attribute then Write_Attribute (XMLNS_XLink_Attribute, Value); else -- Other namespaces can't be expressed in HTML5. Success := False; Self.Diagnosis := League.Strings.To_Universal_String ("namespaced attribute can't be expressed in HTML5"); return; end if; end loop; end Write_Attributes; ------------------- -- Write_DOCTYPE -- ------------------- procedure Write_DOCTYPE (Self : in out HTML5_Writer'Class) is begin Self.DOCTYPE_Written := True; Self.Output.Put ("<!DOCTYPE html>"); -- [HTML5] "It is suggested that newlines be inserted after the DOCTYPE, -- after any comments that are before the root element, after the html -- element's start tag (if it is not omitted), and after any comments -- that are inside the html element but before the head element." Self.Output.Put (League.Characters.Latin.Line_Feed); end Write_DOCTYPE; end XML.SAX.HTML5_Writers;
package body agar.gui.widget.button is package cbinds is function allocate (parent : widget_access_t; flags : flags_t := 0; label : cs.chars_ptr) return button_access_t; pragma import (c, allocate, "AG_ButtonNewS"); function allocate_function (parent : widget_access_t; flags : flags_t := 0; label : cs.chars_ptr; callback : agar.core.event.callback_t) return button_access_t; pragma import (c, allocate_function, "AG_ButtonNewFn"); function allocate_integer (parent : widget_access_t; flags : flags_t := 0; label : cs.chars_ptr; ptr : access c.int) return button_access_t; pragma import (c, allocate_integer, "agar_gui_widget_new_int"); function allocate_uint8 (parent : widget_access_t; flags : flags_t := 0; label : cs.chars_ptr; ptr : access agar.core.types.uint8_t) return button_access_t; pragma import (c, allocate_uint8, "agar_gui_widget_new_uint8"); function allocate_uint16 (parent : widget_access_t; flags : flags_t := 0; label : cs.chars_ptr; ptr : access agar.core.types.uint16_t) return button_access_t; pragma import (c, allocate_uint16, "agar_gui_widget_new_uint16"); function allocate_uint32 (parent : widget_access_t; flags : flags_t := 0; label : cs.chars_ptr; ptr : access agar.core.types.uint32_t) return button_access_t; pragma import (c, allocate_uint32, "agar_gui_widget_new_uint32"); function allocate_flag (parent : widget_access_t; flags : flags_t := 0; label : cs.chars_ptr; ptr : access c.int; mask : c.unsigned) return button_access_t; pragma import (c, allocate_flag, "AG_ButtonNewFlag"); function allocate_flag8 (parent : widget_access_t; flags : flags_t := 0; label : cs.chars_ptr; ptr : access agar.core.types.uint8_t; mask : agar.core.types.uint8_t) return button_access_t; pragma import (c, allocate_flag8, "AG_ButtonNewFlag8"); function allocate_flag16 (parent : widget_access_t; flags : flags_t := 0; label : cs.chars_ptr; ptr : access agar.core.types.uint16_t; mask : agar.core.types.uint16_t) return button_access_t; pragma import (c, allocate_flag16, "AG_ButtonNewFlag16"); function allocate_flag32 (parent : widget_access_t; flags : flags_t := 0; label : cs.chars_ptr; ptr : access agar.core.types.uint32_t; mask : agar.core.types.uint32_t) return button_access_t; pragma import (c, allocate_flag32, "AG_ButtonNewFlag32"); procedure set_padding (button : button_access_t; left_pad : c.int; right_pad : c.int; top_pad : c.int; bottom_pad : c.int); pragma import (c, set_padding, "AG_ButtonSetPadding"); procedure set_focusable (button : button_access_t; flag : c.int); pragma import (c, set_focusable, "AG_ButtonSetFocusable"); procedure set_sticky (button : button_access_t; flag : c.int); pragma import (c, set_sticky, "AG_ButtonSetSticky"); procedure set_repeat_mode (button : button_access_t; flag : c.int); pragma import (c, set_repeat_mode, "AG_ButtonSetRepeatMode"); procedure invert_state (button : button_access_t; flag : c.int); pragma import (c, invert_state, "AG_ButtonInvertState"); procedure text (button : button_access_t; text : cs.chars_ptr); pragma import (c, text, "AG_ButtonTextS"); end cbinds; -- function allocate (parent : widget_access_t; flags : flags_t := 0; label : string) return button_access_t is c_label : aliased c.char_array := c.to_c (label); begin return cbinds.allocate (parent => parent, flags => flags, label => cs.to_chars_ptr (c_label'unchecked_access)); end allocate; function allocate_function (parent : widget_access_t; flags : flags_t := 0; label : string; callback : agar.core.event.callback_t) return button_access_t is c_label : aliased c.char_array := c.to_c (label); begin return cbinds.allocate_function (parent => parent, callback => callback, flags => flags, label => cs.to_chars_ptr (c_label'unchecked_access)); end allocate_function; function allocate_integer (parent : widget_access_t; flags : flags_t := 0; label : string; ptr : access integer) return button_access_t is c_label : aliased c.char_array := c.to_c (label); c_int : aliased c.int; c_button : button_access_t; begin c_button := cbinds.allocate_integer (parent => parent, flags => flags, label => cs.to_chars_ptr (c_label'unchecked_access), ptr => c_int'unchecked_access); if c_button /= null then ptr.all := integer (c_int); end if; return c_button; end allocate_integer; function allocate_uint8 (parent : widget_access_t; flags : flags_t := 0; label : string; ptr : access agar.core.types.uint8_t) return button_access_t is c_label : aliased c.char_array := c.to_c (label); begin return cbinds.allocate_uint8 (parent => parent, flags => flags, label => cs.to_chars_ptr (c_label'unchecked_access), ptr => ptr); end allocate_uint8; function allocate_uint16 (parent : widget_access_t; flags : flags_t := 0; label : string; ptr : access agar.core.types.uint16_t) return button_access_t is c_label : aliased c.char_array := c.to_c (label); begin return cbinds.allocate_uint16 (parent => parent, flags => flags, label => cs.to_chars_ptr (c_label'unchecked_access), ptr => ptr); end allocate_uint16; function allocate_uint32 (parent : widget_access_t; flags : flags_t := 0; label : string; ptr : access agar.core.types.uint32_t) return button_access_t is c_label : aliased c.char_array := c.to_c (label); begin return cbinds.allocate_uint32 (parent => parent, flags => flags, label => cs.to_chars_ptr (c_label'unchecked_access), ptr => ptr); end allocate_uint32; function allocate_flag (parent : widget_access_t; flags : flags_t := 0; label : string; ptr : access integer; mask : integer) return button_access_t is c_label : aliased c.char_array := c.to_c (label); c_int : aliased c.int; c_button : aliased button_access_t; begin c_button := cbinds.allocate_flag (parent => parent, flags => flags, label => cs.to_chars_ptr (c_label'unchecked_access), ptr => c_int'unchecked_access, mask => c.unsigned (mask)); if c_button /= null then ptr.all := integer (c_int); end if; return c_button; end allocate_flag; function allocate_flag8 (parent : widget_access_t; flags : flags_t := 0; label : string; ptr : access agar.core.types.uint8_t; mask : agar.core.types.uint8_t) return button_access_t is c_label : aliased c.char_array := c.to_c (label); begin return cbinds.allocate_flag8 (parent => parent, flags => flags, label => cs.to_chars_ptr (c_label'unchecked_access), ptr => ptr, mask => mask); end allocate_flag8; function allocate_flag16 (parent : widget_access_t; flags : flags_t := 0; label : string; ptr : access agar.core.types.uint16_t; mask : agar.core.types.uint16_t) return button_access_t is c_label : aliased c.char_array := c.to_c (label); begin return cbinds.allocate_flag16 (parent => parent, flags => flags, label => cs.to_chars_ptr (c_label'unchecked_access), ptr => ptr, mask => mask); end allocate_flag16; function allocate_flag32 (parent : widget_access_t; flags : flags_t := 0; label : string; ptr : access agar.core.types.uint32_t; mask : agar.core.types.uint32_t) return button_access_t is c_label : aliased c.char_array := c.to_c (label); begin return cbinds.allocate_flag32 (parent => parent, flags => flags, label => cs.to_chars_ptr (c_label'unchecked_access), ptr => ptr, mask => mask); end allocate_flag32; procedure set_padding (button : button_access_t; left_pad : natural; right_pad : natural; top_pad : natural; bottom_pad : natural) is begin cbinds.set_padding (button => button, left_pad => c.int (left_pad), right_pad => c.int (right_pad), top_pad => c.int (top_pad), bottom_pad => c.int (bottom_pad)); end set_padding; procedure set_focusable (button : button_access_t; flag : boolean) is begin if flag then cbinds.set_focusable (button, 1); else cbinds.set_focusable (button, 0); end if; end set_focusable; procedure set_sticky (button : button_access_t; flag : boolean) is begin if flag then cbinds.set_sticky (button, 1); else cbinds.set_sticky (button, 0); end if; end set_sticky; procedure invert_state (button : button_access_t; flag : boolean) is begin if flag then cbinds.invert_state (button, 1); else cbinds.invert_state (button, 0); end if; end invert_state; procedure set_repeat_mode (button : button_access_t; flag : boolean) is begin if flag then cbinds.set_repeat_mode (button, 1); else cbinds.set_repeat_mode (button, 0); end if; end set_repeat_mode; procedure text (button : button_access_t; text : string) is ca_text : aliased c.char_array := c.to_c (text); begin cbinds.text (button => button, text => cs.to_chars_ptr (ca_text'unchecked_access)); end text; function widget (button : button_access_t) return widget_access_t is begin return button.widget'access; end widget; end agar.gui.widget.button;
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- SYSTEM.TASK_PRIMITIVES.OPERATIONS.ATCB_ALLOCATION -- -- -- -- B o d y -- -- -- -- Copyright (C) 2011, 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. -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; separate (System.Task_Primitives.Operations) package body ATCB_Allocation is --------------- -- Free_ATCB -- --------------- procedure Free_ATCB (T : Task_Id) is Tmp : Task_Id := T; Is_Self : constant Boolean := T = Self; procedure Free is new Ada.Unchecked_Deallocation (Ada_Task_Control_Block, Task_Id); begin if Is_Self then declare Local_ATCB : aliased Ada_Task_Control_Block (0); -- Create a dummy ATCB and initialize it minimally so that "Free" -- can still call Self and Defer/Undefer_Abort after Tmp is freed -- by the underlying memory management library. begin Local_ATCB.Common.LL.Thread := T.Common.LL.Thread; Local_ATCB.Common.Current_Priority := T.Common.Current_Priority; Specific.Set (Local_ATCB'Unchecked_Access); Free (Tmp); -- Note: it is assumed here that for all platforms, Specific.Set -- deletes the task specific information if passed a null value. Specific.Set (null); end; else Free (Tmp); end if; end Free_ATCB; -------------- -- New_ATCB -- -------------- function New_ATCB (Entry_Num : Task_Entry_Index) return Task_Id is begin return new Ada_Task_Control_Block (Entry_Num); end New_ATCB; end ATCB_Allocation;
-- -- Copyright (C) 2022 Jeremy Grosser <jeremy@synack.me> -- -- SPDX-License-Identifier: BSD-3-Clause -- -- Galois Linear Feedback Shift Register -- https://en.wikipedia.org/wiki/Linear-feedback_shift_register#Galois_LFSRs generic type Random_Type is mod <>; Taps : Random_Type; package LFSR is State : Random_Type := Random_Type'Last; function Next return Random_Type; function In_Range (First, Last : Random_Type) return Random_Type; end LFSR;
-- -- Jan & Uwe R. Zimmer, Australia, July 2011 -- with Real_Type; use Real_Type; package Quaternions is type Quaternion_Real is record w, x, y, z : Real; end record; function "abs" (Quad : Quaternion_Real) return Real; function Unit (Quad : Quaternion_Real) return Quaternion_Real; function Conj (Quad : Quaternion_Real) return Quaternion_Real; function "-" (Quad : Quaternion_Real) return Quaternion_Real; function "+" (Left, Right : Quaternion_Real) return Quaternion_Real; function "-" (Left, Right : Quaternion_Real) return Quaternion_Real; function "*" (Left, Right : Quaternion_Real) return Quaternion_Real; function "/" (Left, Right : Quaternion_Real) return Quaternion_Real; function "*" (Left : Quaternion_Real; Right : Real) return Quaternion_Real; function "/" (Left : Quaternion_Real; Right : Real) return Quaternion_Real; function "*" (Left : Real; Right : Quaternion_Real) return Quaternion_Real; function "/" (Left : Real; Right : Quaternion_Real) return Quaternion_Real; function Image (Quad : Quaternion_Real) return String; end Quaternions;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- E X P _ C H 9 -- -- -- -- S p e c -- -- -- -- Copyright (C) 1992-2016, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- Expand routines for chapter 9 constructs with Types; use Types; package Exp_Ch9 is type Subprogram_Protection_Mode is (Dispatching_Mode, Protected_Mode, Unprotected_Mode); -- This type is used to distinguish the different protection modes of a -- protected subprogram. procedure Build_Activation_Chain_Entity (N : Node_Id); -- Given a declaration N of an object that is a task, or contains tasks -- (other than allocators to tasks) this routine ensures that an activation -- chain has been declared in the appropriate scope, building the required -- declaration for the chain variable if not. The name of this variable -- is always _Chain and it is accessed by name. function Build_Call_With_Task (N : Node_Id; E : Entity_Id) return Node_Id; -- N is a node representing the name of a task or an access to a task. -- The value returned is a call to the function whose name is the entity -- E (typically a runtime routine entity obtained using RTE) with the -- Task_Id of the associated task as the parameter. The caller is -- responsible for analyzing and resolving the resulting tree. procedure Build_Class_Wide_Master (Typ : Entity_Id); -- Given an access-to-limited class-wide type or an access-to-limited -- interface, ensure that the designated type has a _master and generate -- a renaming of the said master to service the access type. procedure Build_Master_Entity (Obj_Or_Typ : Entity_Id); -- Given the name of an object or a type which is either a task, contains -- tasks or designates tasks, create a _master in the appropriate scope -- which captures the value of Current_Master. Mark the nearest enclosing -- body or block as being a task master. procedure Build_Master_Renaming (Ptr_Typ : Entity_Id; Ins_Nod : Node_Id := Empty); -- Given an access type Ptr_Typ whose designated type is either a task or -- contains tasks, create a renaming of the form: -- -- <Ptr_Typ>M : Master_Id renames _Master; -- -- where _master denotes the task master of the enclosing context. Ins_Nod -- is used to provide a specific insertion node for the renaming. function Build_Private_Protected_Declaration (N : Node_Id) return Entity_Id; -- A subprogram body without a previous spec that appears in a protected -- body must be expanded separately to create a subprogram declaration -- for it, in order to resolve internal calls to it from other protected -- operations. It would seem that no locking version of the operation is -- needed, but in fact, in Ada 2005 the subprogram may be used in a call- -- back, and therefore a protected version of the operation must be -- generated as well. -- -- Possibly factor this with Exp_Dist.Copy_Specification ??? function Build_Protected_Sub_Specification (N : Node_Id; Prot_Typ : Entity_Id; Mode : Subprogram_Protection_Mode) return Node_Id; -- Build the specification for protected subprogram. This is called when -- expanding a protected type, and also when expanding the declaration for -- an Access_To_Protected_Subprogram type. In the latter case, Prot_Typ is -- empty, and the first parameter of the signature of the protected op is -- of type System.Address. procedure Build_Protected_Subprogram_Call (N : Node_Id; Name : Node_Id; Rec : Node_Id; External : Boolean := True); -- The node N is a subprogram or entry call to a protected subprogram. This -- procedure rewrites this call with the appropriate expansion. Name is the -- subprogram, and Rec is the record corresponding to the protected object. -- External is False if the call is to another protected subprogram within -- the same object. procedure Build_Protected_Subprogram_Call_Cleanup (Op_Spec : Node_Id; Conc_Typ : Node_Id; Loc : Source_Ptr; Stmts : List_Id); -- Append to Stmts the cleanups after a call to a protected subprogram -- whose specification is Op_Spec. Conc_Typ is the concurrent type and Loc -- the sloc for appended statements. The cleanup will either unlock the -- protected object or serve pending entries. procedure Build_Task_Activation_Call (N : Node_Id); -- This procedure is called for constructs that can be task activators, -- i.e. task bodies, subprogram bodies, package bodies and blocks. If the -- construct is a task activator (as indicated by the non-empty setting of -- Activation_Chain_Entity, either in the construct, or, in the case of a -- package body, in its associated package spec), then a call to -- Activate_Tasks with this entity as the single parameter is inserted at -- the start of the statements of the activator. procedure Build_Task_Allocate_Block (Actions : List_Id; N : Node_Id; Args : List_Id); -- This routine is used in the case of allocators where the designated type -- is a task or contains tasks. In this case, the normal initialize call -- is replaced by: -- -- blockname : label; -- blockname : declare -- _Chain : Activation_Chain; -- -- procedure _Expunge is -- begin -- Expunge_Unactivated_Tasks (_Chain); -- end; -- -- begin -- Init (Args); -- Activate_Tasks (_Chain); -- at end -- _Expunge; -- end; -- -- to get the task or tasks created and initialized. The expunge call -- ensures that any tasks that get created but not activated due to an -- exception are properly expunged (it has no effect in the normal case). -- The argument N is the allocator, and Args is the list of arguments for -- the initialization call, constructed by the caller, which uses the -- Master_Id of the access type as the _Master parameter, and _Chain -- (defined above) as the _Chain parameter. procedure Build_Task_Allocate_Block_With_Init_Stmts (Actions : List_Id; N : Node_Id; Init_Stmts : List_Id); -- Ada 2005 (AI-287): Similar to previous routine, but used to expand -- allocated aggregates with default initialized components. Init_Stmts -- contains the list of statements required to initialize the allocated -- aggregate. It replaces the call to Init (Args) done by -- Build_Task_Allocate_Block. Also used to expand allocators containing -- build-in-place function calls. function Build_Wrapper_Spec (Subp_Id : Entity_Id; Obj_Typ : Entity_Id; Formals : List_Id) return Node_Id; -- Ada 2005 (AI-345): Build the specification of a primitive operation -- associated with a protected or task type. This is required to implement -- dispatching calls through interfaces. Subp_Id is the primitive to be -- wrapped, Obj_Typ is the type of the newly added formal parameter to -- handle object notation, Formals are the original entry formals that -- will be explicitly replicated. function Concurrent_Ref (N : Node_Id) return Node_Id; -- Given the name of a concurrent object (task or protected object), or -- the name of an access to a concurrent object, this function returns an -- expression referencing the associated Task_Id or Protection object, -- respectively. Note that a special case is when the name is a reference -- to a task type name. This can only happen within a task body, and the -- meaning is to get the Task_Id for the currently executing task. function Convert_Concurrent (N : Node_Id; Typ : Entity_Id) return Node_Id; -- N is an expression of type Typ. If the type is not a concurrent type -- then it is returned unchanged. If it is a task or protected reference, -- Convert_Concurrent creates an unchecked conversion node from this -- expression to the corresponding concurrent record type value. We need -- this in any situation where the concurrent type is used, because the -- actual concurrent object is an object of the corresponding concurrent -- type, and manipulations on the concurrent object actually manipulate the -- corresponding object of the record type. function Entry_Index_Expression (Sloc : Source_Ptr; Ent : Entity_Id; Index : Node_Id; Ttyp : Entity_Id) return Node_Id; -- Returns an expression to compute a task entry index given the name of -- the entry or entry family. For the case of a task entry family, the -- Index parameter contains the expression for the subscript. Ttyp is the -- task type. procedure Establish_Task_Master (N : Node_Id); -- Given a subprogram body, or a block statement, or a task body, this -- procedure makes the necessary transformations required of a task master -- (add Enter_Master call at start, and establish a cleanup routine to make -- sure Complete_Master is called on exit). procedure Expand_Access_Protected_Subprogram_Type (N : Node_Id); -- Build Equivalent_Type for an Access_To_Protected_Subprogram. -- Equivalent_Type is a record type with two components: a pointer to the -- protected object, and a pointer to the operation itself. procedure Expand_Accept_Declarations (N : Node_Id; Ent : Entity_Id); -- Expand declarations required for accept statement. See bodies of both -- Expand_Accept_Declarations and Expand_N_Accept_Statement for full -- details of the nature and use of these declarations, which are inserted -- immediately before the accept node N. The second argument is the entity -- for the corresponding entry. procedure Expand_Entry_Barrier (N : Node_Id; Ent : Entity_Id); -- Expand the entry barrier into a function. This is called directly -- from Analyze_Entry_Body so that the discriminals and privals of the -- barrier can be attached to the function declaration list, and a new -- set prepared for the entry body procedure, before the entry body -- statement sequence can be expanded. The resulting function is analyzed -- now, within the context of the protected object, to resolve calls to -- other protected functions. procedure Expand_N_Abort_Statement (N : Node_Id); procedure Expand_N_Accept_Statement (N : Node_Id); procedure Expand_N_Asynchronous_Select (N : Node_Id); procedure Expand_N_Conditional_Entry_Call (N : Node_Id); procedure Expand_N_Delay_Relative_Statement (N : Node_Id); procedure Expand_N_Delay_Until_Statement (N : Node_Id); procedure Expand_N_Entry_Body (N : Node_Id); procedure Expand_N_Entry_Call_Statement (N : Node_Id); procedure Expand_N_Entry_Declaration (N : Node_Id); procedure Expand_N_Protected_Body (N : Node_Id); procedure Expand_N_Protected_Type_Declaration (N : Node_Id); -- Expands protected type declarations. This results, among other things, -- in the declaration of a record type for the representation of protected -- objects and (if there are entries) in an entry service procedure. The -- Protection value used by the GNARL to control the object will always be -- the first field of the record, and the entry service procedure spec (if -- it exists) will always immediately follow the record declaration. This -- allows these two nodes to be found from the type, without benefit of -- further attributes, using Corresponding_Record. procedure Expand_N_Requeue_Statement (N : Node_Id); procedure Expand_N_Selective_Accept (N : Node_Id); procedure Expand_N_Single_Protected_Declaration (N : Node_Id); procedure Expand_N_Single_Task_Declaration (N : Node_Id); procedure Expand_N_Task_Body (N : Node_Id); procedure Expand_N_Task_Type_Declaration (N : Node_Id); procedure Expand_N_Timed_Entry_Call (N : Node_Id); procedure Expand_Protected_Body_Declarations (N : Node_Id; Spec_Id : Entity_Id); -- Expand declarations required for a protected body. See bodies of both -- Expand_Protected_Body_Declarations and Expand_N_Protected_Body for full -- details of the nature and use of these declarations. The second argument -- is the entity for the corresponding protected type declaration. function External_Subprogram (E : Entity_Id) return Entity_Id; -- Return the external version of a protected operation, which locks -- the object before invoking the internal protected subprogram body. function Find_Master_Scope (E : Entity_Id) return Entity_Id; -- When a type includes tasks, a master entity is created in the scope, to -- be used by the runtime during activation. In general the master is the -- immediate scope in which the type is declared, but in Ada 2005, in the -- presence of synchronized classwide interfaces, the immediate scope of -- an anonymous access type may be a transient scope, which has no run-time -- presence. In this case, the scope of the master is the innermost scope -- that comes from source. function First_Protected_Operation (D : List_Id) return Node_Id; -- Given the declarations list for a protected body, find the -- first protected operation body. procedure Install_Private_Data_Declarations (Loc : Source_Ptr; Spec_Id : Entity_Id; Conc_Typ : Entity_Id; Body_Nod : Node_Id; Decls : List_Id; Barrier : Boolean := False; Family : Boolean := False); -- This routines generates several types, objects and object renamings used -- in the handling of discriminants and private components of protected and -- task types. It also generates the entry index for entry families. Formal -- Spec_Id denotes an entry, entry family or a subprogram, Conc_Typ is the -- concurrent type where Spec_Id resides, Body_Nod is the corresponding -- body of Spec_Id, Decls are the declarations of the subprogram or entry. -- Flag Barrier denotes whether the context is an entry barrier function. -- Flag Family is used in conjunction with Barrier to denote a barrier for -- an entry family. -- -- The generated types, entities and renamings are: -- -- * If flag Barrier is set or Spec_Id denotes a protected entry or an -- entry family, generate: -- -- type prot_typVP is access prot_typV; -- _object : prot_typVP := prot_typV (_O); -- -- where prot_typV is the corresponding record of a protected type and -- _O is a formal parameter representing the concurrent object of either -- the barrier function or the entry (family). -- -- * If Conc_Typ is a protected type, create a renaming for the Protection -- field _object: -- -- conc_typR : protection_typ renames _object._object; -- -- * If Conc_Typ has discriminants, create renamings of the form: -- -- discr_nameD : discr_typ renames _object.discr_name; -- or -- discr_nameD : discr_typ renames _task.discr_name; -- -- * If Conc_Typ denotes a protected type and has private components, -- generate renamings of the form: -- -- comp_name : comp_typ renames _object.comp_name; -- -- * Finally, is flag Barrier and Family are set or Spec_Id denotes an -- entry family, generate the entry index constant: -- -- subtype Jnn is <Type of Index> range Low .. High; -- J : constant Jnn := -- Jnn'Val (_E - <Index expression> + Jnn'Pos (Jnn'First)); -- -- All the above declarations are inserted in the order shown to the front -- of Decls. function Make_Task_Create_Call (Task_Rec : Entity_Id) return Node_Id; -- Given the entity of the record type created for a task type, build -- the call to Create_Task function Make_Initialize_Protection (Protect_Rec : Entity_Id) return List_Id; -- Given the entity of the record type created for a protected type, build -- a list of statements needed for proper initialization of the object. function Next_Protected_Operation (N : Node_Id) return Node_Id; -- Given a protected operation node (a subprogram or entry body), find the -- following node in the declarations list. procedure Set_Discriminals (Dec : Node_Id); -- Replace discriminals in a protected type for use by the next protected -- operation on the type. Each operation needs a new set of discriminals, -- since it needs a unique renaming of the discriminant fields in the -- record used to implement the protected type. end Exp_Ch9;
-- -- Copyright 2021 (C) Jeremy Grosser -- -- SPDX-License-Identifier: BSD-3-Clause -- with Chests.Ring_Buffers; with HAL.UART; package Serial_Console is type Port (UART : not null HAL.UART.Any_UART_Port) is tagged private; procedure Put (This : in out Port; Item : Character); procedure Put (This : in out Port; Item : String); procedure New_Line (This : in out Port); procedure Put_Line (This : in out Port; Item : String); procedure Get (This : in out Port; Ch : out Character); -- If the RX buffer is empty, Get will block procedure Get_Nonblocking (This : in out Port; Ch : out Character); -- If the receive buffer is empty, Get_Nonblocking will set Ch := ASCII.NUL -- and return immediately function Buffer_Size (This : Port) return Natural; procedure Get (This : in out Port; Item : out String); -- Get will block until Item'Length characters are received from the buffer procedure Poll (This : in out Port); -- Poll should be called upon receiving a UART interrupt, it will read a -- single byte into the buffer for Get. -- -- Poll will block if no data is available from the UART -- If the buffer is full, Poll will delete the oldest character in the buffer. private package Character_Buffers is new Chests.Ring_Buffers (Capacity => 32, Element_Type => Character); type Port (UART : not null HAL.UART.Any_UART_Port) is tagged record RX_Buffer : Character_Buffers.Ring_Buffer; end record; end Serial_Console;
with GNAT.Spitbol; use GNAT.Spitbol; with Ada.Strings.Unbounded; with GNAT.Expect; with GNATCOLL.Projects; with GNATCOLL.Utils; with GNAT.OS_Lib; use GNAT.OS_Lib; use GNAT.Expect; with Ada.Unchecked_Deallocation; package body GPR_Tools.Gprslaves.DB is use GNAT.Spitbol.Table_VString; use type Ada.Strings.Unbounded.Unbounded_String; -------------- -- Register -- -------------- procedure Register (Self : in out Table; Host : Host_Address; Keys : GNAT.Spitbol.Table_VString.Table) is begin for I of Self.Hosts loop if I.Host = Host then I.Keys := Keys; return; end if; end loop; Self.Hosts.Append (Info_Struct'(Host, Keys)); end Register; ---------- -- Find -- ---------- function Find (Self : Table; Keys : GNAT.Spitbol.Table_VString.Table) return Host_Info_Vectors.Vector is begin return Ret : Host_Info_Vectors.Vector do for Candidate of Self.Hosts loop declare Search_Keys : constant Table_Array := Convert_To_Array (Keys); OK : Boolean := True; begin for I of Search_Keys loop if Present (Candidate.Keys, I.Name) then if Get (Candidate.Keys, I.Name) /= I.Value then OK := False; end if; else OK := False; end if; if OK then Ret.Append (Candidate.Host); end if; end loop; end; end loop; end return; end Find; procedure Append (Self : in out Info_Struct; Key_Name : String; Key_Value : String) is begin Set (Self.Keys, Key_Name, V (Key_Value)); end Append; function Get_Free_Port (Default : GNAT.Sockets.Port_Type := 8484) return GNAT.Sockets.Port_Type is S : GNAT.Sockets.Socket_Type; A : GNAT.Sockets.Sock_Addr_Type; begin A.Addr := GNAT.Sockets.Any_Inet_Addr; A.Port := Default; GNAT.Sockets.Create_Socket (S); begin GNAT.Sockets.Bind_Socket (S, A); GNAT.Sockets.Close_Socket (S); exception when others => A.Port := GNAT.Sockets.Any_Port; GNAT.Sockets.Bind_Socket (S, A); A := GNAT.Sockets.Get_Socket_Name (S); GNAT.Sockets.Close_Socket (S); end; return A.Port; end Get_Free_Port; function Get_Gnat_Version return String is Env : GNATCOLL.Projects.Project_Environment_Access; Fd : GNAT.Expect.Process_Descriptor_Access; Gnatls_Args : GNAT.OS_Lib.Argument_List_Access := Argument_String_To_List ("gnatls" & " -v"); procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Process_Descriptor'Class, Process_Descriptor_Access); begin GNATCOLL.Projects.Initialize (Env); GNATCOLL.Projects.Spawn_Gnatls (Self => Env.all, Fd => Fd, Gnatls_Args => Gnatls_Args, Errors => null); if Fd /= null then declare S : constant String := GNATCOLL.Utils.Get_Command_Output (Fd); Index : Integer := S'First; First : Integer; Last : Integer; begin GNATCOLL.Utils.Skip_To_String (S, Index, "GNATLS"); while S (Index) /= ' ' loop Index := Index + 1; end loop; GNATCOLL.Utils.Skip_Blanks (S, Index); First := Index; Last := GNATCOLL.Utils.Line_End (S, Index); Unchecked_Free (Fd); return S (First .. Last); end; end if; Free (Gnatls_Args); return "--"; end Get_Gnat_Version; procedure Initialize (Self : in out Info_Struct; HostName : String := GNAT.Sockets.Host_Name; Port : GNAT.Sockets.Port_Type := Get_Free_Port) is begin Self.Host := (V (HostName), Port); Self.Append ("GNAT", Get_Gnat_Version); end Initialize; end GPR_Tools.Gprslaves.DB;
----------------------------------------------------------------------- -- mat-readers-marshaller -- Marshalling of data in communication buffer -- 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. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with MAT.Types; with MAT.Events; package MAT.Readers.Marshaller is Buffer_Underflow_Error : exception; Buffer_Overflow_Error : exception; -- Get an 8-bit value from the buffer. function Get_Uint8 (Buffer : in Buffer_Ptr) return MAT.Types.Uint8; -- Get a 16-bit value either from big-endian or little endian. function Get_Uint16 (Buffer : in Buffer_Ptr) return MAT.Types.Uint16; -- Get a 32-bit value either from big-endian or little endian. function Get_Uint32 (Buffer : in Buffer_Ptr) return MAT.Types.Uint32; -- Get a 64-bit value either from big-endian or little endian. function Get_Uint64 (Buffer : in Buffer_Ptr) return MAT.Types.Uint64; -- Extract a string from the buffer. The string starts with a byte that -- indicates the string length. function Get_String (Buffer : in Message_Type) return String; -- Extract a string from the buffer. The string starts with a byte that -- indicates the string length. function Get_String (Msg : in Message_Type) return Ada.Strings.Unbounded.Unbounded_String; generic type Target_Type is mod <>; function Get_Target_Value (Msg : in Message_Type; Kind : in MAT.Events.Attribute_Type) return Target_Type; function Get_Target_Size (Msg : in Message_Type; Kind : in MAT.Events.Attribute_Type) return MAT.Types.Target_Size; function Get_Target_Addr (Msg : in Message_Type; Kind : in MAT.Events.Attribute_Type) return MAT.Types.Target_Addr; function Get_Target_Uint32 (Msg : in Message_Type; Kind : in MAT.Events.Attribute_Type) return MAT.Types.Uint32; function Get_Target_Process_Ref (Msg : in Message_Type; Kind : in MAT.Events.Attribute_Type) return MAT.Types.Target_Process_Ref; -- Skip the given number of bytes from the message. procedure Skip (Buffer : in Message_Type; Size : in Natural); end MAT.Readers.Marshaller;
------------------------------------------------------------------------------ -- -- -- ASIS-for-GNAT IMPLEMENTATION COMPONENTS -- -- -- -- A S I S . D A T A _ D E C O M P O S I T I O N . S E T _ G E T -- -- -- -- B o d y -- -- -- -- Copyright (C) 1995-2009, Free Software Foundation, Inc. -- -- -- -- ASIS-for-GNAT is free software; you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 2, or (at your option) any later -- -- version. ASIS-for-GNAT is distributed in the hope that it will be use- -- -- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- -- -- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with ASIS-for-GNAT; see file -- -- COPYING. If not, write to the Free Software Foundation, 51 Franklin -- -- Street, Fifth Floor, Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the -- -- Software Engineering Laboratory of the Swiss Federal Institute of -- -- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the -- -- Scientific Research Computer Center of Moscow State University (SRCC -- -- MSU), Russia, with funding partially provided by grants from the Swiss -- -- National Science Foundation and the Swiss Academy of Engineering -- -- Sciences. ASIS-for-GNAT is now maintained by AdaCore -- -- (http://www.adacore.com). -- -- -- ------------------------------------------------------------------------------ with System; use System; with Asis.Declarations; use Asis.Declarations; with Asis.Definitions; use Asis.Definitions; with Asis.Elements; use Asis.Elements; with Asis.Extensions; use Asis.Extensions; with Asis.Iterator; use Asis.Iterator; with Asis.Set_Get; use Asis.Set_Get; with Asis.Data_Decomposition.Aux; use Asis.Data_Decomposition.Aux; with A4G.Contt; use A4G.Contt; with Atree; use Atree; with Sinfo; use Sinfo; with Einfo; use Einfo; with Nlists; use Nlists; with Uintp; use Uintp; package body Asis.Data_Decomposition.Set_Get is ----------------------- -- Local subprograms -- ----------------------- procedure Set_Derived_Type_Components (E : Asis.Element); -- Provided that E is a derived type definition, this procedure sets in -- Asis_Element_Table the defining identifiers of the components of the -- corresponding type. (For inherited components it sets the corresponding -- implicit names) -------------------- -- Component_Name -- -------------------- function Component_Name (Comp : RC) return Asis.Defining_Name is begin return Comp.Component_Name; end Component_Name; --------------- -- Dimension -- --------------- function Dimension (Comp : AC) return ASIS_Natural is begin return Comp.Dimension; end Dimension; --------------------------- -- Get_Array_Type_Entity -- --------------------------- function Get_Array_Type_Entity (Comp : AC) return Entity_Id is Result : Entity_Id; pragma Warnings (Off, Result); begin -- ???!!! This is a trick needed to reset the right tree! -- ???!!! Should be replaced by a proper tree handling for -- ???!!! array components Result := Node (Comp.Parent_Array_Type); Result := Comp.Array_Type_Entity; return Result; end Get_Array_Type_Entity; --------------------- -- Get_Comp_Entity -- --------------------- function Get_Comp_Entity (Comp : RC) return Entity_Id is begin return R_Node (Component_Name (Comp)); end Get_Comp_Entity; ----------------------- -- Get_Record_Entity -- ----------------------- function Get_Record_Entity (Comp : RC) return Entity_Id is Result : Entity_Id; begin Result := R_Node (Parent_Record_Type (Comp)); while Nkind (Result) /= N_Full_Type_Declaration loop Result := Parent (Result); end loop; Result := Defining_Identifier (Result); return Result; end Get_Record_Entity; --------------------- -- Get_Type_Entity -- --------------------- function Get_Type_Entity (Comp : RC) return Node_Id is Result : Node_Id; begin Result := Etype (R_Node (Component_Name (Comp))); if Ekind (Result) = E_Private_Type then Result := Full_View (Result); end if; return Result; end Get_Type_Entity; ------------------- -- Is_Array_Comp -- ------------------- function Is_Array_Comp (Comp : AC) return Boolean is begin return Comp.Is_Array_Comp; end Is_Array_Comp; function Is_Array_Comp (Comp : RC) return Boolean is begin return Comp.Is_Array_Comp; end Is_Array_Comp; -------------------- -- Is_Record_Comp -- -------------------- function Is_Record_Comp (Comp : AC) return Boolean is begin return Comp.Is_Record_Comp; end Is_Record_Comp; function Is_Record_Comp (Comp : RC) return Boolean is begin return Comp.Is_Record_Comp; end Is_Record_Comp; ----------------------- -- Parent_Array_Type -- ----------------------- function Parent_Array_Type (Comp : AC) return Asis.Declaration is begin return Comp.Parent_Array_Type; end Parent_Array_Type; --------------------- -- Parent_Discrims -- --------------------- function Parent_Discrims (Comp : AC) return Discrim_List is begin if Comp.Parent_Discrims = null then return Null_Discrims; else return Comp.Parent_Discrims.all; end if; end Parent_Discrims; function Parent_Discrims (Comp : RC) return Discrim_List is begin if Comp.Parent_Discrims = null then return Null_Discrims; else return Comp.Parent_Discrims.all; end if; end Parent_Discrims; ------------------------ -- Parent_Record_Type -- ------------------------ function Parent_Record_Type (Comp : RC) return Asis.Declaration is begin return Comp.Parent_Record_Type; end Parent_Record_Type; ------------------------- -- Set_Array_Componnet -- ------------------------- function Set_Array_Componnet (Array_Type_Definition : Element; Enclosing_Record_Component : Record_Component := Nil_Record_Component; Parent_Indication : Element := Nil_Element; Parent_Discriminants : Discrim_List := Null_Discrims; Parent_First_Bit_Offset : ASIS_Natural := 0; Dynamic_Array : Boolean := False) return Array_Component is Comp_Node : Node_Id; Comp_Type_Entity : Node_Id; Result : Array_Component := Nil_Array_Component; Enclosing_Array_Type : Element; Array_Entity : Entity_Id := Empty; -- This should be a type entity defining the enclosed -- array type. This may be an implicit type created by the compiler, -- but the point is that in should contain real ranges for -- this component Dim : Asis.ASIS_Positive; Tmp_Node : Node_Id; Comp_Size : ASIS_Natural; begin Result.Parent_Array_Type := Array_Type_Definition; Result.Parent_Component_Name := Component_Name (Enclosing_Record_Component); Comp_Node := Node (Array_Type_Definition); Comp_Type_Entity := Defining_Identifier (Parent (Comp_Node)); if Ekind (Comp_Type_Entity) in Object_Kind then -- Array definition as a part of an object definition, here we have -- an anonymous array type Comp_Type_Entity := Etype (Etype (Comp_Type_Entity)); Array_Entity := Comp_Type_Entity; end if; Comp_Type_Entity := Component_Type (Comp_Type_Entity); if Ekind (Comp_Type_Entity) = E_Private_Type then Comp_Type_Entity := Full_View (Comp_Type_Entity); end if; Result.Is_Record_Comp := Is_Record_Type (Comp_Type_Entity); Result.Is_Array_Comp := Is_Array_Type (Comp_Type_Entity); if not Is_Nil (Enclosing_Record_Component) then Array_Entity := R_Node (Enclosing_Record_Component.Component_Name); Array_Entity := Etype (Array_Entity); elsif not Is_Nil (Parent_Indication) then Enclosing_Array_Type := Enclosing_Element (Parent_Indication); Enclosing_Array_Type := Enclosing_Element (Enclosing_Array_Type); Enclosing_Array_Type := Enclosing_Element (Enclosing_Array_Type); Array_Entity := Defining_Identifier (R_Node (Enclosing_Array_Type)); Array_Entity := Component_Type (Array_Entity); elsif No (Array_Entity) then Enclosing_Array_Type := Enclosing_Element (Array_Type_Definition); Array_Entity := Defining_Identifier (R_Node (Enclosing_Array_Type)); end if; if Ekind (Array_Entity) = E_Private_Type then Array_Entity := Full_View (Array_Entity); end if; Result.Array_Type_Entity := Array_Entity; -- Computing dimentions and lengths: Tmp_Node := First_Index (Array_Entity); Dim := ASIS_Positive (List_Length (List_Containing (Tmp_Node))); Result.Dimension := Dim; Result.Length := (others => 0); for I in 1 .. Dim loop if Dynamic_Array then Result.Length (I) := 0; else Result.Length (I) := Get_Length (Typ => Array_Entity, Sub => I, Discs => Parent_Discriminants); end if; end loop; Comp_Size := ASIS_Natural (UI_To_Int ( Get_Component_Size (Array_Entity))); Result.Position := Parent_First_Bit_Offset / Storage_Unit; Result.First_Bit := Parent_First_Bit_Offset mod Storage_Unit; Result.Last_Bit := Result.First_Bit + Comp_Size - 1; Result.Size := Comp_Size; Set_Parent_Discrims (Result, Parent_Discriminants); Result.Parent_Context := Get_Current_Cont; Result.Obtained := A_OS_Time; return Result; end Set_Array_Componnet; ------------------------------ -- Set_All_Named_Components -- ------------------------------ procedure Set_All_Named_Components (E : Element) is Discr_Part : Element; begin if Asis.Elements.Type_Kind (E) = A_Derived_Type_Definition then Set_Derived_Type_Components (E); else Discr_Part := Discriminant_Part (Enclosing_Element (E)); Set_Named_Components (Discr_Part, New_List); Set_Named_Components (E, Append); end if; end Set_All_Named_Components; --------------------------------- -- Set_Derived_Type_Components -- --------------------------------- procedure Set_Derived_Type_Components (E : Asis.Element) is Discr_Part : constant Asis.Element := Discriminant_Part (Enclosing_Element (E)); Impl_Comps : constant Asis.Element_List := Implicit_Inherited_Declarations (E); begin Set_Named_Components (Discr_Part, New_List); for J in Impl_Comps'Range loop Asis_Element_Table.Append (Names (Impl_Comps (J)) (1)); end loop; end Set_Derived_Type_Components; -------------------------- -- Set_Named_Components -- -------------------------- procedure Set_Named_Components (E : Element; List_Kind : List_Kinds) is Control : Traverse_Control := Continue; State : No_State := Not_Used; procedure Set_Def_Name (Element : Asis.Element; Control : in out Traverse_Control; State : in out No_State); -- If Element is of A_Defining_Identifier kind, this procedure stores -- it in the Asis Element Table. Used as Pre-Operation procedure Set_Def_Name (Element : Asis.Element; Control : in out Traverse_Control; State : in out No_State) is begin pragma Unreferenced (Control); pragma Unreferenced (State); if Int_Kind (Element) /= A_Defining_Identifier then return; end if; Asis_Element_Table.Append (Element); end Set_Def_Name; procedure Create_Name_List is new Traverse_Element ( State_Information => No_State, Pre_Operation => Set_Def_Name, Post_Operation => No_Op); begin if List_Kind = New_List then Asis_Element_Table.Init; end if; if Is_Nil (E) then return; end if; Create_Name_List (Element => E, Control => Control, State => State); end Set_Named_Components; ------------------------- -- Set_Parent_Discrims -- ------------------------- procedure Set_Parent_Discrims (Comp : in out AC; Discs : Discrim_List) is begin if Discs = Null_Discrims then Comp.Parent_Discrims := null; else Comp.Parent_Discrims := new Discrim_List'(Discs); end if; end Set_Parent_Discrims; ---------------------------- -- Set_Record_Type_Entity -- ---------------------------- procedure Set_Record_Type_Entity (AC : Array_Component) is begin Record_Type_Entity := Get_Array_Type_Entity (AC); Record_Type_Entity := Component_Type (Record_Type_Entity); end Set_Record_Type_Entity; procedure Set_Record_Type_Entity (RC : Record_Component) is begin Record_Type_Entity := R_Node (Component_Name (RC)); Record_Type_Entity := Etype (Record_Type_Entity); end Set_Record_Type_Entity; procedure Set_Record_Type_Entity is begin Record_Type_Entity := Defining_Identifier (Parent (R_Node (Parent_Type_Definition))); end Set_Record_Type_Entity; -------------------------------- -- Set_Parent_Type_Definition -- -------------------------------- procedure Set_Parent_Type_Definition (E : Element) is begin Parent_Type_Definition := E; end Set_Parent_Type_Definition; -------------------------------------- -- Set_Record_Components_From_Names -- -------------------------------------- procedure Set_Record_Components_From_Names (Parent_First_Bit : ASIS_Natural := 0; Data_Stream : Portable_Data := Nil_Portable_Data; Discriminants : Boolean := False) is New_Comp : Asis.List_Index; Component_Name : Element; Comp_Entity : Node_Id; Discs : constant Discrim_List := Build_Discrim_List_If_Data_Presented (Rec => Record_Type_Entity, Data => Data_Stream, Ignore_Discs => Discriminants); Comp_Type_Entity : Node_Id; Comp_First_Bit_Offset : ASIS_Natural; Comp_Position : ASIS_Natural; Comp_Size : ASIS_Natural; begin Record_Component_Table.Init; for I in 1 .. Asis_Element_Table.Last loop Component_Name := Def_N_Table (I); Comp_Entity := Node (Component_Name); if Discs = Null_Discrims or else Component_Present (Comp_Entity, Discs) then Record_Component_Table.Increment_Last; New_Comp := Record_Component_Table.Last; RC_Table (New_Comp).Parent_Record_Type := Parent_Type_Definition; RC_Table (New_Comp).Component_Name := Component_Name; Comp_Type_Entity := Etype (Comp_Entity); if Ekind (Comp_Type_Entity) = E_Private_Type then Comp_Type_Entity := Full_View (Comp_Type_Entity); end if; RC_Table (New_Comp).Is_Record_Comp := Is_Record_Type (Comp_Type_Entity); RC_Table (New_Comp).Is_Array_Comp := Is_Array_Type (Comp_Type_Entity); if Discs = Null_Discrims then RC_Table (New_Comp).Parent_Discrims := null; else RC_Table (New_Comp).Parent_Discrims := new Discrim_List'(Discs); end if; Comp_First_Bit_Offset := Parent_First_Bit + ASIS_Natural (UI_To_Int ( Get_Component_Bit_Offset (Comp_Entity, Discs))); Comp_Position := Comp_First_Bit_Offset / Storage_Unit; Comp_Size := ASIS_Natural (UI_To_Int (Get_Esize (Comp_Entity, Discs))); RC_Table (New_Comp).Position := Comp_Position; RC_Table (New_Comp).First_Bit := Comp_First_Bit_Offset mod Storage_Unit; RC_Table (New_Comp).Last_Bit := RC_Table (New_Comp).First_Bit + Comp_Size - 1; RC_Table (New_Comp).Size := Comp_Size; RC_Table (New_Comp).Parent_Context := Get_Current_Cont; RC_Table (New_Comp).Obtained := A_OS_Time; end if; end loop; end Set_Record_Components_From_Names; end Asis.Data_Decomposition.Set_Get;
with freetype.Face, freeType_C.Binding; package body freetype.charMap is use freeType_C; ----------- -- Utility -- function to_characterCode (From : in Character) return characterCode is begin return Character'Pos (From) + 1; end to_characterCode; --------- -- Forge -- function to_charMap (parent_Face : access Face.item'Class) return Item is use freetype_c.Binding; use type FT_int; Self : Item; begin Self.ftFace := parent_Face.freetype_Face; Self.Err := 0; if FT_Face_Get_charmap (Self.ftFace) = null then if FT_Face_Get_num_charmaps (Self.ftFace) = 0 then Self.Err := 16#96#; return Self; end if; Self.Err := FT_Set_Charmap (Self.ftFace, FT_Face_Get_charmap_at (Self.ftFace, 0)); end if; Self.ftEncoding := FT_Face_Get_charmap (Self.ftFace).Encoding; for i in characterCode'(1) .. max_Precomputed loop Self.charIndexCache (i) := FT_Get_Char_Index (Self.ftFace, FT_ULong (i - 1)); end loop; return Self; end to_charMap; procedure destruct (Self : in out Item) is begin Self.charMap.clear; end destruct; -------------- -- Attributes -- function Encoding (Self : in Item) return FT_Encoding is begin return Self.ftEncoding; end Encoding; function CharMap (Self : access Item; Encoding : in FT_Encoding) return Boolean is use freeType_C.Binding; use type FT_Encoding, FT_Error; begin if Self.ftEncoding = Encoding then Self.Err := 0; return True; end if; Self.Err := FT_Select_Charmap (Self.ftFace, Encoding); if Self.Err = 0 then Self.ftEncoding := Encoding; Self.charMap.clear; end if; return Self.Err = 0; end CharMap; function GlyphListIndex (Self : in Item; Character : in CharacterCode) return GlyphIndex is begin return Self.charMap.Element (Character); exception when Constraint_Error => return -1; end GlyphListIndex; function FontIndex (Self : in Item; Character : in characterCode) return GlyphIndex is use freeType_C.Binding; begin if Character < max_Precomputed then return GlyphIndex (Self.charIndexCache (Character)); end if; return GlyphIndex (FT_Get_Char_Index (Self.ftFace, Character)); end FontIndex; procedure insertIndex (Self : in out Item; Character : in characterCode; containerIndex : in ada.Containers.Count_type) is begin Self.charMap.insert (Character, GlyphIndex (containerIndex)); end insertIndex; function Error (Self : in Item) return FT_Error is begin return Self.Err; end Error; end freetype.charMap;
pragma Ada_2012; pragma Style_Checks (Off); with Interfaces.C; use Interfaces.C; package bits_types_u_sigset_t_h is -- skipped anonymous struct anon_1 type uu_sigset_t_array937 is array (0 .. 15) of aliased unsigned_long; type uu_sigset_t is record uu_val : aliased uu_sigset_t_array937; -- /usr/include/bits/types/__sigset_t.h:7 end record with Convention => C_Pass_By_Copy; -- /usr/include/bits/types/__sigset_t.h:8 end bits_types_u_sigset_t_h;
with Basic_Test_Window; use Basic_Test_Window; with Giza.Context; use Giza.Context; package Test_Images is subtype Parent is Test_Window; type Images_Window is new Parent with private; type Images_Window_Ref is access all Images_Window; overriding procedure On_Displayed (This : in out Images_Window) is null; overriding procedure On_Hidden (This : in out Images_Window) is null; overriding procedure Draw (This : in out Images_Window; Ctx : in out Giza.Context.Class; Force : Boolean := True); private type Images_Window is new Test_Window with null record; end Test_Images;
package Discr31 is type Byte_List_Type is array(Positive range <>) of Integer; type Log_Item_Type(Last : Natural) is record Data : Byte_List_Type(1 .. Last) := (others => 0); Link : Natural := 0; end record; type Packet_Data_Type is access Log_Item_Type; function Log_Item(Packet : in Packet_Data_Type) return Log_Item_Type; end Discr31;
-- Copyright 2016 Steven Stewart-Gallus -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -- implied. See the License for the specific language governing -- permissions and limitations under the License. with System; with Interfaces.C; use Interfaces.C; with Interfaces.C.Strings; with Libc.Stddef; package Pulse.Proplist with Spark_Mode => Off is -- unsupported macro: PA_PROP_MEDIA_NAME "media.name" -- unsupported macro: PA_PROP_MEDIA_TITLE "media.title" -- unsupported macro: PA_PROP_MEDIA_ARTIST "media.artist" -- unsupported macro: PA_PROP_MEDIA_COPYRIGHT "media.copyright" -- unsupported macro: PA_PROP_MEDIA_SOFTWARE "media.software" -- unsupported macro: PA_PROP_MEDIA_LANGUAGE "media.language" -- unsupported macro: PA_PROP_MEDIA_FILENAME "media.filename" -- unsupported macro: PA_PROP_MEDIA_ICON "media.icon" -- unsupported macro: PA_PROP_MEDIA_ICON_NAME "media.icon_name" -- unsupported macro: PA_PROP_MEDIA_ROLE "media.role" -- unsupported macro: PA_PROP_FILTER_WANT "filter.want" -- unsupported macro: PA_PROP_FILTER_APPLY "filter.apply" -- unsupported macro: PA_PROP_FILTER_SUPPRESS "filter.suppress" -- unsupported macro: PA_PROP_EVENT_ID "event.id" -- unsupported macro: PA_PROP_EVENT_DESCRIPTION "event.description" -- unsupported macro: PA_PROP_EVENT_MOUSE_X "event.mouse.x" -- unsupported macro: PA_PROP_EVENT_MOUSE_Y "event.mouse.y" -- unsupported macro: PA_PROP_EVENT_MOUSE_HPOS "event.mouse.hpos" -- unsupported macro: PA_PROP_EVENT_MOUSE_VPOS "event.mouse.vpos" -- unsupported macro: PA_PROP_EVENT_MOUSE_BUTTON "event.mouse.button" -- unsupported macro: PA_PROP_WINDOW_NAME "window.name" -- unsupported macro: PA_PROP_WINDOW_ID "window.id" -- unsupported macro: PA_PROP_WINDOW_ICON "window.icon" -- unsupported macro: PA_PROP_WINDOW_ICON_NAME "window.icon_name" -- unsupported macro: PA_PROP_WINDOW_X "window.x" -- unsupported macro: PA_PROP_WINDOW_Y "window.y" -- unsupported macro: PA_PROP_WINDOW_WIDTH "window.width" -- unsupported macro: PA_PROP_WINDOW_HEIGHT "window.height" -- unsupported macro: PA_PROP_WINDOW_HPOS "window.hpos" -- unsupported macro: PA_PROP_WINDOW_VPOS "window.vpos" -- unsupported macro: PA_PROP_WINDOW_DESKTOP "window.desktop" -- unsupported macro: PA_PROP_WINDOW_X11_DISPLAY "window.x11.display" -- unsupported macro: PA_PROP_WINDOW_X11_SCREEN "window.x11.screen" -- unsupported macro: PA_PROP_WINDOW_X11_MONITOR "window.x11.monitor" -- unsupported macro: PA_PROP_WINDOW_X11_XID "window.x11.xid" -- unsupported macro: PA_PROP_APPLICATION_NAME "application.name" -- unsupported macro: PA_PROP_APPLICATION_ID "application.id" -- unsupported macro: PA_PROP_APPLICATION_VERSION "application.version" -- unsupported macro: PA_PROP_APPLICATION_ICON "application.icon" -- unsupported macro: PA_PROP_APPLICATION_ICON_NAME "application.icon_name" -- unsupported macro: PA_PROP_APPLICATION_LANGUAGE "application.language" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_ID "application.process.id" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_BINARY "application.process.binary" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_USER "application.process.user" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_HOST "application.process.host" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_MACHINE_ID "application.process.machine_id" -- unsupported macro: PA_PROP_APPLICATION_PROCESS_SESSION_ID "application.process.session_id" -- unsupported macro: PA_PROP_DEVICE_STRING "device.string" -- unsupported macro: PA_PROP_DEVICE_API "device.api" -- unsupported macro: PA_PROP_DEVICE_DESCRIPTION "device.description" -- unsupported macro: PA_PROP_DEVICE_BUS_PATH "device.bus_path" -- unsupported macro: PA_PROP_DEVICE_SERIAL "device.serial" -- unsupported macro: PA_PROP_DEVICE_VENDOR_ID "device.vendor.id" -- unsupported macro: PA_PROP_DEVICE_VENDOR_NAME "device.vendor.name" -- unsupported macro: PA_PROP_DEVICE_PRODUCT_ID "device.product.id" -- unsupported macro: PA_PROP_DEVICE_PRODUCT_NAME "device.product.name" -- unsupported macro: PA_PROP_DEVICE_CLASS "device.class" -- unsupported macro: PA_PROP_DEVICE_FORM_FACTOR "device.form_factor" -- unsupported macro: PA_PROP_DEVICE_BUS "device.bus" -- unsupported macro: PA_PROP_DEVICE_ICON "device.icon" -- unsupported macro: PA_PROP_DEVICE_ICON_NAME "device.icon_name" -- unsupported macro: PA_PROP_DEVICE_ACCESS_MODE "device.access_mode" -- unsupported macro: PA_PROP_DEVICE_MASTER_DEVICE "device.master_device" -- unsupported macro: PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE "device.buffering.buffer_size" -- unsupported macro: PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE "device.buffering.fragment_size" -- unsupported macro: PA_PROP_DEVICE_PROFILE_NAME "device.profile.name" -- unsupported macro: PA_PROP_DEVICE_INTENDED_ROLES "device.intended_roles" -- unsupported macro: PA_PROP_DEVICE_PROFILE_DESCRIPTION "device.profile.description" -- unsupported macro: PA_PROP_MODULE_AUTHOR "module.author" -- unsupported macro: PA_PROP_MODULE_DESCRIPTION "module.description" -- unsupported macro: PA_PROP_MODULE_USAGE "module.usage" -- unsupported macro: PA_PROP_MODULE_VERSION "module.version" -- unsupported macro: PA_PROP_FORMAT_SAMPLE_FORMAT "format.sample_format" -- unsupported macro: PA_PROP_FORMAT_RATE "format.rate" -- unsupported macro: PA_PROP_FORMAT_CHANNELS "format.channels" -- unsupported macro: PA_PROP_FORMAT_CHANNEL_MAP "format.channel_map" -- unsupported macro: PA_UPDATE_SET PA_UPDATE_SET -- unsupported macro: PA_UPDATE_MERGE PA_UPDATE_MERGE -- unsupported macro: PA_UPDATE_REPLACE PA_UPDATE_REPLACE type pa_proplist is limited private; type pa_proplist_access is access all pa_proplist; function pa_proplist_new return pa_proplist_access; -- /usr/include/pulse/proplist.h:277 pragma Import (C, pa_proplist_new, "pa_proplist_new"); procedure pa_proplist_free (p : pa_proplist_access); -- /usr/include/pulse/proplist.h:280 pragma Import (C, pa_proplist_free, "pa_proplist_free"); function pa_proplist_key_valid (key : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/pulse/proplist.h:283 pragma Import (C, pa_proplist_key_valid, "pa_proplist_key_valid"); function pa_proplist_sets (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr; value : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/pulse/proplist.h:289 pragma Import (C, pa_proplist_sets, "pa_proplist_sets"); function pa_proplist_setp (p : pa_proplist_access; pair : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/pulse/proplist.h:297 pragma Import (C, pa_proplist_setp, "pa_proplist_setp"); function pa_proplist_setf (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr; format : Interfaces.C.Strings.chars_ptr -- , ... ) return int; -- /usr/include/pulse/proplist.h:304 pragma Import (C, pa_proplist_setf, "pa_proplist_setf"); function pa_proplist_set (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr; data : System.Address; nbytes : Libc.Stddef.size_t) return int; -- /usr/include/pulse/proplist.h:309 pragma Import (C, pa_proplist_set, "pa_proplist_set"); function pa_proplist_gets (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings .chars_ptr; -- /usr/include/pulse/proplist.h:315 pragma Import (C, pa_proplist_gets, "pa_proplist_gets"); function pa_proplist_get (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr; data : System.Address; nbytes : access Libc.Stddef.size_t) return int; -- /usr/include/pulse/proplist.h:322 pragma Import (C, pa_proplist_get, "pa_proplist_get"); type pa_update_mode is (PA_UPDATE_SET, PA_UPDATE_MERGE, PA_UPDATE_REPLACE); pragma Convention (C, pa_update_mode); -- /usr/include/pulse/proplist.h:325 subtype pa_update_mode_t is pa_update_mode; procedure pa_proplist_update (p : pa_proplist_access; mode : pa_update_mode_t; other : System.Address); -- /usr/include/pulse/proplist.h:349 pragma Import (C, pa_proplist_update, "pa_proplist_update"); function pa_proplist_unset (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/pulse/proplist.h:353 pragma Import (C, pa_proplist_unset, "pa_proplist_unset"); function pa_proplist_unset_many (p : pa_proplist_access; keys : System.Address) return int; -- /usr/include/pulse/proplist.h:360 pragma Import (C, pa_proplist_unset_many, "pa_proplist_unset_many"); function pa_proplist_iterate (p : pa_proplist_access; state : System.Address) return Interfaces.C.Strings .chars_ptr; -- /usr/include/pulse/proplist.h:371 pragma Import (C, pa_proplist_iterate, "pa_proplist_iterate"); function pa_proplisto_string (p : pa_proplist_access) return Interfaces.C.Strings .chars_ptr; -- /usr/include/pulse/proplist.h:377 pragma Import (C, pa_proplisto_string, "pa_proplisto_string"); function pa_proplisto_string_sep (p : pa_proplist_access; sep : Interfaces.C.Strings.chars_ptr) return Interfaces.C.Strings .chars_ptr; -- /usr/include/pulse/proplist.h:382 pragma Import (C, pa_proplisto_string_sep, "pa_proplisto_string_sep"); function pa_proplist_from_string (str : Interfaces.C.Strings.chars_ptr) return System.Address; -- /usr/include/pulse/proplist.h:386 pragma Import (C, pa_proplist_from_string, "pa_proplist_from_string"); function pa_proplist_contains (p : pa_proplist_access; key : Interfaces.C.Strings.chars_ptr) return int; -- /usr/include/pulse/proplist.h:390 pragma Import (C, pa_proplist_contains, "pa_proplist_contains"); procedure pa_proplist_clear (p : pa_proplist_access); -- /usr/include/pulse/proplist.h:393 pragma Import (C, pa_proplist_clear, "pa_proplist_clear"); function pa_proplist_copy (p : pa_proplist_access) return System.Address; -- /usr/include/pulse/proplist.h:397 pragma Import (C, pa_proplist_copy, "pa_proplist_copy"); function pa_proplist_size (p : pa_proplist_access) return unsigned; -- /usr/include/pulse/proplist.h:400 pragma Import (C, pa_proplist_size, "pa_proplist_size"); function pa_proplist_isempty (p : pa_proplist_access) return int; -- /usr/include/pulse/proplist.h:403 pragma Import (C, pa_proplist_isempty, "pa_proplist_isempty"); function pa_proplist_equal (a : System.Address; b : System.Address) return int; -- /usr/include/pulse/proplist.h:407 pragma Import (C, pa_proplist_equal, "pa_proplist_equal"); private type pa_proplist is limited record null; end record; end Pulse.Proplist;
-- { dg-do compile } with deref2; procedure deref3 is Obj : aliased deref2.NT; begin deref2.PT_View (Obj'Access).Op; Obj.PT_View.all.Op; Obj.PT_View.Op; end;
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This package provides an interface to the on-board "window watchdog" -- provided by the STM32F4 family. -- Important: see Figure 215 in RM0090, the STM32 reference manual, -- illustrating the watchdog behavior and significant events. -- Note that time is increasing to the right in the figure. -- www.st.com/resource/en/reference_manual/DM00031020.pdf package STM32.WWDG is -- the Window Watchdog pragma Elaborate_Body; procedure Enable_Watchdog_Clock; procedure Reset_Watchdog; -- Resets the peripheral using the RCC type Prescalers is (Divider_1, Divider_2, Divider_4, Divider_8) with Size => 2; -- These prescalers are clock frequency dividers, with numeric divisor -- values corresponding to the digits in the names. The dividers are used -- to determine the watchdog counter clock frequency driving the countdown -- timer. -- -- The frequency is computed as follows: -- PCLK1 / 4096 / divider-value -- For example, assuming PCLK1 of 45MHz and Divider_8, we'd get: -- 45_000_000 / 4096 / 8 => 1373 Hz -- -- The frequency can be used to calculate the time span values for the -- refresh window, for example. See the demo program for doing that. procedure Set_Watchdog_Prescaler (Value : Prescalers); -- Set the divider used to derive the watchdog counter clock frequency -- driving the countdown timer. -- -- Note that the watchdog counter only counts down to 16#40# (64) before -- triggering the reset, and the upper limit for the counter value is 127, -- so there is a relatively limited number of counts available for the -- refresh window to be open. Therefore, the frequency at which the -- watchdog clock drives the counter is a significant factor in the -- total possible time span for the refresh window. subtype Downcounter is UInt7 range 16#40# .. UInt7'Last; -- 16#40# is the last value of the countdown counter prior to a reset. When -- the count goes to 16#3F# the high-oder bit being cleared triggers the -- reset (if the watchdog is activated). Thus we never want to specify a -- counter value less than 16#40#. procedure Set_Watchdog_Window (Window_Start_Count : Downcounter); -- Set the value of the countdown counter for when the refresh window is -- to open. In figure 215, this is the counter value at the start of the -- "refresh allowed" interval. It is an arbitrary, user-defined value. -- -- The last counter value prior to reset is always 64 (16#40#). At 16#3F# -- the high-order counter bit (T6 in the figure) clears, causing the -- watchdog to trigger the system reset (when activated). -- -- To prevent a reset, the watchdog counter must be refreshed by the -- application but only when the counter is lower than Window_Start_Count -- and greater than 16#3F#. procedure Activate_Watchdog (New_Count : Downcounter); -- Set the watchdog counter to begin counting down from New_Count and -- activate the watchdog. In the figure, this is the counter value at -- the start of the "refresh not allowed" interval. It is an arbitrary, -- user-defined value. -- -- Once activated there is no way to deactivate the watchdog other -- than a system reset. -- -- Note that, as a "window" watchdog, the period in which the counter can -- be refreshed does not open immediately upon activating the watchdog. procedure Refresh_Watchdog_Counter (New_Count : Downcounter); -- Set the counter to begin counting down from New_Count. Used to refresh -- the watchdog counter in order to prevent the watchdog timeout. In the -- figure, this is the counter value at the start of the "refresh not -- allowed" interval. It is an arbitrary, user-defined value, but is likely -- the same value passed to Activate_Watchdog. The difference between this -- routine and the activating routine is soley the activation. procedure Enable_Early_Wakeup_Interrupt; -- When enabled, an interrupt occurs whenever the counter reaches the value -- 16#40#, ie one counter decrement period before the counter causes a -- system reset. Once enabled, this interrupt can only be disabled by -- hardware after a system reset. function Early_Wakeup_Interrupt_Indicated return Boolean with Inline; -- Set by hardware when the counter has reached the value 16#40#, the -- counter value just prior to the reset being triggered. Always set, -- even if the interrupt is not enabled. procedure Clear_Early_Wakeup_Interrupt with Inline; -- Clears the status bit function WWDG_Reset_Indicated return Boolean; -- Indicated in the RCC peripheral procedure Clear_WWDG_Reset_Flag; -- In the RCC peripheral procedure Reset_System; -- an immediate software-driven reset, just as if the count hit 16#3F# end STM32.WWDG;
package body Protected_Body_Declaration is protected body T is function func return Integer is begin return 0; end func; end T; end Protected_Body_Declaration;
with Ada.Finalization; with kv.avm.Registers; with kv.avm.Control; package kv.avm.Capabilities is type Capability_Interface is interface; type Capability_Access is access all Capability_Interface'CLASS; procedure Execute (Self : in out Capability_Interface; Machine : in out kv.avm.Control.Control_Interface'CLASS; Input : in kv.avm.Registers.Register_Type; Output : out kv.avm.Registers.Register_Type; Status : out kv.avm.Control.Status_Type) is abstract; type Capabilities_Type is new Ada.Finalization.Controlled with private; overriding procedure Initialize (Self : in out Capabilities_Type); overriding procedure Adjust (Self : in out Capabilities_Type); overriding procedure Finalize (Self : in out Capabilities_Type); function Has(Self : Capabilities_Type; Key : String) return Boolean; function Lookup(Self : Capabilities_Type; Key : String) return Capability_Access; procedure Add (Self : in out Capabilities_Type; Key : in String; Value : in Capability_Access); procedure Execute (Self : in Capabilities_Type; Key : in String; Machine : in out kv.avm.Control.Control_Interface'CLASS; Input : in kv.avm.Registers.Register_Type; Output : out kv.avm.Registers.Register_Type; Status : out kv.avm.Control.Status_Type); private type Capabilities_Reference_Counter_Type; type Capabilities_Reference_Counter_Access is access all Capabilities_Reference_Counter_Type; type Capabilities_Type is new Ada.Finalization.Controlled with record Ref : Capabilities_Reference_Counter_Access; end record; end kv.avm.Capabilities;
-- $Id: StringM.mi,v 1.5 1993/08/18 15:06:51 grosch rel $ -- $Log: StringM.mi,v $ -- Ich, Doktor Josef Grosch, Informatiker, Sept. 1994 with DynArray, Strings, Text_Io; use Strings, Text_Io; package body StringM is package Int_Io is new Integer_IO (Integer); use Int_Io; package Char_DA is new DynArray (Character); use Char_DA; InitialMemorySize: constant Integer := 1024 * 16; MemoryPtr : Char_DA.FlexArray; MemorySize : Integer; MemorySpaceLeft : Integer; MemoryFreePtr : Integer; function PutString (s: tString) return tStringRef is StrLength : Integer := Length (s); NeededSpace : Integer := StrLength + 2; OldMemorySize : Integer; StartPtr : Integer := MemoryFreePtr; t : String (1 .. StrLength) := To_String (s); begin while MemorySpaceLeft < NeededSpace loop OldMemorySize := MemorySize; ExtendArray (MemoryPtr, MemorySize); MemorySpaceLeft := MemorySpaceLeft + (MemorySize - OldMemorySize); end loop; MemoryPtr (MemoryFreePtr) := Character'Val (StrLength / 256); MemoryFreePtr := MemoryFreePtr + 1; MemoryPtr (MemoryFreePtr) := Character'Val (StrLength mod 256); for i in 1 .. StrLength loop MemoryPtr (MemoryFreePtr + i) := t (i); end loop; MemoryFreePtr := MemoryFreePtr + StrLength + 1; MemorySpaceLeft := MemorySpaceLeft - NeededSpace; return StartPtr; end PutString; function GetString (r: tStringRef) return tString is StrLength : Integer := Length (r); s : String (1 .. StrLength); t : tString; begin for i in 1 .. StrLength loop s (i) := MemoryPtr (r + i + 1); end loop; To_tString (s, t); return t; end GetString; function Length (r: tStringRef) return Integer is begin return Character'Pos (MemoryPtr (r)) * 256 + Character'Pos (MemoryPtr (r+1)); end Length; function IsEqual (r: tStringRef; s: tString) return Boolean is begin return GetString (r) = s; end IsEqual; procedure WriteString (f: File_Type; r: tStringRef) is begin for i in r + 2 .. r + 1 + Length (r) loop Put (f, MemoryPtr (i)); end loop; end WriteString; procedure WriteStringMemory is StringPtr : Integer; begin StringPtr := 0; while StringPtr < MemoryFreePtr loop Put (Standard_Output, StringPtr, 5); Put (Standard_Output, ' '); WriteString (Standard_Output, StringPtr); New_Line (Standard_Output); StringPtr := StringPtr + Length (StringPtr) + 2; end loop; New_Line (Standard_Output); Put (Standard_Output, StringPtr, 5); Put (Standard_Output, " Bytes"); New_Line (Standard_Output); end WriteStringMemory; procedure InitStringMemory is begin MemorySpaceLeft := MemorySize; MemoryFreePtr := 0; end InitStringMemory; begin MemorySize := InitialMemorySize; MakeArray (MemoryPtr, MemorySize); InitStringMemory; end StringM;
with Ada.Text_IO, Ada.Numerics.Generic_Elementary_Functions; procedure Mean_Angles is type X_Real is digits 4; -- or more digits for improved precision subtype Real is X_Real range 0.0 .. 360.0; -- the range of interest type Angles is array(Positive range <>) of Real; procedure Put(R: Real) is package IO is new Ada.Text_IO.Float_IO(Real); begin IO.Put(R, Fore => 3, Aft => 2, Exp => 0); end Put; function Mean_Angle(A: Angles) return Real is Sin_Sum, Cos_Sum: X_Real := 0.0; -- X_Real since sums might exceed 360.0 package Math is new Ada.Numerics.Generic_Elementary_Functions(Real); use Math; begin for I in A'Range loop Sin_Sum := Sin_Sum + Sin(A(I), Cycle => 360.0); Cos_Sum := Cos_Sum + Cos(A(I), Cycle => 360.0); end loop; return Arctan(Sin_Sum / X_Real(A'Length), Cos_Sum / X_Real(A'Length), Cycle => 360.0); -- may raise Ada.Numerics.Argument_Error if inputs are -- numerically instable, e.g., when Cos_Sum is 0.0 end Mean_Angle; begin Put(Mean_Angle((10.0, 20.0, 30.0))); Ada.Text_IO.New_Line; -- 20.00 Put(Mean_Angle((10.0, 350.0))); Ada.Text_IO.New_Line; -- 0.00 Put(Mean_Angle((90.0, 180.0, 270.0, 360.0))); -- Ada.Numerics.Argument_Error! end Mean_Angles;
----------------------------------------------------------------------- -- babel-files-maps -- Hash maps for files and directories -- Copyright (C) 2014 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.Containers.Hashed_Maps; with Util.Strings; package Babel.Files.Maps is -- Babel.Base.Get_File_Map (Directory, File_Map); -- Babel.Base.Get_Directory_Map (Directory, Dir_Map); -- File_Map.Find (New_File); -- Dir_Map.Find (New_File); -- Hash string -> File package File_Maps is new Ada.Containers.Hashed_Maps (Key_Type => Util.Strings.Name_Access, Element_Type => File_Type, Hash => Util.Strings.Hash, Equivalent_Keys => Util.Strings.Equivalent_Keys, "=" => "="); subtype File_Map is File_Maps.Map; subtype File_Cursor is File_Maps.Cursor; -- Find the file with the given name in the file map. function Find (From : in File_Map; Name : in String) return File_Cursor; -- Find the file with the given name in the file map. function Find (From : in File_Map; Name : in String) return File_Type; -- Insert the file in the file map. procedure Insert (Into : in out File_Map; File : in File_Type); -- Hash string -> Directory package Directory_Maps is new Ada.Containers.Hashed_Maps (Key_Type => Util.Strings.Name_Access, Element_Type => Directory_Type, Hash => Util.Strings.Hash, Equivalent_Keys => Util.Strings.Equivalent_Keys, "=" => "="); subtype Directory_Map is Directory_Maps.Map; subtype Directory_Cursor is Directory_Maps.Cursor; -- Find the directory with the given name in the directory map. function Find (From : in Directory_Map; Name : in String) return Directory_Cursor; -- Find the directory with the given name in the directory map. function Find (From : in Directory_Map; Name : in String) return Directory_Type; procedure Add_File (Dirs : in out Directory_Map; Files : in out File_Map; Path : in String; File : out File_Type); type Differential_Container is new Babel.Files.Default_Container with private; -- Add the file with the given name in the container. overriding procedure Add_File (Into : in out Differential_Container; Element : in File_Type); -- Add the directory with the given name in the container. overriding procedure Add_Directory (Into : in out Differential_Container; Element : in Directory_Type); -- Create a new file instance with the given name in the container. overriding function Create (Into : in Differential_Container; Name : in String) return File_Type; -- Create a new directory instance with the given name in the container. overriding function Create (Into : in Differential_Container; Name : in String) return Directory_Type; -- Find the file with the given name in this file container. -- Returns NO_FILE if the file was not found. overriding function Find (From : in Differential_Container; Name : in String) return File_Type; -- Find the directory with the given name in this file container. -- Returns NO_DIRECTORY if the directory was not found. overriding function Find (From : in Differential_Container; Name : in String) return Directory_Type; -- Set the directory object associated with the container. overriding procedure Set_Directory (Into : in out Differential_Container; Directory : in Directory_Type); -- Prepare the differential container by setting up the known files and known -- directories. The <tt>Update</tt> procedure is called to give access to the -- maps that can be updated. procedure Prepare (Container : in out Differential_Container; Update : access procedure (Files : in out File_Map; Dirs : in out Directory_Map)); private type Differential_Container is new Babel.Files.Default_Container with record Known_Files : File_Map; Known_Dirs : Directory_Map; end record; end Babel.Files.Maps;
with gel.Keyboard, lace.Event, lace.Subject; package gel.Mouse with remote_Types -- -- Provides an interface to a mouse. -- is type Item is limited interface and lace.Subject.item; type View is access all Item'class; ---------- --- Events -- type Button_Id is range 1 .. 5; type Site is new math.Integers (1 .. 2); -- Window pixel (x,y) site. type button_press_Event is new lace.Event.item with record Button : button_Id; modifier_Set : keyboard.modifier_Set; Site : mouse.Site; end record; type button_release_Event is new lace.Event.item with record Button : button_Id; modifier_Set : keyboard.modifier_Set; Site : mouse.Site; end record; type motion_Event is new lace.Event.item with record Site : mouse.Site; end record; -------------- --- Attributes -- -- Nil. -------------- --- Operations -- procedure emit_button_press_Event (Self : in out Item'Class; Button : in mouse.button_Id; Modifiers : in keyboard.modifier_Set; Site : in mouse.Site); procedure emit_button_release_Event (Self : in out Item'Class; Button : in mouse.button_Id; Modifiers : in keyboard.modifier_Set; Site : in mouse.Site); procedure emit_motion_Event (Self : in out Item'Class; Site : in mouse.Site); end gel.Mouse;
-- This package has been generated automatically by GNATtest. -- Do not edit any part of it, see GNATtest documentation for more details. -- begin read only with Gnattest_Generated; package Goals.Test_Data.Tests is type Test is new GNATtest_Generated.GNATtest_Standard.Goals.Test_Data .Test with null record; procedure Test_GoalText_c541ba_7395a3(Gnattest_T: in out Test); -- goals.ads:96:4:GoalText:Test_GoalText procedure Test_ClearCurrentGoal_cb9255_59ac81(Gnattest_T: in out Test); -- goals.ads:106:4:ClearCurrentGoal:Test_ClearCurrentGoal procedure Test_UpdateGoal_cfe7db_0e93ce(Gnattest_T: in out Test); -- goals.ads:119:4:UpdateGoal:Test_UpdateGoal end Goals.Test_Data.Tests; -- end read only
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" private with Glfw.Enums; package Glfw.Events.Joysticks is use type Interfaces.C.C_float; -- GLFW supports up to 16 joysticks; they are indexed from 1 to 16. type Joystick_Index is range 1 .. 16; -- A Joystick object will link to the first joystick by default. type Joystick is tagged private; type Axis_Position is new Interfaces.C.C_float range -1.0 .. 1.0; type Axis_Positions is array (Positive range <>) of Axis_Position; function Index (Source : Joystick) return Joystick_Index; procedure Set_Index (Target : in out Joystick; Value : Joystick_Index); function Present (Source : Joystick) return Boolean; function Num_Axis (Source : Joystick) return Natural; function Num_Buttons (Source : Joystick) return Natural; procedure Get_Positions (Source : Joystick; Values : in out Axis_Positions); procedure Get_Buttons (Source : Joystick; Values : in out Button_States); private type Joystick is tagged record Raw_Index : Enums.Joystick_ID := Enums.Joystick_1; end record; end Glfw.Events.Joysticks;
------------------------------------------------------------------------------ -- -- -- GNAT EXAMPLE -- -- -- -- Copyright (C) 2016, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- -- Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Real_Time; use Ada.Real_Time; with Ada.Text_IO; use Ada.Text_IO; pragma Warnings (Off); with System.SF2.GPIO; use System.SF2.GPIO; pragma Warnings (On); procedure Blinky is DS3 : constant GPIO_Num := 1; DS4 : constant GPIO_Num := 2; Dot_Time : constant Time_Span := Milliseconds (50); Dash_Time : constant Time_Span := 3 * Dot_Time; --------- -- Dot -- --------- procedure Dot is begin Set (DS3); Set (DS4); delay until Clock + Dot_Time; Clear (DS3); Clear (DS4); delay until Clock + Dot_Time; end Dot; ---------- -- Dash -- ---------- procedure Dash is begin Set (DS3); Set (DS4); delay until Clock + Dash_Time; Clear (DS3); Clear (DS4); delay until Clock + Dot_Time; end Dash; ----------- -- Morse -- ----------- procedure Morse (S : String) is begin for J in S'Range loop case S (J) is when 'a' => Dot; Dash; when 'b' => Dash; Dot; Dot; Dot; when 'c' => Dash; Dot; Dash; Dot; when 'd' => Dash; Dot; Dot; when 'e' => Dot; when 'f' => Dot; Dot; Dash; Dot; when 'g' => Dash; Dash; Dot; when 'h' => Dot; Dot; Dot; Dot; when 'i' => Dot; Dot; when 'j' => Dot; Dash; Dash; Dash; when 'k' => Dash; Dot; Dash; when 'l' => Dot; Dash; Dot; Dot; when 'm' => Dash; Dash; when 'n' => Dash; Dot; when 'o' => Dash; Dash; Dash; when 'p' => Dot; Dash; Dash; Dot; when 'q' => Dash; Dash; Dot; Dash; when 'r' => Dot; Dash; Dot; when 's' => Dot; Dot; Dot; when 't' => Dash; when 'u' => Dot; Dot; Dash; when 'v' => Dot; Dot; Dot; Dash; when 'w' => Dot; Dash; Dash; when 'x' => Dash; Dot; Dot; Dash; when 'y' => Dash; Dot; Dash; Dash; when 'z' => Dash; Dash; Dot; Dot; when '1' => Dot; Dash; Dash; Dash; Dash; when '2' => Dot; Dot; Dash; Dash; Dash; when '3' => Dot; Dot; Dot; Dash; Dash; when '4' => Dot; Dot; Dot; Dot; Dash; when '5' => Dot; Dot; Dot; Dot; Dot; when '6' => Dash; Dot; Dot; Dot; Dot; when '7' => Dash; Dash; Dot; Dot; Dot; when '8' => Dash; Dash; Dash; Dot; Dot; when '9' => Dash; Dash; Dash; Dash; Dot; when '0' => Dash; Dash; Dash; Dash; Dash; when others => null; end case; if S (J) in 'a' .. 'z' or else S (J) in '0' .. '9' then delay until Clock + 2 * Dot_Time; elsif S (J) = ' ' then delay until Clock + 6 * Dot_Time; end if; Put (S (J)); end loop; New_Line; end Morse; begin GPIO_Init; GPIO_Config (DS3, Output_Mode); GPIO_Config (DS4, Output_Mode); loop Morse ("hello world"); delay until Clock + Milliseconds (2000); end loop; end Blinky;
pragma License (Unrestricted); -- with System; -- with Ada.Task_Identification; -- See C.7.1 package Ada.Dynamic_Priorities is pragma Preelaborate; -- procedure Set_Priority ( -- Priority : System.Any_Priority; -- T : Task_Identification.Task_Id := Task_Identification.Current_Task); -- function Get_Priority ( -- T : Task_Identification.Task_Id := Task_Identification.Current_Task) -- return System.Any_Priority; end Ada.Dynamic_Priorities;
-- SPDX-FileCopyrightText: 2021 Max Reznik <reznikmm@gmail.com> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with Ada.Containers.Hashed_Maps; with Program.Elements; with Program.Element_Vectors; with Lace.Element_Flat_Kinds; generic type Property_Name is (<>); type Property_Value is private; type Abstract_Context; type Variant_Kind is private; with function Hash (Value : Variant_Kind) return Ada.Containers.Hash_Type is <>; package Lace.Generic_Engines is pragma Preelaborate; type Engine (Context : access Abstract_Context) is tagged limited private; function Get_Property (Self : access Engine; Element : Program.Elements.Element_Access; Name : Property_Name) return Property_Value; -- Evaluate a property (with Name) for given Element function Get_Property (Self : access Engine; List : Program.Element_Vectors.Element_Vector_Access; Name : Property_Name; Empty : Property_Value; Sum : access function (Left, Right : Property_Value) return Property_Value) return Property_Value; -- Evaluate a property (with Name) for each Element and aggregate results -- with Sum function taking Empty as a start value. type Formula_Access is access function (Engine : access Abstract_Context; Element : Program.Elements.Element_Access; Name : Property_Name) return Property_Value; procedure Register_Formula (Self : in out Engine; Kind : Lace.Element_Flat_Kinds.Element_Flat_Kind; Name : Property_Name; Formula : not null Formula_Access); -- Register given function (Formula) as a calculator given property (with -- Name) for elements of given Kind. No selector could be set if there is -- a formula. type Selector_Access is access function (Engine : access Abstract_Context; Element : Program.Elements.Element_Access; Name : Property_Name) return Variant_Kind; procedure Register_Selector (Self : in out Engine; Kind : Lace.Element_Flat_Kinds.Element_Flat_Kind; Name : Property_Name; Selector : not null Selector_Access); -- Turn property with Name to multivariant form. Use Selector to choose -- a variant for particular Element. No formula could be set if there is -- a selector. procedure Register_Variant (Self : in out Engine; Kind : Lace.Element_Flat_Kinds.Element_Flat_Kind; Name : Property_Name; Variant : Variant_Kind; Formula : access function (Engine : access Abstract_Context; Element : Program.Elements.Element_Access; Name : Property_Name) return Property_Value); -- Register given function (Formula) as a calculator of the property -- Variant. The property should have a selector. private type Property_Key is record Kind : Lace.Element_Flat_Kinds.Element_Flat_Kind; Name : Property_Name; end record; function Hash (Value : Property_Key) return Ada.Containers.Hash_Type; type Property_Descriptor is record Formula : Formula_Access; -- Formula, only if no variant selector Selector : Selector_Access; -- Selector, only if no formula end record; package Property_Descriptor_Maps is new Ada.Containers.Hashed_Maps (Key_Type => Property_Key, Element_Type => Property_Descriptor, Hash => Hash, Equivalent_Keys => "=", "=" => "="); type Varian_Key is record Property : Property_Key; Variant : Variant_Kind; end record; function Hash (Value : Varian_Key) return Ada.Containers.Hash_Type; package Varian_Descriptor_Maps is new Ada.Containers.Hashed_Maps (Key_Type => Varian_Key, Element_Type => Formula_Access, Hash => Hash, Equivalent_Keys => "=", "=" => "="); type Engine (Context : access Abstract_Context) is tagged limited record Descriptor : Property_Descriptor_Maps.Map; Varian : Varian_Descriptor_Maps.Map; end record; end Lace.Generic_Engines;
pragma Ada_2012; with Ada.Command_Line; with System.Address_To_Access_Conversions; with Interfaces.C.Strings; with Pulse_Def_H, Pulse_Sample_H; use Ada; package body Pulsada.Thin is ---------- -- Open -- ---------- procedure Open (Session : in out Session_Type; Rate : Sampling_Frequency; N_Channels : Channel_Index; Application_Name : String := ""; Stream_Name : String := "") is use Pulse_Simple_H; use Pulse_Sample_H; use Interfaces; function Use_Default (X, Default : String) return C.Strings.Chars_Ptr is (C.Strings.New_String ((if X = "" then Default else X))); Sample_Spec : aliased Pa_Sample_Spec := (Format => PA_SAMPLE_S16LE, Rate => Unsigned_32 (Rate), Channels => Unsigned_8 (N_Channels)); begin Session.S := Pa_Simple_New (Server => C.Strings.Null_Ptr, Name => Use_Default (Application_Name, Command_Line.Command_Name), Dir => Pulse_Def_H.PA_STREAM_RECORD, Dev => C.Strings.Null_Ptr, Stream_Name => Use_Default (Stream_Name, "stream"), Ss => Sample_Spec'Access, Map => null, Attr => null, Error => null); end Open; ---------- -- Read -- ---------- procedure Read (Session : in out Session_Type; Data : Frame_Block) is use Interfaces; use Pulse_Simple_H; use type Interfaces.C.Int; pragma Warnings (Off); package Convert is new System.Address_To_Access_Conversions (Block_Buffer); function Size (Data : Frame_Block) return C.Size_T is (C.Size_T (Integer (Data.N_Frames) * Integer (Data.N_Channels) * 2)); Err : aliased C.Int; begin if Pa_Simple_Read (S => Session.S, Data => Convert.To_Address (Convert.Object_Pointer (Data.Data)), Bytes => Size (Data), Error => Err'Access) < 0 then null; end if; end Read; ----------- -- Close -- ----------- procedure Close (Session : in out Session_Type) is begin Pulse_Simple_H.Pa_Simple_Free (Session.S); end Close; ---------------- -- Initialize -- ---------------- overriding procedure Initialize (Obj : in out Session_Type) is begin Obj.S := null; end Initialize; -------------- -- Finalize -- -------------- overriding procedure Finalize (Obj : in out Session_Type) is begin Obj.Close; end Finalize; end Pulsada.Thin;
package body afrl.cmasi.keepInZone is function getFullLmcpTypeName(this : KeepInZone) return String is ("afrl.cmasi.keepInZone.KeepInZone"); function getLmcpTypeName(this : KeepInZone) return String is ("KeepInZone"); function getLmcpType (this : KeepInZone) return UInt32_t is (CmasiEnum'Pos(KEEPINZONE_ENUM)); end afrl.cmasi.keepInZone;
----------------------------------------------------------------------- -- ado-c -- Support for driver implementation -- 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 Interfaces.C; with Interfaces.C.Strings; with Ada.Finalization; with Ada.Strings.Unbounded; with Ada.Unchecked_Conversion; with System; package ADO.C is type String_Ptr is limited private; -- Convert a string to a C string. function To_String_Ptr (S : String) return String_Ptr; -- Convert an unbounded string to a C string. function To_String_Ptr (S : Ada.Strings.Unbounded.Unbounded_String) return String_Ptr; -- Get the C string pointer. function To_C (S : String_Ptr) return Interfaces.C.Strings.chars_ptr; -- Set the string procedure Set_String (S : in out String_Ptr; Value : in String); function To_chars_ptr is new Ada.Unchecked_Conversion (System.Address, Interfaces.C.Strings.chars_ptr); private use Interfaces.C; type String_Ptr is new Ada.Finalization.Limited_Controlled with record Ptr : Strings.chars_ptr := Interfaces.C.Strings.Null_Ptr; end record; -- Reclaim the storage held by the C string. procedure Finalize (S : in out String_Ptr); end ADO.C;
-- -- Jan & Uwe R. Zimmer, Australia, July 2011 -- with Ada.Task_Identification; use Ada.Task_Identification; with Ada.Text_IO; use Ada.Text_IO; package body Exceptions is procedure Show_Exception (Exception_Identifier : Exception_Occurrence; Optional_Message : String := "") is begin Put_Line (Current_Error, "Task " & Image (Current_Task) & " reports: "); Put_Line (Current_Error, Exception_Information (Exception_Identifier)); if Optional_Message /= "" then Put_Line (Current_Error, "Additional message: " & Optional_Message); end if; end Show_Exception; end Exceptions;
-- Copyright 2009, 2011 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- This program declares a bunch of unconstrained objects and -- discrinimated records; the goal is to check that GDB does not crash -- when printing them even if they are not initialized. with Parse_Controlled; procedure Parse is -- START A : aliased Integer := 1; type Access_Type is access all Integer; type String_Access is access String; type My_Record is record Field1 : Access_Type; Field2 : String (1 .. 2); end record; type Discriminants_Record (A : Integer; B : Boolean) is record C : Float; end record; Z : Discriminants_Record := (A => 1, B => False, C => 2.0); type Variable_Record (A : Boolean := True) is record case A is when True => B : Integer; when False => C : Float; D : Integer; end case; end record; Y : Variable_Record := (A => True, B => 1); Y2 : Variable_Record := (A => False, C => 1.0, D => 2); Nv : Parse_Controlled.Null_Variant; type Union_Type (A : Boolean := False) is record case A is when True => B : Integer; when False => C : Float; end case; end record; pragma Unchecked_Union (Union_Type); Ut : Union_Type := (A => True, B => 3); type Tagged_Type is tagged record A : Integer; B : Character; end record; Tt : Tagged_Type := (A => 2, B => 'C'); type Child_Tagged_Type is new Tagged_Type with record C : Float; end record; Ctt : Child_Tagged_Type := (Tt with C => 4.5); type Child_Tagged_Type2 is new Tagged_Type with null record; Ctt2 : Child_Tagged_Type2 := (Tt with null record); type My_Record_Array is array (Natural range <>) of My_Record; W : My_Record_Array := ((Field1 => A'Access, Field2 => "ab"), (Field1 => A'Access, Field2 => "rt")); type Discriminant_Record (Num1, Num2, Num3, Num4 : Natural) is record Field1 : My_Record_Array (1 .. Num2); Field2 : My_Record_Array (Num1 .. 10); Field3 : My_Record_Array (Num1 .. Num2); Field4 : My_Record_Array (Num3 .. Num2); Field5 : My_Record_Array (Num4 .. Num2); end record; Dire : Discriminant_Record (1, 7, 3, 0); type Null_Variant_Part (Discr : Integer) is record case Discr is when 1 => Var_1 : Integer; when 2 => Var_2 : Boolean; when others => null; end case; end record; Nvp : Null_Variant_Part (3); type T_Type is array (Positive range <>) of Integer; type T_Ptr_Type is access T_Type; T_Ptr : T_Ptr_Type := new T_Type' (13, 17); T_Ptr2 : T_Ptr_Type := new T_Type' (2 => 13, 3 => 17); function Foos return String is begin return "string"; end Foos; My_Str : String := Foos; type Value_Var_Type is ( V_Null, V_Boolean, V_Integer ); type Value_Type( Var : Value_Var_Type := V_Null ) is record case Var is when V_Null => null; when V_Boolean => Boolean_Value : Boolean; when V_Integer => Integer_Value : Integer; end case; end record; NBI_N : Value_Type := (Var => V_Null); NBI_I : Value_Type := (Var => V_Integer, Integer_Value => 18); NBI_B : Value_Type := (Var => V_Boolean, Boolean_Value => True); begin null; end Parse;
-- This spec has been automatically generated from STM32L4x6.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package STM32_SVD.OPAMP is pragma Preelaborate; --------------- -- Registers -- --------------- subtype OPAMP1_CSR_OPAMODE_Field is HAL.UInt2; subtype OPAMP1_CSR_PGA_GAIN_Field is HAL.UInt2; subtype OPAMP1_CSR_VM_SEL_Field is HAL.UInt2; -- OPAMP1 control/status register type OPAMP1_CSR_Register is record -- Operational amplifier Enable OPAEN : Boolean := False; -- Operational amplifier Low Power Mode OPALPM : Boolean := False; -- Operational amplifier PGA mode OPAMODE : OPAMP1_CSR_OPAMODE_Field := 16#0#; -- Operational amplifier Programmable amplifier gain value PGA_GAIN : OPAMP1_CSR_PGA_GAIN_Field := 16#0#; -- unspecified Reserved_6_7 : HAL.UInt2 := 16#0#; -- Inverting input selection VM_SEL : OPAMP1_CSR_VM_SEL_Field := 16#0#; -- Non inverted input selection VP_SEL : Boolean := False; -- unspecified Reserved_11_11 : HAL.Bit := 16#0#; -- Calibration mode enabled CALON : Boolean := False; -- Calibration selection CALSEL : Boolean := False; -- allows to switch from AOP offset trimmed values to AOP offset USERTRIM : Boolean := False; -- Operational amplifier calibration output CALOUT : Boolean := False; -- unspecified Reserved_16_30 : HAL.UInt15 := 16#0#; -- Operational amplifier power supply range for stability OPA_RANGE : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for OPAMP1_CSR_Register use record OPAEN at 0 range 0 .. 0; OPALPM at 0 range 1 .. 1; OPAMODE at 0 range 2 .. 3; PGA_GAIN at 0 range 4 .. 5; Reserved_6_7 at 0 range 6 .. 7; VM_SEL at 0 range 8 .. 9; VP_SEL at 0 range 10 .. 10; Reserved_11_11 at 0 range 11 .. 11; CALON at 0 range 12 .. 12; CALSEL at 0 range 13 .. 13; USERTRIM at 0 range 14 .. 14; CALOUT at 0 range 15 .. 15; Reserved_16_30 at 0 range 16 .. 30; OPA_RANGE at 0 range 31 .. 31; end record; subtype OPAMP1_OTR_TRIMOFFSETN_Field is HAL.UInt5; subtype OPAMP1_OTR_TRIMOFFSETP_Field is HAL.UInt5; -- OPAMP1 offset trimming register in normal mode type OPAMP1_OTR_Register is record -- Trim for NMOS differential pairs TRIMOFFSETN : OPAMP1_OTR_TRIMOFFSETN_Field := 16#0#; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; -- Trim for PMOS differential pairs TRIMOFFSETP : OPAMP1_OTR_TRIMOFFSETP_Field := 16#0#; -- unspecified Reserved_13_31 : HAL.UInt19 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for OPAMP1_OTR_Register use record TRIMOFFSETN at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; TRIMOFFSETP at 0 range 8 .. 12; Reserved_13_31 at 0 range 13 .. 31; end record; subtype OPAMP1_LPOTR_TRIMLPOFFSETN_Field is HAL.UInt5; subtype OPAMP1_LPOTR_TRIMLPOFFSETP_Field is HAL.UInt5; -- OPAMP1 offset trimming register in low-power mode type OPAMP1_LPOTR_Register is record -- Trim for NMOS differential pairs TRIMLPOFFSETN : OPAMP1_LPOTR_TRIMLPOFFSETN_Field := 16#0#; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; -- Trim for PMOS differential pairs TRIMLPOFFSETP : OPAMP1_LPOTR_TRIMLPOFFSETP_Field := 16#0#; -- unspecified Reserved_13_31 : HAL.UInt19 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for OPAMP1_LPOTR_Register use record TRIMLPOFFSETN at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; TRIMLPOFFSETP at 0 range 8 .. 12; Reserved_13_31 at 0 range 13 .. 31; end record; subtype OPAMP2_CSR_OPAMODE_Field is HAL.UInt2; subtype OPAMP2_CSR_PGA_GAIN_Field is HAL.UInt2; subtype OPAMP2_CSR_VM_SEL_Field is HAL.UInt2; -- OPAMP2 control/status register type OPAMP2_CSR_Register is record -- Operational amplifier Enable OPAEN : Boolean := False; -- Operational amplifier Low Power Mode OPALPM : Boolean := False; -- Operational amplifier PGA mode OPAMODE : OPAMP2_CSR_OPAMODE_Field := 16#0#; -- Operational amplifier Programmable amplifier gain value PGA_GAIN : OPAMP2_CSR_PGA_GAIN_Field := 16#0#; -- unspecified Reserved_6_7 : HAL.UInt2 := 16#0#; -- Inverting input selection VM_SEL : OPAMP2_CSR_VM_SEL_Field := 16#0#; -- Non inverted input selection VP_SEL : Boolean := False; -- unspecified Reserved_11_11 : HAL.Bit := 16#0#; -- Calibration mode enabled CALON : Boolean := False; -- Calibration selection CALSEL : Boolean := False; -- allows to switch from AOP offset trimmed values to AOP offset USERTRIM : Boolean := False; -- Operational amplifier calibration output CALOUT : Boolean := False; -- unspecified Reserved_16_31 : HAL.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for OPAMP2_CSR_Register use record OPAEN at 0 range 0 .. 0; OPALPM at 0 range 1 .. 1; OPAMODE at 0 range 2 .. 3; PGA_GAIN at 0 range 4 .. 5; Reserved_6_7 at 0 range 6 .. 7; VM_SEL at 0 range 8 .. 9; VP_SEL at 0 range 10 .. 10; Reserved_11_11 at 0 range 11 .. 11; CALON at 0 range 12 .. 12; CALSEL at 0 range 13 .. 13; USERTRIM at 0 range 14 .. 14; CALOUT at 0 range 15 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype OPAMP2_OTR_TRIMOFFSETN_Field is HAL.UInt5; subtype OPAMP2_OTR_TRIMOFFSETP_Field is HAL.UInt5; -- OPAMP2 offset trimming register in normal mode type OPAMP2_OTR_Register is record -- Trim for NMOS differential pairs TRIMOFFSETN : OPAMP2_OTR_TRIMOFFSETN_Field := 16#0#; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; -- Trim for PMOS differential pairs TRIMOFFSETP : OPAMP2_OTR_TRIMOFFSETP_Field := 16#0#; -- unspecified Reserved_13_31 : HAL.UInt19 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for OPAMP2_OTR_Register use record TRIMOFFSETN at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; TRIMOFFSETP at 0 range 8 .. 12; Reserved_13_31 at 0 range 13 .. 31; end record; subtype OPAMP2_LPOTR_TRIMLPOFFSETN_Field is HAL.UInt5; subtype OPAMP2_LPOTR_TRIMLPOFFSETP_Field is HAL.UInt5; -- OPAMP2 offset trimming register in low-power mode type OPAMP2_LPOTR_Register is record -- Trim for NMOS differential pairs TRIMLPOFFSETN : OPAMP2_LPOTR_TRIMLPOFFSETN_Field := 16#0#; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; -- Trim for PMOS differential pairs TRIMLPOFFSETP : OPAMP2_LPOTR_TRIMLPOFFSETP_Field := 16#0#; -- unspecified Reserved_13_31 : HAL.UInt19 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for OPAMP2_LPOTR_Register use record TRIMLPOFFSETN at 0 range 0 .. 4; Reserved_5_7 at 0 range 5 .. 7; TRIMLPOFFSETP at 0 range 8 .. 12; Reserved_13_31 at 0 range 13 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Operational amplifiers type OPAMP_Peripheral is record -- OPAMP1 control/status register OPAMP1_CSR : aliased OPAMP1_CSR_Register; -- OPAMP1 offset trimming register in normal mode OPAMP1_OTR : aliased OPAMP1_OTR_Register; -- OPAMP1 offset trimming register in low-power mode OPAMP1_LPOTR : aliased OPAMP1_LPOTR_Register; -- OPAMP2 control/status register OPAMP2_CSR : aliased OPAMP2_CSR_Register; -- OPAMP2 offset trimming register in normal mode OPAMP2_OTR : aliased OPAMP2_OTR_Register; -- OPAMP2 offset trimming register in low-power mode OPAMP2_LPOTR : aliased OPAMP2_LPOTR_Register; end record with Volatile; for OPAMP_Peripheral use record OPAMP1_CSR at 16#0# range 0 .. 31; OPAMP1_OTR at 16#4# range 0 .. 31; OPAMP1_LPOTR at 16#8# range 0 .. 31; OPAMP2_CSR at 16#10# range 0 .. 31; OPAMP2_OTR at 16#14# range 0 .. 31; OPAMP2_LPOTR at 16#18# range 0 .. 31; end record; -- Operational amplifiers OPAMP_Periph : aliased OPAMP_Peripheral with Import, Address => System'To_Address (16#40007800#); end STM32_SVD.OPAMP;
package body Set_Of_Names is use type Ada.Containers.Count_Type, Vecs.Cursor; function Start(Names: Set) return Index_Type is begin if Names.Length = 0 then return 1; else return Names.First_Index; end if; end Start; function Stop(Names: Set) return Index_Type_With_Null is begin if Names.Length=0 then return 0; else return Names.Last_Index; end if; end Stop; function Size(Names: Set) return Index_Type_With_Null is begin return Index_Type_With_Null(Names.Length); end Size; procedure Add(Names: in out Set; Name: String; Index: out Index_Type) is I: Index_Type_With_Null := Names.Idx(Name); begin if I = 0 then -- Name is not yet in Set Names.Append(Name); Index := Names.Stop; else Index := I; end if; end Add; procedure Add(Names: in out Set; Name: String) is I: Index_Type; begin Names.Add(Name, I); end Add; procedure Sub(Names: in out Set; Name: String) is I: Index_Type_With_Null := Names.Idx(Name); begin if I /= 0 then -- Name is in set Names.Delete(I); end if; end Sub; function Idx(Names: Set; Name: String) return Index_Type_With_Null is begin for I in Names.First_Index .. Names.Last_Index loop if Names.Element(I) = Name then return I; end if; end loop; return 0; end Idx; function Name(Names: Set; Index: Index_Type) return String is begin return Names.Element(Index); end Name; end Set_Of_Names;
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- A L I . U T I L -- -- -- -- B o d y -- -- -- -- $Revision$ -- -- -- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING. If not, write -- -- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, -- -- MA 02111-1307, USA. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Binderr; use Binderr; with Namet; use Namet; with Opt; use Opt; with Osint; use Osint; with System.CRC32; package body ALI.Util is ----------------------- -- Local Subprograms -- ----------------------- procedure Accumulate_Checksum (C : Character; Csum : in out Word); pragma Inline (Accumulate_Checksum); -- This routine accumulates the checksum given character C. During the -- scanning of a source file, this routine is called with every character -- in the source, excluding blanks, and all control characters (except -- that ESC is included in the checksum). Upper case letters not in string -- literals are folded by the caller. See Sinput spec for the documentation -- of the checksum algorithm. Note: checksum values are only used if we -- generate code, so it is not necessary to worry about making the right -- sequence of calls in any error situation. procedure Initialize_Checksum (Csum : out Word); -- Sets initial value of Csum before any calls to Accumulate_Checksum ------------------------- -- Accumulate_Checksum -- ------------------------- procedure Accumulate_Checksum (C : Character; Csum : in out Word) is begin System.CRC32.Update (System.CRC32.CRC32 (Csum), C); end Accumulate_Checksum; --------------------- -- Checksums_Match -- --------------------- function Checksums_Match (Checksum1, Checksum2 : Word) return Boolean is begin return Checksum1 = Checksum2 and then Checksum1 /= Checksum_Error; end Checksums_Match; ----------------------- -- Get_File_Checksum -- ----------------------- function Get_File_Checksum (Fname : Name_Id) return Word is Src : Source_Buffer_Ptr; Hi : Source_Ptr; Csum : Word; Ptr : Source_Ptr; Bad : exception; -- Raised if file not found, or file format error use ASCII; -- Make control characters visible procedure Free_Source; -- Free source file buffer procedure Free_Source is procedure free (Arg : Source_Buffer_Ptr); pragma Import (C, free, "free"); begin free (Src); end Free_Source; -- Start of processing for Get_File_Checksum begin Read_Source_File (Fname, 0, Hi, Src); -- If we cannot find the file, then return an impossible checksum, -- impossible becaues checksums have the high order bit zero, so -- that checksums do not match. if Src = null then raise Bad; end if; Initialize_Checksum (Csum); Ptr := 0; loop case Src (Ptr) is -- Spaces and formatting information are ignored in checksum when ' ' | CR | LF | VT | FF | HT => Ptr := Ptr + 1; -- EOF is ignored unless it is the last character when EOF => if Ptr = Hi then Free_Source; return Csum; else Ptr := Ptr + 1; end if; -- Non-blank characters that are included in the checksum when '#' | '&' | '*' | ':' | '(' | ',' | '.' | '=' | '>' | '<' | ')' | '/' | ';' | '|' | '!' | '+' | '_' | '0' .. '9' | 'a' .. 'z' => Accumulate_Checksum (Src (Ptr), Csum); Ptr := Ptr + 1; -- Upper case letters, fold to lower case when 'A' .. 'Z' => Accumulate_Checksum (Character'Val (Character'Pos (Src (Ptr)) + 32), Csum); Ptr := Ptr + 1; -- Left bracket, really should do wide character thing here, -- but for now, don't bother. when '[' => raise Bad; -- Minus, could be comment when '-' => if Src (Ptr + 1) = '-' then Ptr := Ptr + 2; while Src (Ptr) >= ' ' or else Src (Ptr) = HT loop Ptr := Ptr + 1; end loop; else Accumulate_Checksum ('-', Csum); Ptr := Ptr + 1; end if; -- String delimited by double quote when '"' => Accumulate_Checksum ('"', Csum); loop Ptr := Ptr + 1; exit when Src (Ptr) = '"'; if Src (Ptr) < ' ' then raise Bad; end if; Accumulate_Checksum (Src (Ptr), Csum); end loop; Accumulate_Checksum ('"', Csum); Ptr := Ptr + 1; -- String delimited by percent when '%' => Accumulate_Checksum ('%', Csum); loop Ptr := Ptr + 1; exit when Src (Ptr) = '%'; if Src (Ptr) < ' ' then raise Bad; end if; Accumulate_Checksum (Src (Ptr), Csum); end loop; Accumulate_Checksum ('%', Csum); Ptr := Ptr + 1; -- Quote, could be character constant when ''' => Accumulate_Checksum (''', Csum); if Src (Ptr + 2) = ''' then Accumulate_Checksum (Src (Ptr + 1), Csum); Accumulate_Checksum (''', Csum); Ptr := Ptr + 3; -- Otherwise assume attribute char. We should deal with wide -- character cases here, but that's hard, so forget it. else Ptr := Ptr + 1; end if; -- Upper half character, more to be done here, we should worry -- about folding Latin-1, folding other character sets, and -- dealing with the nasty case of upper half wide encoding. when Upper_Half_Character => Accumulate_Checksum (Src (Ptr), Csum); Ptr := Ptr + 1; -- Escape character, we should do the wide character thing here, -- but for now, do not bother. when ESC => raise Bad; -- Invalid control characters when NUL | SOH | STX | ETX | EOT | ENQ | ACK | BEL | BS | SO | SI | DLE | DC1 | DC2 | DC3 | DC4 | NAK | SYN | ETB | CAN | EM | FS | GS | RS | US | DEL => raise Bad; -- Invalid graphic characters when '$' | '?' | '@' | '`' | '\' | '^' | '~' | ']' | '{' | '}' => raise Bad; end case; end loop; exception when Bad => Free_Source; return Checksum_Error; end Get_File_Checksum; --------------------------- -- Initialize_ALI_Source -- --------------------------- procedure Initialize_ALI_Source is begin -- When (re)initializing ALI data structures the ALI user expects to -- get a fresh set of data structures. Thus we first need to erase the -- marks put in the name table by the previous set of ALI routine calls. -- This loop is empty and harmless the first time in. for J in Source.First .. Source.Last loop Set_Name_Table_Info (Source.Table (J).Sfile, 0); Source.Table (J).Source_Found := False; end loop; Source.Init; end Initialize_ALI_Source; ------------------------- -- Initialize_Checksum -- ------------------------- procedure Initialize_Checksum (Csum : out Word) is begin System.CRC32.Initialize (System.CRC32.CRC32 (Csum)); end Initialize_Checksum; -------------- -- Read_ALI -- -------------- procedure Read_ALI (Id : ALI_Id) is Afile : File_Name_Type; Text : Text_Buffer_Ptr; Idread : ALI_Id; begin for I in ALIs.Table (Id).First_Unit .. ALIs.Table (Id).Last_Unit loop for J in Units.Table (I).First_With .. Units.Table (I).Last_With loop Afile := Withs.Table (J).Afile; -- Only process if not a generic (Afile /= No_File) and if -- file has not been processed already. if Afile /= No_File and then Get_Name_Table_Info (Afile) = 0 then Text := Read_Library_Info (Afile); if Text = null then Error_Msg_Name_1 := Afile; Error_Msg_Name_2 := Withs.Table (J).Sfile; Error_Msg ("% not found, % must be compiled"); Set_Name_Table_Info (Afile, Int (No_Unit_Id)); return; end if; Idread := Scan_ALI (F => Afile, T => Text, Ignore_ED => Force_RM_Elaboration_Order, Err => False); Free (Text); if ALIs.Table (Idread).Compile_Errors then Error_Msg_Name_1 := Withs.Table (J).Sfile; Error_Msg ("% had errors, must be fixed, and recompiled"); Set_Name_Table_Info (Afile, Int (No_Unit_Id)); elsif ALIs.Table (Idread).No_Object then Error_Msg_Name_1 := Withs.Table (J).Sfile; Error_Msg ("% must be recompiled"); Set_Name_Table_Info (Afile, Int (No_Unit_Id)); end if; -- Recurse to get new dependents Read_ALI (Idread); end if; end loop; end loop; end Read_ALI; ---------------------- -- Set_Source_Table -- ---------------------- procedure Set_Source_Table (A : ALI_Id) is F : File_Name_Type; S : Source_Id; Stamp : Time_Stamp_Type; begin Sdep_Loop : for D in ALIs.Table (A).First_Sdep .. ALIs.Table (A).Last_Sdep loop F := Sdep.Table (D).Sfile; -- If this is the first time we are seeing this source file, -- then make a new entry in the source table. if Get_Name_Table_Info (F) = 0 then Source.Increment_Last; S := Source.Last; Set_Name_Table_Info (F, Int (S)); Source.Table (S).Sfile := F; Source.Table (S).All_Timestamps_Match := True; -- Initialize checksum fields Source.Table (S).Checksum := Sdep.Table (D).Checksum; Source.Table (S).All_Checksums_Match := True; -- In check source files mode, try to get time stamp from file if Opt.Check_Source_Files then Stamp := Source_File_Stamp (F); -- If we got the stamp, then set the stamp in the source -- table entry and mark it as set from the source so that -- it does not get subsequently changed. if Stamp (Stamp'First) /= ' ' then Source.Table (S).Stamp := Stamp; Source.Table (S).Source_Found := True; -- If we could not find the file, then the stamp is set -- from the dependency table entry (to be possibly reset -- if we find a later stamp in subsequent processing) else Source.Table (S).Stamp := Sdep.Table (D).Stamp; Source.Table (S).Source_Found := False; -- In All_Sources mode, flag error of file not found if Opt.All_Sources then Error_Msg_Name_1 := F; Error_Msg ("cannot locate %"); end if; end if; -- First time for this source file, but Check_Source_Files -- is off, so simply initialize the stamp from the Sdep entry else Source.Table (S).Source_Found := False; Source.Table (S).Stamp := Sdep.Table (D).Stamp; end if; -- Here if this is not the first time for this source file, -- so that the source table entry is already constructed. else S := Source_Id (Get_Name_Table_Info (F)); -- Update checksum flag if not Checksums_Match (Sdep.Table (D).Checksum, Source.Table (S).Checksum) then Source.Table (S).All_Checksums_Match := False; end if; -- Check for time stamp mismatch if Sdep.Table (D).Stamp /= Source.Table (S).Stamp then Source.Table (S).All_Timestamps_Match := False; -- When we have a time stamp mismatch, we go look for the -- source file even if Check_Source_Files is false, since -- if we find it, then we can use it to resolve which of the -- two timestamps in the ALI files is likely to be correct. if not Check_Source_Files then Stamp := Source_File_Stamp (F); if Stamp (Stamp'First) /= ' ' then Source.Table (S).Stamp := Stamp; Source.Table (S).Source_Found := True; end if; end if; -- If the stamp in the source table entry was set from the -- source file, then we do not change it (the stamp in the -- source file is always taken as the "right" one). if Source.Table (S).Source_Found then null; -- Otherwise, we have no source file available, so we guess -- that the later of the two timestamps is the right one. -- Note that this guess only affects which error messages -- are issued later on, not correct functionality. else if Sdep.Table (D).Stamp > Source.Table (S).Stamp then Source.Table (S).Stamp := Sdep.Table (D).Stamp; end if; end if; end if; end if; -- Set the checksum value in the source table S := Source_Id (Get_Name_Table_Info (F)); Source.Table (S).Checksum := Sdep.Table (D).Checksum; end loop Sdep_Loop; end Set_Source_Table; ---------------------- -- Set_Source_Table -- ---------------------- procedure Set_Source_Table is begin for A in ALIs.First .. ALIs.Last loop Set_Source_Table (A); end loop; end Set_Source_Table; ------------------------- -- Time_Stamp_Mismatch -- ------------------------- function Time_Stamp_Mismatch (A : ALI_Id) return File_Name_Type is Src : Source_Id; -- Source file Id for the current Sdep entry begin for D in ALIs.Table (A).First_Sdep .. ALIs.Table (A).Last_Sdep loop Src := Source_Id (Get_Name_Table_Info (Sdep.Table (D).Sfile)); if Opt.Minimal_Recompilation and then Sdep.Table (D).Stamp /= Source.Table (Src).Stamp then -- If minimal recompilation is in action, replace the stamp -- of the source file in the table if checksums match. -- ??? It is probably worth updating the ALI file with a new -- field to avoid recomputing it each time. if Checksums_Match (Get_File_Checksum (Sdep.Table (D).Sfile), Source.Table (Src).Checksum) then Sdep.Table (D).Stamp := Source.Table (Src).Stamp; end if; end if; if not Source.Table (Src).Source_Found or else Sdep.Table (D).Stamp /= Source.Table (Src).Stamp then return Source.Table (Src).Sfile; end if; end loop; return No_File; end Time_Stamp_Mismatch; end ALI.Util;
-- { dg-do run } with Ada.Unchecked_Conversion; with Ada.Streams; use Ada.Streams; with Ada.Text_IO; use Ada.Text_IO; procedure Unchecked_Convert2 is subtype Day_Number is Integer range 0 .. 31; subtype Byte_Array_Of_Integer is Stream_Element_Array (1 .. Integer'Size / Stream_Element_Array'Component_Size); function To_Byte_Array is new Ada.Unchecked_Conversion (Integer, Byte_Array_Of_Integer); Day_Now : Day_Number; Pragma Volatile (Day_Now); Arr : Stream_Element_Array (1 .. 12) := (others => 16#ff#); procedure Test (Arr : Stream_Element_Array) is begin if Arr(5) /= 0 or Arr(6) /= 0 or Arr(7) /= 0 or Arr(8) /= 0 then raise Program_Error; end if; end; begin Day_Now := 0; Arr (5 .. 8) := To_Byte_Array (Day_Now); Test (Arr); Arr (1) := 16#ff#; end Unchecked_Convert2;
with openGL.Primitive.indexed; package body openGL.Model.line.colored is --------- --- Forge -- function to_line_Model (Color : in openGL.Color; End_1, End_2 : in Vector_3 := Origin_3D) return Item is Self : Item; begin Self.Color := +Color; Self.Vertices (1).Site := End_1; Self.Vertices (2).Site := End_2; Self.set_Bounds; return Self; end to_line_Model; function new_line_Model (Color : in openGL.Color; End_1, End_2 : in Vector_3 := Origin_3D) return View is begin return new Item' (to_line_Model (Color, End_1, End_2)); end new_line_Model; -------------- --- Attributes -- overriding function to_GL_Geometries (Self : access Item; Textures : access Texture.name_Map_of_texture'Class; Fonts : in Font.font_id_Map_of_font) return Geometry.views is pragma unreferenced (Textures, Fonts); use Geometry.colored; indices_Count : constant long_Index_t := 2; the_Indices : aliased Indices := (1 .. indices_Count => <>); the_Primitive : Primitive.indexed.view; begin if Self.Geometry = null then Self.Geometry := Geometry.colored.new_Geometry; end if; set_Sites: begin Self.Vertices (1).Color := (Primary => Self.Color, Alpha => opaque_Value); Self.Vertices (2).Color := (Primary => Self.Color, Alpha => opaque_Value); end set_Sites; the_Indices := (1, 2); Self.Geometry.is_Transparent (False); Self.Geometry.Vertices_are (Self.Vertices); the_Primitive := Primitive.indexed.new_Primitive (Primitive.Lines, the_Indices); Self.Geometry.add (Primitive.view (the_Primitive)); return (1 => Self.Geometry); end to_GL_Geometries; function Site (Self : in Item; for_End : in end_Id) return Vector_3 is begin return Self.Vertices (for_End).Site; end Site; procedure Site_is (Self : in out Item; Now : in Vector_3; for_End : in end_Id) is use Geometry.colored; begin Self.Vertices (for_End).Site := Now; Self.Geometry.Vertices_are (Self.Vertices); Self.set_Bounds; end Site_is; end openGL.Model.line.colored;
------------------------------------------------------------------------------ -- -- -- ASIS-for-GNAT IMPLEMENTATION COMPONENTS -- -- -- -- A 4 G . D E F A U L T S -- -- -- -- Copyright (C) 1995-2010, Free Software Foundation, Inc. -- -- -- -- ASIS-for-GNAT is free software; you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 2, or (at your option) any later -- -- version. ASIS-for-GNAT is distributed in the hope that it will be use- -- -- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- -- -- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with ASIS-for-GNAT; see file -- -- COPYING. If not, write to the Free Software Foundation, 51 Franklin -- -- Street, Fifth Floor, Boston, MA 02110-1301, USA. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the -- -- Software Engineering Laboratory of the Swiss Federal Institute of -- -- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the -- -- Scientific Research Computer Center of Moscow State University (SRCC -- -- MSU), Russia, with funding partially provided by grants from the Swiss -- -- National Science Foundation and the Swiss Academy of Engineering -- -- Sciences. ASIS-for-GNAT is now maintained by AdaCore -- -- (http://www.adacore.com). -- -- -- ------------------------------------------------------------------------------ with Unchecked_Deallocation; with A4G.A_Osint; use A4G.A_Osint; with A4G.U_Conv; use A4G.U_Conv; with Output; use Output; package body A4G.Defaults is procedure Free_String is new Unchecked_Deallocation (String, String_Access); procedure Add_Src_Search_Dir (Dir : String); -- Add Dir at the end of the default source file search path. procedure Add_Lib_Search_Dir (Dir : String); -- Add Dir at the end of the default library (=object+ALI) file search -- path. ------------------------ -- Add_Lib_Search_Dir -- ------------------------ procedure Add_Lib_Search_Dir (Dir : String) is begin ASIS_Lib_Search_Directories.Increment_Last; ASIS_Lib_Search_Directories.Table (ASIS_Lib_Search_Directories.Last) := new String'(Normalize_Directory_Name (Dir)); end Add_Lib_Search_Dir; ------------------------ -- Add_Src_Search_Dir -- ------------------------ procedure Add_Src_Search_Dir (Dir : String) is begin ASIS_Src_Search_Directories.Increment_Last; ASIS_Src_Search_Directories.Table (ASIS_Src_Search_Directories.Last) := new String'(Normalize_Directory_Name (Dir)); end Add_Src_Search_Dir; -------------- -- Finalize -- -------------- procedure Finalize is begin -- finalise ASIS_Src_Search_Directories: for I in First_Dir_Id .. ASIS_Src_Search_Directories.Last loop Free_String (ASIS_Src_Search_Directories.Table (I)); end loop; -- finalize ASIS_Lib_Search_Directories: for I in First_Dir_Id .. ASIS_Lib_Search_Directories.Last loop Free_String (ASIS_Lib_Search_Directories.Table (I)); end loop; -- finalize ASIS_Tree_Search_Directories for I in First_Dir_Id .. ASIS_Tree_Search_Directories.Last loop Free_String (ASIS_Tree_Search_Directories.Table (I)); end loop; end Finalize; ---------------- -- Initialize -- ---------------- procedure Initialize is Search_Path : String_Access; begin -- just in case: Finalize; ASIS_Src_Search_Directories.Init; ASIS_Lib_Search_Directories.Init; ASIS_Tree_Search_Directories.Init; -- stroring the defaults for: the code is stolen from Osint -- (body, rev. 1.147) and then adjusted for Dir_kind in Search_Dir_Kinds loop case Dir_kind is when Source => Search_Path := Getenv ("ADA_INCLUDE_PATH"); when Object => Search_Path := Getenv ("ADA_OBJECTS_PATH"); when Tree => -- There is no environment variable for separate -- tree path at the moment; exit; end case; if Search_Path'Length > 0 then declare Lower_Bound : Positive := 1; Upper_Bound : Positive; begin loop while Lower_Bound <= Search_Path'Last and then Search_Path.all (Lower_Bound) = ASIS_Path_Separator loop Lower_Bound := Lower_Bound + 1; end loop; exit when Lower_Bound > Search_Path'Last; Upper_Bound := Lower_Bound; while Upper_Bound <= Search_Path'Last and then Search_Path.all (Upper_Bound) /= ASIS_Path_Separator loop Upper_Bound := Upper_Bound + 1; end loop; case Dir_kind is when Source => Add_Src_Search_Dir (Search_Path.all (Lower_Bound .. Upper_Bound - 1)); when Object => Add_Lib_Search_Dir (Search_Path.all (Lower_Bound .. Upper_Bound - 1)); when Tree => exit; -- non implemented yet; end case; Lower_Bound := Upper_Bound + 1; end loop; end; end if; end loop; -- ??? TEMPORARY SOLUTION: the default objects search path -- is also used as the default tree path for J in First_Dir_Id .. ASIS_Lib_Search_Directories.Last loop ASIS_Tree_Search_Directories.Increment_Last; ASIS_Tree_Search_Directories.Table (ASIS_Tree_Search_Directories.Last) := new String'(ASIS_Lib_Search_Directories.Table (J).all); end loop; Free (Search_Path); end Initialize; ------------------------- -- Locate_Default_File -- ------------------------- function Locate_Default_File (File_Name : String_Access; Dir_Kind : Search_Dir_Kinds) return String_Access is function Is_Here_In_Src (File_Name : String_Access; Dir : Dir_Id) return Boolean; function Is_Here_In_Lib (File_Name : String_Access; Dir : Dir_Id) return Boolean; -- funtion Is_Here_In_Tree (File_Name : String_Access; Dir : Dir_Id) -- return Boolean; function Is_Here_In_Src (File_Name : String_Access; Dir : Dir_Id) return Boolean is begin return Is_Regular_File (ASIS_Src_Search_Directories.Table (Dir).all & To_String (File_Name)); end Is_Here_In_Src; function Is_Here_In_Lib (File_Name : String_Access; Dir : Dir_Id) return Boolean is begin return Is_Regular_File (ASIS_Lib_Search_Directories.Table (Dir).all & To_String (File_Name)); end Is_Here_In_Lib; begin case Dir_Kind is when Source => for Dir in First_Dir_Id .. ASIS_Src_Search_Directories.Last loop if Is_Here_In_Src (File_Name, Dir) then return new String' (ASIS_Src_Search_Directories.Table (Dir).all & File_Name.all); end if; end loop; when Object => for Dir in First_Dir_Id .. ASIS_Lib_Search_Directories.Last loop if Is_Here_In_Lib (File_Name, Dir) then return new String' (ASIS_Lib_Search_Directories.Table (Dir).all & File_Name.all); end if; end loop; when Tree => null; -- non implemented yet; end case; return null; end Locate_Default_File; ------------------------ -- Print_Lib_Defaults -- ------------------------ procedure Print_Lib_Defaults is begin if ASIS_Lib_Search_Directories.Last < First_Dir_Id then Write_Str (" No default library files search path"); Write_Eol; else for Dir in First_Dir_Id .. ASIS_Lib_Search_Directories.Last loop Write_Str (" " & ASIS_Lib_Search_Directories.Table (Dir).all); Write_Eol; end loop; end if; end Print_Lib_Defaults; --------------------------- -- Print_Source_Defaults -- --------------------------- procedure Print_Source_Defaults is begin if ASIS_Src_Search_Directories.Last < First_Dir_Id then Write_Str (" No default source search path"); Write_Eol; else for Dir in First_Dir_Id .. ASIS_Src_Search_Directories.Last loop Write_Str (" " & ASIS_Src_Search_Directories.Table (Dir).all); Write_Eol; end loop; end if; end Print_Source_Defaults; ------------------------- -- Print_Tree_Defaults -- ------------------------- procedure Print_Tree_Defaults is begin if ASIS_Tree_Search_Directories.Last < First_Dir_Id then Write_Str (" No default tree files search path"); Write_Eol; else for Dir in First_Dir_Id .. ASIS_Tree_Search_Directories.Last loop Write_Str (" " & ASIS_Tree_Search_Directories.Table (Dir).all); Write_Eol; end loop; end if; end Print_Tree_Defaults; end A4G.Defaults;
----------------------------------------------------------------------- -- awa-images-beans -- Image Ada Beans -- Copyright (C) 2016 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with ADO; with Util.Beans.Objects; with Util.Beans.Basic; with AWA.Storages.Beans; with AWA.Images.Models; with AWA.Images.Modules; -- == Image Beans == -- The <tt>Image_List_Bean</tt> type is used to represent a list of image stored in -- a folder. -- -- The <tt>Image_Bean</tt> type holds all the data to give information about an image. -- -- == Ada Beans == -- @include images.xml package AWA.Images.Beans is -- ------------------------------ -- Image List Bean -- ------------------------------ -- This bean represents a list of images for a given folder. type Image_List_Bean is new AWA.Storages.Beans.Storage_List_Bean with record -- List of images. Image_List : aliased AWA.Images.Models.Image_Info_List_Bean; Image_List_Bean : AWA.Images.Models.Image_Info_List_Bean_Access; end record; type Image_List_Bean_Access is access all Image_List_Bean'Class; -- Load the list of images associated with the current folder. overriding procedure Load_Files (Storage : in Image_List_Bean); overriding function Get_Value (List : in Image_List_Bean; Name : in String) return Util.Beans.Objects.Object; -- Create the Image_List_Bean bean instance. function Create_Image_List_Bean (Module : in AWA.Images.Modules.Image_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access; -- ------------------------------ -- Image Bean -- ------------------------------ -- Information about an image (excluding the image data itself). type Image_Bean is new AWA.Images.Models.Image_Bean with record Module : AWA.Images.Modules.Image_Module_Access; end record; type Image_Bean_Access is access all Image_Bean'Class; overriding procedure Load (Into : in out Image_Bean; Outcome : in out Ada.Strings.Unbounded.Unbounded_String); -- Create the Image_Bean bean instance. function Create_Image_Bean (Module : in AWA.Images.Modules.Image_Module_Access) return Util.Beans.Basic.Readonly_Bean_Access; end AWA.Images.Beans;
with Ada.Text_IO; use Ada.Text_IO; with System.Storage_Elements; use System.Storage_Elements; with BBqueue; with BBqueue.Buffers.framed; with System; use System; procedure Main_Framed with SPARK_Mode is use type BBqueue.Result_Kind; Q : aliased BBqueue.Buffers.framed.Framed_Buffer (60); procedure Fill_With_CB (Request, Actual : BBqueue.Count; Val : Storage_Element); procedure Print_Content_With_CB; ------------------ -- Fill_With_CB -- ------------------ procedure Fill_With_CB (Request, Actual : BBqueue.Count; Val : Storage_Element) is pragma SPARK_Mode (Off); procedure Process_Write (Data : out Storage_Array; To_Commit : out BBqueue.Count); procedure Process_Write (Data : out Storage_Array; To_Commit : out BBqueue.Count) is begin Put_Line ("Fill" & Actual'Img & " bytes."); Data (Data'First .. Data'First + Actual - 1) := (others => Val); To_Commit := Actual; end Process_Write; procedure Write is new BBqueue.Buffers.framed.Write_CB (Process_Write); Result : BBqueue.Result_Kind; begin Write (Q, Request, Result); if Result /= BBqueue.Valid then Put_Line ("Write failed: " & Result'Img); end if; end Fill_With_CB; --------------------------- -- Print_Content_With_CB -- --------------------------- procedure Print_Content_With_CB is procedure Process_Read (Data : Storage_Array); procedure Process_Read (Data : Storage_Array) is begin Put ("Print" & Data'Length'Img & " bytes -> "); for Elt of Data loop Put (Elt'Img); end loop; New_Line; end Process_Read; procedure Read is new BBqueue.Buffers.framed.Read_CB (Process_Read); Result : BBqueue.Result_Kind; begin Read (Q, Result); if Result /= BBqueue.Valid then Put_Line ("Read failed: " & Result'Img); end if; end Print_Content_With_CB; V : Storage_Element := 1; begin Put_Line ("Count'Object_Size:" & BBqueue.Count'Object_Size'Img); for X in BBqueue.Count range 1 .. 4 loop Put_Line ("-- Loop" & X'Img & " --"); Fill_With_CB (10, X, V); Fill_With_CB (20, X * 2, V * 2); V := V + 1; Print_Content_With_CB; Print_Content_With_CB; end loop; end Main_Framed;
with Ada.Characters.Latin_1; with Ada.Text_IO; package body AOC.AOC_2019.Day08 is Width : Natural := 25; Height : Natural := 6; Image_Size : Natural := Width * Height; type Pixel is new Character range '0' .. '2'; type Layer is array (0 .. Image_Size-1) of Pixel; Checksum : Natural; Result : Layer := (others => '2'); procedure Init (D : in out Day_08; Root : String) is use Ada.Text_IO; File : File_Type; begin Open (File => File, Mode => In_File, Name => Root & "/input/2019/day08.txt"); declare Image : String := Get_Line (File); Offset : Natural := Image'First; Zero_Count : Natural := Natural'Last; begin while Offset < Image'Last loop declare type Pixel_Count_Array is array (Pixel) of Natural; Pixel_Count : Pixel_Count_Array := (others => 0); begin for I in Layer'Range loop declare Current_Pixel : Pixel := Pixel (Image (Offset + I)); begin Pixel_Count (Current_Pixel) := Pixel_Count (Current_Pixel) + 1; if Result (I) = '2' then Result (I) := Current_Pixel; end if; end; end loop; if Pixel_Count ('0') < Zero_Count then Zero_Count := Pixel_Count ('0'); Checksum := Pixel_Count ('1') * Pixel_Count ('2'); end if; end; Offset := Offset + Image_Size; end loop; end; Close (File); end Init; function Part_1 (D : Day_08) return String is begin return Checksum'Image; end Part_1; function Part_2 (D : Day_08) return String is Image : String (Result'First .. Result'Last + Height); Dest : Natural := Image'First; begin for I in Result'Range loop if I mod Width = 0 then Image (Dest) := Ada.Characters.Latin_1.LF; Dest := Dest + 1; end if; Image (Dest) := (if Result (I) = '1' then '#' else ' '); Dest := Dest + 1; end loop; return Image; end Part_2; end AOC.AOC_2019.Day08;
generic Max_Elements : Positive; type Number is digits <>; package Moving is procedure Add_Number (N : Number); function Moving_Average (N : Number) return Number; function Get_Average return Number; end Moving;
with Ada.Exceptions; with Ada.Wide_Text_IO; use Ada.Wide_Text_IO; with Ada.Characters.Handling; use Ada.Characters.Handling; with Ada.Command_Line; with Ada.Directories; with Asis; with Asis.Ada_Environments; with Asis.Implementation; with Asis.Exceptions; with Asis.Errors; with Context_Processing; procedure PP_Ada_FPops is My_Context : Asis.Context; My_Context_Name : Wide_String := Asis.Ada_Environments.Default_Name; -- The default name in case of the GNAT ASIS implementation is empty. -- In the GNAT ASIS implementation the name of a Context does not have any -- special meaning or semantics associated with particular names. My_Context_Parameters : Wide_String := Asis.Ada_Environments.Default_Parameters; -- The default Context parameters in case of the GNAT ASIS implementation -- are an empty string. This corresponds to the following Context -- definition: "-CA -FT -SA", and has the following meaning: -- -CA - a Context is made up by all the tree files in the tree search -- path; the tree search path is not set, so the default is used, -- and the default is the current directory; -- -FT - only pre-created trees are used, no tree file can be created by -- ASIS; -- -SA - source files for all the Compilation Units belonging to the -- Context (except the predefined Standard package) are considered -- in the consistency check when opening the Context; Initialization_Parameters : Wide_String := ""; Finalization_Parameters : Wide_String := ""; -- If you would like to use some specific initialization or finalization -- parameters, you may set them here as initialization expressions in -- the declarations above. -- Function that processes the mandatory argument and outputs an error message -- if the argument is not there or is not appropriate. function Get_Output_Path return String is package C renames Ada.Command_Line; package D renames Ada.Directories; begin if C.Argument_Count = 1 then declare Argument : String := C.Argument(1); Full_Path : String := D.Full_Name(Argument); begin case D.Kind(Full_Path) is when D.Directory => if Full_Path /= D.Full_Name(D.Current_Directory) then -- success! return Full_Path; else Put("The argument directory must be distinct from the current directory."); New_Line; end if; when others => Put("The argument "); Put(To_Wide_String(Argument)); Put(" is not a directory."); New_Line; end case; exception when D.Name_Error => Put("The argument "); Put(To_Wide_String(Argument)); Put(" is not an existing directory."); New_Line; end; else Put("There has to be exactly one command-line argument: <Output_Directory>"); New_Line; end if; -- if we got here, we failed: return ""; end Get_Output_Path; Output_Path : String := Get_Output_Path; begin -- Check that there is one argument and check it is an existing file path: if Output_Path /= "" then -- Initialise ASIS context: Asis.Implementation.Initialize (Initialization_Parameters); Asis.Ada_Environments.Associate (The_Context => My_Context, Name => My_Context_Name, Parameters => My_Context_Parameters); Asis.Ada_Environments.Open (My_Context); -- Do the translation: Context_Processing.Process_Context (The_Context => My_Context, Trace => True, Output_Path => Output_Path); -- Finalise ASIS context: Asis.Ada_Environments.Close (My_Context); Asis.Ada_Environments.Dissociate (My_Context); Asis.Implementation.Finalize (Finalization_Parameters); end if; exception -- The exception handling in this driver is somewhat redundant and may -- need some reconsidering when using this driver in real ASIS tools when Ex : Asis.Exceptions.ASIS_Inappropriate_Context | Asis.Exceptions.ASIS_Inappropriate_Container | Asis.Exceptions.ASIS_Inappropriate_Compilation_Unit | Asis.Exceptions.ASIS_Inappropriate_Element | Asis.Exceptions.ASIS_Inappropriate_Line | Asis.Exceptions.ASIS_Inappropriate_Line_Number | Asis.Exceptions.ASIS_Failed => Ada.Wide_Text_IO.Put ("ASIS exception ("); Ada.Wide_Text_IO.Put (Ada.Characters.Handling.To_Wide_String ( Ada.Exceptions.Exception_Name (Ex))); Ada.Wide_Text_IO.Put (") is raised"); Ada.Wide_Text_IO.New_Line; Ada.Wide_Text_IO.Put ("ASIS Error Status is "); Ada.Wide_Text_IO.Put (Asis.Errors.Error_Kinds'Wide_Image (Asis.Implementation.Status)); Ada.Wide_Text_IO.New_Line; Ada.Wide_Text_IO.Put ("ASIS Diagnosis is "); Ada.Wide_Text_IO.New_Line; Ada.Wide_Text_IO.Put (Asis.Implementation.Diagnosis); Ada.Wide_Text_IO.New_Line; Asis.Implementation.Set_Status; when Ex : others => Ada.Wide_Text_IO.Put (Ada.Characters.Handling.To_Wide_String ( Ada.Exceptions.Exception_Name (Ex))); Ada.Wide_Text_IO.Put (" is raised ("); Ada.Wide_Text_IO.Put (Ada.Characters.Handling.To_Wide_String ( Ada.Exceptions.Exception_Information (Ex))); Ada.Wide_Text_IO.Put (")"); Ada.Wide_Text_IO.New_Line; end PP_Ada_FPops;
-- part of AdaYaml, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "copying.txt" with Ada.Finalization; with Ada.Unchecked_Deallocation; with AUnit.Assertions; use AUnit.Assertions; package body Yaml.Lexer.Tokenization_Test is use type Text.Reference; subtype Evaluated_Token is Token_Kind with Static_Predicate => Evaluated_Token in Scalar_Token_Kind | Suffix | Verbatim_Tag; subtype Short_Lexeme_Token is Token_Kind with Static_Predicate => Short_Lexeme_Token in Unknown_Directive | Anchor | Alias; subtype Full_Lexeme_Token is Token_Kind with Static_Predicate => Full_Lexeme_Token in Directive_Param | Tag_Handle; subtype Value_Token is Token_Kind with Static_Predicate => Value_Token in Evaluated_Token | Short_Lexeme_Token | Full_Lexeme_Token; subtype Empty_Token is Token_Kind with Static_Predicate => not (Empty_Token in Value_Token | Indentation); type Token_With_Value_Holder (Kind : Token_Kind) is record Refcount : Natural := 1; case Kind is when Value_Token => Value : Text.Reference; when Indentation => Depth : Natural; when others => null; end case; end record; type Token_With_Value_Holder_Access is access Token_With_Value_Holder; type Token_With_Value is new Ada.Finalization.Controlled with record Reference : Token_With_Value_Holder_Access; end record; overriding procedure Adjust (Object : in out Token_With_Value); overriding procedure Finalize (Object : in out Token_With_Value); procedure Adjust (Object : in out Token_With_Value) is begin if Object.Reference /= null then Object.Reference.Refcount := Object.Reference.Refcount + 1; end if; end Adjust; procedure Finalize (Object : in out Token_With_Value) is procedure Free is new Ada.Unchecked_Deallocation (Token_With_Value_Holder, Token_With_Value_Holder_Access); Reference : Token_With_Value_Holder_Access := Object.Reference; begin Object.Reference := null; if Reference /= null then Reference.Refcount := Reference.Refcount - 1; if Reference.Refcount = 0 then Free (Reference); end if; end if; end Finalize; function To_String (T : Token_With_Value) return String is (T.Reference.Kind'Img & (case T.Reference.Kind is when Value_Token => '(' & Escaped (T.Reference.Value) & ')', when Indentation => '(' & T.Reference.Depth'Img & ')', when others => "")); type Token_List is array (Positive range <>) of Token_With_Value; function TI (Indent : Natural) return Token_With_Value is (Token_With_Value'(Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Indentation, Depth => Indent))); function With_String (Tok : Value_Token; S : String; T : in out Test_Cases.Test_Case'Class) return Token_With_Value is begin return V : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder (Kind => Tok)) do V.Reference.Refcount := 1; V.Reference.Value := TC (T).Pool.From_String (S); end return; end With_String; function TPS (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Plain_Scalar, Content, T)); function TSQS (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Single_Quoted_Scalar, Content, T)); function TDQS (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Double_Quoted_Scalar, Content, T)); function TLS (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Literal_Scalar, Content, T)); function TFS (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Folded_Scalar, Content, T)); TStrE : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Stream_End)); TMK : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Map_Key_Ind)); TMV : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Map_Value_Ind)); TMS : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Flow_Map_Start)); TME : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Flow_Map_End)); TSep : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Flow_Separator)); TSS : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Flow_Seq_Start)); TSE : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Flow_Seq_End)); TSI : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Seq_Item_Ind)); TYD : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Yaml_Directive)); TTD : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Tag_Directive)); TDirE : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Directives_End)); TDocE : constant Token_With_Value := (Ada.Finalization.Controlled with Reference => new Token_With_Value_Holder'(Refcount => 1, Kind => Document_End)); function TDP (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Directive_Param, Content, T)); function TTH (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Tag_Handle, Content, T)); function TTV (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Verbatim_Tag, Content, T)); function TTU (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Suffix, Content, T)); function TUD (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Unknown_Directive, Content, T)); function TAn (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Anchor, Content, T)); function TAli (T : in out Test_Cases.Test_Case'Class; Content : String) return Token_With_Value is (With_String (Alias, Content, T)); function To_String (L : Instance; T : Token_Kind) return String is (T'Img & (case T is when Evaluated_Token => '(' & Escaped (L.Value) & ')', when Short_Lexeme_Token => '(' & Escaped (Short_Lexeme (L)) & ')', when Full_Lexeme_Token => '(' & Escaped (Full_Lexeme (L)) & ')', when Empty_Token => "", when Indentation => '(' & Natural'(L.Pos - L.Line_Start - 1)'Img & ')')); procedure Assert_Equals (P : Text.Pool.Reference; Input : String; Expected : Token_List) is L : Instance; I : Natural := 0; begin Init (L, Input, P); for Expected_Token of Expected loop I := I + 1; declare T : constant Token := Next_Token (L); begin Assert (T.Kind = Expected_Token.Reference.Kind, "Wrong token kind at #" & I'Img & ": Expected " & To_String (Expected_Token) & ", got " & To_String (L, T.Kind)); if T.Kind = Expected_Token.Reference.Kind then case T.Kind is when Evaluated_Token => Assert (L.Value = Expected_Token.Reference.Value, "Wrong content at #" & I'Img & ": Expected " & Escaped (Expected_Token.Reference.Value) & ", got " & Escaped (L.Value)); when Full_Lexeme_Token => Assert (Full_Lexeme (L) = Expected_Token.Reference.Value, "Wrong " & T.Kind'Img & " at #" & I'Img & ": Expected " & Escaped (Expected_Token.Reference.Value) & ", got " & Escaped (Full_Lexeme (L))); when Short_Lexeme_Token => Assert (Short_Lexeme (L) = Expected_Token.Reference.Value, "Wrong " & T.Kind'Img & "at #" & I'Img & ": Expected " & Escaped (Expected_Token.Reference.Value) & ", got " & Escaped (Short_Lexeme (L))); when Indentation => Assert (L.Pos - L.Line_Start - 1 = Expected_Token.Reference.Depth, "Wrong indentation at #" & I'Img & ": Expected" & Expected_Token.Reference.Depth'Img & ", got " & Integer'(L.Pos - L.Line_Start - 2)'Img); when Empty_Token => null; end case; end if; end; end loop; end Assert_Equals; procedure Register_Tests (T : in out TC) is use AUnit.Test_Cases.Registration; begin Register_Routine (T, Empty_Document'Access, "Empty document"); Register_Routine (T, Single_Line_Scalar'Access, "Single line scalar"); Register_Routine (T, Multiline_Scalar'Access, "Multiline scalar"); Register_Routine (T, Single_Line_Mapping'Access, "Single line mapping"); Register_Routine (T, Multiline_Mapping'Access, "Multiline mapping"); Register_Routine (T, Explicit_Mapping'Access, "Explicit mapping"); Register_Routine (T, Sequence'Access, "Sequence"); Register_Routine (T, Sequence_With_Block_Mappings'Access, "Sequence with block mappings"); Register_Routine (T, Single_Quoted_Scalar'Access, "Single-line single quoted scalar"); Register_Routine (T, Multiline_Single_Quoted_Scalar'Access, "Multiline single quoted scalar"); Register_Routine (T, Double_Quoted_Scalar'Access, "Single-line double quoted scalar"); Register_Routine (T, Multiline_Double_Quoted_Scalar'Access, "Multiline double quoted scalar"); Register_Routine (T, Escape_Sequences'Access, "Escape sequences"); Register_Routine (T, Block_Scalar'Access, "Block scalar"); Register_Routine (T, Block_Scalars'Access, "Block scalars"); Register_Routine (T, Directives'Access, "Directives"); Register_Routine (T, Markers'Access, "Markers and unknown directives"); Register_Routine (T, Flow_Indicators'Access, "Flow indicators"); Register_Routine (T, Adjacent_Map_Values'Access, "Adjacent map values (JSON-style)"); Register_Routine (T, Tag_Handles'Access, "Tag handles"); Register_Routine (T, Verbatim_Tag_Handle'Access, "Verbatim tag handle"); Register_Routine (T, Anchors_And_Aliases'Access, "Anchors and aliases"); Register_Routine (T, Empty_Lines'Access, "Empty lines"); end Register_Tests; function Name (T : TC) return Message_String is pragma Unreferenced (T); begin return AUnit.Format ("Tokenization tests for Lexer"); end Name; procedure Set_Up (T : in out TC) is begin T.Pool.Create (8092); end Set_Up; procedure Empty_Document (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "", (1 => TStrE)); end Empty_Document; procedure Single_Line_Scalar (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "scalar", (TI (0), TPS (T, "scalar"), TStrE)); end Single_Line_Scalar; procedure Multiline_Scalar (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "scalar" & Line_Feed & " line two", (TI (0), TPS (T, "scalar line two"), TStrE)); end Multiline_Scalar; procedure Single_Line_Mapping (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "key: value", (TI (0), TPS (T, "key"), TMV, TPS (T, "value"), TStrE)); end Single_Line_Mapping; procedure Multiline_Mapping (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "key:" & Line_Feed & " value", (TI (0), TPS (T, "key"), TMV, TI (2), TPS (T, "value"), TStrE)); end Multiline_Mapping; procedure Explicit_Mapping (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "? key" & Line_Feed & ": value", (TI (0), TMK, TPS (T, "key"), TI (0), TMV, TPS (T, "value"), TStrE)); end Explicit_Mapping; procedure Sequence (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "- a" & Line_Feed & "- b", (TI (0), TSI, TPS (T, "a"), TI (0), TSI, TPS (T, "b"), TStrE)); end Sequence; procedure Sequence_With_Block_Mappings (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "-" & Line_Feed & " avg: 0.228", (TI (0), TSI, TI (2), TPS (T, "avg"), TMV, TPS (T, "0.228"), TStrE)); end Sequence_With_Block_Mappings; procedure Single_Quoted_Scalar (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "'quoted scalar'", (TI (0), TSQS (T, "quoted scalar"), TStrE)); end Single_Quoted_Scalar; procedure Multiline_Single_Quoted_Scalar (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "'quoted" & Line_Feed & " multi line " & Line_Feed & Line_Feed & "scalar'", (TI (0), TSQS (T, "quoted multi line" & Line_Feed & "scalar"), TStrE)); end Multiline_Single_Quoted_Scalar; procedure Double_Quoted_Scalar (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, """quoted scalar""", (TI (0), TDQS (T, "quoted scalar"), TStrE)); end Double_Quoted_Scalar; procedure Multiline_Double_Quoted_Scalar (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, """quoted" & Line_Feed & " multi line " & Line_Feed & Line_Feed & "scalar""", (TI (0), TDQS (T, "quoted multi line" & Line_Feed & "scalar"), TStrE)); end Multiline_Double_Quoted_Scalar; procedure Escape_Sequences (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, """\n\x31\u0032\U00000033""", (TI (0), TDQS (T, Line_Feed & "123"), TStrE)); end Escape_Sequences; procedure Block_Scalar (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "|" & Line_Feed & " a" & Line_Feed & Line_Feed & " b" & Line_Feed & " # comment", (TI (0), TLS (T, "a" & Line_Feed & Line_Feed & "b" & Line_Feed), TStrE)); end Block_Scalar; procedure Block_Scalars (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "one : >2-" & Line_Feed & " foo" & Line_Feed & " bar" & Line_Feed & "two: |+" & Line_Feed & " bar" & Line_Feed & " baz" & Line_Feed & Line_Feed, (TI (0), TPS (T, "one"), TMV, TFS (T, " foo bar"), TI (0), TPS (T, "two"), TMV, TLS (T, "bar" & Line_Feed & " baz" & Line_Feed & Line_Feed), TStrE)); end Block_Scalars; procedure Directives (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "%YAML 1.3" & Line_Feed & "---" & Line_Feed & "%TAG" & Line_Feed & "..." & Line_Feed & Line_Feed & "%TAG ! example%20.html", (TYD, TDP (T, "1.3"), TDirE, TI (0), TPS (T, "%TAG"), TDocE, TTD, TTH (T, "!"), TTU (T, "example .html"), TStrE)); end Directives; procedure Markers (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "---" & Line_Feed & "---" & Line_Feed & "..." & Line_Feed & "%UNKNOWN warbl", (TDirE, TDirE, TDocE, TUD (T, "UNKNOWN"), TDP (T, "warbl"), TStrE)); end Markers; procedure Flow_Indicators (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "bla]: {c: d, [e]: f}", (TI (0), TPS (T, "bla]"), TMV, TMS, TPS (T, "c"), TMV, TPS (T, "d"), TSep, TSS, TPS (T, "e"), TSE, TMV, TPS (T, "f"), TME, TStrE)); end Flow_Indicators; procedure Adjacent_Map_Values (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "{""foo"":bar, [1]" & Line_Feed & ":egg}", (TI (0), TMS, TDQS (T, "foo"), TMV, TPS (T, "bar"), TSep, TSS, TPS (T, "1"), TSE, TMV, TPS (T, "egg"), TME, TStrE)); end Adjacent_Map_Values; procedure Tag_Handles (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "- !!str string" & Line_Feed & "- !local%21 local" & Line_Feed & "- !e! e", (TI (0), TSI, TTH (T, "!!"), TTU (T, "str"), TPS (T, "string"), TI (0), TSI, TTH (T, "!"), TTU (T, "local!"), TPS (T, "local"), TI (0), TSI, TTH (T, "!e!"), TTU (T, ""), TPS (T, "e"), TStrE)); end Tag_Handles; procedure Verbatim_Tag_Handle (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "!<tag:yaml.org,2002:str> string", (TI (0), TTV (T, "tag:yaml.org,2002:str"), TPS (T, "string"), TStrE)); end Verbatim_Tag_Handle; procedure Anchors_And_Aliases (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "&a foo: {&b b: *a, *b : c}", (TI (0), TAn (T, "a"), TPS (T, "foo"), TMV, TMS, TAn (T, "b"), TPS (T, "b"), TMV, TAli (T, "a"), TSep, TAli (T, "b"), TMV, TPS (T, "c"), TME, TStrE)); end Anchors_And_Aliases; procedure Empty_Lines (T : in out Test_Cases.Test_Case'Class) is begin Assert_Equals (TC (T).Pool, "block: foo" & Line_Feed & Line_Feed & " bar" & Line_Feed & Line_Feed & " baz" & Line_Feed & "flow: {" & Line_Feed & " foo" & Line_Feed & Line_Feed & " bar: baz" & Line_Feed & Line_Feed & Line_Feed & " mi" & Line_Feed & "}", (TI (0), TPS (T, "block"), TMV, TPS (T, "foo" & Line_Feed & "bar" & Line_Feed & "baz"), TI (0), TPS (T, "flow"), TMV, TMS, TPS (T, "foo" & Line_Feed & "bar"), TMV, TPS (T, "baz" & Line_Feed & Line_Feed & "mi"), TME, TStrE)); end Empty_Lines; end Yaml.Lexer.Tokenization_Test;
-- { dg-do run } with GNAT.Compiler_Version; procedure Test_Version is package Vsn is new GNAT.Compiler_Version; use Vsn; X : constant String := Version; begin if X'Length = 78 then -- 78 = Ver_Len_Max + Ver_Prefix'Length -- actual version should be shorter than this raise Program_Error; end if; end Test_Version;
with Ada.Text_IO; procedure Hello is package IO renames Ada.Text_IO; X: Integer := 4; begin case X is when 1 => Walk_The_Dog; when 5 => Launch_Nuke; when 8 | 10 => Sell_All_Stock; when others => Self_Destruct; end case; end Hello;
package Vect16 is type Sarray is array (1 .. 4) of Long_Float; for Sarray'Alignment use 16; procedure Add_Sub (X, Y : Sarray; R,S : out Sarray); end Vect16;
------------------------------------------------------------------------------ -- 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. ------------------------------------------------------------------------------ package Asis.Gela.Elements.Expr is ------------------------- -- Box_Expression_Node -- ------------------------- type Box_Expression_Node is new Expression_Node with private; type Box_Expression_Ptr is access all Box_Expression_Node; for Box_Expression_Ptr'Storage_Pool use Lists.Pool; function New_Box_Expression_Node (The_Context : ASIS.Context) return Box_Expression_Ptr; function Expression_Kind (Element : Box_Expression_Node) return Asis.Expression_Kinds; function Clone (Element : Box_Expression_Node; Parent : Asis.Element) return Asis.Element; ----------------------- -- Base_Literal_Node -- ----------------------- type Base_Literal_Node is abstract new Expression_Node with private; type Base_Literal_Ptr is access all Base_Literal_Node; for Base_Literal_Ptr'Storage_Pool use Lists.Pool; function Value_Image (Element : Base_Literal_Node) return Wide_String; procedure Set_Value_Image (Element : in out Base_Literal_Node; Value : in Wide_String); -------------------------- -- Integer_Literal_Node -- -------------------------- type Integer_Literal_Node is new Base_Literal_Node with private; type Integer_Literal_Ptr is access all Integer_Literal_Node; for Integer_Literal_Ptr'Storage_Pool use Lists.Pool; function New_Integer_Literal_Node (The_Context : ASIS.Context) return Integer_Literal_Ptr; function Expression_Kind (Element : Integer_Literal_Node) return Asis.Expression_Kinds; function Clone (Element : Integer_Literal_Node; Parent : Asis.Element) return Asis.Element; ----------------------- -- Real_Literal_Node -- ----------------------- type Real_Literal_Node is new Base_Literal_Node with private; type Real_Literal_Ptr is access all Real_Literal_Node; for Real_Literal_Ptr'Storage_Pool use Lists.Pool; function New_Real_Literal_Node (The_Context : ASIS.Context) return Real_Literal_Ptr; function Expression_Kind (Element : Real_Literal_Node) return Asis.Expression_Kinds; function Clone (Element : Real_Literal_Node; Parent : Asis.Element) return Asis.Element; ------------------------- -- String_Literal_Node -- ------------------------- type String_Literal_Node is new Base_Literal_Node with private; type String_Literal_Ptr is access all String_Literal_Node; for String_Literal_Ptr'Storage_Pool use Lists.Pool; function New_String_Literal_Node (The_Context : ASIS.Context) return String_Literal_Ptr; function Expression_Kind (Element : String_Literal_Node) return Asis.Expression_Kinds; function Clone (Element : String_Literal_Node; Parent : Asis.Element) return Asis.Element; -------------------------- -- Base_Identifier_Node -- -------------------------- type Base_Identifier_Node is abstract new Expression_Node with private; type Base_Identifier_Ptr is access all Base_Identifier_Node; for Base_Identifier_Ptr'Storage_Pool use Lists.Pool; function Name_Image (Element : Base_Identifier_Node) return Wide_String; procedure Set_Name_Image (Element : in out Base_Identifier_Node; Value : in Wide_String); function Corresponding_Name_Declaration (Element : Base_Identifier_Node) return Asis.Declaration; procedure Set_Corresponding_Name_Declaration (Element : in out Base_Identifier_Node; Value : in Asis.Declaration); function Corresponding_Name_Definition_List (Element : Base_Identifier_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Add_To_Corresponding_Name_Definition_List (Element : in out Base_Identifier_Node; Item : in Asis.Element); function Corresponding_Generic_Element (Element : Base_Identifier_Node) return Asis.Defining_Name; procedure Set_Corresponding_Generic_Element (Element : in out Base_Identifier_Node; Value : in Asis.Defining_Name); --------------------- -- Identifier_Node -- --------------------- type Identifier_Node is new Base_Identifier_Node with private; type Identifier_Ptr is access all Identifier_Node; for Identifier_Ptr'Storage_Pool use Lists.Pool; function New_Identifier_Node (The_Context : ASIS.Context) return Identifier_Ptr; function Expression_Kind (Element : Identifier_Node) return Asis.Expression_Kinds; function Clone (Element : Identifier_Node; Parent : Asis.Element) return Asis.Element; -------------------------- -- Operator_Symbol_Node -- -------------------------- type Operator_Symbol_Node is new Base_Identifier_Node with private; type Operator_Symbol_Ptr is access all Operator_Symbol_Node; for Operator_Symbol_Ptr'Storage_Pool use Lists.Pool; function New_Operator_Symbol_Node (The_Context : ASIS.Context) return Operator_Symbol_Ptr; function Operator_Kind (Element : Operator_Symbol_Node) return Asis.Operator_Kinds; procedure Set_Operator_Kind (Element : in out Operator_Symbol_Node; Value : in Asis.Operator_Kinds); function Expression_Kind (Element : Operator_Symbol_Node) return Asis.Expression_Kinds; function Clone (Element : Operator_Symbol_Node; Parent : Asis.Element) return Asis.Element; ---------------------------- -- Character_Literal_Node -- ---------------------------- type Character_Literal_Node is new Base_Identifier_Node with private; type Character_Literal_Ptr is access all Character_Literal_Node; for Character_Literal_Ptr'Storage_Pool use Lists.Pool; function New_Character_Literal_Node (The_Context : ASIS.Context) return Character_Literal_Ptr; function Expression_Kind (Element : Character_Literal_Node) return Asis.Expression_Kinds; function Clone (Element : Character_Literal_Node; Parent : Asis.Element) return Asis.Element; ------------------------------ -- Enumeration_Literal_Node -- ------------------------------ type Enumeration_Literal_Node is new Base_Identifier_Node with private; type Enumeration_Literal_Ptr is access all Enumeration_Literal_Node; for Enumeration_Literal_Ptr'Storage_Pool use Lists.Pool; function New_Enumeration_Literal_Node (The_Context : ASIS.Context) return Enumeration_Literal_Ptr; function Expression_Kind (Element : Enumeration_Literal_Node) return Asis.Expression_Kinds; function Clone (Element : Enumeration_Literal_Node; Parent : Asis.Element) return Asis.Element; ------------------------------- -- Explicit_Dereference_Node -- ------------------------------- type Explicit_Dereference_Node is new Expression_Node with private; type Explicit_Dereference_Ptr is access all Explicit_Dereference_Node; for Explicit_Dereference_Ptr'Storage_Pool use Lists.Pool; function New_Explicit_Dereference_Node (The_Context : ASIS.Context) return Explicit_Dereference_Ptr; function Prefix (Element : Explicit_Dereference_Node) return Asis.Expression; procedure Set_Prefix (Element : in out Explicit_Dereference_Node; Value : in Asis.Expression); function Expression_Kind (Element : Explicit_Dereference_Node) return Asis.Expression_Kinds; function Children (Element : access Explicit_Dereference_Node) return Traverse_List; function Clone (Element : Explicit_Dereference_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Explicit_Dereference_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ------------------------ -- Function_Call_Node -- ------------------------ type Function_Call_Node is new Expression_Node with private; type Function_Call_Ptr is access all Function_Call_Node; for Function_Call_Ptr'Storage_Pool use Lists.Pool; function New_Function_Call_Node (The_Context : ASIS.Context) return Function_Call_Ptr; function Prefix (Element : Function_Call_Node) return Asis.Expression; procedure Set_Prefix (Element : in out Function_Call_Node; Value : in Asis.Expression); function Is_Prefix_Call (Element : Function_Call_Node) return Boolean; procedure Set_Is_Prefix_Call (Element : in out Function_Call_Node; Value : in Boolean); function Is_Dispatching_Call (Element : Function_Call_Node) return Boolean; procedure Set_Is_Dispatching_Call (Element : in out Function_Call_Node; Value : in Boolean); function Corresponding_Called_Function (Element : Function_Call_Node) return Asis.Declaration; procedure Set_Corresponding_Called_Function (Element : in out Function_Call_Node; Value : in Asis.Declaration); function Function_Call_Parameters (Element : Function_Call_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Function_Call_Parameters (Element : in out Function_Call_Node; Value : in Asis.Element); function Function_Call_Parameters_List (Element : Function_Call_Node) return Asis.Element; function Normalized_Function_Call_Parameters (Element : Function_Call_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Add_To_Normalized_Function_Call_Parameters (Element : in out Function_Call_Node; Item : in Asis.Element); function Is_Call_On_Dispatching_Operation (Element : Function_Call_Node) return Boolean; procedure Set_Is_Call_On_Dispatching_Operation (Element : in out Function_Call_Node; Value : in Boolean); function Record_Aggregate (Element : Function_Call_Node) return Asis.Element; procedure Set_Record_Aggregate (Element : in out Function_Call_Node; Value : in Asis.Element); function Expression_Kind (Element : Function_Call_Node) return Asis.Expression_Kinds; function Children (Element : access Function_Call_Node) return Traverse_List; function Clone (Element : Function_Call_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Function_Call_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ---------------------------- -- Indexed_Component_Node -- ---------------------------- type Indexed_Component_Node is new Expression_Node with private; type Indexed_Component_Ptr is access all Indexed_Component_Node; for Indexed_Component_Ptr'Storage_Pool use Lists.Pool; function New_Indexed_Component_Node (The_Context : ASIS.Context) return Indexed_Component_Ptr; function Prefix (Element : Indexed_Component_Node) return Asis.Expression; procedure Set_Prefix (Element : in out Indexed_Component_Node; Value : in Asis.Expression); function Index_Expressions (Element : Indexed_Component_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Index_Expressions (Element : in out Indexed_Component_Node; Value : in Asis.Element); function Index_Expressions_List (Element : Indexed_Component_Node) return Asis.Element; function Expression_Kind (Element : Indexed_Component_Node) return Asis.Expression_Kinds; function Children (Element : access Indexed_Component_Node) return Traverse_List; function Clone (Element : Indexed_Component_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Indexed_Component_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ---------------- -- Slice_Node -- ---------------- type Slice_Node is new Expression_Node with private; type Slice_Ptr is access all Slice_Node; for Slice_Ptr'Storage_Pool use Lists.Pool; function New_Slice_Node (The_Context : ASIS.Context) return Slice_Ptr; function Prefix (Element : Slice_Node) return Asis.Expression; procedure Set_Prefix (Element : in out Slice_Node; Value : in Asis.Expression); function Slice_Range (Element : Slice_Node) return Asis.Discrete_Range; procedure Set_Slice_Range (Element : in out Slice_Node; Value : in Asis.Discrete_Range); function Expression_Kind (Element : Slice_Node) return Asis.Expression_Kinds; function Children (Element : access Slice_Node) return Traverse_List; function Clone (Element : Slice_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Slice_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ----------------------------- -- Selected_Component_Node -- ----------------------------- type Selected_Component_Node is new Expression_Node with private; type Selected_Component_Ptr is access all Selected_Component_Node; for Selected_Component_Ptr'Storage_Pool use Lists.Pool; function New_Selected_Component_Node (The_Context : ASIS.Context) return Selected_Component_Ptr; function Prefix (Element : Selected_Component_Node) return Asis.Expression; procedure Set_Prefix (Element : in out Selected_Component_Node; Value : in Asis.Expression); function Selector (Element : Selected_Component_Node) return Asis.Expression; procedure Set_Selector (Element : in out Selected_Component_Node; Value : in Asis.Expression); function Expression_Kind (Element : Selected_Component_Node) return Asis.Expression_Kinds; function Children (Element : access Selected_Component_Node) return Traverse_List; function Clone (Element : Selected_Component_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Selected_Component_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ------------------------------ -- Attribute_Reference_Node -- ------------------------------ type Attribute_Reference_Node is new Expression_Node with private; type Attribute_Reference_Ptr is access all Attribute_Reference_Node; for Attribute_Reference_Ptr'Storage_Pool use Lists.Pool; function New_Attribute_Reference_Node (The_Context : ASIS.Context) return Attribute_Reference_Ptr; function Prefix (Element : Attribute_Reference_Node) return Asis.Expression; procedure Set_Prefix (Element : in out Attribute_Reference_Node; Value : in Asis.Expression); function Attribute_Kind (Element : Attribute_Reference_Node) return Asis.Attribute_Kinds; procedure Set_Attribute_Kind (Element : in out Attribute_Reference_Node; Value : in Asis.Attribute_Kinds); function Attribute_Designator_Identifier (Element : Attribute_Reference_Node) return Asis.Expression; procedure Set_Attribute_Designator_Identifier (Element : in out Attribute_Reference_Node; Value : in Asis.Expression); function Attribute_Designator_Expressions (Element : Attribute_Reference_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Attribute_Designator_Expressions (Element : in out Attribute_Reference_Node; Value : in Asis.Element); function Attribute_Designator_Expressions_List (Element : Attribute_Reference_Node) return Asis.Element; function Expression_Kind (Element : Attribute_Reference_Node) return Asis.Expression_Kinds; function Children (Element : access Attribute_Reference_Node) return Traverse_List; function Clone (Element : Attribute_Reference_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Attribute_Reference_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); -------------------------------- -- Base_Record_Aggregate_Node -- -------------------------------- type Base_Record_Aggregate_Node is abstract new Expression_Node with private; type Base_Record_Aggregate_Ptr is access all Base_Record_Aggregate_Node; for Base_Record_Aggregate_Ptr'Storage_Pool use Lists.Pool; function Record_Component_Associations (Element : Base_Record_Aggregate_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Record_Component_Associations (Element : in out Base_Record_Aggregate_Node; Value : in Asis.Element); function Record_Component_Associations_List (Element : Base_Record_Aggregate_Node) return Asis.Element; function Normalized_Record_Component_Associations (Element : Base_Record_Aggregate_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Add_To_Normalized_Record_Component_Associations (Element : in out Base_Record_Aggregate_Node; Item : in Asis.Element); function Children (Element : access Base_Record_Aggregate_Node) return Traverse_List; --------------------------- -- Record_Aggregate_Node -- --------------------------- type Record_Aggregate_Node is new Base_Record_Aggregate_Node with private; type Record_Aggregate_Ptr is access all Record_Aggregate_Node; for Record_Aggregate_Ptr'Storage_Pool use Lists.Pool; function New_Record_Aggregate_Node (The_Context : ASIS.Context) return Record_Aggregate_Ptr; function Expression_Kind (Element : Record_Aggregate_Node) return Asis.Expression_Kinds; function Clone (Element : Record_Aggregate_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Record_Aggregate_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ------------------------------ -- Extension_Aggregate_Node -- ------------------------------ type Extension_Aggregate_Node is new Base_Record_Aggregate_Node with private; type Extension_Aggregate_Ptr is access all Extension_Aggregate_Node; for Extension_Aggregate_Ptr'Storage_Pool use Lists.Pool; function New_Extension_Aggregate_Node (The_Context : ASIS.Context) return Extension_Aggregate_Ptr; function Extension_Aggregate_Expression (Element : Extension_Aggregate_Node) return Asis.Expression; procedure Set_Extension_Aggregate_Expression (Element : in out Extension_Aggregate_Node; Value : in Asis.Expression); function Expression_Kind (Element : Extension_Aggregate_Node) return Asis.Expression_Kinds; function Children (Element : access Extension_Aggregate_Node) return Traverse_List; function Clone (Element : Extension_Aggregate_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Extension_Aggregate_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ------------------------------- -- Base_Array_Aggregate_Node -- ------------------------------- type Base_Array_Aggregate_Node is abstract new Expression_Node with private; type Base_Array_Aggregate_Ptr is access all Base_Array_Aggregate_Node; for Base_Array_Aggregate_Ptr'Storage_Pool use Lists.Pool; function Array_Component_Associations (Element : Base_Array_Aggregate_Node; Include_Pragmas : in Boolean := False) return Asis.Element_List; procedure Set_Array_Component_Associations (Element : in out Base_Array_Aggregate_Node; Value : in Asis.Element); function Array_Component_Associations_List (Element : Base_Array_Aggregate_Node) return Asis.Element; function Children (Element : access Base_Array_Aggregate_Node) return Traverse_List; ------------------------------------- -- Positional_Array_Aggregate_Node -- ------------------------------------- type Positional_Array_Aggregate_Node is new Base_Array_Aggregate_Node with private; type Positional_Array_Aggregate_Ptr is access all Positional_Array_Aggregate_Node; for Positional_Array_Aggregate_Ptr'Storage_Pool use Lists.Pool; function New_Positional_Array_Aggregate_Node (The_Context : ASIS.Context) return Positional_Array_Aggregate_Ptr; function Expression_Kind (Element : Positional_Array_Aggregate_Node) return Asis.Expression_Kinds; function Clone (Element : Positional_Array_Aggregate_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Positional_Array_Aggregate_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); -------------------------------- -- Named_Array_Aggregate_Node -- -------------------------------- type Named_Array_Aggregate_Node is new Base_Array_Aggregate_Node with private; type Named_Array_Aggregate_Ptr is access all Named_Array_Aggregate_Node; for Named_Array_Aggregate_Ptr'Storage_Pool use Lists.Pool; function New_Named_Array_Aggregate_Node (The_Context : ASIS.Context) return Named_Array_Aggregate_Ptr; function Expression_Kind (Element : Named_Array_Aggregate_Node) return Asis.Expression_Kinds; function Clone (Element : Named_Array_Aggregate_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Named_Array_Aggregate_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ----------------------------- -- Base_Short_Circuit_Node -- ----------------------------- type Base_Short_Circuit_Node is abstract new Expression_Node with private; type Base_Short_Circuit_Ptr is access all Base_Short_Circuit_Node; for Base_Short_Circuit_Ptr'Storage_Pool use Lists.Pool; function Short_Circuit_Operation_Left_Expression (Element : Base_Short_Circuit_Node) return Asis.Expression; procedure Set_Short_Circuit_Operation_Left_Expression (Element : in out Base_Short_Circuit_Node; Value : in Asis.Expression); function Short_Circuit_Operation_Right_Expression (Element : Base_Short_Circuit_Node) return Asis.Expression; procedure Set_Short_Circuit_Operation_Right_Expression (Element : in out Base_Short_Circuit_Node; Value : in Asis.Expression); function Children (Element : access Base_Short_Circuit_Node) return Traverse_List; --------------------------------- -- And_Then_Short_Circuit_Node -- --------------------------------- type And_Then_Short_Circuit_Node is new Base_Short_Circuit_Node with private; type And_Then_Short_Circuit_Ptr is access all And_Then_Short_Circuit_Node; for And_Then_Short_Circuit_Ptr'Storage_Pool use Lists.Pool; function New_And_Then_Short_Circuit_Node (The_Context : ASIS.Context) return And_Then_Short_Circuit_Ptr; function Expression_Kind (Element : And_Then_Short_Circuit_Node) return Asis.Expression_Kinds; function Clone (Element : And_Then_Short_Circuit_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access And_Then_Short_Circuit_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); -------------------------------- -- Or_Else_Short_Circuit_Node -- -------------------------------- type Or_Else_Short_Circuit_Node is new Base_Short_Circuit_Node with private; type Or_Else_Short_Circuit_Ptr is access all Or_Else_Short_Circuit_Node; for Or_Else_Short_Circuit_Ptr'Storage_Pool use Lists.Pool; function New_Or_Else_Short_Circuit_Node (The_Context : ASIS.Context) return Or_Else_Short_Circuit_Ptr; function Expression_Kind (Element : Or_Else_Short_Circuit_Node) return Asis.Expression_Kinds; function Clone (Element : Or_Else_Short_Circuit_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Or_Else_Short_Circuit_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ----------------------------------- -- In_Range_Membership_Test_Node -- ----------------------------------- type In_Range_Membership_Test_Node is new Expression_Node with private; type In_Range_Membership_Test_Ptr is access all In_Range_Membership_Test_Node; for In_Range_Membership_Test_Ptr'Storage_Pool use Lists.Pool; function New_In_Range_Membership_Test_Node (The_Context : ASIS.Context) return In_Range_Membership_Test_Ptr; function Membership_Test_Expression (Element : In_Range_Membership_Test_Node) return Asis.Expression; procedure Set_Membership_Test_Expression (Element : in out In_Range_Membership_Test_Node; Value : in Asis.Expression); function Membership_Test_Range (Element : In_Range_Membership_Test_Node) return Asis.Range_Constraint; procedure Set_Membership_Test_Range (Element : in out In_Range_Membership_Test_Node; Value : in Asis.Range_Constraint); function Expression_Kind (Element : In_Range_Membership_Test_Node) return Asis.Expression_Kinds; function Children (Element : access In_Range_Membership_Test_Node) return Traverse_List; function Clone (Element : In_Range_Membership_Test_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access In_Range_Membership_Test_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); --------------------------------------- -- Not_In_Range_Membership_Test_Node -- --------------------------------------- type Not_In_Range_Membership_Test_Node is new In_Range_Membership_Test_Node with private; type Not_In_Range_Membership_Test_Ptr is access all Not_In_Range_Membership_Test_Node; for Not_In_Range_Membership_Test_Ptr'Storage_Pool use Lists.Pool; function New_Not_In_Range_Membership_Test_Node (The_Context : ASIS.Context) return Not_In_Range_Membership_Test_Ptr; function Expression_Kind (Element : Not_In_Range_Membership_Test_Node) return Asis.Expression_Kinds; function Clone (Element : Not_In_Range_Membership_Test_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Not_In_Range_Membership_Test_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ---------------------------------- -- In_Type_Membership_Test_Node -- ---------------------------------- type In_Type_Membership_Test_Node is new Expression_Node with private; type In_Type_Membership_Test_Ptr is access all In_Type_Membership_Test_Node; for In_Type_Membership_Test_Ptr'Storage_Pool use Lists.Pool; function New_In_Type_Membership_Test_Node (The_Context : ASIS.Context) return In_Type_Membership_Test_Ptr; function Membership_Test_Expression (Element : In_Type_Membership_Test_Node) return Asis.Expression; procedure Set_Membership_Test_Expression (Element : in out In_Type_Membership_Test_Node; Value : in Asis.Expression); function Membership_Test_Subtype_Mark (Element : In_Type_Membership_Test_Node) return Asis.Expression; procedure Set_Membership_Test_Subtype_Mark (Element : in out In_Type_Membership_Test_Node; Value : in Asis.Expression); function Expression_Kind (Element : In_Type_Membership_Test_Node) return Asis.Expression_Kinds; function Children (Element : access In_Type_Membership_Test_Node) return Traverse_List; function Clone (Element : In_Type_Membership_Test_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access In_Type_Membership_Test_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); -------------------------------------- -- Not_In_Type_Membership_Test_Node -- -------------------------------------- type Not_In_Type_Membership_Test_Node is new In_Type_Membership_Test_Node with private; type Not_In_Type_Membership_Test_Ptr is access all Not_In_Type_Membership_Test_Node; for Not_In_Type_Membership_Test_Ptr'Storage_Pool use Lists.Pool; function New_Not_In_Type_Membership_Test_Node (The_Context : ASIS.Context) return Not_In_Type_Membership_Test_Ptr; function Expression_Kind (Element : Not_In_Type_Membership_Test_Node) return Asis.Expression_Kinds; function Clone (Element : Not_In_Type_Membership_Test_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Not_In_Type_Membership_Test_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ----------------------- -- Null_Literal_Node -- ----------------------- type Null_Literal_Node is new Expression_Node with private; type Null_Literal_Ptr is access all Null_Literal_Node; for Null_Literal_Ptr'Storage_Pool use Lists.Pool; function New_Null_Literal_Node (The_Context : ASIS.Context) return Null_Literal_Ptr; function Expression_Kind (Element : Null_Literal_Node) return Asis.Expression_Kinds; function Clone (Element : Null_Literal_Node; Parent : Asis.Element) return Asis.Element; ----------------------------------- -- Parenthesized_Expression_Node -- ----------------------------------- type Parenthesized_Expression_Node is new Expression_Node with private; type Parenthesized_Expression_Ptr is access all Parenthesized_Expression_Node; for Parenthesized_Expression_Ptr'Storage_Pool use Lists.Pool; function New_Parenthesized_Expression_Node (The_Context : ASIS.Context) return Parenthesized_Expression_Ptr; function Expression_Parenthesized (Element : Parenthesized_Expression_Node) return Asis.Expression; procedure Set_Expression_Parenthesized (Element : in out Parenthesized_Expression_Node; Value : in Asis.Expression); function Expression_Kind (Element : Parenthesized_Expression_Node) return Asis.Expression_Kinds; function Children (Element : access Parenthesized_Expression_Node) return Traverse_List; function Clone (Element : Parenthesized_Expression_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Parenthesized_Expression_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); -------------------------- -- Base_Conversion_Node -- -------------------------- type Base_Conversion_Node is abstract new Expression_Node with private; type Base_Conversion_Ptr is access all Base_Conversion_Node; for Base_Conversion_Ptr'Storage_Pool use Lists.Pool; function Converted_Or_Qualified_Subtype_Mark (Element : Base_Conversion_Node) return Asis.Expression; procedure Set_Converted_Or_Qualified_Subtype_Mark (Element : in out Base_Conversion_Node; Value : in Asis.Expression); function Converted_Or_Qualified_Expression (Element : Base_Conversion_Node) return Asis.Expression; procedure Set_Converted_Or_Qualified_Expression (Element : in out Base_Conversion_Node; Value : in Asis.Expression); function Children (Element : access Base_Conversion_Node) return Traverse_List; -------------------------- -- Type_Conversion_Node -- -------------------------- type Type_Conversion_Node is new Base_Conversion_Node with private; type Type_Conversion_Ptr is access all Type_Conversion_Node; for Type_Conversion_Ptr'Storage_Pool use Lists.Pool; function New_Type_Conversion_Node (The_Context : ASIS.Context) return Type_Conversion_Ptr; function Expression_Kind (Element : Type_Conversion_Node) return Asis.Expression_Kinds; function Clone (Element : Type_Conversion_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Type_Conversion_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ------------------------------- -- Qualified_Expression_Node -- ------------------------------- type Qualified_Expression_Node is new Base_Conversion_Node with private; type Qualified_Expression_Ptr is access all Qualified_Expression_Node; for Qualified_Expression_Ptr'Storage_Pool use Lists.Pool; function New_Qualified_Expression_Node (The_Context : ASIS.Context) return Qualified_Expression_Ptr; function Expression_Kind (Element : Qualified_Expression_Node) return Asis.Expression_Kinds; function Clone (Element : Qualified_Expression_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Qualified_Expression_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ---------------------------------- -- Allocation_From_Subtype_Node -- ---------------------------------- type Allocation_From_Subtype_Node is new Expression_Node with private; type Allocation_From_Subtype_Ptr is access all Allocation_From_Subtype_Node; for Allocation_From_Subtype_Ptr'Storage_Pool use Lists.Pool; function New_Allocation_From_Subtype_Node (The_Context : ASIS.Context) return Allocation_From_Subtype_Ptr; function Allocator_Subtype_Indication (Element : Allocation_From_Subtype_Node) return Asis.Subtype_Indication; procedure Set_Allocator_Subtype_Indication (Element : in out Allocation_From_Subtype_Node; Value : in Asis.Subtype_Indication); function Expression_Kind (Element : Allocation_From_Subtype_Node) return Asis.Expression_Kinds; function Children (Element : access Allocation_From_Subtype_Node) return Traverse_List; function Clone (Element : Allocation_From_Subtype_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Allocation_From_Subtype_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); ----------------------------------------------- -- Allocation_From_Qualified_Expression_Node -- ----------------------------------------------- type Allocation_From_Qualified_Expression_Node is new Expression_Node with private; type Allocation_From_Qualified_Expression_Ptr is access all Allocation_From_Qualified_Expression_Node; for Allocation_From_Qualified_Expression_Ptr'Storage_Pool use Lists.Pool; function New_Allocation_From_Qualified_Expression_Node (The_Context : ASIS.Context) return Allocation_From_Qualified_Expression_Ptr; function Allocator_Qualified_Expression (Element : Allocation_From_Qualified_Expression_Node) return Asis.Expression; procedure Set_Allocator_Qualified_Expression (Element : in out Allocation_From_Qualified_Expression_Node; Value : in Asis.Expression); function Expression_Kind (Element : Allocation_From_Qualified_Expression_Node) return Asis.Expression_Kinds; function Children (Element : access Allocation_From_Qualified_Expression_Node) return Traverse_List; function Clone (Element : Allocation_From_Qualified_Expression_Node; Parent : Asis.Element) return Asis.Element; procedure Copy (Source : in Asis.Element; Target : access Allocation_From_Qualified_Expression_Node; Cloner : in Cloner_Class; Parent : in Asis.Element); private type Box_Expression_Node is new Expression_Node with record null; end record; type Base_Literal_Node is abstract new Expression_Node with record Value_Image : aliased Unbounded_Wide_String; end record; type Integer_Literal_Node is new Base_Literal_Node with record null; end record; type Real_Literal_Node is new Base_Literal_Node with record null; end record; type String_Literal_Node is new Base_Literal_Node with record null; end record; type Base_Identifier_Node is abstract new Expression_Node with record Name_Image : aliased Unbounded_Wide_String; Corresponding_Name_Declaration : aliased Asis.Declaration; Corresponding_Name_Definition_List : aliased Secondary_Definition_Lists.List_Node; Corresponding_Generic_Element : aliased Asis.Defining_Name; end record; type Identifier_Node is new Base_Identifier_Node with record null; end record; type Operator_Symbol_Node is new Base_Identifier_Node with record Operator_Kind : aliased Asis.Operator_Kinds := Not_An_Operator; end record; type Character_Literal_Node is new Base_Identifier_Node with record null; end record; type Enumeration_Literal_Node is new Base_Identifier_Node with record null; end record; type Explicit_Dereference_Node is new Expression_Node with record Prefix : aliased Asis.Expression; end record; type Function_Call_Node is new Expression_Node with record Prefix : aliased Asis.Expression; Is_Prefix_Call : aliased Boolean := True; Is_Dispatching_Call : aliased Boolean := False; Corresponding_Called_Function : aliased Asis.Declaration; Function_Call_Parameters : aliased Primary_Association_Lists.List; Normalized_Function_Call_Parameters : aliased Secondary_Association_Lists.List_Node; Is_Call_On_Dispatching_Operation : aliased Boolean := False; Record_Aggregate : aliased Asis.Element; end record; type Indexed_Component_Node is new Expression_Node with record Prefix : aliased Asis.Expression; Index_Expressions : aliased Primary_Expression_Lists.List; end record; type Slice_Node is new Expression_Node with record Prefix : aliased Asis.Expression; Slice_Range : aliased Asis.Discrete_Range; end record; type Selected_Component_Node is new Expression_Node with record Prefix : aliased Asis.Expression; Selector : aliased Asis.Expression; end record; type Attribute_Reference_Node is new Expression_Node with record Prefix : aliased Asis.Expression; Attribute_Kind : aliased Asis.Attribute_Kinds := Not_An_Attribute; Attribute_Designator_Identifier : aliased Asis.Expression; Attribute_Designator_Expressions : aliased Primary_Expression_Lists.List; end record; type Base_Record_Aggregate_Node is abstract new Expression_Node with record Record_Component_Associations : aliased Primary_Association_Lists.List; Normalized_Record_Component_Associations : aliased Secondary_Association_Lists.List_Node; end record; type Record_Aggregate_Node is new Base_Record_Aggregate_Node with record null; end record; type Extension_Aggregate_Node is new Base_Record_Aggregate_Node with record Extension_Aggregate_Expression : aliased Asis.Expression; end record; type Base_Array_Aggregate_Node is abstract new Expression_Node with record Array_Component_Associations : aliased Primary_Association_Lists.List; end record; type Positional_Array_Aggregate_Node is new Base_Array_Aggregate_Node with record null; end record; type Named_Array_Aggregate_Node is new Base_Array_Aggregate_Node with record null; end record; type Base_Short_Circuit_Node is abstract new Expression_Node with record Short_Circuit_Operation_Left_Expression : aliased Asis.Expression; Short_Circuit_Operation_Right_Expression : aliased Asis.Expression; end record; type And_Then_Short_Circuit_Node is new Base_Short_Circuit_Node with record null; end record; type Or_Else_Short_Circuit_Node is new Base_Short_Circuit_Node with record null; end record; type In_Range_Membership_Test_Node is new Expression_Node with record Membership_Test_Expression : aliased Asis.Expression; Membership_Test_Range : aliased Asis.Range_Constraint; end record; type Not_In_Range_Membership_Test_Node is new In_Range_Membership_Test_Node with record null; end record; type In_Type_Membership_Test_Node is new Expression_Node with record Membership_Test_Expression : aliased Asis.Expression; Membership_Test_Subtype_Mark : aliased Asis.Expression; end record; type Not_In_Type_Membership_Test_Node is new In_Type_Membership_Test_Node with record null; end record; type Null_Literal_Node is new Expression_Node with record null; end record; type Parenthesized_Expression_Node is new Expression_Node with record Expression_Parenthesized : aliased Asis.Expression; end record; type Base_Conversion_Node is abstract new Expression_Node with record Converted_Or_Qualified_Subtype_Mark : aliased Asis.Expression; Converted_Or_Qualified_Expression : aliased Asis.Expression; end record; type Type_Conversion_Node is new Base_Conversion_Node with record null; end record; type Qualified_Expression_Node is new Base_Conversion_Node with record null; end record; type Allocation_From_Subtype_Node is new Expression_Node with record Allocator_Subtype_Indication : aliased Asis.Subtype_Indication; end record; type Allocation_From_Qualified_Expression_Node is new Expression_Node with record Allocator_Qualified_Expression : aliased Asis.Expression; end record; end Asis.Gela.Elements.Expr;
pragma License (Unrestricted); package Ada.Decimal is pragma Pure; Max_Scale : constant := +18; -- implementation-defined Min_Scale : constant := -18; -- implementation-defined Min_Delta : constant := 10.0 ** (-Max_Scale); Max_Delta : constant := 10.0 ** (-Min_Scale); Max_Decimal_Digits : constant := 18; -- implementation-defined generic type Dividend_Type is delta <> digits <>; type Divisor_Type is delta <> digits <>; type Quotient_Type is delta <> digits <>; type Remainder_Type is delta <> digits <>; procedure Divide ( Dividend : Dividend_Type; Divisor : Divisor_Type; Quotient : out Quotient_Type; Remainder : out Remainder_Type) with Import, Convention => Intrinsic; end Ada.Decimal;
-- -*- Mode: Ada -*- -- Filename : last_chance_handler.adb -- Description : Implementation of the exception handler for the kernel. -- Author : Luke A. Guest -- Created On : Thu Jun 14 12:06:48 2012 -- Licence : See LICENCE in the root directory. -- with Console; use Console; procedure Last_Chance_Handler (Source_Location : System.Address; Line : Integer) is procedure Crash (Source_Location : System.Address; Line : Integer) with Import => True, Convention => Ada; begin -- TODO: Add in code to dump the info to serial/screen which -- is obviously board specific. -- Put ("Exception raised", -- Screen_Width_Range'First, -- Screen_Height_Range'Last); Crash (Source_Location => Source_Location, Line => Line); end Last_Chance_Handler;
----------------------------------------------------------------------- -- Memory clients - Client info related to its memory -- Copyright (C) 2014, 2015, 2019 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with MAT.Events.Probes; with MAT.Memory.Tools; with MAT.Expressions; package MAT.Memory.Targets is Not_Found : exception; -- Define some global statistics about the memory slots. type Memory_Stat is record Thread_Count : Natural := 0; Total_Alloc : MAT.Types.Target_Size := 0; Total_Free : MAT.Types.Target_Size := 0; Malloc_Count : Natural := 0; Free_Count : Natural := 0; Realloc_Count : Natural := 0; Used_Count : Natural := 0; end record; type Target_Memory is tagged limited private; type Client_Memory_Ref is access all Target_Memory; -- Initialize the target memory object to manage the memory slots, the stack frames -- and setup the reader to analyze the memory events. procedure Initialize (Memory : in out Target_Memory; Manager : in out MAT.Events.Probes.Probe_Manager_Type'Class); -- Add the memory region from the list of memory region managed by the program. procedure Add_Region (Memory : in out Target_Memory; Region : in Region_Info); -- Find the memory region that intersect the given section described by <tt>From</tt> -- and <tt>To</tt>. Each memory region that intersects is added to the <tt>Into</tt> -- map. procedure Find (Memory : in out Target_Memory; From : in MAT.Types.Target_Addr; To : in MAT.Types.Target_Addr; Into : in out MAT.Memory.Region_Info_Map); -- Find the region that matches the given name. function Find_Region (Memory : in Target_Memory; Name : in String) return Region_Info; -- Take into account a malloc probe. The memory slot [Addr .. Slot.Size] is inserted -- in the used slots map. The freed slots that intersect the malloc'ed region are -- removed from the freed map. procedure Probe_Malloc (Memory : in out Target_Memory; Addr : in MAT.Types.Target_Addr; Slot : in Allocation); -- Take into account a free probe. Add the memory slot in the freed map and remove -- the slot from the used slots map. procedure Probe_Free (Memory : in out Target_Memory; Addr : in MAT.Types.Target_Addr; Slot : in Allocation; Size : out MAT.Types.Target_Size; By : out MAT.Events.Event_Id_Type); -- Take into account a realloc probe. The old memory slot represented by Old_Addr is -- removed from the used slots maps and the new memory slot [Addr .. Slot.Size] is -- inserted in the used slots map. procedure Probe_Realloc (Memory : in out Target_Memory; Addr : in MAT.Types.Target_Addr; Old_Addr : in MAT.Types.Target_Addr; Slot : in Allocation; Old_Size : out MAT.Types.Target_Size; By : out MAT.Events.Event_Id_Type); -- Collect the information about memory slot sizes allocated by the application. procedure Size_Information (Memory : in out Target_Memory; Sizes : in out MAT.Memory.Tools.Size_Info_Map); -- Collect the information about threads and the memory allocations they've made. procedure Thread_Information (Memory : in out Target_Memory; Threads : in out Memory_Info_Map); -- Collect the information about frames and the memory allocations they've made. procedure Frame_Information (Memory : in out Target_Memory; Level : in Natural; Frames : in out Frame_Info_Map); -- Get the global memory and allocation statistics. procedure Stat_Information (Memory : in out Target_Memory; Result : out Memory_Stat); -- Find from the <tt>Memory</tt> map the memory slots whose address intersects -- the region [From .. To] and which is selected by the given filter expression. -- Add the memory slot in the <tt>Into</tt> list if it does not already contains -- the memory slot. procedure Find (Memory : in out Target_Memory; From : in MAT.Types.Target_Addr; To : in MAT.Types.Target_Addr; Filter : in MAT.Expressions.Expression_Type; Into : in out MAT.Memory.Allocation_Map); private protected type Memory_Allocator is -- Add the memory region from the list of memory region managed by the program. procedure Add_Region (Region : in Region_Info); -- Find the region that matches the given name. function Find_Region (Name : in String) return Region_Info; -- Find the memory region that intersect the given section described by <tt>From</tt> -- and <tt>To</tt>. Each memory region that intersects is added to the <tt>Into</tt> -- map. procedure Find (From : in MAT.Types.Target_Addr; To : in MAT.Types.Target_Addr; Into : in out MAT.Memory.Region_Info_Map); -- Take into account a malloc probe. The memory slot [Addr .. Slot.Size] is inserted -- in the used slots map. The freed slots that intersect the malloc'ed region are -- removed from the freed map. procedure Probe_Malloc (Addr : in MAT.Types.Target_Addr; Slot : in Allocation); -- Take into account a free probe. Add the memory slot in the freed map and remove -- the slot from the used slots map. procedure Probe_Free (Addr : in MAT.Types.Target_Addr; Slot : in Allocation; Size : out MAT.Types.Target_Size; By : out MAT.Events.Event_Id_Type); -- Take into account a realloc probe. The old memory slot represented by Old_Addr is -- removed from the used slots maps and the new memory slot [Addr .. Slot.Size] is -- inserted in the used slots map. procedure Probe_Realloc (Addr : in MAT.Types.Target_Addr; Old_Addr : in MAT.Types.Target_Addr; Slot : in Allocation; Old_Size : out MAT.Types.Target_Size; By : out MAT.Events.Event_Id_Type); -- Collect the information about memory slot sizes allocated by the application. procedure Size_Information (Sizes : in out MAT.Memory.Tools.Size_Info_Map); -- Collect the information about threads and the memory allocations they've made. procedure Thread_Information (Threads : in out Memory_Info_Map); -- Collect the information about frames and the memory allocations they've made. procedure Frame_Information (Level : in Natural; Frames : in out Frame_Info_Map); -- Find from the <tt>Memory</tt> map the memory slots whose address intersects -- the region [From .. To] and which is selected by the given filter expression. -- Add the memory slot in the <tt>Into</tt> list if it does not already contains -- the memory slot. procedure Find (From : in MAT.Types.Target_Addr; To : in MAT.Types.Target_Addr; Filter : in MAT.Expressions.Expression_Type; Into : in out MAT.Memory.Allocation_Map); -- Get the global memory and allocation statistics. procedure Stat_Information (Result : out Memory_Stat); private Used_Slots : Allocation_Map; Freed_Slots : Allocation_Map; Regions : Region_Info_Map; Stats : Memory_Stat; end Memory_Allocator; type Target_Memory is tagged limited record Manager : MAT.Events.Probes.Probe_Manager_Type_Access; Memory : Memory_Allocator; end record; end MAT.Memory.Targets;
pragma License (Unrestricted); private with System.Native_Real_Time; package Ada.Real_Time is type Time is private; Time_First : constant Time; Time_Last : constant Time; Time_Unit : constant := Duration'Delta; -- implementation-defined-real-number type Time_Span is private; Time_Span_First : constant Time_Span; Time_Span_Last : constant Time_Span; Time_Span_Zero : constant Time_Span; Time_Span_Unit : constant Time_Span; Tick : constant Time_Span; function Clock return Time; function "+" (Left : Time; Right : Time_Span) return Time with Import, Convention => Intrinsic; function "+" (Left : Time_Span; Right : Time) return Time with Import, Convention => Intrinsic; function "-" (Left : Time; Right : Time_Span) return Time with Import, Convention => Intrinsic; function "-" (Left : Time; Right : Time) return Time_Span with Import, Convention => Intrinsic; function "<" (Left, Right : Time) return Boolean with Import, Convention => Intrinsic; function "<=" (Left, Right : Time) return Boolean with Import, Convention => Intrinsic; function ">" (Left, Right : Time) return Boolean with Import, Convention => Intrinsic; function ">=" (Left, Right : Time) return Boolean with Import, Convention => Intrinsic; function "+" (Left, Right : Time_Span) return Time_Span with Import, Convention => Intrinsic; function "-" (Left, Right : Time_Span) return Time_Span with Import, Convention => Intrinsic; function "-" (Right : Time_Span) return Time_Span with Import, Convention => Intrinsic; function "*" (Left : Time_Span; Right : Integer) return Time_Span with Convention => Intrinsic; function "*" (Left : Integer; Right : Time_Span) return Time_Span with Convention => Intrinsic; function "/" (Left, Right : Time_Span) return Integer with Convention => Intrinsic; function "/" (Left : Time_Span; Right : Integer) return Time_Span with Convention => Intrinsic; pragma Pure_Function ("*"); pragma Pure_Function ("/"); pragma Inline_Always ("*"); pragma Inline_Always ("/"); function "abs" (Right : Time_Span) return Time_Span with Import, Convention => Intrinsic; function "<" (Left, Right : Time_Span) return Boolean with Import, Convention => Intrinsic; function "<=" (Left, Right : Time_Span) return Boolean with Import, Convention => Intrinsic; function ">" (Left, Right : Time_Span) return Boolean with Import, Convention => Intrinsic; function ">=" (Left, Right : Time_Span) return Boolean with Import, Convention => Intrinsic; function To_Duration (TS : Time_Span) return Duration; function To_Time_Span (D : Duration) return Time_Span; pragma Pure_Function (To_Duration); pragma Pure_Function (To_Time_Span); pragma Inline (To_Duration); pragma Inline (To_Time_Span); function Nanoseconds (NS : Integer) return Time_Span; function Microseconds (US : Integer) return Time_Span; function Milliseconds (MS : Integer) return Time_Span; function Seconds (S : Integer) return Time_Span; -- function Minutes (M : Integer) return Time_Span; pragma Pure_Function (Nanoseconds); pragma Pure_Function (Microseconds); pragma Pure_Function (Milliseconds); pragma Pure_Function (Seconds); pragma Inline (Nanoseconds); pragma Inline (Microseconds); pragma Inline (Milliseconds); pragma Inline (Seconds); type Seconds_Count is range -(2 ** (Duration'Size - 1)) / 1_000_000_000 .. (2 ** (Duration'Size - 1) - 1) / 1_000_000_000; -- implementation-defined -- procedure Split (T : Time; SC : out Seconds_Count; TS : out Time_Span); -- function Time_Of (SC : Seconds_Count; TS : Time_Span) return Time; -- Note: What is Split meaning? -- Because the origin point of Time is unspecified... private type Time is new Duration; Time_First : constant Time := Time'First; Time_Last : constant Time := Time'Last; type Time_Span is new Duration; Time_Span_First : constant Time_Span := Time_Span'First; Time_Span_Last : constant Time_Span := Time_Span'Last; Time_Span_Zero : constant Time_Span := 0.0; Time_Span_Unit : constant Time_Span := Time_Span'Delta; Tick : constant Time_Span := System.Native_Real_Time.Tick; end Ada.Real_Time;
with Ada.Text_Io; package body Widgets is procedure Paint_Event (This : in out Widget'Class) is begin Ada.Text_Io.Put_Line ("Widgets.Paint_Event() called"); Ada.Text_Io.Put_Line (" Object_Name = """ & This.Get_Name & """"); end; end Widgets;
with Ada.Strings.Fixed; with Ada.Integer_Text_IO; -- Copyright 2021 Melwyn Francis Carlo procedure A030 is use Ada.Strings.Fixed; use Ada.Integer_Text_IO; Sum : Integer := 0; Sum_Of_Powers : Integer := 0; Num_len : Integer; begin for I in 2 .. 1_000_000 loop Sum_Of_Powers := 0; Num_len := Trim (Integer'Image (I), Ada.Strings.Both)'Length; for J in 1 .. Num_len loop Sum_Of_Powers := Sum_Of_Powers + ((Character'Pos (Trim (Integer'Image (I), Ada.Strings.Both) (J)) - Character'Pos ('0')) ** 5); end loop; if Sum_Of_Powers = I then Sum := Sum + I; end if; end loop; Put (Sum, Width => 0); end A030;
----------------------------------------------------------------------- -- akt-windows -- GtK Windows for Ada Keystore GTK application -- Copyright (C) 2019 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Finalization; with Gtk.Widget; with Gtkada.Builder; with Keystore.Files; with Util.Log.Loggers; private with Ada.Strings.Unbounded; private with Gtk.Scrolled_Window; private with Gtk.Frame; private with Gtk.Viewport; private with Gtk.Status_Bar; private with Gtk.Tree_View; private with Gtk.Tree_Store; private with Gtk.Tree_Model; private with Gtk.Tree_Selection; private with Gtk.Cell_Renderer_Text; private with Gtk.Text_Buffer; private with Gtk.Text_View; package AKT.Windows is Initialize_Error : exception; -- The logger Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("AKT.Windows"); type Application_Type is limited new Ada.Finalization.Limited_Controlled with private; type Application_Access is access all Application_Type; -- Initialize the target instance. overriding procedure Initialize (Application : in out Application_Type); -- Release the storage. overriding procedure Finalize (Application : in out Application_Type); -- Initialize the widgets and create the Gtk gui. procedure Initialize_Widget (Application : in out Application_Type; Widget : out Gtk.Widget.Gtk_Widget); procedure Open_File (Application : in out Application_Type; Path : in String; Password : in Keystore.Secret_Key); procedure Create_File (Application : in out Application_Type; Path : in String; Storage_Count : in Natural; Password : in Keystore.Secret_Key); -- Set the UI label with the given value. procedure Set_Label (Application : in Application_Type; Name : in String; Value : in String); procedure List_Keystore (Application : in out Application_Type); procedure Edit_Current (Application : in out Application_Type); procedure Save_Current (Application : in out Application_Type); -- Lock the keystore so that it is necessary to ask the password again to see/edit items. procedure Lock (Application : in out Application_Type); -- Unlock the keystore with the password. procedure Unlock (Application : in out Application_Type; Password : in Keystore.Secret_Key); -- Return True if the keystore is locked. function Is_Locked (Application : in Application_Type) return Boolean; -- Return True if the keystore is open. function Is_Open (Application : in Application_Type) return Boolean; procedure Main (Application : in out Application_Type); -- Report a message in the status area. procedure Message (Application : in out Application_Type; Message : in String); procedure Refresh_Toolbar (Application : in out Application_Type); private -- Load the glade XML definition. procedure Load_UI (Application : in out Application_Type); type Application_Type is limited new Ada.Finalization.Limited_Controlled with record Builder : Gtkada.Builder.Gtkada_Builder; Previous_Event_Counter : Integer := 0; Main : Gtk.Widget.Gtk_Widget; About : Gtk.Widget.Gtk_Widget; Chooser : Gtk.Widget.Gtk_Widget; Status : Gtk.Status_Bar.Gtk_Status_Bar; Wallet : Keystore.Files.Wallet_File; Path : Ada.Strings.Unbounded.Unbounded_String; Frame : Gtk.Frame.Gtk_Frame; Scrolled : Gtk.Scrolled_Window.Gtk_Scrolled_Window; Viewport : Gtk.Viewport.Gtk_Viewport; List : Gtk.Tree_Store.Gtk_Tree_Store; Current_Row : Gtk.Tree_Model.Gtk_Tree_Iter; Tree : Gtk.Tree_View.Gtk_Tree_View; Selection : Gtk.Tree_Selection.Gtk_Tree_Selection; Col_Text : Gtk.Cell_Renderer_Text.Gtk_Cell_Renderer_Text; Editor : Gtk.Text_View.Gtk_Text_View; Buffer : Gtk.Text_Buffer.Gtk_Text_Buffer; Current : Ada.Strings.Unbounded.Unbounded_String; Editing : Boolean := False; Locked : Boolean := False; end record; end AKT.Windows;
----------------------------------------------------------------------- -- awa-votes-modules -- Module votes -- Copyright (C) 2013, 2014, 2018 Stephane Carrez -- Written by Stephane Carrez (Stephane.Carrez@gmail.com) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with ASF.Applications; with ADO; with AWA.Modules; -- == Integration == -- The `Vote_Module` manages the votes on entities. It provides operations that are -- used by the vote beans or other services to vote for an item. An instance of the -- `Vote_Module` must be declared and registered in the AWA application. -- The module instance can be defined as follows: -- -- type Application is new AWA.Applications.Application with record -- Vote_Module : aliased AWA.Votes.Modules.Vote_Module; -- end record; -- -- And registered in the `Initialize_Modules` procedure by using: -- -- Register (App => App.Self.all'Access, -- Name => AWA.Votes.Modules.NAME, -- URI => "votes", -- Module => App.Vote_Module'Access); package AWA.Votes.Modules is -- The name under which the module is registered. NAME : constant String := "votes"; -- ------------------------------ -- Module votes -- ------------------------------ type Vote_Module is new AWA.Modules.Module with private; type Vote_Module_Access is access all Vote_Module'Class; -- Initialize the votes module. overriding procedure Initialize (Plugin : in out Vote_Module; App : in AWA.Modules.Application_Access; Props : in ASF.Applications.Config); -- Get the votes module. function Get_Vote_Module return Vote_Module_Access; -- Vote for the given element and return the total vote for that element. procedure Vote_For (Model : in Vote_Module; Id : in ADO.Identifier; Entity_Type : in String; Permission : in String; Value : in Integer; Total : out Integer); private type Vote_Module is new AWA.Modules.Module with null record; end AWA.Votes.Modules;
with League.Application; with XML.SAX.Input_Sources.Streams.Files; with XML.SAX.Simple_Readers; with Handlers; procedure Main is Handler : aliased Handlers.Handler; Input : aliased XML.SAX.Input_Sources.Streams.Files.File_Input_Source; Reader : aliased XML.SAX.Simple_Readers.SAX_Simple_Reader; begin Input.Open_By_File_Name (League.Application.Arguments.Element (1)); Reader.Set_Content_Handler (Handler'Unchecked_Access); Reader.Parse (Input'Unchecked_Access); end Main;
with Ada.Text_IO; use Ada.Text_IO; procedure testcase (i: Natural) is begin case i is when 0 => Ada.Text_IO.Put ("zero"); when 1 => Ada.Text_IO.Put ("one"); when 2 => Ada.Text_IO.Put ("two"); -- case statements have to cover all possible cases: when others => Ada.Text_IO.Put ("none of the above"); end case; end testCase;
PROCEDURE ExHandler IS BEGIN BEGIN null; EXCEPTION WHEN OTHERS => NULL; END; NULL; END ExHandler;
-- -- 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.tasks; use ewok.tasks; with ewok.tasks_shared; use ewok.tasks_shared; with ewok.exported.dma; with ewok.dma_shared; with ewok.dma; with ewok.perm; with ewok.sanitize; with ewok.debug; package body ewok.syscalls.dma with spark_mode => off is package TSK renames ewok.tasks; procedure svc_register_dma (caller_id : in ewok.tasks_shared.t_task_id; params : in t_parameters; mode : in ewok.tasks_shared.t_task_mode) is dma_config : ewok.exported.dma.t_dma_user_config with import, address => to_address (params(1)); descriptor : unsigned_32 with import, address => to_address (params(2)); index : ewok.dma_shared.t_registered_dma_index; ok : boolean; begin -- Forbidden after end of task initialization if is_init_done (caller_id) then goto ret_denied; end if; -- DMA allowed for that task? if not ewok.perm.ressource_is_granted (ewok.perm.PERM_RES_DEV_DMA, caller_id) then pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma(): permission not granted")); goto ret_denied; end if; -- Ada based sanitation using on types compliance if not dma_config'valid_scalars then pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma(): invalid dma_t")); goto ret_inval; end if; -- Does dma_config'address and descriptor'address are in the caller -- address space ? if not ewok.sanitize.is_range_in_data_slot (to_system_address (dma_config'address), dma_config'size/8, caller_id, mode) or not ewok.sanitize.is_word_in_data_slot (to_system_address (descriptor'address), caller_id, mode) then pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma(): parameters not in task's memory space")); goto ret_denied; end if; -- Verify DMA configuration transmitted by the user if not ewok.dma.sanitize_dma (dma_config, caller_id, ewok.exported.dma.t_config_mask'(others => false), mode) then pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma(): invalid dma configuration")); goto ret_inval; end if; -- Check if controller/stream are already used -- Note: A DMA controller can manage only one channel per stream in the -- same time. if ewok.dma.stream_is_already_used (dma_config) then pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma(): dma configuration already used")); goto ret_denied; end if; -- Is there any user descriptor available ? if TSK.tasks_list(caller_id).num_dma_id < MAX_DMAS_PER_TASK then TSK.tasks_list(caller_id).num_dma_id := TSK.tasks_list(caller_id).num_dma_id + 1; else goto ret_busy; end if; -- Initialization ewok.dma.init_stream (dma_config, caller_id, index, ok); if not ok then pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma(): dma initialization failed")); goto ret_denied; end if; declare dma_descriptor : constant unsigned_32 := TSK.tasks_list(caller_id).num_dma_id; begin TSK.tasks_list(caller_id).dma_id(dma_descriptor) := index; end; descriptor := TSK.tasks_list(caller_id).num_dma_id; set_return_value (caller_id, mode, SYS_E_DONE); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_busy>> descriptor := 0; set_return_value (caller_id, mode, SYS_E_BUSY); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_inval>> descriptor := 0; set_return_value (caller_id, mode, SYS_E_INVAL); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_denied>> descriptor := 0; set_return_value (caller_id, mode, SYS_E_DENIED); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; end svc_register_dma; procedure svc_register_dma_shm (caller_id : in ewok.tasks_shared.t_task_id; params : in t_parameters; mode : in ewok.tasks_shared.t_task_mode) is user_dma_shm : ewok.exported.dma.t_dma_shm_info with import, address => to_address (params(1)); granted_id : ewok.tasks_shared.t_task_id; begin -- Forbidden after end of task initialization if is_init_done (caller_id) then goto ret_denied; end if; -- Ada based sanitation using on types compliance if not user_dma_shm'valid_scalars then pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma_shm(): invalid dma_shm_t")); goto ret_inval; end if; -- Does user_dma_shm'address is in the caller address space ? if not ewok.sanitize.is_range_in_data_slot (to_system_address (user_dma_shm'address), user_dma_shm'size/8, caller_id, mode) then pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma_shm(): parameters not in task's memory space")); goto ret_denied; end if; -- Verify DMA shared memory configuration transmitted by the user if not ewok.dma.sanitize_dma_shm (user_dma_shm, caller_id, mode) then pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma_shm(): invalid configuration")); goto ret_inval; end if; granted_id := user_dma_shm.granted_id; -- Does the task can share memory with its target task? if not ewok.perm.dmashm_is_granted (caller_id, granted_id) then pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma_shm(): not granted")); goto ret_denied; end if; -- Is there any user descriptor available ? if TSK.tasks_list(granted_id).num_dma_shms < MAX_DMA_SHM_PER_TASK and TSK.tasks_list(caller_id).num_dma_shms < MAX_DMA_SHM_PER_TASK then TSK.tasks_list(granted_id).num_dma_shms := TSK.tasks_list(granted_id).num_dma_shms + 1; TSK.tasks_list(caller_id).num_dma_shms := TSK.tasks_list(caller_id).num_dma_shms + 1; else pragma DEBUG (debug.log (debug.ERROR, "svc_register_dma_shm(): busy")); goto ret_busy; end if; TSK.tasks_list(granted_id).dma_shm(TSK.tasks_list(granted_id).num_dma_shms) := user_dma_shm; TSK.tasks_list(caller_id).dma_shm(TSK.tasks_list(caller_id).num_dma_shms) := user_dma_shm; set_return_value (caller_id, mode, SYS_E_DONE); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_busy>> set_return_value (caller_id, mode, SYS_E_BUSY); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_inval>> set_return_value (caller_id, mode, SYS_E_INVAL); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_denied>> set_return_value (caller_id, mode, SYS_E_DENIED); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; end svc_register_dma_shm; procedure svc_dma_reconf (caller_id : in ewok.tasks_shared.t_task_id; params : in out t_parameters; mode : in ewok.tasks_shared.t_task_mode) is new_dma_config : ewok.exported.dma.t_dma_user_config with import, address => to_address (params(1)); config_mask : ewok.exported.dma.t_config_mask with import, address => params(2)'address; dma_descriptor : unsigned_32 with import, address => params(3)'address; ok : boolean; begin -- Forbidden before end of task initialization if not is_init_done (caller_id) then goto ret_denied; end if; -- Ada based sanitation using on types compliance is not easy, -- as only fields marked by config_mask have a real interpretation -- These fields are checked in the dma_sanitize_dma() function call -- bellow -- Does new_dma_config'address is in the caller address space ? if not ewok.sanitize.is_range_in_data_slot (to_system_address (new_dma_config'address), new_dma_config'size/8, caller_id, mode) then pragma DEBUG (debug.log (debug.ERROR, "svc_dma_reconf(): parameters not in task's memory space")); goto ret_inval; end if; -- Valid DMA descriptor ? if dma_descriptor < TSK.tasks_list(caller_id).dma_id'first or dma_descriptor > TSK.tasks_list(caller_id).num_dma_id then pragma DEBUG (debug.log (debug.ERROR, "svc_dma_reconf(): invalid descriptor")); goto ret_inval; end if; -- Check if the user tried to change the DMA ctrl/channel/stream -- parameters if not ewok.dma.has_same_dma_channel (TSK.tasks_list(caller_id).dma_id(dma_descriptor), new_dma_config) then pragma DEBUG (debug.log (debug.ERROR, "svc_dma_reconf(): ctrl/channel/stream changed")); goto ret_inval; end if; -- Verify DMA configuration transmitted by the user if not ewok.dma.sanitize_dma (new_dma_config, caller_id, config_mask, mode) then pragma DEBUG (debug.log (debug.ERROR, "svc_dma_reconf(): invalid configuration")); goto ret_inval; end if; -- Reconfigure the DMA controller ewok.dma.reconfigure_stream (new_dma_config, TSK.tasks_list(caller_id).dma_id(dma_descriptor), config_mask, caller_id, ok); if not ok then goto ret_inval; end if; set_return_value (caller_id, mode, SYS_E_DONE); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_inval>> set_return_value (caller_id, mode, SYS_E_INVAL); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_denied>> set_return_value (caller_id, mode, SYS_E_DENIED); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; end svc_dma_reconf; procedure svc_dma_reload (caller_id : in ewok.tasks_shared.t_task_id; params : in out t_parameters; mode : in ewok.tasks_shared.t_task_mode) is dma_descriptor : unsigned_32 with import, address => params(1)'address; begin -- Forbidden before end of task initialization if not is_init_done (caller_id) then goto ret_denied; end if; -- Valid DMA descriptor ? if dma_descriptor < TSK.tasks_list(caller_id).dma_id'first or dma_descriptor > TSK.tasks_list(caller_id).num_dma_id then pragma DEBUG (debug.log (debug.ERROR, "svc_dma_reload(): invalid descriptor")); goto ret_inval; end if; ewok.dma.enable_dma_stream (TSK.tasks_list(caller_id).dma_id(dma_descriptor)); set_return_value (caller_id, mode, SYS_E_DONE); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_inval>> set_return_value (caller_id, mode, SYS_E_INVAL); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_denied>> set_return_value (caller_id, mode, SYS_E_DENIED); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; end svc_dma_reload; procedure svc_dma_disable (caller_id : in ewok.tasks_shared.t_task_id; params : in out t_parameters; mode : in ewok.tasks_shared.t_task_mode) is dma_descriptor : unsigned_32 with import, address => params(1)'address; begin -- Forbidden before end of task initialization if not is_init_done (caller_id) then goto ret_denied; end if; -- Valid DMA descriptor ? if dma_descriptor < TSK.tasks_list(caller_id).dma_id'first or dma_descriptor > TSK.tasks_list(caller_id).num_dma_id then pragma DEBUG (debug.log (debug.ERROR, "svc_dma_disable(): invalid descriptor")); goto ret_inval; end if; ewok.dma.disable_dma_stream (TSK.tasks_list(caller_id).dma_id(dma_descriptor)); set_return_value (caller_id, mode, SYS_E_DONE); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_inval>> set_return_value (caller_id, mode, SYS_E_INVAL); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; <<ret_denied>> set_return_value (caller_id, mode, SYS_E_DENIED); ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE); return; end svc_dma_disable; end ewok.syscalls.dma;
with Ada.Text_IO; procedure Strip_Characters_From_String is function Strip(The_String: String; The_Characters: String) return String is Keep: array (Character) of Boolean := (others => True); Result: String(The_String'Range); Last: Natural := Result'First-1; begin for I in The_Characters'Range loop Keep(The_Characters(I)) := False; end loop; for J in The_String'Range loop if Keep(The_String(J)) then Last := Last+1; Result(Last) := The_String(J); end if; end loop; return Result(Result'First .. Last); end Strip; S: String := "She was a soul stripper. She took my heart!"; begin -- main Ada.Text_IO.Put_Line(Strip(S, "aei")); end Strip_Characters_From_String;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Interfaces; function TOML.Generic_Parse (Stream : in out Input_Stream) return TOML.Read_Result is ---------------------------- -- Lexical analysis state -- ---------------------------- WW_Backspace : constant Wide_Wide_Character := Wide_Wide_Character'Val (Character'Pos (ASCII.BS)); WW_Linefeed : constant Wide_Wide_Character := Wide_Wide_Character'Val (Character'Pos (ASCII.LF)); WW_Form_Feed : constant Wide_Wide_Character := Wide_Wide_Character'Val (Character'Pos (ASCII.FF)); WW_Carriage_Return : constant Wide_Wide_Character := Wide_Wide_Character'Val (Character'Pos (ASCII.CR)); WW_Tab : constant Wide_Wide_Character := Wide_Wide_Character'Val (Character'Pos (ASCII.HT)); subtype WW_Control_Characters is Wide_Wide_Character with Static_Predicate => WW_Control_Characters in Wide_Wide_Character'Val (16#00#) .. Wide_Wide_Character'Val (16#1F#) | Wide_Wide_Character'Val (16#7F#); subtype WW_Non_ASCII is Wide_Wide_Character range Wide_Wide_Character'Val (16#80#) .. Wide_Wide_Character'Last; type Codepoint_Buffer_Type (EOF : Boolean := False) is record To_Reemit : Boolean; -- If true, the next call to Read_Codepoint should do nothing, except -- resetting this to component to false. Location : Source_Location; case EOF is when True => null; when False => Codepoint : Wide_Wide_Character; end case; end record; Codepoint_Buffer : Codepoint_Buffer_Type := (EOF => False, To_Reemit => False, Location => No_Location, Codepoint => <>); -- Buffer used to temporarily store information read from Stream type Token_Kind is (Newline, Equal, Dot, Comma, Curly_Bracket_Open, Curly_Bracket_Close, Square_Bracket_Open, Square_Bracket_Close, Double_Square_Bracket_Open, Double_Square_Bracket_Close, Boolean_Literal, Integer_Literal, String_Literal); subtype No_Text_Token is Token_Kind range Newline .. Double_Square_Bracket_Close; -- Tokens whose text does not matter: the kind itself holds enough -- information to describe the token. type Any_Token (Kind : Token_Kind := Token_Kind'First) is record case Kind is when No_Text_Token => null; when Boolean_Literal => Boolean_Value : Boolean; when Integer_Literal => Integer_Value : Any_Integer; when String_Literal => String_Value : Unbounded_UTF8_String; end case; end record; True_Keyword : constant Any_Token := (Kind => Boolean_Literal, Boolean_Value => True); False_Keyword : constant Any_Token := (Kind => Boolean_Literal, Boolean_Value => False); type Token_Buffer_Type (EOF : Boolean := False) is record To_Reemit : Boolean; -- If true, the next call to Read_Token should do nothing, except -- resetting this to component to false. case EOF is when True => null; when False => Token : Any_Token; Location : Source_Location; end case; end record; Token_Buffer : Token_Buffer_Type := (EOF => False, To_Reemit => False, Location => No_Location, Token => <>); ------------------------------ -- Syntactic analysis state -- ------------------------------ Root_Table : constant TOML_Value := Create_Table; Result : Read_Result := (Success => True, Value => Root_Table); Current_Table : TOML_Value := Root_Table; -- Table that the next key/value pair node will update function Create_Error (Message : String; Location : Source_Location := No_Location) return Boolean with Post => not Create_Error'Result; -- Put in Result an unsuccessful Read_Result value with the provided error -- information. If no source location is passed, use -- Codepoint_Buffer.Location. -- -- This is a function that always return False for convenience in parsing -- helpers, which are all functions that return False on error. function Create_Lexing_Error (Message : String := "invalid token") return Boolean with Post => not Create_Lexing_Error'Result; -- Like Create_Error, but use Token_Buffer.Location as the source location -- for the error. function Create_Syntax_Error (Message : String := "invalid syntax") return Boolean with Post => not Create_Syntax_Error'Result; -- Like Create_Error, but use Token_Buffer.Location as the source location -- for the error. ----------------------- -- Codepoint reading -- ----------------------- function Read_Codepoint return Boolean with Pre => not Codepoint_Buffer.EOF or else Codepoint_Buffer.To_Reemit; -- Read a UTF-8 codepoint from Stream. If EOF is reached or a codepoint -- could be read, return True and update Codepoint_Buffer accordingly -- (location included). Otherwise, return False and put an error in Result. -- -- Note that this automatically discards carriage returns codepoints when -- they are immediately followed by a linefeed. When they are not followed -- by a linefeed, this creates an error. procedure Reemit_Codepoint with Pre => not Codepoint_Buffer.To_Reemit; -- Re-emit the same codepoint the next time that Read_Codepoint is called -------------------- -- Token decoding -- -------------------- function Read_Token (Key_Expected : Boolean) return Boolean with Pre => not Token_Buffer.EOF or else Token_Buffer.To_Reemit; -- Read a token from Stream. If EOF is reached or a token could be read, -- return True and update Token_Buffer accordingly (location included). -- Otherwise, return False and put an error in Result. -- -- If Key_Expected is true: -- -- * parse tokens that could be integer literals as string literals; -- * parse "[["/"]]" as double square bracket tokens instead of two -- consecutive square bracket tokens. procedure Reemit_Token with Pre => not Token_Buffer.To_Reemit; -- Re-emit the same token the next time that Read_Token is called procedure Append_As_UTF8 (Codepoint : Wide_Wide_Character) with Pre => not Token_Buffer.EOF and then Token_Buffer.Token.Kind = String_Literal; -- Append the given codepoint to Token_Buffer.Token.String_Value (a UTF-8 -- encoded string). function Read_Unicode_Escape_Sequence (Location : Source_Location) return Boolean; -- Helper for Read_Quoted_String. Assuming that string parsing just read a -- "\u" or "\U" prefix, parse the rest of the Unicode escape sequence and -- append the denoted codepoint using Append_As_UTF8. If successful, return -- True, otherwise put an error in Result and return False. function Read_Quoted_String return Boolean; -- Helper for Read_Token. Read a string literal, whose first quote is in -- Codepoint_Buffer. Return whether successful, updating Token_Buffer -- accordingly. function Read_Integer return Boolean; -- Helper for Read_Token. Read an integer literal, whose first digit (or -- sign) is in Codepoint_Buffer. Return whether successful, updating -- Token_Buffer accordingly. function Read_Bare_Key return Boolean; -- Helper for Read_Token. Read a bare key, whose first character is in -- Codepoint_Buffer. Return whether successful, updating Token_Buffer -- accordingly. function Read_Keyword (Text : Wide_Wide_String; Token : Any_Token) return Boolean; -- Helper for Read_Token. Try to read the given Text, whose first character -- is in Codepoint_Buffer. Return whether successful, updating Token_Buffer -- accordingly. -------------------- -- Syntax parsing -- -------------------- function Parse_Line return Boolean; -- Read and parse the next line in Stream. Update Result accordingly. ------------------------ -- Table construction -- ------------------------ function Get_Table (Key : Unbounded_UTF8_String; Table : in out TOML_Value; Traverse_Arrays : Boolean := False) return Boolean; -- Look for a sub-table in Table correspondig to Key. On success, store it -- in Table and return True. Otherwise, return False and put an error in -- Result. -- -- If there is no Key entry in Table, create one and register it. -- -- If this entry is an array, then assuming all the following hold: -- -- * Traverse_Arrays is true; -- * Table contains a Key entry that is an array of tables; -- * this array contains at least one element. -- -- then this gets the last table that was added to this array. Otherwise, -- this fails. function Parse_Section (Array_Of_Table : Boolean) return Boolean; -- Parse the name of a section ([my.table]) and update Current_Table -- accordingly. This assumes that the opening bracket is already in -- Token_Buffer. When this returns, the Newline token (or EOF) is in -- Token_Buffer. -- -- If Array_Of_Table is false, expect the section name to designate a -- table. Otherwise, expect it to designate an array of tables. -- -- Return whether parsing and interpretation was successful. function Parse_Dotted_Keys (Table : in out TOML_Value; Key : out Unbounded_UTF8_String; Traverse_Arrays : Boolean := False) return Boolean; -- Parse a sequence of dotted keys and interpret it as a reference into -- Table. Put the last key in Key, and update Table to the referenced table -- (i.e. the one in which Key will reference/create an entry). -- -- This assumes that the first token that constitutes the dotted keys is in -- Token_Buffer. When this returns, the token just passed the dotted keys -- will be in Token_Buffer. -- -- Return whether parsing and interpretation was successful. function Parse_Value (Value : out TOML_Value) return Boolean; -- Parse an inline value (boolean/integer literal, inline table, inline -- array, ...) and put it in Value. -- -- The first token that constitutes the value is expected to be read during -- the call. When this returns, Token_Buffer contains the last token that -- was used to parse the value. function Parse_Array (Value : out TOML_Value) return Boolean; -- Parse an inline array and put it in Value. -- -- This assumes that the first token that constitutes the array (i.e. '[') -- is in Token_Buffer. When this returns, Token_Buffer contains the last -- token that was used to parse the value (i.e. ']'). function Parse_Table (Value : out TOML_Value) return Boolean; -- Parse an inline table and put it in Value. -- -- This assumes that the first token that constitutes the table (i.e. '{') -- is in Token_Buffer. When this returns, Token_Buffer contains the last -- token that was used to parse the value (i.e. '}'). ------------------ -- Create_Error -- ------------------ function Create_Error (Message : String; Location : Source_Location := No_Location) return Boolean is begin Result := (Success => False, Message => To_Unbounded_String (Message), Location => (if Location = No_Location then Codepoint_Buffer.Location else Location)); return False; end Create_Error; ------------------------- -- Create_Lexing_Error -- ------------------------- function Create_Lexing_Error (Message : String := "invalid token") return Boolean is begin return Create_Error (Message, Token_Buffer.Location); end Create_Lexing_Error; ------------------------- -- Create_Syntax_Error -- ------------------------- function Create_Syntax_Error (Message : String := "invalid syntax") return Boolean is begin return Create_Error (Message, Token_Buffer.Location); end Create_Syntax_Error; -------------------- -- Read_Codepoint -- -------------------- function Read_Codepoint return Boolean is use type Interfaces.Unsigned_32; Error_Message : constant String := "invalid UTF-8 encoding"; EOF : Boolean; Char : Character; -- Holders for Get OUT formals Bytes_Count : Positive; -- Number of bytes that encode the codepoint to read Min_Codepoint : constant array (1 .. 4) of Interfaces.Unsigned_32 := (1 => 16#00#, 2 => 16#80#, 3 => 16#80_00#, 4 => 16#1_00_00#); -- For each Bytes_Count, smallest codepoint that is allowed Byte : Interfaces.Unsigned_32; -- Numeric view for Char Result : Interfaces.Unsigned_32 := 0; -- Numeric view for the Result begin -- If we are supposed to re-emit the previously read codepoint, do -- nothing more. if Codepoint_Buffer.To_Reemit then Codepoint_Buffer.To_Reemit := False; return True; end if; -- Try to read the first byte Get (Stream, EOF, Char); if EOF then Codepoint_Buffer := (EOF => True, To_Reemit => False, Location => (Codepoint_Buffer.Location.Line, Codepoint_Buffer.Location.Column + 1)); return True; else Byte := Character'Pos (Char); end if; -- If this is a carriage return, discarding after checking that it is -- followed by a linefeed. if Char = ASCII.CR then Get (Stream, EOF, Char); if EOF or else Char /= ASCII.LF then return Create_Error ("invalid stray carriage return"); end if; Byte := Character'Pos (Char); end if; -- Special handling of source location update occurs only with pure -- ASCII characters, so we can handle it here. if Codepoint_Buffer.Location = No_Location then Codepoint_Buffer.Location := (1, 1); else case Char is when ASCII.LF => Codepoint_Buffer.Location := (Codepoint_Buffer.Location.Line + 1, 1); when ASCII.HT => declare Column : Natural := Codepoint_Buffer.Location.Column; Column_Mod : constant Natural := Column mod Tab_Stop; begin if Column_Mod = 0 then Column := Column + Tab_Stop; else Column := Column + Tab_Stop - Column_Mod; end if; Codepoint_Buffer.Location.Column := Column; end; when others => Codepoint_Buffer.Location.Column := Codepoint_Buffer.Location.Column + 1; end case; end if; -- Its leading bits tell us how many bytes are to be expected if (Byte and 2#1000_0000#) = 0 then Bytes_Count := 1; Result := Byte and 2#0111_1111#; elsif (Byte and 2#1110_0000#) = 2#1100_0000# then Bytes_Count := 2; Result := Byte and 2#0001_1111#; elsif (Byte and 2#1111_0000#) = 2#1110_0000# then Bytes_Count := 3; Result := Byte and 2#0000_1111#; elsif (Byte and 2#1111_1000#) = 2#1111_0000# then Bytes_Count := 4; Result := Byte and 2#0000_0111#; else return Create_Error (Error_Message); end if; -- Read the remaining bytes. We know how many we must read, so if we -- reach EOF in the process, we know it's an error. for I in 2 .. Bytes_Count loop Get (Stream, EOF, Char); Byte := Character'Pos (Char); if EOF or else (Byte and 2#1100_0000#) /= 2#1000_0000# then return Create_Error (Error_Message); end if; Result := 64 * Result + (Byte and 2#0011_1111#); end loop; -- Check that the codepoint is as big as the number of bytes allows if Result < Min_Codepoint (Bytes_Count) then return Create_Error (Error_Message); end if; Codepoint_Buffer.Codepoint := Wide_Wide_Character'Val (Result); return True; end Read_Codepoint; ---------------------- -- Reemit_Codepoint -- ---------------------- procedure Reemit_Codepoint is begin Codepoint_Buffer.To_Reemit := True; end Reemit_Codepoint; ---------------- -- Read_Token -- ---------------- function Read_Token (Key_Expected : Boolean) return Boolean is begin -- If we are supposed to re-emit the previously read token, do nothing -- more. if Token_Buffer.To_Reemit then Token_Buffer.To_Reemit := False; return True; end if; loop -- The location for this token is the location of the codepoint -- cursor before reading it. Token_Buffer.Location := Codepoint_Buffer.Location; -- Try to read the first codepoint. If we reached the end of file, -- communicate this fact to the caller and stop there. if not Read_Codepoint then return False; end if; if Codepoint_Buffer.EOF then Token_Buffer := (EOF => True, To_Reemit => False); return True; end if; -- Otherwise, see what we can do with this codepoint case Codepoint_Buffer.Codepoint is -- If this is a newline (either LF or CR-LF), return the -- corresponding token. when WW_Linefeed => Token_Buffer.Location := Codepoint_Buffer.Location; Token_Buffer.Token := (Kind => Newline); return True; when WW_Carriage_Return => if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then return Create_Lexing_Error ("trailing CR"); elsif Codepoint_Buffer.Codepoint /= WW_Linefeed then return Create_Lexing_Error ("stray CR"); end if; Token_Buffer.Token := (Kind => Newline); return True; -- Skip whitespaces when WW_Tab | ' ' => null; -- Skip comments. Note that the end of file is allowed to occur in -- a comment, i.e. without a newline at the end. when '#' => Comment_Loop : loop if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then Token_Buffer := (EOF => True, To_Reemit => False); return True; elsif Codepoint_Buffer.Codepoint = WW_Linefeed then -- Don't forget to re-emit the linefeed: it is not part -- of the comment itself Reemit_Codepoint; exit Comment_Loop; end if; end loop Comment_Loop; -- Parse no-text tokens that cannot be keys when '=' => Token_Buffer.Token := (Kind => Equal); return True; when '.' => Token_Buffer.Token := (Kind => Dot); return True; when ',' => Token_Buffer.Token := (Kind => Comma); return True; when '{' => Token_Buffer.Token := (Kind => Curly_Bracket_Open); return True; when '}' => Token_Buffer.Token := (Kind => Curly_Bracket_Close); return True; when '[' => if not Read_Codepoint then return False; elsif Key_Expected and then not Codepoint_Buffer.EOF and then Codepoint_Buffer.Codepoint = '[' then Token_Buffer.Token := (Kind => Double_Square_Bracket_Open); else Reemit_Codepoint; Token_Buffer.Token := (Kind => Square_Bracket_Open); end if; return True; when ']' => if not Read_Codepoint then return False; elsif Key_Expected and then not Codepoint_Buffer.EOF and then Codepoint_Buffer.Codepoint = ']' then Token_Buffer.Token := (Kind => Double_Square_Bracket_Close); else Reemit_Codepoint; Token_Buffer.Token := (Kind => Square_Bracket_Close); end if; return True; -- Parse string literals when '"' | ''' => return Read_Quoted_String; -- The rest is potential bare keys (bare keys, integer literals, -- boolean literals, ...). when '0' .. '9' => if Key_Expected then return Read_Bare_Key; else return Read_Integer; end if; when 'A' .. 'Z' | 'a' .. 'z' | '_' => if Key_Expected then return Read_Bare_Key; end if; -- Detect keywords: "false" or "true". TODO: handle "inf" and -- "nan". case Codepoint_Buffer.Codepoint is when 'f' => return Read_Keyword ("false", False_Keyword); when 't' => return Read_Keyword ("true", True_Keyword); when others => return Create_Lexing_Error; end case; when '+' => return Read_Integer; when '-' => if Key_Expected then return Read_Bare_Key; else return Read_Integer; end if; when others => return Create_Lexing_Error; end case; end loop; end Read_Token; ------------------ -- Reemit_Token -- ------------------ procedure Reemit_Token is begin Token_Buffer.To_Reemit := True; end Reemit_Token; -------------------- -- Append_As_UTF8 -- -------------------- procedure Append_As_UTF8 (Codepoint : Wide_Wide_Character) is use Interfaces; Ordinal : constant Unsigned_32 := Wide_Wide_Character'Pos (Codepoint); function Bit_Slice (LSB, Width : Natural) return Unsigned_8; -- Return the slice of bits in Codepoint/Ordinal starting at the given -- 0-based index Least Significant Bit (LSB) and that contains Width -- bits. function Bit_Slice (LSB, Width : Natural) return Unsigned_8 is Shifted : constant Unsigned_32 := Shift_Right (Ordinal, LSB); Mask : constant Unsigned_32 := 2 ** Width - 1; begin return Unsigned_8 (Shifted and Mask); end Bit_Slice; Bytes : array (1 .. 4) of Unsigned_8; Last_Byte : Positive; begin case Ordinal is when 16#0000# .. 16#007F# => Bytes (1) := Bit_Slice (0, 7); Last_Byte := 1; when 16#0080# .. 16#07FF# => Bytes (1) := 2#1100_0000# or Bit_Slice (6, 5); Bytes (2) := 2#1000_0000# or Bit_Slice (0, 6); Last_Byte := 2; when 16#0800# .. 16#FFFF# => Bytes (1) := 2#1110_0000# or Bit_Slice (12, 4); Bytes (2) := 2#1000_0000# or Bit_Slice (6, 6); Bytes (3) := 2#1000_0000# or Bit_Slice (0, 6); Last_Byte := 3; when 16#1_0000# .. 16#10_FFFF# => Bytes (1) := 2#1111_0000# or Bit_Slice (18, 3); Bytes (2) := 2#1000_0000# or Bit_Slice (12, 6); Bytes (3) := 2#1000_0000# or Bit_Slice (6, 6); Bytes (4) := 2#1000_0000# or Bit_Slice (0, 6); Last_Byte := 4; when 16#11_0000# .. Unsigned_32'Last => -- Given that Codepoint comes from decoded UTF-8, this alternative -- should be unreachable. raise Program_Error; end case; declare Str : String (1 .. Last_Byte) with Import, Address => Bytes'Address; begin Append (Token_Buffer.Token.String_Value, Str); end; end Append_As_UTF8; ---------------------------------- -- Read_Unicode_Escape_Sequence -- ---------------------------------- function Read_Unicode_Escape_Sequence (Location : Source_Location) return Boolean is use Interfaces; Size : constant Positive := (if Codepoint_Buffer.Codepoint = 'u' then 4 else 8); -- Number of digits to read CP : Unsigned_32; -- Temporary buffer for the codepoint we just read Result : Unsigned_32 := 0; -- Denoted Unicode codepoint begin for I in 1 .. Size loop if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then return Create_Error ("unterminated Unicode escape sequence", Location); end if; -- Turn the hexadecimal digit we just read into a number and add it -- to Result, or raise an error if this is not a valid digit. CP := Wide_Wide_Character'Pos (Codepoint_Buffer.Codepoint); declare Denoted_Digit : Unsigned_32; begin if Codepoint_Buffer.Codepoint in '0' .. '9' then Denoted_Digit := CP - Wide_Wide_Character'Pos ('0'); elsif Codepoint_Buffer.Codepoint in 'a' .. 'f' then Denoted_Digit := CP - Wide_Wide_Character'Pos ('a') + 10; elsif Codepoint_Buffer.Codepoint in 'A' .. 'F' then Denoted_Digit := CP - Wide_Wide_Character'Pos ('A') + 10; else return Create_Error ("invalid Unicode escape sequence", Location); end if; Result := 16 * Result + Denoted_Digit; end; end loop; Append_As_UTF8 (Wide_Wide_Character'Val (Result)); return True; end Read_Unicode_Escape_Sequence; ------------------------ -- Read_Quoted_String -- ------------------------ function Read_Quoted_String return Boolean is Delimiter : constant Wide_Wide_Character := Codepoint_Buffer.Codepoint; Is_Literal : constant Boolean := Delimiter = '''; Is_Multiline : Boolean := False; function Unterminated_String return Boolean is (Create_Error ("unterminated string")); Location : Source_Location; begin -- Read the potential first character of this string. if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then return Create_Error ("unterminated string"); end if; Token_Buffer.Token := (Kind => String_Literal, others => <>); -- If we have a second delimiter, then check if this is a multi-line -- string. if Codepoint_Buffer.Codepoint = Delimiter then if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF or else Codepoint_Buffer.Codepoint = WW_Linefeed then -- We found two delimiters and the end of line/file: this -- designates an empty string. Reemit_Codepoint; return True; elsif Codepoint_Buffer.Codepoint = Delimiter then -- We have three consecutive delimiters: this is a multiline -- string. Is_Multiline := True; end if; else -- Never mind: no second delimiter, so put this codepoint back to be -- read again in the scanning loop. Reemit_Codepoint; end if; -- Now, go through all codepoints until we find the closing -- delimiter(s). loop if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then return Create_Error ("unterminated string"); end if; Location := Codepoint_Buffer.Location; case Codepoint_Buffer.Codepoint is when '"' | ''' => if Codepoint_Buffer.Codepoint /= Delimiter then -- If this character is not the string delimiter, include it -- as-is in the denoted string. Append_As_UTF8 (Codepoint_Buffer.Codepoint); elsif not Is_Multiline then -- Otherwise, if the string is not multi-line, it's the end -- of our string. return True; -- At this point, we know this string is multiline: look for -- the two next characters: if they are all delimiters, this -- is the end of our string. Otherwise, continue reading -- them... elsif not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then return Unterminated_String; elsif Codepoint_Buffer.Codepoint /= Delimiter then -- The second delimiter is missing: append the first one -- and schedule to re-examine the current codepoint in -- another loop iteration. Append_As_UTF8 (Delimiter); Reemit_Codepoint; -- Read the third character... elsif not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then return Unterminated_String; elsif Codepoint_Buffer.Codepoint /= Delimiter then -- The third delimiter is missing: append the first two ones -- and schedule to re-examine the current codepoint in -- another loop iteration. Append_As_UTF8 (Delimiter); Append_As_UTF8 (Delimiter); Reemit_Codepoint; else -- We just got the third delimiter, closing the string return True; end if; when '\' => -- If this is a literal string, we have a literal backslash. if Is_Literal then Append_As_UTF8 (Codepoint_Buffer.Codepoint); -- This starts an escape sequence: read the next character to -- find out which. elsif not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then return Unterminated_String; else case Codepoint_Buffer.Codepoint is when 'b' => Append_As_UTF8 (WW_Backspace); when 't' => Append_As_UTF8 (WW_Tab); when 'n' => Append_As_UTF8 (WW_Linefeed); when 'f' => Append_As_UTF8 (WW_Form_Feed); when 'r' => Append_As_UTF8 (WW_Carriage_Return); when '"' => Append_As_UTF8 ('"'); when '\' => Append_As_UTF8 ('\'); when 'u' | 'U' => if not Read_Unicode_Escape_Sequence (Location) then return False; end if; when WW_Linefeed => if not Is_Multiline then return Unterminated_String; elsif Is_Literal then Append_As_UTF8 (WW_Linefeed); else -- This is a multi-line basic string, and we just -- found a "line ending backslash": discard all the -- whitespace characters we find next. Discard_Whitespace : loop if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then return Unterminated_String; elsif Codepoint_Buffer.Codepoint not in ' ' | WW_Tab | WW_Linefeed then -- We found something that must not be -- discarded: re-emit it so that the next -- loop iteration processes it. Reemit_Codepoint; exit Discard_Whitespace; end if; end loop Discard_Whitespace; end if; when others => return Create_Error ("invalid escape sequence", Location); end case; end if; when WW_Control_Characters => -- Linefeeds are allowed only for multi-line strings. if Codepoint_Buffer.Codepoint = WW_Linefeed and then Is_Multiline then -- When they are the first codepoint after the string -- delimiter, they are discarded. if Length (Token_Buffer.Token.String_Value) > 0 then Append_As_UTF8 (WW_Linefeed); end if; else return Create_Error ("invalid string", Location); end if; when others => Append_As_UTF8 (Codepoint_Buffer.Codepoint); end case; end loop; end Read_Quoted_String; ------------------ -- Read_Integer -- ------------------ function Read_Integer return Boolean is use Interfaces; type Any_Format is (Decimal, Hexadecimal, Binary, Octal); Format : Any_Format := Decimal; -- Format for the integer to parse Base : constant array (Any_Format) of Unsigned_64 := (Decimal => 10, Hexadecimal => 16, Binary => 2, Octal => 8); type Any_Sign is (None, Positive, Negative); Sign : Any_Sign := None; -- Sign for the integer to parse Abs_Value : Interfaces.Unsigned_64 := 0; -- Absolute value for the integer that is parsed Just_Passed_Underscore : Boolean := False; -- Whether the last codepoint processed was an underscore function Too_Large_Error return Boolean is (Create_Error ("too large integer", Token_Buffer.Location)); begin Token_Buffer.Token := (Kind => Integer_Literal, Integer_Value => 0); -- Decode the sign, if any if Codepoint_Buffer.Codepoint in '+' | '-' then Sign := (if Codepoint_Buffer.Codepoint = '+' then Positive else Negative); if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then return Create_Lexing_Error; end if; end if; -- If this token starts with 0, we have either: -- -- * just 0, i.e. the next character cannot be a digit as leading zeros -- are forbidden. -- -- * 'b' (for binary literals), 'x' (for hexadecimal) or 'o' (for -- octal). if Codepoint_Buffer.Codepoint = '0' then if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then Reemit_Codepoint; return True; end if; case Codepoint_Buffer.Codepoint is when '0' .. '9' | '_' => return Create_Lexing_Error ("leading zeros not allowed"); when 'b' => Format := Binary; when 'o' => Format := Octal; when 'x' => Format := Hexadecimal; when ' ' | WW_Tab | WW_Linefeed | WW_Carriage_Return => -- Allowed token separators: stop reading the integer right -- here. Reemit_Codepoint; return True; when others => return Create_Lexing_Error; end case; -- At this point we just found which format to use: we can now start -- to read the integer. if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then Reemit_Codepoint; return True; end if; end if; -- Now read and decode all digits for this token loop declare Codepoint : constant Unsigned_64 := Wide_Wide_Character'Pos (Codepoint_Buffer.Codepoint); Is_Digit : Boolean := False; Digit : Unsigned_64; begin -- See if we have a digit case Codepoint_Buffer.Codepoint is when '0' .. '9' => Is_Digit := True; Digit := Codepoint - Wide_Wide_Character'Pos ('0'); when 'a' .. 'f' => Is_Digit := True; Digit := Codepoint - Wide_Wide_Character'Pos ('a') + 10; when 'A' .. 'F' => Is_Digit := True; Digit := Codepoint - Wide_Wide_Character'Pos ('A') + 10; when '_' => if Just_Passed_Underscore then return Create_Lexing_Error ("underscores must be surrounded by digits"); else Just_Passed_Underscore := True; end if; when 'g' .. 'z' | 'G' .. 'Z' | WW_Non_ASCII => -- These codepoints cannot start a new token and yet they -- are invalid elements for integer literals: this is an -- error. return Create_Lexing_Error; when others => -- If we end up here, either we found the beginning of a new -- toker, or a token separator: stop reading the integer -- right here. Reemit_Codepoint; exit; end case; -- Decode the digit (if we found one) if Is_Digit then if Digit >= Base (Format) then return Create_Lexing_Error; end if; declare Next_Value : Unsigned_64; begin begin Next_Value := Base (Format) * Abs_Value + Digit; exception when Constraint_Error => return Too_Large_Error; end; Abs_Value := Next_Value; end; Just_Passed_Underscore := False; end if; -- Read the next digit. Consider this integer token done if we -- reached the end of stream. if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF then Reemit_Codepoint; exit; end if; end; end loop; -- Apply the sign, making sure that there is no overflow in the process declare Rel_Value : Integer_64; begin if Sign = Negative then if Abs_Value <= Unsigned_64 (Integer_64'Last) then Rel_Value := -Integer_64 (Abs_Value); elsif Abs_Value = Unsigned_64 (Integer_64'Last) + 1 then Rel_Value := Integer_64'First; else return Too_Large_Error; end if; else if Abs_Value <= Unsigned_64 (Integer_64'Last) then Rel_Value := Integer_64 (Abs_Value); else return Too_Large_Error; end if; end if; Token_Buffer.Token.Integer_Value := Any_Integer (Rel_Value); return True; end; end Read_Integer; ------------------- -- Read_Bare_Key -- ------------------- function Read_Bare_Key return Boolean is begin Token_Buffer.Token := (Kind => String_Literal, others => <>); loop -- Add the previously read character to the key token Append_As_UTF8 (Codepoint_Buffer.Codepoint); -- Then check the next character: exit the loop as soon as we either -- reach the end of stream, or we find a non-key character. if not Read_Codepoint then return False; end if; exit when Codepoint_Buffer.EOF or else Codepoint_Buffer.Codepoint not in '0' .. '9' | 'A' .. 'Z' | 'a' .. 'z' | '_' | '-'; end loop; -- Be sure to schedule the re-emission of the read event that made us -- stop reading characters so that callers can attempt to read one more -- token. Reemit_Codepoint; return True; end Read_Bare_Key; ------------------ -- Read_Keyword -- ------------------ function Read_Keyword (Text : Wide_Wide_String; Token : Any_Token) return Boolean is begin -- Read all codepoints that constitute the token (except the first one, -- as per the Read_Keyword contract) and make sure they match the -- expected text. for I in Text'First + 1 .. Text'Last loop if not Read_Codepoint then return False; elsif Codepoint_Buffer.EOF or else Codepoint_Buffer.Codepoint /= Text (I) then return Create_Lexing_Error ("invalid token"); end if; end loop; Token_Buffer.Token := Token; return True; end Read_Keyword; ---------------- -- Parse_Line -- ---------------- function Parse_Line return Boolean is begin if not Read_Token (Key_Expected => True) then return False; elsif Token_Buffer.EOF then return True; end if; case Token_Buffer.Token.Kind is when Newline => return True; when Square_Bracket_Open => -- Parse a [section] return Parse_Section (Array_Of_Table => False); when Double_Square_Bracket_Open => -- Parse a [[section]] return Parse_Section (Array_Of_Table => True); when String_Literal => -- Parse a key/value pair declare Table : TOML_Value := Current_Table; Key : Unbounded_UTF8_String; Value : TOML_Value; begin -- Parse the dotted key that identify the table entry to -- create. In particular, get the destination table (Table) and -- the key to insert (Key) and make sure there is no existing -- entry for Key. if not Parse_Dotted_Keys (Table, Key, Traverse_Arrays => False) then return False; elsif Table.Has (Key) then return Create_Syntax_Error ("duplicate key"); end if; if Token_Buffer.EOF or else Token_Buffer.Token.Kind /= Equal then return Create_Syntax_Error; end if; -- Now parse the value for the entry to insert. On success, do -- the insertion. if Parse_Value (Value) then Table.Set (Key, Value); else return False; end if; return True; end; when others => return Create_Syntax_Error; end case; end Parse_Line; --------------- -- Get_Table -- --------------- function Get_Table (Key : Unbounded_UTF8_String; Table : in out TOML_Value; Traverse_Arrays : Boolean := False) return Boolean is Next_Table : TOML_Value := Table.Get_Or_Null (Key); begin if Next_Table.Is_Null then Next_Table := Create_Table; Table.Set (Key, Next_Table); Table := Next_Table; return True; elsif Next_Table.Kind = TOML_Table then Table := Next_Table; return True; elsif Traverse_Arrays and then Next_Table.Kind = TOML_Array and then Next_Table.Item_Kind = TOML_Table and then Next_Table.Length > 0 then Table := Next_Table.Item (Next_Table.Length); return True; else return Create_Syntax_Error ("invalid table key"); end if; end Get_Table; ------------------- -- Parse_Section -- ------------------- function Parse_Section (Array_Of_Table : Boolean) return Boolean is Closing_Bracket : constant Token_Kind := (if Array_Of_Table then Double_Square_Bracket_Close else Square_Bracket_Close); Table : TOML_Value := Root_Table; Key : Unbounded_UTF8_String; begin -- Get the first token for the section name, as per Parse_Dotted_Keys's -- contract. if not Read_Token (Key_Expected => True) then return False; elsif Token_Buffer.EOF then return Create_Syntax_Error; elsif not Parse_Dotted_Keys (Table, Key, Traverse_Arrays => True) then return False; -- At this point, Parse_Dotted_Keys left the first non-key token in -- Token_Buffer: make sure we have the closing bracket. elsif Token_Buffer.EOF or else Token_Buffer.Token.Kind /= Closing_Bracket then return Create_Syntax_Error; -- And now, make sure that we have either EOF or a newline next elsif not Read_Token (Key_Expected => False) or else (not Token_Buffer.EOF and then Token_Buffer.Token.Kind /= Newline) then return Create_Syntax_Error; end if; -- Finally, create the requested table if Array_Of_Table then -- Key is supposed to refer to an array of tables: if there is no -- such entry in Table, create one, otherwise make sure it has the -- expected item type. declare Arr : TOML_Value := Table.Get_Or_Null (Key); begin if Arr.Is_Null then Arr := Create_Array (TOML_Table); Table.Set (Key, Arr); elsif Arr.Item_Kind_Set and then Arr.Item_Kind /= TOML_Table then return Create_Syntax_Error ("invalid array"); end if; -- Create a new table and append it to this array Current_Table := Create_Table; Arr.Append (Current_Table); end; else -- If Key is already associated to a table, return it (it's an error -- if it is not a table). Create the destination table otherwise. if Table.Has (Key) then Current_Table := Table.Get (Key); if Current_Table.Kind /= TOML_Table then return Create_Syntax_Error ("duplicate key"); end if; else Current_Table := Create_Table; Table.Set (Key, Current_Table); end if; end if; return True; end Parse_Section; ----------------------- -- Parse_Dotted_Keys -- ----------------------- function Parse_Dotted_Keys (Table : in out TOML_Value; Key : out Unbounded_UTF8_String; Traverse_Arrays : Boolean := False) return Boolean is Has_Key : Boolean := False; -- Whether we parsed at least one key begin loop -- Process the current key, updating Table accordingly if Token_Buffer.EOF or else Token_Buffer.Token.Kind /= String_Literal then return Create_Syntax_Error; end if; -- We are about to parse a key. If we already parsed one, we need to -- fetch the corresponding table. if Has_Key and then not Get_Table (Key, Table, Traverse_Arrays) then return False; end if; Key := Token_Buffer.Token.String_Value; Has_Key := True; -- If the next token is a dot, expect another key. Otherwise, stop -- parsing keys. if not Read_Token (Key_Expected => True) then return False; elsif Token_Buffer.EOF or else Token_Buffer.Token.Kind /= Dot then return True; elsif not Read_Token (Key_Expected => True) then return False; end if; end loop; end Parse_Dotted_Keys; ----------------- -- Parse_Value -- ----------------- function Parse_Value (Value : out TOML_Value) return Boolean is begin -- Fetch the first token that encodes the value to parse... if not Read_Token (Key_Expected => False) then return False; elsif Token_Buffer.EOF then return Create_Syntax_Error; end if; case Token_Buffer.Token.Kind is when Boolean_Literal => Value := Create_Boolean (Token_Buffer.Token.Boolean_Value); when Integer_Literal => Value := Create_Integer (Token_Buffer.Token.Integer_Value); when String_Literal => Value := Create_String (Token_Buffer.Token.String_Value); when Square_Bracket_Open => return Parse_Array (Value); when Curly_Bracket_Open => return Parse_Table (Value); when others => return Create_Syntax_Error ("invalid (or not supported yet) syntax"); end case; return True; end Parse_Value; ----------------- -- Parse_Array -- ----------------- function Parse_Array (Value : out TOML_Value) return Boolean is Comma_Allowed : Boolean := False; begin Value := Create_Array; loop -- Fetch the next token. We need one, so reaching end of stream is a -- parsing error. if not Read_Token (Key_Expected => False) then return False; elsif Token_Buffer.EOF then return Create_Syntax_Error; end if; case Token_Buffer.Token.Kind is when Square_Bracket_Close => return True; when Newline => -- Newlines are allowed anywhere between surrounding brackets, -- values and commas. null; when Comma => if Comma_Allowed then Comma_Allowed := False; else return Create_Syntax_Error; end if; when others => -- We are expecting a comma right after parsing a value, so if -- we have a potential value in this case, we know a comma is -- missing. if Comma_Allowed then return Create_Syntax_Error; end if; -- We already read the first token for this value, but -- Parse_Value expects it not to be read yet, so plan to -- re-emit it. Reemit_Token; declare Item : TOML_Value; begin -- Parse the item value, reject heterogeneous arrays, and -- then append the item to the result. if not Parse_Value (Item) then return False; end if; if not Value.Item_Kind_Matches (Item) then return Create_Error ("heterogeneous array"); end if; Value.Append (Item); end; Comma_Allowed := True; end case; end loop; end Parse_Array; ----------------- -- Parse_Table -- ----------------- function Parse_Table (Value : out TOML_Value) return Boolean is Comma_Allowed : Boolean := False; Key : Unbounded_UTF8_String; begin Value := Create_Table; loop -- Fetch the next token (a potential key for the next table entry, or -- a closing bracket). We need one, so reaching end of stream is a -- parsing error. if not Read_Token (Key_Expected => True) then return False; elsif Token_Buffer.EOF then return Create_Syntax_Error; end if; case Token_Buffer.Token.Kind is when Curly_Bracket_Close => return True; when Newline => return Create_Error ("newlines not allowed in inlined tables"); when Comma => if Comma_Allowed then Comma_Allowed := False; else return Create_Syntax_Error; end if; when String_Literal => -- We are expecting a comma right after parsing a value, so if -- we have a potential value in this case, we know a comma is -- missing. if Comma_Allowed then return Create_Syntax_Error; end if; Key := Token_Buffer.Token.String_Value; -- Read the equal token if not Read_Token (Key_Expected => False) then return False; elsif Token_Buffer.EOF then return Create_Syntax_Error; elsif Token_Buffer.Token.Kind /= Equal then return Create_Syntax_Error; end if; -- Now read the value declare Item : TOML_Value; begin -- Parse the item value, reject heterogeneous arrays, and -- then append the item to the result. if not Parse_Value (Item) then return False; end if; -- Finally register the table entry if Value.Has (Key) then return Create_Error ("duplicate key"); end if; Value.Set (Key, Item); Comma_Allowed := True; end; when others => return Create_Syntax_Error; end case; end loop; end Parse_Table; begin while not Token_Buffer.EOF loop if not Parse_Line then return Result; end if; end loop; return Result; end TOML.Generic_Parse;
with Text_IO; procedure No_To_WAR is begin Text_IO.Put_line("No to war!"); end No_To_WAR;
-- PACKAGE Fourier8 -- -- Standard Radix 8 (decimation in frequency) Cooley-Tukey FFT. -- Procedure FFT does a Discrete Fourier Transform on data sets -- that are powers-of-2 in length. The package is pure. -- -- Radix 2 FFT's read and write the entire data set to the data array -- log(N) times per transform (where N is the data length). -- Radix 2**k FFT's read and write the entire data set to the data array -- log(N) / k times per transform (where N is the data length). -- These reads and writes slow down the calculation significantly, -- especially as arrays get large and spill out of the machine's -- cache ram. So the higher Radix FFT's are usually quite a bit faster -- than the simpler Radix 2 FFT's when the data sets get large. -- (The code, on the other hand, is not pretty!) -- -- -- 2. Notes on use. -- -- If length of the data set to be transformed is not a power -- of 2, then it is padded with Zeros to make it a power of 2. -- -- Data is stored as 2 arrays of Real numbers, one for the Real part, -- one for the complex part. -- -- Only data in the range 0..N is transformed. -- N is input as: Input_Data_Last. -- If N+1 is not a power of 2, then the Data array will be padded -- with zeros out to the nearest power of 2. -- The FFT is then performed on the enlarged set of data. -- -- More precisely if Input_Data_Last is not 2**N-1 for some integer N -- then all data points in the range Input_Data_Last+1..2**M-1 -- *will be set to zero*, i.e. data is padded with Zeros to the nearest -- power of two. The FFT will be performed on the interval 0..2**M-1, -- where 2**M-1 = Transformed_Data_Last = smallest power of 2 (minus -- one) that is greater than or equal to Input_Data_Last. -- (You input the number of data points *minus one*, so that this number -- can have the same type as the array index, which has range 0..2**N-1). -- -- The user sets the maximum size of the storage array by -- setting the generic parameter Log_Of_Max_Data_Length. -- -- The user has the option of Normalizing the data by dividing -- the results by SQRT (N), where N is the number of data points. -- If you want normalization by 1/N instead, then choose the no -- normalization option and perform the normalization yourself. -- -- -- 3. Notes on the Discrete Fourier Transform (DFT) -- -- The N point Discrete Fourier Transform F(W) of a function of time G(T): -- -- N-1 -- F(W_n) = DFT(N){G} = SUM { G(T_m) * Exp (-i * W_n * T_m)/Sqrt (N) }, -- m=0 -- -- where the sum is over m and goes from 0 to N-1. (N is the -- number of data points and is a power of 2.) Notice that this -- is the discretized version of the integral by which one calculates -- the Fourier coefficients of a Fourier series. In other words, -- F(W_n) is the projection of the function G (which we wish to -- write as a sum of the Fourier basis functions Exp) onto the -- appropriate basis function. -- -- Dividing by SQRT (N) normalizes the Fourier basis function Exp. -- If this is done, then the Fourier coefficients F(W) give the -- power spectrum: Power(W) = F(W) * Conjugate (F(W)). -- -- The discrete components of time T_m are given by (Tmax/N)*m -- where Tmax is the total time interval of the transform, and m -- goes from 0 to N-1. Similarly, the dicrete components of -- frequency are W_n = (2*Pi/Tmax)*n where n goes from 0 to N-1. -- Consequently the Dicrete Fourier Transform is -- -- N-1 -- F(W_n) = SUM { G(T_m) * Exp (-i * (2*Pi/N) * n * m)/Sqrt(N) }. -- m=0 -- -- In calculating F(W) we are finding the coefficients F(W_n) of -- plane waves Exp (i * W_n * T_m) such that a sum over these plane -- waves times the appropriate coefficient F(W_n) reproduces (approx.) -- the funtion of time G(T). The plane waves Exp (i * W_n * T_m) are -- said to form a complete set of states for functions G(T) that -- are restricted to an interval [0,Tmax). They satisfy periodic -- boundary conditions: State (n, T) = State (n, T + Tmax). It -- follows from the periodic boundary conditions and from the -- definition State (n, T) = Exp (i * W_n * T) that the discrete -- frequencies W_n have the form W_n = (2*Pi/Tmax)*n. Because the -- the sum is truncated at N-1 the Fourier series won't exactly -- approximate the function of time G(T). Finally, notice that -- the (un-normalized) states State (n, T) look like: -- -- { 1, Exp (i*(2*Pi/Tmax)*T), Exp (i*(2*Pi/Tmax)*2*T), ... } -- -- If we take the FFT of State (n, T) we should a get back a -- delta function F(W) peaked at the nth data point W_n. A test -- procedure demonstrates this. -- -- It is important to note from these definitions that we are -- assuming that the function of time G(T) is restricted to an -- interval of time [0, Tmax). If we want to use the FFT to approximate -- the integral of G(T)*Exp(i*W*T) on another time interval, say -- [-Tmax/2, Tmax/2], then must transform coordinates of the integral -- to the time interval [0,Tmax). The -- result of this transformation is to put an W (hence n) dependent phase -- factor out front of the prediction of the FFT. In fact, in the case -- just described, the phase factor is -- Exp (i * W_n * Tmax/2) = Exp (i * W_n * 2 * Pi * n / (W_n * 2)). -- This equals Exp (i * Pi * n), which is +1 or -1 depending on whether -- n is even of odd. -- -- -- 4. Notes on the radix 8 fast fourier transform (FFT) -- see below -- --***************************************************************** generic type Real is digits <>; type Array_Index is range <>; type Data_Array is array (Array_Index) of Real; Log_Of_Max_Data_Length : Positive; -- The FFT can only operate on range 0..2**N-1, where the maximum -- value N can have is N_max = Log_Of_Max_Data_Length. -- -- The generic formal Data_Array has arbitrary limits. This is -- useful, but the FFT algorithm works on a restricted range. It -- only operates on data in power-of-2 ranges: 0..2**N-1 for some N. -- The user can find out about this restriction at runtime or at -- compile time. To make sure he finds out about it at compile time -- he is required to enter the Maximum value N is allowed to have. -- That value is N_max = Log_Of_Max_Data_Length. -- The package checks that 0..2**N_max-1 is in in the range of -- Array_Index, during compilation, and also exports a -- subtype of Array_Index that has range 0..2**N_max-1. This -- subtype is called Data_Index, and all computation is done on it. package Fourier8 is pragma Pure (Fourier8); Data_Index_Last : constant Array_Index := Array_Index (2**Log_Of_Max_Data_Length-1); subtype Data_Index is Array_Index range 0..Data_Index_Last; -- Data_Index: the index on which all computation is performed. One -- of the reasons this subset is defined is to make sure that the generic -- formal type Array_Index contains the range 0..2**N-1 -- where N is the log of the max number of data points. The FFT -- is always done on some sub range of this: 0..M where M <= 2**N-1. type Exp_Storage is private; -- Must declare an object of this type and pass it to FFT as a parameter. -- That is all you ever have to do. The program does eveything else -- for you. (It contains the Sin's for the FFT ... keeps the package Pure.) -- So all you do is declare: -- -- My_Exp_Table : Exp_Storage; -- -- and then in the call to FFT, you add the parameter: -- -- Exp_Table => My_Exp_Table, -- procedure FFT (Data_Re, Data_Im : in out Data_Array; --destroys original data Transformed_Data_Last : out Data_Index; Input_Data_Last : in Data_Index; Exp_Table : in out Exp_Storage; Inverse_FFT_Desired : in Boolean := False; Normalized_Data_Desired : in Boolean := False; Bit_Reversal_Desired : in Boolean := True); -- FFT's the arrays Data_Re and Data_Im, and puts the results back -- into the same arrays. The original data is destroyed. -- -- The user inputs: Input_Data_Last -- -- The procedure performs an FFT on data that lies in the interval -- -- 0 .. Input_Data_Last. -- -- Data beyond this point will be set to Complex_Zero out to the -- nearest power of 2: Transformed_Data_Last. -- The transformed data is returned in the array Data, in the range -- -- 0 .. Transformed_Data_Last. -- -- Transformed_Data_Last+1 is a power of 2 -- Input_Data_Last+1 need not be a power of 2 pragma Inline (FFT); private -- Types for a table of SIN's and COS's called Exp_Table. Makes the -- package pure by moving declaration of the table to the client program. -- The Table is passed to the FFT as an in/out parameter. Half_Max_Data_Length : constant Array_Index := Data_Index_Last / 2; subtype Exp_Mode_Index is Data_Index range 0..Half_Max_Data_Length+29; -- The +29 sometimes helps. (the usual -1 is ok). type Sinusoid_Storage is Array(Exp_Mode_Index) of Real; type Exp_Storage is record Re : Sinusoid_Storage; Im : Sinusoid_Storage; Current_Size_Of_Exp_Table : Data_Index := 0; end record; -- Current_Size_Of_Exp_Table -- tells the FFT routine whether to reconstruct Exp_Table. -- Current_Size_Of_Exp_Table is initialized to 0 so that the table -- is correctly initialized on first call to Make_Exp_Table. end Fourier8; --***************************************************************** -- Notes on the radix 8 fast fourier transform (FFT) -- -- The FFT is an algorithm for computing the discrete Fourier transform -- with K*N*Log(N) arithmetic operation (where K is about 4 or 5). A -- direct calulation of the DFT uses O(N**2) operations. (N is the -- number of Data points; always a power of 2 in what follows.) Here's -- the decimation in frequency way. We break the N point DFT (DFT(N)) -- into two DFT's of N/2 points. Recursive application of this gives -- the Cooley_Tukey FFT. One of the 2 DFTs will give the even points -- of the final result; the other gives the odd points of the final -- result. Here is the derivation of first of the 2 DFTs. We start by -- defining F as the N point discrete Fourier transform of G: DFT(N){G}. -- -- N-1 -- r in [0,N-1]: F(r) = SUM { W(N)**(rn) * G(n) } -- n=0 -- -- where W(N) = exp(-i*2*Pi/N), for the direct DFT, and exp(i*2*Pi/N) for -- the inverse DFT. For the even-indexed data points this is: -- -- N/2-1 -- r in [0,N/2-1]: F(2r) = SUM { W(N)**(2rn) * G(n) } -- n=0 -- -- N/2-1 -- + SUM { W(N)**(2r(n+N/2)) * G(n+N/2) } -- n=0 -- -- Now use the fact that W(N)**(2rn) = W(N/2)**(rn) and that W(N)**(rN) -- equals 1 to get: -- -- r in [0,N/2-1]: F(2r) = DFT(N/2) { G(n) + G(N+N/2) }. -- -- Now get the odd-indexed data points by the same process. The result: -- -- r in [0,N/2-1]: -- -- F(2r) = DFT(N/2) { (G(n) + G(N+N/2)) } -- F(2r+1) = DFT(N/2) { (G(n) - G(N+N/2)) * W(N)**n }. -- -- So now if you wrote a recursive procedure that performs the above -- process, making N a variable (a parameter of the recursive procedure) -- then you are done. (i.e. next step is to break the two N/2 point -- DFTs into 4 N/4 point DFTs, etc.) In practice we just do it directly. -- Each stage you form two new data sequences of length N/2 as defined -- above: G(n) + G(N+N/2) and [G(n) + G(N+N/2)] * W(N)**n . -- These operation are called the Butterflies. Then you -- perform the N/2 point DFT on both by doing the same thing all over -- again but with N -> N/2. For example the W(N)**n term goes to W(N/2)**n. -- This process is repeated Log2(N) times. The variable in the code is -- called Stage: Stage is in 0..Log2(N)-1. Actually we have just described -- the radix 2 FFT. Below is the radix 4 FFT, in which you directly break -- DFT into 4 DFT's of length N/4. This gives you a 20-30% reduction -- in floating point ops. (And you use half as many stages, which is -- very important in the out-of-core FFT in this set, which writes -- the entire data set to the hard disk each stage.) Here is the radix -- 4 FFT. To derive it, you just follow the above procedure. -- -- for r in [0,N/4-1]: -- -- F(4r) = DFT(N/4){ [G(n) + G(n+N/4) + G(n+2N/4) + G(n+3N/4)] * W(N)**0n} -- F(4r+1) = DFT(N/4){ [G(n) -i*G(n+N/4) - G(n+2N/4) +i*G(n+3N/4)] * W(N)**1n} -- F(4r+2) = DFT(N/4){ [G(n) - G(n+N/4) + G(n+2N/4) - G(n+3N/4)] * W(N)**2n} -- F(4r+3) = DFT(N/4){ [G(n) +i*G(n+N/4) - G(n+2N/4) -i*G(n+3N/4)] * W(N)**3n} -- -- The improvement in computation comes from the fact that one need not -- perform any operations in multiplying by i, and from the fact that -- several quantities, like G(n) + G(N+N/2), appear more than once in -- the expessions. The 4 expressions in brackets [] form a 4 point DFT. -- Notice that the factors of G are given by exp (-i k m (2Pi/N)) where -- N = 4 and k, m go from 0..3. i.e. exp (-i k m (2Pi/N)) = -- m= 0 1 2 3 -- -- k=0 1 1 1 1 -- k=1 1 -i -1 i -- k=2 1 -1 1 -1 -- k=3 1 i -1 -i -- -- This is the kernel to which all higher DFT's are reduced. The -- W(N)**kn terms are called twiddle factors, I think. If the number -- of Radix 2 stages (log(N)) is not divisible by 2, then a final radix -- 2 stage must be performed to complete the FFT. Finally, be aware that -- to get the inverse DFT, all of the i's and exp's above must be -- replaced with their complex conjugates. -- The factors of G for Radix 8 are given by exp (-i k m (2Pi/N)) where -- N = 8 and k, m go from 0..7. i.e. exp (-i k m (2Pi/N)) = -- m= 0 1 2 3 4 5 6 7 -- -- k=0 1 1 1 1 1 1 1 1 -- k=1 1 a(1-i) -i a(-1-i) -1 -a(1-i) i -a(-1-i) -- k=2 1 -i -1 i 1 -i -1 i -- k=3 1 a(-1-i) i a(1-i) -1 -a(-1-i) -i -a(1-i) -- k=4 1 -1 1 -1 1 -1 1 -1 -- k=5 1 a(-1+i) -i a(1+i) -1 -a(-1+i) i -a(1+i) -- k=6 1 i -1 -i 1 i -1 -i -- k=7 1 a(1+i) i a(-1+i) -1 -a(1+i) -i -a(-1+i) -- -- In the above, a = 1/Sqrt(2.0). If you call the above matrix Exp_km, -- the FFT becomes: -- -- for each r in [0, N/8-1] we have: -- -- for k in 0..7: -- F(8r+k) = DFT(N/8){ [Exp_km * G(n+mN/8)] * W(N)**(k*n)} -- -- where W(N) = exp(-i*2*Pi/N), for the direct DFT, and exp(i*2*Pi/N) for -- the inverse DFT. -- Each stage of the FFT you transform the data according to the formula in -- in the { }. Then the idea is to perform eight N/8 point FFT's. But each -- of these is again performed according the the above formula, giving the -- next stage in the FFT. The above turns an N point FFT into 8 N/8 point -- FFT's. The next stage turns those eight N/8 pt. FFT's into 64 N/64 pt -- FFT's. To apply the above formula to that latter step, N must be replaced -- by N/8 in the above formula. -- You don't get a big reduction in floating point going from Radix 4 to 8, -- but you read the array fewer times from memory, -- and you can perform more floating point per expression which often helps. -- Accuracy is improved because fewer complex mults are done. -- Below let Dm = G(n+mN/8). (D stands for Data.) -- -- D0new := ((D0+D4) + (D2+D6) + ( (D1+D5) + (D3+D7))) * Exp0; -- D2new := ((D0+D4) - (D2+D6) - i*( (D1+D5) - (D3+D7))) * Exp2; -- D4new := ((D0+D4) + (D2+D6) - ( (D1+D5) + (D3+D7))) * Exp4; -- D6new := ((D0+D4) - (D2+D6) + i*( (D1+D5) - (D3+D7))) * Exp6; -- -- D1new := ((D0-D4) - i(D2-D6) + a( 1-i)*(D1-D5) + a(-1-i)*(D3-D7))*Exp1; -- D3new := ((D0-D4) + i(D2-D6) + a(-1-i)*(D1-D5) + a( 1-i)*(D3-D7))*Exp3; -- D5new := ((D0-D4) - i(D2-D6) + a(-1+i)*(D1-D5) + a( 1+i)*(D3-D7))*Exp5; -- D7new := ((D0-D4) + i(D2-D6) + a( 1+i)*(D1-D5) + a(-1+i)*(D3-D7))*Exp7; -- -- The last set can be written: -- --D1new = ((D0-D4) - i(D2-D6) - a(i((D1-D5)+(D3-D7)) - ((D1-D5)-(D3-D7))))*Exp1; --D3new = ((D0-D4) + i(D2-D6) - a(i((D1-D5)+(D3-D7)) + ((D1-D5)-(D3-D7))))*Exp3; --D5new = ((D0-D4) - i(D2-D6) + a(i((D1-D5)+(D3-D7)) - ((D1-D5)-(D3-D7))))*Exp5; --D7new = ((D0-D4) + i(D2-D6) + a(i((D1-D5)+(D3-D7)) + ((D1-D5)-(D3-D7))))*Exp7; -- --*****************************************************************
with Interfaces.C.Strings, System; use type System.Address; package body FLTK.Widgets.Inputs.Secret is procedure secret_input_set_draw_hook (W, D : in System.Address); pragma Import (C, secret_input_set_draw_hook, "secret_input_set_draw_hook"); pragma Inline (secret_input_set_draw_hook); procedure secret_input_set_handle_hook (W, H : in System.Address); pragma Import (C, secret_input_set_handle_hook, "secret_input_set_handle_hook"); pragma Inline (secret_input_set_handle_hook); function new_fl_secret_input (X, Y, W, H : in Interfaces.C.int; Text : in Interfaces.C.char_array) return System.Address; pragma Import (C, new_fl_secret_input, "new_fl_secret_input"); pragma Inline (new_fl_secret_input); procedure free_fl_secret_input (F : in System.Address); pragma Import (C, free_fl_secret_input, "free_fl_secret_input"); pragma Inline (free_fl_secret_input); procedure fl_secret_input_draw (W : in System.Address); pragma Import (C, fl_secret_input_draw, "fl_secret_input_draw"); pragma Inline (fl_secret_input_draw); function fl_secret_input_handle (W : in System.Address; E : in Interfaces.C.int) return Interfaces.C.int; pragma Import (C, fl_secret_input_handle, "fl_secret_input_handle"); pragma Inline (fl_secret_input_handle); procedure Finalize (This : in out Secret_Input) is begin if This.Void_Ptr /= System.Null_Address and then This in Secret_Input'Class then free_fl_secret_input (This.Void_Ptr); This.Void_Ptr := System.Null_Address; end if; Finalize (Input (This)); end Finalize; package body Forge is function Create (X, Y, W, H : in Integer; Text : in String) return Secret_Input is begin return This : Secret_Input do This.Void_Ptr := new_fl_secret_input (Interfaces.C.int (X), Interfaces.C.int (Y), Interfaces.C.int (W), Interfaces.C.int (H), Interfaces.C.To_C (Text)); fl_widget_set_user_data (This.Void_Ptr, Widget_Convert.To_Address (This'Unchecked_Access)); secret_input_set_draw_hook (This.Void_Ptr, Draw_Hook'Address); secret_input_set_handle_hook (This.Void_Ptr, Handle_Hook'Address); end return; end Create; end Forge; procedure Draw (This : in out Secret_Input) is begin fl_secret_input_draw (This.Void_Ptr); end Draw; function Handle (This : in out Secret_Input; Event : in Event_Kind) return Event_Outcome is begin return Event_Outcome'Val (fl_secret_input_handle (This.Void_Ptr, Event_Kind'Pos (Event))); end Handle; end FLTK.Widgets.Inputs.Secret;
-- This spec has been automatically generated from nrf53.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package NRF53_SVD.GPIO_P0 is pragma Preelaborate; --------------- -- Registers -- --------------- -- If pin satisfied sense criteria type DETECTMODE_Register is record -- LDETECT if 1 DETECTMODE : Boolean := False; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DETECTMODE_Register use record DETECTMODE at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; -- If pin satisfied sense criteria type DETECTMODE_SEC_Register is record -- LDETECT if 1 DETECTMODE : Boolean := False; -- unspecified Reserved_1_31 : HAL.UInt31 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for DETECTMODE_SEC_Register use record DETECTMODE at 0 range 0 .. 0; Reserved_1_31 at 0 range 1 .. 31; end record; subtype PIN_CFG_0_PULL_Field is HAL.UInt2; subtype PIN_CFG_0_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_0_SENSE_Field is HAL.UInt2; subtype PIN_CFG_0_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_0_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_0_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_0_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_0_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_0_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_0_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_1_PULL_Field is HAL.UInt2; subtype PIN_CFG_1_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_1_SENSE_Field is HAL.UInt2; subtype PIN_CFG_1_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_1_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_1_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_1_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_1_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_1_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_1_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_2_PULL_Field is HAL.UInt2; subtype PIN_CFG_2_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_2_SENSE_Field is HAL.UInt2; subtype PIN_CFG_2_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_2_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_2_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_2_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_2_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_2_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_2_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_3_PULL_Field is HAL.UInt2; subtype PIN_CFG_3_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_3_SENSE_Field is HAL.UInt2; subtype PIN_CFG_3_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_3_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_3_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_3_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_3_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_3_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_3_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_4_PULL_Field is HAL.UInt2; subtype PIN_CFG_4_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_4_SENSE_Field is HAL.UInt2; subtype PIN_CFG_4_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_4_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_4_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_4_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_4_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_4_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_4_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_5_PULL_Field is HAL.UInt2; subtype PIN_CFG_5_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_5_SENSE_Field is HAL.UInt2; subtype PIN_CFG_5_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_5_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_5_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_5_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_5_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_5_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_5_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_6_PULL_Field is HAL.UInt2; subtype PIN_CFG_6_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_6_SENSE_Field is HAL.UInt2; subtype PIN_CFG_6_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_6_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_6_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_6_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_6_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_6_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_6_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_7_PULL_Field is HAL.UInt2; subtype PIN_CFG_7_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_7_SENSE_Field is HAL.UInt2; subtype PIN_CFG_7_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_7_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_7_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_7_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_7_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_7_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_7_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_8_PULL_Field is HAL.UInt2; subtype PIN_CFG_8_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_8_SENSE_Field is HAL.UInt2; subtype PIN_CFG_8_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_8_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_8_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_8_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_8_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_8_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_8_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_9_PULL_Field is HAL.UInt2; subtype PIN_CFG_9_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_9_SENSE_Field is HAL.UInt2; subtype PIN_CFG_9_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_9_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_9_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_9_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_9_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_9_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_9_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_10_PULL_Field is HAL.UInt2; subtype PIN_CFG_10_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_10_SENSE_Field is HAL.UInt2; subtype PIN_CFG_10_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_10_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_10_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_10_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_10_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_10_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_10_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_11_PULL_Field is HAL.UInt2; subtype PIN_CFG_11_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_11_SENSE_Field is HAL.UInt2; subtype PIN_CFG_11_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_11_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_11_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_11_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_11_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_11_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_11_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_12_PULL_Field is HAL.UInt2; subtype PIN_CFG_12_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_12_SENSE_Field is HAL.UInt2; subtype PIN_CFG_12_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_12_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_12_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_12_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_12_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_12_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_12_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_13_PULL_Field is HAL.UInt2; subtype PIN_CFG_13_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_13_SENSE_Field is HAL.UInt2; subtype PIN_CFG_13_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_13_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_13_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_13_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_13_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_13_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_13_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_14_PULL_Field is HAL.UInt2; subtype PIN_CFG_14_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_14_SENSE_Field is HAL.UInt2; subtype PIN_CFG_14_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_14_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_14_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_14_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_14_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_14_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_14_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_15_PULL_Field is HAL.UInt2; subtype PIN_CFG_15_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_15_SENSE_Field is HAL.UInt2; subtype PIN_CFG_15_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_15_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_15_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_15_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_15_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_15_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_15_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_16_PULL_Field is HAL.UInt2; subtype PIN_CFG_16_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_16_SENSE_Field is HAL.UInt2; subtype PIN_CFG_16_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_16_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_16_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_16_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_16_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_16_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_16_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_17_PULL_Field is HAL.UInt2; subtype PIN_CFG_17_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_17_SENSE_Field is HAL.UInt2; subtype PIN_CFG_17_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_17_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_17_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_17_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_17_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_17_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_17_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_18_PULL_Field is HAL.UInt2; subtype PIN_CFG_18_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_18_SENSE_Field is HAL.UInt2; subtype PIN_CFG_18_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_18_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_18_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_18_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_18_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_18_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_18_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_19_PULL_Field is HAL.UInt2; subtype PIN_CFG_19_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_19_SENSE_Field is HAL.UInt2; subtype PIN_CFG_19_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_19_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_19_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_19_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_19_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_19_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_19_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_20_PULL_Field is HAL.UInt2; subtype PIN_CFG_20_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_20_SENSE_Field is HAL.UInt2; subtype PIN_CFG_20_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_20_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_20_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_20_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_20_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_20_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_20_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_21_PULL_Field is HAL.UInt2; subtype PIN_CFG_21_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_21_SENSE_Field is HAL.UInt2; subtype PIN_CFG_21_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_21_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_21_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_21_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_21_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_21_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_21_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_22_PULL_Field is HAL.UInt2; subtype PIN_CFG_22_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_22_SENSE_Field is HAL.UInt2; subtype PIN_CFG_22_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_22_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_22_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_22_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_22_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_22_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_22_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_23_PULL_Field is HAL.UInt2; subtype PIN_CFG_23_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_23_SENSE_Field is HAL.UInt2; subtype PIN_CFG_23_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_23_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_23_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_23_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_23_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_23_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_23_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_24_PULL_Field is HAL.UInt2; subtype PIN_CFG_24_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_24_SENSE_Field is HAL.UInt2; subtype PIN_CFG_24_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_24_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_24_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_24_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_24_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_24_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_24_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_25_PULL_Field is HAL.UInt2; subtype PIN_CFG_25_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_25_SENSE_Field is HAL.UInt2; subtype PIN_CFG_25_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_25_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_25_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_25_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_25_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_25_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_25_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_26_PULL_Field is HAL.UInt2; subtype PIN_CFG_26_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_26_SENSE_Field is HAL.UInt2; subtype PIN_CFG_26_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_26_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_26_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_26_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_26_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_26_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_26_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_27_PULL_Field is HAL.UInt2; subtype PIN_CFG_27_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_27_SENSE_Field is HAL.UInt2; subtype PIN_CFG_27_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_27_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_27_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_27_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_27_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_27_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_27_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_28_PULL_Field is HAL.UInt2; subtype PIN_CFG_28_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_28_SENSE_Field is HAL.UInt2; subtype PIN_CFG_28_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_28_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_28_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_28_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_28_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_28_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_28_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_29_PULL_Field is HAL.UInt2; subtype PIN_CFG_29_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_29_SENSE_Field is HAL.UInt2; subtype PIN_CFG_29_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_29_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_29_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_29_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_29_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_29_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_29_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_30_PULL_Field is HAL.UInt2; subtype PIN_CFG_30_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_30_SENSE_Field is HAL.UInt2; subtype PIN_CFG_30_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_30_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_30_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_30_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_30_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_30_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_30_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; subtype PIN_CFG_31_PULL_Field is HAL.UInt2; subtype PIN_CFG_31_DRIVE_Field is HAL.UInt4; subtype PIN_CFG_31_SENSE_Field is HAL.UInt2; subtype PIN_CFG_31_MCUSEL_Field is HAL.UInt3; -- Pin configuration type PIN_CFG_31_Register is record -- In/out configuration STANCE : Boolean := False; -- Input configuration INPUT : Boolean := False; -- Pull configuration PULL : PIN_CFG_31_PULL_Field := 16#0#; -- unspecified Reserved_4_7 : HAL.UInt4 := 16#0#; -- Drive configuration DRIVE : PIN_CFG_31_DRIVE_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; -- Pin sensing mech SENSE : PIN_CFG_31_SENSE_Field := 16#0#; -- unspecified Reserved_18_27 : HAL.UInt10 := 16#0#; -- Which MCU subsystem controls the pin MCUSEL : PIN_CFG_31_MCUSEL_Field := 16#0#; -- unspecified Reserved_31_31 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PIN_CFG_31_Register use record STANCE at 0 range 0 .. 0; INPUT at 0 range 1 .. 1; PULL at 0 range 2 .. 3; Reserved_4_7 at 0 range 4 .. 7; DRIVE at 0 range 8 .. 11; Reserved_12_15 at 0 range 12 .. 15; SENSE at 0 range 16 .. 17; Reserved_18_27 at 0 range 18 .. 27; MCUSEL at 0 range 28 .. 30; Reserved_31_31 at 0 range 31 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- General purpose input and output type GPIO_P0_Peripheral is record -- Write GPIO port OUT_k : aliased HAL.UInt32; -- Set individual bits in GPIO port OUTSET : aliased HAL.UInt32; -- Clear individual bits in GPIO port OUTCLR : aliased HAL.UInt32; -- Read GPIO port IN_k : aliased HAL.UInt32; -- Direction of GPIO port DIR : aliased HAL.UInt32; -- direction set DIRSET : aliased HAL.UInt32; -- direction clr DIRCLR : aliased HAL.UInt32; -- If pin satisfied sense criteria LATCH : aliased HAL.UInt32; -- If pin satisfied sense criteria DETECTMODE : aliased DETECTMODE_Register; -- If pin satisfied sense criteria DETECTMODE_SEC : aliased DETECTMODE_SEC_Register; -- Pin configuration PIN_CFG_0 : aliased PIN_CFG_0_Register; -- Pin configuration PIN_CFG_1 : aliased PIN_CFG_1_Register; -- Pin configuration PIN_CFG_2 : aliased PIN_CFG_2_Register; -- Pin configuration PIN_CFG_3 : aliased PIN_CFG_3_Register; -- Pin configuration PIN_CFG_4 : aliased PIN_CFG_4_Register; -- Pin configuration PIN_CFG_5 : aliased PIN_CFG_5_Register; -- Pin configuration PIN_CFG_6 : aliased PIN_CFG_6_Register; -- Pin configuration PIN_CFG_7 : aliased PIN_CFG_7_Register; -- Pin configuration PIN_CFG_8 : aliased PIN_CFG_8_Register; -- Pin configuration PIN_CFG_9 : aliased PIN_CFG_9_Register; -- Pin configuration PIN_CFG_10 : aliased PIN_CFG_10_Register; -- Pin configuration PIN_CFG_11 : aliased PIN_CFG_11_Register; -- Pin configuration PIN_CFG_12 : aliased PIN_CFG_12_Register; -- Pin configuration PIN_CFG_13 : aliased PIN_CFG_13_Register; -- Pin configuration PIN_CFG_14 : aliased PIN_CFG_14_Register; -- Pin configuration PIN_CFG_15 : aliased PIN_CFG_15_Register; -- Pin configuration PIN_CFG_16 : aliased PIN_CFG_16_Register; -- Pin configuration PIN_CFG_17 : aliased PIN_CFG_17_Register; -- Pin configuration PIN_CFG_18 : aliased PIN_CFG_18_Register; -- Pin configuration PIN_CFG_19 : aliased PIN_CFG_19_Register; -- Pin configuration PIN_CFG_20 : aliased PIN_CFG_20_Register; -- Pin configuration PIN_CFG_21 : aliased PIN_CFG_21_Register; -- Pin configuration PIN_CFG_22 : aliased PIN_CFG_22_Register; -- Pin configuration PIN_CFG_23 : aliased PIN_CFG_23_Register; -- Pin configuration PIN_CFG_24 : aliased PIN_CFG_24_Register; -- Pin configuration PIN_CFG_25 : aliased PIN_CFG_25_Register; -- Pin configuration PIN_CFG_26 : aliased PIN_CFG_26_Register; -- Pin configuration PIN_CFG_27 : aliased PIN_CFG_27_Register; -- Pin configuration PIN_CFG_28 : aliased PIN_CFG_28_Register; -- Pin configuration PIN_CFG_29 : aliased PIN_CFG_29_Register; -- Pin configuration PIN_CFG_30 : aliased PIN_CFG_30_Register; -- Pin configuration PIN_CFG_31 : aliased PIN_CFG_31_Register; end record with Volatile; for GPIO_P0_Peripheral use record OUT_k at 16#4# range 0 .. 31; OUTSET at 16#8# range 0 .. 31; OUTCLR at 16#C# range 0 .. 31; IN_k at 16#10# range 0 .. 31; DIR at 16#14# range 0 .. 31; DIRSET at 16#18# range 0 .. 31; DIRCLR at 16#1C# range 0 .. 31; LATCH at 16#20# range 0 .. 31; DETECTMODE at 16#24# range 0 .. 31; DETECTMODE_SEC at 16#28# range 0 .. 31; PIN_CFG_0 at 16#200# range 0 .. 31; PIN_CFG_1 at 16#204# range 0 .. 31; PIN_CFG_2 at 16#208# range 0 .. 31; PIN_CFG_3 at 16#20C# range 0 .. 31; PIN_CFG_4 at 16#210# range 0 .. 31; PIN_CFG_5 at 16#214# range 0 .. 31; PIN_CFG_6 at 16#218# range 0 .. 31; PIN_CFG_7 at 16#21C# range 0 .. 31; PIN_CFG_8 at 16#220# range 0 .. 31; PIN_CFG_9 at 16#224# range 0 .. 31; PIN_CFG_10 at 16#228# range 0 .. 31; PIN_CFG_11 at 16#22C# range 0 .. 31; PIN_CFG_12 at 16#230# range 0 .. 31; PIN_CFG_13 at 16#234# range 0 .. 31; PIN_CFG_14 at 16#238# range 0 .. 31; PIN_CFG_15 at 16#23C# range 0 .. 31; PIN_CFG_16 at 16#240# range 0 .. 31; PIN_CFG_17 at 16#244# range 0 .. 31; PIN_CFG_18 at 16#248# range 0 .. 31; PIN_CFG_19 at 16#24C# range 0 .. 31; PIN_CFG_20 at 16#250# range 0 .. 31; PIN_CFG_21 at 16#254# range 0 .. 31; PIN_CFG_22 at 16#258# range 0 .. 31; PIN_CFG_23 at 16#25C# range 0 .. 31; PIN_CFG_24 at 16#260# range 0 .. 31; PIN_CFG_25 at 16#264# range 0 .. 31; PIN_CFG_26 at 16#268# range 0 .. 31; PIN_CFG_27 at 16#26C# range 0 .. 31; PIN_CFG_28 at 16#270# range 0 .. 31; PIN_CFG_29 at 16#274# range 0 .. 31; PIN_CFG_30 at 16#278# range 0 .. 31; PIN_CFG_31 at 16#27C# range 0 .. 31; end record; -- General purpose input and output GPIO_P0_Periph : aliased GPIO_P0_Peripheral with Import, Address => System'To_Address (16#50842500#); -- General purpose input and output GPIO_P1_Periph : aliased GPIO_P0_Peripheral with Import, Address => System'To_Address (16#50842800#); end NRF53_SVD.GPIO_P0;