repo_name
stringlengths
9
74
language
stringclasses
1 value
length_bytes
int64
11
9.34M
extension
stringclasses
2 values
content
stringlengths
11
9.34M
zorodc/ada-http1
Ada
3,726
adb
with Ada.Text_IO; use Ada.Text_IO; package body HTTP.Request is package body Parse is procedure Debug (Ctx : in Context; Str : in String) is function Slice (Idx: in HTTP.Indexes; Str : in String) return String is (Str (Idx.First .. Idx.Last)); begin Put_Line ("KIND: " & Slice (Ctx.Split.Line.Kind, Str)); Put_Line ("PATH: " & Slice (Ctx.Split.Line.Path, Str)); Put_Line ("VERS: " & Slice (Ctx.Split.Line.Vers, Str)); for I in Integer range 1 .. Ctx.Split.Cnt-1 loop Put_Line ("[" & Slice (Ctx.Split.Headers (I).Key, Str) & ": " & Slice (Ctx.Split.Headers (I).Val, Str) & "]"); end loop; Put_Line ("TERMINAL STATE: " & Parse_State'Image (Ctx.State)); end Debug; package State is type Char_Table is array (Character) of Parse_State; type Step_Table is array (Parse_State) of Char_Table; subtype Up is Character range 'A' .. 'Z'; subtype Low is Character range 'a' .. 'z'; subtype Num is Character range '0' .. '9'; CR : constant Character := ASCII.CR; LF : constant Character := ASCII.LF; -- A mealy machine expressed as a lookup table, for request parsing; Table : Step_Table := ( Kind => (Up => Kind, ' ' => Path, others => Err), Path => (Up | Low |'/' | '.' => Path, ' ' => Pref, others => Err), Pref => (Up | Num |'/' | '.' => Pref, CR => Line, others => Err), -------------------------------------------------------------------- -- TODO: ... Perhaps put the transitions for Responses here. -------------------------------------------------------------------- Line => ( LF => Head, others => Err), Head => (Up|Low|'-' => Head, ':' => SSep, CR => Term, others => Err), SSep => ( ' ' => HBod, others => Err ), HBod => (CR => Line, others => HBod), Term => (LF => Done, others => Err ), Done => (others => Overread), Overread => (others => Overread), -- Maps to itself. Err => (others => Err )); -- Maps to itself. function Step (St : Parse_State; Ch : Character) return Parse_State is (State.Table (St) (Ch)); end State; procedure Update_Split (Req : in out As_Sliced; Prv, Nxt : in Parse_State; Count : in Natural) is procedure Update (Next_Indxs : in out Indexes; Transition : in Boolean) is begin if Transition then Next_Indxs.First := Count + 1; end if; Next_Indxs.Last := Count; end Update; Trans : Boolean := Prv /= Nxt; begin -- TODO: Use inheiritance + casting to have a single function. case Nxt is when Kind => Update (Req.Line.Kind, False); when Path => Update (Req.Line.Path, Trans); when Pref => Update (Req.Line.Vers, Trans); when Head => Update (Req.Headers (Req.Cnt).Key, Trans); when HBod => Update (Req.Headers (Req.Cnt).Val, Trans); when Line => Req.Cnt := Req.Cnt + 1; when others => null; end case; end Update_Split; procedure One_Char (Ctx : in out Context; Char : in Character) is Next_State : Parse_State; begin Next_State := State.Step(Ctx.State, Char); Update_Split (Ctx.Split, Ctx.State, Next_State, Ctx.Count); Ctx. Count := Ctx. Count + 1; Ctx. State := Next_State; end One_Char; procedure Str_Read (Ctx: in out Context; Str: in String; Cnt: out Natural) is Original : Positive := Ctx.Count; begin for I in Str'Range loop One_Char (Ctx, Str (I)); exit when Ctx. State = Done; end loop; Cnt := Ctx. Count - Original; end Str_Read; end Parse; end HTTP.Request;
reznikmm/clic
Ada
1,278
adb
with CLIC_Ex.Commands.TTY; with CLIC_Ex.Commands.User_Input; package body CLIC_Ex.Commands.Subsub is ------------- -- Execute -- ------------- overriding procedure Execute (Cmd : in out Instance; Args : AAA.Strings.Vector) is procedure Set_Global_Switches (Config : in out CLIC.Subcommand.Switches_Configuration) is null; package Sub is new CLIC.Subcommand.Instance (Main_Command_Name => "subsub", Version => "0.0.0", Set_Global_Switches => Set_Global_Switches, Put => Ada.Text_IO.Put, Put_Line => Ada.Text_IO.Put_Line, Put_Error => Ada.Text_IO.Put_Line, Error_Exit => GNAT.OS_Lib.OS_Exit, TTY_Chapter => CLIC.TTY.Info, TTY_Description => CLIC.TTY.Description, TTY_Version => CLIC.TTY.Version, TTY_Underline => CLIC.TTY.Underline, TTY_Emph => CLIC.TTY.Emph); begin Sub.Register (new Sub.Builtin_Help); Sub.Register (new CLIC_Ex.Commands.TTY.Instance); Sub.Register (new CLIC_Ex.Commands.User_Input.Instance); Sub.Execute (Args); end Execute; end CLIC_Ex.Commands.Subsub;
tum-ei-rcs/StratoX
Ada
400
adb
package body calc with SPARK_Mode is procedure Forgetful_Assert (X, Y : out Integer) with SPARK_Mode is begin X := 1; Y := 2; pragma Assert (X = 1); pragma Assert (Y = 2); pragma Assert_And_Cut (X > 0); -- also forgets about Y pragma Assert (Y = 2); pragma Assert (X > 0); pragma Assert (X = 1); end Forgetful_Assert; end calc;
JeremyGrosser/Ada_Drivers_Library
Ada
3,441
adb
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2018-2020, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with nRF.Device; with nRF.TWI; package body MicroBit.I2C is Init_Done : Boolean := False; Device : nRF.TWI.TWI_Master renames nRF.Device.TWI_0; -- This device should not conflict with the device used in MicroBit.SPI. -- See nRF Series Reference Manual, chapter Memory.Instantiation. ----------------- -- Initialized -- ----------------- function Initialized return Boolean is (Init_Done); ---------------- -- Initialize -- ---------------- procedure Initialize (S : Speed := S400kbps) is begin Device.Configure (SCL => MB_SCL.Pin, SDA => MB_SDA.Pin, Speed => (case S is when S100kbps => nRF.TWI.TWI_100kbps, when S250kbps => nRF.TWI.TWI_250kbps, when S400kbps => nRF.TWI.TWI_400kbps) ); Device.Enable; Init_Done := True; end Initialize; ---------------- -- Controller -- ---------------- function Controller return not null Any_I2C_Port is (Device'Access); end MicroBit.I2C;
DrenfongWong/tkm-rpc
Ada
1,639
ads
with Tkmrpc.Types; with Tkmrpc.Operations.Ike; package Tkmrpc.Request.Ike.Isa_Sign is Data_Size : constant := 1520; type Data_Type is record Isa_Id : Types.Isa_Id_Type; Lc_Id : Types.Lc_Id_Type; Init_Message : Types.Init_Message_Type; end record; for Data_Type use record Isa_Id at 0 range 0 .. (8 * 8) - 1; Lc_Id at 8 range 0 .. (8 * 8) - 1; Init_Message at 16 range 0 .. (1504 * 8) - 1; end record; for Data_Type'Size use Data_Size * 8; Padding_Size : constant := Request.Body_Size - Data_Size; subtype Padding_Range is Natural range 1 .. Padding_Size; subtype Padding_Type is Types.Byte_Sequence (Padding_Range); type Request_Type is record Header : Request.Header_Type; Data : Data_Type; Padding : Padding_Type; end record; for Request_Type use record Header at 0 range 0 .. (Request.Header_Size * 8) - 1; Data at Request.Header_Size range 0 .. (Data_Size * 8) - 1; Padding at Request.Header_Size + Data_Size range 0 .. (Padding_Size * 8) - 1; end record; for Request_Type'Size use Request.Request_Size * 8; Null_Request : constant Request_Type := Request_Type' (Header => Request.Header_Type'(Operation => Operations.Ike.Isa_Sign, Request_Id => 0), Data => Data_Type'(Isa_Id => Types.Isa_Id_Type'First, Lc_Id => Types.Lc_Id_Type'First, Init_Message => Types.Null_Init_Message_Type), Padding => Padding_Type'(others => 0)); end Tkmrpc.Request.Ike.Isa_Sign;
fractal-mind/Amass
Ada
1,226
ads
-- Copyright 2021 Jeff Foley. All rights reserved. -- Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. local json = require("json") name = "FullHunt" type = "api" function start() set_rate_limit(1) end function check() local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c ~= nil and c.key ~= nil and c.key ~= "") then return true end return false end function vertical(ctx, domain) local c local cfg = datasrc_config() if cfg ~= nil then c = cfg.credentials end if (c == nil or c.key == nil or c.key == "") then return end local resp, err = request(ctx, { ['url']=build_url(domain), ['headers']={['X-API-KEY']=c.key}, }) if (err ~= nil and err ~= "") then log(ctx, "vertical request to service failed: " .. err) return end local j = json.decode(resp) if (j == nil or j.hosts == nil) then return end for _, sub in pairs(j.hosts) do new_name(ctx, sub) end end function build_url(domain) return "https://fullhunt.io/api/v1/domain/" .. domain .. "/subdomains" end
pmderodat/sdlada
Ada
21,664
adb
-------------------------------------------------------------------------------------------------------------------- -- Copyright (c) 2013-2018 Luke A. Guest -- -- This software is provided 'as-is', without any express or implied -- warranty. In no event will the authors be held liable for any damages -- arising from the use of this software. -- -- Permission is granted to anyone to use this software for any purpose, -- including commercial applications, and to alter it and redistribute it -- freely, subject to the following restrictions: -- -- 1. The origin of this software must not be misrepresented; you must not -- claim that you wrote the original software. If you use this software -- in a product, an acknowledgment in the product documentation would be -- appreciated but is not required. -- -- 2. Altered source versions must be plainly marked as such, and must not be -- misrepresented as being the original software. -- -- 3. This notice may not be removed or altered from any source -- distribution. -------------------------------------------------------------------------------------------------------------------- with Ada.Unchecked_Conversion; with Interfaces; with Interfaces.C; with Interfaces.C.Strings; with SDL.Error; -- with SDL.Video.Surfaces.Makers; -- with SDL.Log; package body SDL.Video.Windows is package C renames Interfaces.C; use type Interfaces.Unsigned_32; use type C.int; use type SDL.C_Pointers.Windows_Pointer; use type System.Address; function Undefined_Window_Position (Display : Natural := 0) return SDL.Natural_Coordinate is Mask : constant Interfaces.Unsigned_32 := 16#1FFF_0000#; begin return C.int (Interfaces.Unsigned_32 (Display) or Mask); end Undefined_Window_Position; function Centered_Window_Position (Display : Natural := 0) return SDL.Natural_Coordinate is Mask : constant Interfaces.Unsigned_32 := 16#2FFF_0000#; begin return C.int (Interfaces.Unsigned_32 (Display) or Mask); end Centered_Window_Position; procedure Increment_Windows is begin Total_Windows_Created := Total_Windows_Created + 1; end Increment_Windows; procedure Decrement_Windows is begin Total_Windows_Created := Total_Windows_Created - 1; end Decrement_Windows; overriding procedure Finalize (Self : in out Window) is procedure SDL_Destroy (W : in SDL.C_Pointers.Windows_Pointer) with Import => True, Convention => C, External_Name => "SDL_DestroyWindow"; begin -- SDL.Log.Put_Debug ("Windows.Finalize: " & (if Self.Internal = null then "null" else "not null") & -- " " & (if Self.Owns = True then "owns" else "Doesn't own")); -- Make sure we don't delete this twice! if Self.Internal /= null and then Self.Owns then -- SDL.Log.Put_Debug ("Windows.Finalize: Deleting"); SDL_Destroy (Self.Internal); Self.Internal := null; Decrement_Windows; end if; end Finalize; function Get_Brightness (Self : in Window) return Brightness is function SDL_Get_Brightness (W : in SDL.C_Pointers.Windows_Pointer) return C.C_float with Import => True, Convention => C, External_Name => "SDL_GetWindowBrightness"; begin return Brightness (SDL_Get_Brightness (Self.Internal)); end Get_Brightness; procedure Set_Brightness (Self : in out Window; How_Bright : in Brightness) is function SDL_Set_Brightness (W : in SDL.C_Pointers.Windows_Pointer; B : in C.C_float) return C.int with Import => True, Convention => C, External_Name => "SDL_SetWindowBrightness"; Result : C.int := SDL_Set_Brightness (Self.Internal, C.C_float (How_Bright)); begin if Result /= Success then raise Window_Error with SDL.Error.Get; end if; end Set_Brightness; -- TODO: Try to see if we can just see User_Data_Access as the return type from the C function. function To_Data_Access is new Ada.Unchecked_Conversion (Source => System.Address, Target => User_Data_Access); function To_Address is new Ada.Unchecked_Conversion (Source => User_Data_Access, Target => System.Address); -- TODO: Make this and Set_Data generic. function Get_Data (Self : in Window; Name : in String) return User_Data_Access is function SDL_Get_Window_Data (W : in SDL.C_Pointers.Windows_Pointer; Name : in C.Strings.chars_ptr) return System.Address with Import => True, Convention => C, External_Name => "SDL_GetWindowData"; C_Name_Str : C.Strings.chars_ptr := C.Strings.New_String (Name); Item : User_Data_Access := To_Data_Access (SDL_Get_Window_Data (Self.Internal, C_Name_Str)); begin C.Strings.Free (C_Name_Str); return Item; end Get_Data; function Set_Data (Self : in out Window; Name : in String; Item : in User_Data_Access) return User_Data_Access is function SDL_Set_Window_Data (W : in SDL.C_Pointers.Windows_Pointer; Name : in C.Strings.chars_ptr; User_Data : in System.Address) return System.Address with Import => True, Convention => C, External_Name => "SDL_SetWindowData"; C_Name_Str : C.Strings.chars_ptr := C.Strings.New_String (Name); Previous_Data : User_Data_Access := To_Data_Access (SDL_Set_Window_Data (Self.Internal, C_Name_Str, To_Address (Item))); begin C.Strings.Free (C_Name_Str); return Previous_Data; end Set_Data; function Display_Index (Self : in Window) return Positive is function SDL_Get_Window_Display_Index (W : in SDL.C_Pointers.Windows_Pointer) return C.int with Import => True, Convention => C, External_Name => "SDL_GetWindowDisplayIndex"; Total : C.int := SDL_Get_Window_Display_Index (Self.Internal); begin if Total < 0 then raise Window_Error with SDL.Error.Get; end if; return Positive (Total); end Display_Index; procedure Get_Display_Mode (Self : in Window; Mode : out SDL.Video.Displays.Mode) is function SDL_Get_Window_Display_Mode (W : in SDL.C_Pointers.Windows_Pointer; M : out SDL.Video.Displays.Mode) return C.int with Import => True, Convention => C, External_Name => "SDL_GetWindowDisplayMode"; Result : C.int := SDL_Get_Window_Display_Mode (Self.Internal, Mode); begin if Result /= Success then raise Window_Error with SDL.Error.Get; end if; end Get_Display_Mode; procedure Set_Display_Mode (Self : in out Window; Mode : in SDL.Video.Displays.Mode) is function SDL_Set_Window_Display_Mode (W : in SDL.C_Pointers.Windows_Pointer; M : in SDL.Video.Displays.Mode) return C.int with Import => True, Convention => C, External_Name => "SDL_SetWindowDisplayMode"; Result : C.int := SDL_Set_Window_Display_Mode (Self.Internal, Mode); begin if Result /= Success then raise Window_Error with SDL.Error.Get; end if; end Set_Display_Mode; function Get_Flags (Self : in Window) return Window_Flags is function SDL_Get_Window_Flags (W : in SDL.C_Pointers.Windows_Pointer) return Window_Flags with Import => True, Convention => C, External_Name => "SDL_GetWindowFlags"; begin return SDL_Get_Window_Flags (Self.Internal); end Get_Flags; function From_ID (Window_ID : in ID) return Window is function SDL_Get_Window_From_ID (W : in ID) return SDL.C_Pointers.Windows_Pointer with Import => True, Convention => C, External_Name => "SDL_GetWindowFromID"; begin return W : constant Window := (Ada.Finalization.Limited_Controlled with Internal => SDL_Get_Window_From_ID (Window_ID), Owns => False) do null; end return; end From_ID; procedure Get_Gamma_Ramp (Self : in Window; Red, Green, Blue : out SDL.Video.Pixel_Formats.Gamma_Ramp) is function SDL_Get_Window_Gamma_Ramp (W : in SDL.C_Pointers.Windows_Pointer; R, G, B : out SDL.Video.Pixel_Formats.Gamma_Ramp) return C.int with Import => True, Convention => C, External_Name => "SDL_GetWindowGammaRamp"; Result : C.int := SDL_Get_Window_Gamma_Ramp (Self.Internal, Red, Green, Blue); begin if Result /= Success then raise Window_Error with SDL.Error.Get; end if; end Get_Gamma_Ramp; procedure Set_Gamma_Ramp (Self : in out Window; Red, Green, Blue : in SDL.Video.Pixel_Formats.Gamma_Ramp) is function SDL_Set_Window_Gamma_Ramp (W : in SDL.C_Pointers.Windows_Pointer; R, G, B : in SDL.Video.Pixel_Formats.Gamma_Ramp) return C.int with Import => True, Convention => C, External_Name => "SDL_SetWindowGammaRamp"; Result : C.int := SDL_Set_Window_Gamma_Ramp (Self.Internal, Red, Green, Blue); begin if Result /= Success then raise Window_Error with SDL.Error.Get; end if; end Set_Gamma_Ramp; function Is_Grabbed (Self : in Window) return Boolean is function SDL_Get_Window_Grab (W : in SDL.C_Pointers.Windows_Pointer) return SDL_Bool with Import => True, Convention => C, External_Name => "SDL_GetWindowGrab"; begin return (SDL_Get_Window_Grab (Self.Internal) = SDL_True); end Is_Grabbed; procedure Set_Grabbed (Self : in out Window; Grabbed : in Boolean := True) is procedure SDL_Set_Window_Grab (W : in SDL.C_Pointers.Windows_Pointer; G : in SDL_Bool) with Import => True, Convention => C, External_Name => "SDL_SetWindowGrab"; begin SDL_Set_Window_Grab (Self.Internal, (if Grabbed = True then SDL_True else SDL_False)); end Set_Grabbed; function Get_ID (Self : in Window) return ID is function SDL_Get_Window_ID (W : in SDL.C_Pointers.Windows_Pointer) return ID with Import => True, Convention => C, External_Name => "SDL_GetWindowID"; begin return SDL_Get_Window_ID (Self.Internal); end Get_ID; function Get_Maximum_Size (Self : in Window) return SDL.Sizes is procedure SDL_Get_Window_Maximum_Size (Win : in SDL.C_Pointers.Windows_Pointer; W, H : out SDL.Dimension) with Import => True, Convention => C, External_Name => "SDL_GetWindowMaximumSize"; W, H : C.int := 0; begin SDL_Get_Window_Maximum_Size (Self.Internal, W, H); return SDL.Sizes'(Width => W, Height => H); end Get_Maximum_Size; procedure Set_Maximum_Size (Self : in out Window; Size : in SDL.Sizes) is procedure SDL_Get_Window_Maximum_Size (Win : in SDL.C_Pointers.Windows_Pointer; W, H : in C.int) with Import => True, Convention => C, External_Name => "SDL_SetWindowMaximumSize"; begin SDL_Get_Window_Maximum_Size (Self.Internal, C.int (Size.Width), C.int (Size.Height)); end Set_Maximum_Size; function Get_Minimum_Size (Self : in Window) return SDL.Sizes is procedure SDL_Get_Window_Minimum_Size (Win : in SDL.C_Pointers.Windows_Pointer; W, H : out SDL.Dimension) with Import => True, Convention => C, External_Name => "SDL_GetWindowMinimumSize"; W, H : C.int := 0; begin SDL_Get_Window_Minimum_Size (Self.Internal, W, H); return SDL.Sizes'(Width => W, Height => H); end Get_Minimum_Size; procedure Set_Minimum_Size (Self : in out Window; Size : in SDL.Sizes) is procedure SDL_Get_Window_Minimum_Size (Win : in SDL.C_Pointers.Windows_Pointer; W, H : in C.int) with Import => True, Convention => C, External_Name => "SDL_SetWindowMinimumSize"; begin SDL_Get_Window_Minimum_Size (Self.Internal, C.int (Size.Width), C.int (Size.Height)); end Set_Minimum_Size; function Pixel_Format (Self : in Window) return SDL.Video.Pixel_Formats.Pixel_Format is function SDL_Get_Window_Pixel_Format (W : in SDL.C_Pointers.Windows_Pointer) return SDL.Video.Pixel_Formats.Pixel_Format with Import => True, Convention => C, External_Name => "SDL_GetWindowPixelFormat"; begin return SDL_Get_Window_Pixel_Format (Self.Internal); end Pixel_Format; function Get_Position (Self : in Window) return SDL.Natural_Coordinates is procedure SDL_Get_Window_Position (W : in SDL.C_Pointers.Windows_Pointer; X, Y : out C.int) with Import => True, Convention => C, External_Name => "SDL_GetWindowPosition"; Position : SDL.Natural_Coordinates := SDL.Zero_Coordinate; begin SDL_Get_Window_Position (Self.Internal, Position.X, Position.Y); return Position; end Get_Position; procedure Set_Position (Self : in out Window; Position : SDL.Natural_Coordinates) is procedure SDL_Set_Window_Position (W : in SDL.C_Pointers.Windows_Pointer; X, Y : in C.int) with Import => True, Convention => C, External_Name => "SDL_SetWindowPosition"; begin SDL_Set_Window_Position (Self.Internal, Position.X, Position.Y); end Set_Position; function Get_Size (Self : in Window) return SDL.Sizes is procedure SDL_Get_Window_Size (Win : in SDL.C_Pointers.Windows_Pointer; W, H : out SDL.Dimension) with Import => True, Convention => C, External_Name => "SDL_GetWindowSize"; W, H : C.int := 0; begin SDL_Get_Window_Size (Self.Internal, W, H); return SDL.Sizes'(Width => W, Height => H); end Get_Size; procedure Set_Size (Self : in out Window; Size : in SDL.Sizes) is procedure SDL_Get_Window_Size (Win : in SDL.C_Pointers.Windows_Pointer; W, H : in C.int) with Import => True, Convention => C, External_Name => "SDL_SetWindowSize"; begin SDL_Get_Window_Size (Self.Internal, C.int (Size.Width), C.int (Size.Height)); end Set_Size; function Get_Surface (Self : in Window) return SDL.Video.Surfaces.Surface is function SDL_Get_Window_Surface (W : in SDL.C_Pointers.Windows_Pointer) return SDL.Video.Surfaces.Internal_Surface_Pointer with Import => True, Convention => C, External_Name => "SDL_GetWindowSurface"; use type SDL.Video.Surfaces.Internal_Surface_Pointer; S : SDL.Video.Surfaces.Internal_Surface_Pointer := SDL_Get_Window_Surface (Self.Internal); function Make_Surface_From_Pointer (S : in SDL.Video.Surfaces.Internal_Surface_Pointer) return SDL.Video.Surfaces.Surface with Convention => Ada, Import => True; begin if S = null then raise Window_Error with SDL.Error.Get; end if; return Make_Surface_From_Pointer (S); end Get_Surface; function Get_Title (Self : in Window) return Ada.Strings.UTF_Encoding.UTF_8_String is function SDL_Get_Window_Title (W : in SDL.C_Pointers.Windows_Pointer) return C.Strings.chars_ptr with Import => True, Convention => C, External_Name => "SDL_GetWindowTitle"; begin return C.Strings.Value (SDL_Get_Window_Title (Self.Internal)); end Get_Title; procedure Set_Title (Self : in Window; Title : in Ada.Strings.UTF_Encoding.UTF_8_String) is procedure SDL_Set_Window_Title (W : in SDL.C_Pointers.Windows_Pointer; C_Str : in C.char_array) with Import => True, Convention => C, External_Name => "SDL_SetWindowTitle"; begin SDL_Set_Window_Title (Self.Internal, C.To_C (Title)); end Set_Title; procedure Hide (Self : in Window) is procedure SDL_Hide_Window (W : in SDL.C_Pointers.Windows_Pointer) with Import => True, Convention => C, External_Name => "SDL_HideWindow"; begin SDL_Hide_Window (Self.Internal); end Hide; procedure Show (Self : in Window) is procedure SDL_Show_Window (W : in SDL.C_Pointers.Windows_Pointer) with Import => True, Convention => C, External_Name => "SDL_ShowWindow"; begin SDL_Show_Window (Self.Internal); end Show; procedure Maximise (Self : in Window) is procedure SDL_Maximise_Window (W : in SDL.C_Pointers.Windows_Pointer) with Import => True, Convention => C, External_Name => "SDL_MaximizeWindow"; begin SDL_Maximise_Window (Self.Internal); end Maximise; procedure Minimise (Self : in Window) is procedure SDL_Minimise_Window (W : in SDL.C_Pointers.Windows_Pointer) with Import => True, Convention => C, External_Name => "SDL_MinimizeWindow"; begin SDL_Minimise_Window (Self.Internal); end Minimise; procedure Raise_And_Focus (Self : in Window) is procedure SDL_Raise_Window (W : in SDL.C_Pointers.Windows_Pointer) with Import => True, Convention => C, External_Name => "SDL_RaiseWindow"; begin SDL_Raise_Window (Self.Internal); end Raise_And_Focus; procedure Restore (Self : in Window) is procedure SDL_Restore_Window (W : in SDL.C_Pointers.Windows_Pointer) with Import => True, Convention => C, External_Name => "SDL_RestoreWindow"; begin SDL_Restore_Window (Self.Internal); end Restore; procedure Set_Mode (Self : in out Window; Flags : in Full_Screen_Flags) is function SDL_Window_Full_Screen (W : in SDL.C_Pointers.Windows_Pointer; F : in Full_Screen_Flags) return C.int with Import => True, Convention => C, External_Name => "SDL_SetWindowFullscreen"; Result : C.int := SDL_Window_Full_Screen (Self.Internal, Flags); begin if Result /= Success then raise Window_Error with SDL.Error.Get; end if; end Set_Mode; procedure Set_Icon (Self : in out Window; Icon : in SDL.Video.Surfaces.Surface) is procedure SDL_Set_Window_Icon (W : in SDL.C_Pointers.Windows_Pointer; S : SDL.Video.Surfaces.Internal_Surface_Pointer) with Import => True, Convention => C, External_Name => "SDL_SetWindowIcon"; function Get_Internal_Surface (Self : in SDL.Video.Surfaces.Surface) return SDL.Video.Surfaces.Internal_Surface_Pointer with Import => True, Convention => Ada; begin SDL_Set_Window_Icon (Self.Internal, Get_Internal_Surface (Icon)); end Set_Icon; procedure Update_Surface (Self : in Window) is function SDL_Update_Window_Surface (W : in SDL.C_Pointers.Windows_Pointer) return C.int with Import => True, Convention => C, External_Name => "SDL_UpdateWindowSurface"; Result : C.int := SDL_Update_Window_Surface (Self.Internal); begin if Result /= Success then raise Window_Error with SDL.Error.Get; end if; end Update_Surface; procedure Update_Surface_Rectangle (Self : in Window; Rectangle : in SDL.Video.Rectangles.Rectangle) is function SDL_Update_Window_Surface_Rects (W : in SDL.C_Pointers.Windows_Pointer; R : in SDL.Video.Rectangles.Rectangle; L : in C.int) return C.int with Import => True, Convention => C, External_Name => "SDL_UpdateWindowSurfaceRects"; Result : C.int := SDL_Update_Window_Surface_Rects (Self.Internal, Rectangle, 1); begin if Result /= Success then raise Window_Error with SDL.Error.Get; end if; end Update_Surface_Rectangle; procedure Update_Surface_Rectangles (Self : in Window; Rectangles : SDL.Video.Rectangles.Rectangle_Arrays) is function SDL_Update_Window_Surface_Rects (W : in SDL.C_Pointers.Windows_Pointer; R : in SDL.Video.Rectangles.Rectangle_Arrays; L : in C.int) return C.int with Import => True, Convention => C, External_Name => "SDL_UpdateWindowSurfaceRects"; Result : C.int := SDL_Update_Window_Surface_Rects (Self.Internal, Rectangles, Rectangles'Length); begin if Result /= Success then raise Window_Error with SDL.Error.Get; end if; end Update_Surface_Rectangles; function Exist return Boolean is begin if Total_Windows_Created /= Natural'First then return True; end if; return False; end Exist; function Get_Internal_Window (Self : in Window) return SDL.C_Pointers.Windows_Pointer is begin return Self.Internal; end Get_Internal_Window; end SDL.Video.Windows;
AdaCore/libadalang
Ada
68
adb
with Non_Existing_Unit; procedure Test is begin null; end Test;
zhmu/ananas
Ada
14,077
adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . V A L _ R E A L -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2022, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with System.Double_Real; with System.Float_Control; with System.Unsigned_Types; use System.Unsigned_Types; with System.Val_Util; use System.Val_Util; with System.Value_R; pragma Warnings (Off, "non-static constant in preelaborated unit"); -- Every constant is static given our instantiation model package body System.Val_Real is pragma Assert (Num'Machine_Mantissa <= Uns'Size); -- We need an unsigned type large enough to represent the mantissa Need_Extra : constant Boolean := Num'Machine_Mantissa > Uns'Size - 4; -- If the mantissa of the floating-point type is almost as large as the -- unsigned type, we do not have enough space for an extra digit in the -- unsigned type so we handle the extra digit separately, at the cost of -- a bit more work in Integer_to_Real. Precision_Limit : constant Uns := (if Need_Extra then 2**Num'Machine_Mantissa - 1 else 2**Uns'Size - 1); -- If we handle the extra digit separately, we use the precision of the -- floating-point type so that the conversion is exact. package Impl is new Value_R (Uns, Precision_Limit, Round => Need_Extra); subtype Base_T is Unsigned range 2 .. 16; -- The following tables compute the maximum exponent of the base that can -- fit in the given floating-point format, that is to say the element at -- index N is the largest K such that N**K <= Num'Last. Maxexp32 : constant array (Base_T) of Positive := [2 => 127, 3 => 80, 4 => 63, 5 => 55, 6 => 49, 7 => 45, 8 => 42, 9 => 40, 10 => 38, 11 => 37, 12 => 35, 13 => 34, 14 => 33, 15 => 32, 16 => 31]; Maxexp64 : constant array (Base_T) of Positive := [2 => 1023, 3 => 646, 4 => 511, 5 => 441, 6 => 396, 7 => 364, 8 => 341, 9 => 323, 10 => 308, 11 => 296, 12 => 285, 13 => 276, 14 => 268, 15 => 262, 16 => 255]; Maxexp80 : constant array (Base_T) of Positive := [2 => 16383, 3 => 10337, 4 => 8191, 5 => 7056, 6 => 6338, 7 => 5836, 8 => 5461, 9 => 5168, 10 => 4932, 11 => 4736, 12 => 4570, 13 => 4427, 14 => 4303, 15 => 4193, 16 => 4095]; package Double_Real is new System.Double_Real (Num); use type Double_Real.Double_T; subtype Double_T is Double_Real.Double_T; -- The double floating-point type function Integer_to_Real (Str : String; Val : Uns; Base : Unsigned; Scale : Integer; Extra : Unsigned; Minus : Boolean) return Num; -- Convert the real value from integer to real representation function Large_Powten (Exp : Natural) return Double_T; -- Return 10.0**Exp as a double number, where Exp > Maxpow --------------------- -- Integer_to_Real -- --------------------- function Integer_to_Real (Str : String; Val : Uns; Base : Unsigned; Scale : Integer; Extra : Unsigned; Minus : Boolean) return Num is pragma Assert (Base in 2 .. 16); pragma Assert (Num'Machine_Radix = 2); pragma Unsuppress (Range_Check); Maxexp : constant Positive := (if Num'Size = 32 then Maxexp32 (Base) elsif Num'Size = 64 then Maxexp64 (Base) elsif Num'Machine_Mantissa = 64 then Maxexp80 (Base) else raise Program_Error); -- Maximum exponent of the base that can fit in Num R_Val : Num; D_Val : Double_T; S : Integer := Scale; begin -- We call the floating-point processor reset routine so we can be sure -- that the x87 FPU is properly set for conversions. This is especially -- needed on Windows, where calls to the operating system randomly reset -- the processor into 64-bit mode. if Num'Machine_Mantissa = 64 then System.Float_Control.Reset; end if; -- Take into account the extra digit, i.e. do the two computations -- (1) R_Val := R_Val * Num (B) + Num (Extra) -- (2) S := S - 1 -- In the first, the three operands are exact, so using an FMA would -- be ideal, but we are most likely running on the x87 FPU, hence we -- may not have one. That is why we turn the multiplication into an -- iterated addition with exact error handling, so that we can do a -- single rounding at the end. if Need_Extra and then Extra > 0 then declare B : Unsigned := Base; Acc : Num := 0.0; Err : Num := 0.0; Fac : Num := Num (Val); DS : Double_T; begin loop -- If B is odd, add one factor. Note that the accumulator is -- never larger than the factor at this point (it is in fact -- never larger than the factor minus the initial value). if B rem 2 /= 0 then if Acc = 0.0 then Acc := Fac; else DS := Double_Real.Quick_Two_Sum (Fac, Acc); Acc := DS.Hi; Err := Err + DS.Lo; end if; exit when B = 1; end if; -- Now B is (morally) even, halve it and double the factor, -- which is always an exact operation. B := B / 2; Fac := Fac * 2.0; end loop; -- Add Extra to the error, which are both small integers D_Val := Double_Real.Quick_Two_Sum (Acc, Err + Num (Extra)); S := S - 1; end; -- Or else, if the Extra digit is zero, do the exact conversion elsif Need_Extra then D_Val := Double_Real.To_Double (Num (Val)); -- Otherwise, the value contains more bits than the mantissa so do the -- conversion in two steps. else declare Mask : constant Uns := 2**(Uns'Size - Num'Machine_Mantissa) - 1; Hi : constant Uns := Val and not Mask; Lo : constant Uns := Val and Mask; begin if Hi = 0 then D_Val := Double_Real.To_Double (Num (Lo)); else D_Val := Double_Real.Quick_Two_Sum (Num (Hi), Num (Lo)); end if; end; end if; -- Compute the final value by applying the scaling, if any if Val = 0 or else S = 0 then R_Val := Double_Real.To_Single (D_Val); else case Base is -- If the base is a power of two, we use the efficient Scaling -- attribute with an overflow check, if it is not 2, to catch -- ludicrous exponents that would result in an infinity or zero. when 2 => R_Val := Num'Scaling (Double_Real.To_Single (D_Val), S); when 4 => if Integer'First / 2 <= S and then S <= Integer'Last / 2 then S := S * 2; end if; R_Val := Num'Scaling (Double_Real.To_Single (D_Val), S); when 8 => if Integer'First / 3 <= S and then S <= Integer'Last / 3 then S := S * 3; end if; R_Val := Num'Scaling (Double_Real.To_Single (D_Val), S); when 16 => if Integer'First / 4 <= S and then S <= Integer'Last / 4 then S := S * 4; end if; R_Val := Num'Scaling (Double_Real.To_Single (D_Val), S); -- If the base is 10, use a double implementation for the sake -- of accuracy, to be removed when exponentiation is improved. -- When the exponent is positive, we can do the computation -- directly because, if the exponentiation overflows, then -- the final value overflows as well. But when the exponent -- is negative, we may need to do it in two steps to avoid -- an artificial underflow. when 10 => declare Powten : constant array (0 .. Maxpow) of Double_T; pragma Import (Ada, Powten); for Powten'Address use Powten_Address; begin if S > 0 then if S <= Maxpow then D_Val := D_Val * Powten (S); else D_Val := D_Val * Large_Powten (S); end if; else if S < -Maxexp then D_Val := D_Val / Large_Powten (Maxexp); S := S + Maxexp; end if; if S >= -Maxpow then D_Val := D_Val / Powten (-S); else D_Val := D_Val / Large_Powten (-S); end if; end if; R_Val := Double_Real.To_Single (D_Val); end; -- Implementation for other bases with exponentiation -- When the exponent is positive, we can do the computation -- directly because, if the exponentiation overflows, then -- the final value overflows as well. But when the exponent -- is negative, we may need to do it in two steps to avoid -- an artificial underflow. when others => declare B : constant Num := Num (Base); begin R_Val := Double_Real.To_Single (D_Val); if S > 0 then R_Val := R_Val * B ** S; else if S < -Maxexp then R_Val := R_Val / B ** Maxexp; S := S + Maxexp; end if; R_Val := R_Val / B ** (-S); end if; end; end case; end if; -- Finally deal with initial minus sign, note that this processing is -- done even if Uval is zero, so that -0.0 is correctly interpreted. return (if Minus then -R_Val else R_Val); exception when Constraint_Error => Bad_Value (Str); end Integer_to_Real; ------------------ -- Large_Powten -- ------------------ function Large_Powten (Exp : Natural) return Double_T is Powten : constant array (0 .. Maxpow) of Double_T; pragma Import (Ada, Powten); for Powten'Address use Powten_Address; R : Double_T; E : Natural; begin pragma Assert (Exp > Maxpow); R := Powten (Maxpow); E := Exp - Maxpow; while E > Maxpow loop R := R * Powten (Maxpow); E := E - Maxpow; end loop; R := R * Powten (E); return R; end Large_Powten; --------------- -- Scan_Real -- --------------- function Scan_Real (Str : String; Ptr : not null access Integer; Max : Integer) return Num is Base : Unsigned; Scale : Integer; Extra : Unsigned; Minus : Boolean; Val : Uns; begin Val := Impl.Scan_Raw_Real (Str, Ptr, Max, Base, Scale, Extra, Minus); return Integer_to_Real (Str, Val, Base, Scale, Extra, Minus); end Scan_Real; ---------------- -- Value_Real -- ---------------- function Value_Real (Str : String) return Num is Base : Unsigned; Scale : Integer; Extra : Unsigned; Minus : Boolean; Val : Uns; begin Val := Impl.Value_Raw_Real (Str, Base, Scale, Extra, Minus); return Integer_to_Real (Str, Val, Base, Scale, Extra, Minus); end Value_Real; end System.Val_Real;
AdaCore/gpr
Ada
3,051
ads
------------------------------------------------------------------------------ -- -- -- GPR2 PROJECT MANAGER -- -- -- -- Copyright (C) 2021-2023, AdaCore -- -- -- -- This 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. This software is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- -- TABILITY 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, -- -- see <http://www.gnu.org/licenses/>. -- -- -- ------------------------------------------------------------------------------ -- Synchronize data to/from the slave. The usage is: -- -- On one side: -- 1. call Send_Files for every slave to be synchronized -- 2. call Wait to wait for the synchronization to be terminated -- -- On the other side: -- 1. call Receive_Files with GPR2.Compilation.Protocol; with GPR2.Containers; package GPR2.Compilation.Sync is type Direction is (To_Slave, To_Master); procedure Send_Files (Channel : Protocol.Communication_Channel; Root_Dir : String; Excluded_Patterns : Containers.Value_List; Included_Patterns : Containers.Value_List; Mode : Direction); -- Synchronize from the build master to the slave procedure Wait; -- Wait for all synchronization to be terminated function Receive_Files (Channel : Protocol.Communication_Channel; Root_Dir : String; Total_File : out Natural; Total_Transferred : out Natural; Remote_Files : out Containers.Value_Set; Is_Debug : Boolean; Display : access procedure (Message : String)) return Protocol.Command_Kind; -- This routine must be used to receive the files that will be sent over -- by To_Slave. Total_File will be set with the total number of files -- checked and Total_Transferred the total number of files actually -- transferred (because of a time-stamp mismatch). The Root_Dir is the -- directory from where the files are to be written. Finally a Display -- routine can be passed to display messages during the transfer. Some -- messages are only displayed depending on Is_Debug status. end GPR2.Compilation.Sync;
Componolit/libsparkcrypto
Ada
6,559
adb
------------------------------------------------------------------------------- -- This file is part of libsparkcrypto. -- -- Copyright (C) 2010, Alexander Senier -- Copyright (C) 2010, secunet Security Networks AG -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- * Neither the name of the nor the names of its contributors may be used -- to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with LSC.Internal.Ops64; with LSC.Internal.Debug; pragma Unreferenced (LSC.Internal.Debug); package body LSC.Internal.HMAC_SHA512 is IPad : constant SHA512.Block_Type := SHA512.Block_Type'(SHA512.Block_Index => 16#36363636_36363636#); OPad : constant SHA512.Block_Type := SHA512.Block_Type'(SHA512.Block_Index => 16#5C5C5C5C_5C5C5C5C#); ---------------------------------------------------------------------------- function Context_Init (Key : SHA512.Block_Type) return Context_Type is Result : Context_Type; Temp : SHA512.Block_Type; begin pragma Debug (Debug.Put_Line ("HMAC.SHA512.Context_Init:")); Result.Key := Key; Result.SHA512_Context := SHA512.SHA512_Context_Init; Ops64.Block_XOR (IPad, Result.Key, Temp); SHA512.Context_Update (Result.SHA512_Context, Temp); return Result; end Context_Init; ---------------------------------------------------------------------------- procedure Context_Update (Context : in out Context_Type; Block : in SHA512.Block_Type) is begin pragma Debug (Debug.Put_Line ("HMAC.SHA512.Context_Update:")); SHA512.Context_Update (Context.SHA512_Context, Block); end Context_Update; ---------------------------------------------------------------------------- procedure Context_Finalize_Outer (Context : in out Context_Type) with Depends => (Context => Context); procedure Context_Finalize_Outer (Context : in out Context_Type) is Hash : SHA512.SHA512_Hash_Type; Temp : SHA512.Block_Type; begin Hash := SHA512.SHA512_Get_Hash (Context.SHA512_Context); Context.SHA512_Context := SHA512.SHA512_Context_Init; Ops64.Block_XOR (OPad, Context.Key, Temp); SHA512.Context_Update (Context.SHA512_Context, Temp); Temp := SHA512.Null_Block; Ops64.Block_Copy (Hash, Temp); SHA512.Context_Finalize (Context.SHA512_Context, Temp, 512); end Context_Finalize_Outer; ---------------------------------------------------------------------------- procedure Context_Finalize (Context : in out Context_Type; Block : in SHA512.Block_Type; Length : in SHA512.Block_Length_Type) is begin pragma Debug (Debug.Put_Line ("HMAC.SHA512.Context_Finalize:")); SHA512.Context_Finalize (Context.SHA512_Context, Block, Length); Context_Finalize_Outer (Context); end Context_Finalize; ---------------------------------------------------------------------------- function Get_Prf (Context : in Context_Type) return SHA512.SHA512_Hash_Type is begin return SHA512.SHA512_Get_Hash (Context.SHA512_Context); end Get_Prf; ---------------------------------------------------------------------------- function Get_Auth (Context : in Context_Type) return Auth_Type is Result : Auth_Type; Prf : SHA512.SHA512_Hash_Type; begin Prf := SHA512.SHA512_Get_Hash (Context.SHA512_Context); for Index in Auth_Index loop Result (Index) := Prf (Index); end loop; return Result; end Get_Auth; ---------------------------------------------------------------------------- function Keyed_Hash (Key : SHA512.Block_Type; Message : SHA512.Message_Type; Length : SHA512.Message_Index) return Context_Type with Pre => Message'First <= Message'Last and Length / SHA512.Block_Size + (if Length mod SHA512.Block_Size = 0 then 0 else 1) <= Message'Length; function Keyed_Hash (Key : SHA512.Block_Type; Message : SHA512.Message_Type; Length : SHA512.Message_Index) return Context_Type is HMAC_Ctx : Context_Type; begin HMAC_Ctx := Context_Init (Key); SHA512.Hash_Context (Message, Length, HMAC_Ctx.SHA512_Context); Context_Finalize_Outer (HMAC_Ctx); return HMAC_Ctx; end Keyed_Hash; ---------------------------------------------------------------------------- function Pseudorandom (Key : SHA512.Block_Type; Message : SHA512.Message_Type; Length : SHA512.Message_Index) return SHA512.SHA512_Hash_Type is begin return Get_Prf (Keyed_Hash (Key, Message, Length)); end Pseudorandom; ---------------------------------------------------------------------------- function Authenticate (Key : SHA512.Block_Type; Message : SHA512.Message_Type; Length : SHA512.Message_Index) return Auth_Type is begin return Get_Auth (Keyed_Hash (Key, Message, Length)); end Authenticate; end LSC.Internal.HMAC_SHA512;
AdaCore/gpr
Ada
52
ads
package Pack11 is procedure Dummy; end Pack11;
charlie5/cBound
Ada
1,421
ads
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces.C; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_glx_bool32_iterator_t is -- Item -- type Item is record data : access xcb.xcb_glx_bool32_t; the_rem : aliased Interfaces.C.int; index : aliased Interfaces.C.int; end record; -- Item_Array -- type Item_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_glx_bool32_iterator_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_glx_bool32_iterator_t.Item, Element_Array => xcb.xcb_glx_bool32_iterator_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_glx_bool32_iterator_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_glx_bool32_iterator_t.Pointer, Element_Array => xcb.xcb_glx_bool32_iterator_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_glx_bool32_iterator_t;
zhmu/ananas
Ada
1,851
ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . C A L E N D A R . T I M E _ Z O N E S -- -- -- -- S p e c -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ -- This package provides routines to determine the offset of dates to GMT. -- It is defined in the Ada 2005 RM (9.6.1). package Ada.Calendar.Time_Zones is -- Time zone manipulation type Time_Offset is range -(28 * 60) .. 28 * 60; -- Offset in minutes Unknown_Zone_Error : exception; function Local_Time_Offset (Date : Time := Clock) return Time_Offset; function UTC_Time_Offset (Date : Time := Clock) return Time_Offset renames Local_Time_Offset; -- Returns (in minutes), the difference between the implementation-defined -- time zone of Calendar, and UTC time, at the time Date. If the time zone -- of the Calendar implementation is unknown, raises Unknown_Zone_Error. end Ada.Calendar.Time_Zones;
io7m/coreland-gnatver
Ada
443
ads
package GNATver is type Variant_t is (GNAT_UNKNOWN, GNAT_FSF, GNAT_GPL, GNAT_PRO, GNAT_GAP); type Version_t is record Variant : Variant_t := GNAT_UNKNOWN; Major : Natural := 0; Minor : Natural := 0; Patch : Natural := 0; end record; procedure Decode (Version : out Version_t; Image : in String); procedure Decode_Current (Version : out Version_t); end GNATver;
reznikmm/matreshka
Ada
11,582
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.CMOF.Associations; with AMF.CMOF.Classes; with AMF.CMOF.Data_Types; with AMF.Factories.Standard_Profile_L2_Factories; with AMF.Links; with AMF.Standard_Profile_L2.Auxiliaries; with AMF.Standard_Profile_L2.Calls; with AMF.Standard_Profile_L2.Creates; with AMF.Standard_Profile_L2.Derives; with AMF.Standard_Profile_L2.Destroies; with AMF.Standard_Profile_L2.Documents; with AMF.Standard_Profile_L2.Entities; with AMF.Standard_Profile_L2.Executables; with AMF.Standard_Profile_L2.Focuses; with AMF.Standard_Profile_L2.Frameworks; with AMF.Standard_Profile_L2.Implementation_Classes; with AMF.Standard_Profile_L2.Implements; with AMF.Standard_Profile_L2.Instantiates; with AMF.Standard_Profile_L2.Libraries; with AMF.Standard_Profile_L2.Metaclasses; with AMF.Standard_Profile_L2.Model_Libraries; with AMF.Standard_Profile_L2.Processes; with AMF.Standard_Profile_L2.Realizations; with AMF.Standard_Profile_L2.Refines; with AMF.Standard_Profile_L2.Responsibilities; with AMF.Standard_Profile_L2.Scripts; with AMF.Standard_Profile_L2.Sends; with AMF.Standard_Profile_L2.Services; with AMF.Standard_Profile_L2.Sources; with AMF.Standard_Profile_L2.Specifications; with AMF.Standard_Profile_L2.Subsystems; with AMF.Standard_Profile_L2.Traces; with AMF.Standard_Profile_L2.Types; with AMF.Standard_Profile_L2.Utilities; with League.Holders; package AMF.Internals.Factories.Standard_Profile_L2_Factories is type Standard_Profile_L2_Factory is limited new AMF.Internals.Factories.Metamodel_Factory_Base and AMF.Factories.Standard_Profile_L2_Factories.Standard_Profile_L2_Factory with null record; overriding function Convert_To_String (Self : not null access Standard_Profile_L2_Factory; Data_Type : not null access AMF.CMOF.Data_Types.CMOF_Data_Type'Class; Value : League.Holders.Holder) return League.Strings.Universal_String; overriding function Create (Self : not null access Standard_Profile_L2_Factory; Meta_Class : not null access AMF.CMOF.Classes.CMOF_Class'Class) return not null AMF.Elements.Element_Access; overriding function Create_From_String (Self : not null access Standard_Profile_L2_Factory; Data_Type : not null access AMF.CMOF.Data_Types.CMOF_Data_Type'Class; Image : League.Strings.Universal_String) return League.Holders.Holder; overriding function Create_Link (Self : not null access Standard_Profile_L2_Factory; Association : not null access AMF.CMOF.Associations.CMOF_Association'Class; First_Element : not null AMF.Elements.Element_Access; Second_Element : not null AMF.Elements.Element_Access) return not null AMF.Links.Link_Access; overriding function Get_Package (Self : not null access constant Standard_Profile_L2_Factory) return AMF.CMOF.Packages.Collections.Set_Of_CMOF_Package; function Constructor (Extent : AMF.Internals.AMF_Extent) return not null AMF.Factories.Factory_Access; function Get_Package return not null AMF.CMOF.Packages.CMOF_Package_Access; function Create_Auxiliary (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Auxiliaries.Standard_Profile_L2_Auxiliary_Access; function Create_Call (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Calls.Standard_Profile_L2_Call_Access; function Create_Create (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Creates.Standard_Profile_L2_Create_Access; function Create_Derive (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Derives.Standard_Profile_L2_Derive_Access; function Create_Destroy (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Destroies.Standard_Profile_L2_Destroy_Access; function Create_Document (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Documents.Standard_Profile_L2_Document_Access; function Create_Entity (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Entities.Standard_Profile_L2_Entity_Access; function Create_Executable (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Executables.Standard_Profile_L2_Executable_Access; function Create_Focus (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Focuses.Standard_Profile_L2_Focus_Access; function Create_Framework (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Frameworks.Standard_Profile_L2_Framework_Access; function Create_Implement (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Implements.Standard_Profile_L2_Implement_Access; function Create_Implementation_Class (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Implementation_Classes.Standard_Profile_L2_Implementation_Class_Access; function Create_Instantiate (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Instantiates.Standard_Profile_L2_Instantiate_Access; function Create_Library (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Libraries.Standard_Profile_L2_Library_Access; function Create_Metaclass (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Metaclasses.Standard_Profile_L2_Metaclass_Access; function Create_Model_Library (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Model_Libraries.Standard_Profile_L2_Model_Library_Access; function Create_Process (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Processes.Standard_Profile_L2_Process_Access; function Create_Realization (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Realizations.Standard_Profile_L2_Realization_Access; function Create_Refine (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Refines.Standard_Profile_L2_Refine_Access; function Create_Responsibility (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Responsibilities.Standard_Profile_L2_Responsibility_Access; function Create_Script (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Scripts.Standard_Profile_L2_Script_Access; function Create_Send (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Sends.Standard_Profile_L2_Send_Access; function Create_Service (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Services.Standard_Profile_L2_Service_Access; function Create_Source (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Sources.Standard_Profile_L2_Source_Access; function Create_Specification (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Specifications.Standard_Profile_L2_Specification_Access; function Create_Subsystem (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Subsystems.Standard_Profile_L2_Subsystem_Access; function Create_Trace (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Traces.Standard_Profile_L2_Trace_Access; function Create_Type (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Types.Standard_Profile_L2_Type_Access; function Create_Utility (Self : not null access Standard_Profile_L2_Factory) return AMF.Standard_Profile_L2.Utilities.Standard_Profile_L2_Utility_Access; end AMF.Internals.Factories.Standard_Profile_L2_Factories;
reznikmm/gela
Ada
35,554
adb
with Gela.Compilations; with Gela.Element_Factories; with Gela.Element_Visiters; with Gela.Elements.Compilation_Unit_Bodies; with Gela.Elements.Compilation_Unit_Declarations; with Gela.Elements.Compilation_Units; with Gela.Elements.Compilations; with Gela.Elements.Subunits; with Gela.LARL_Parsers; with Gela.Lexers; with Gela.Fix_Node_Factories; with Gela.Pass_List; with Gela.Plain_Compilations; with Gela.Source_Finders; with Gela.Elements.Library_Unit_Declarations; with Gela.Symbol_Sets; with Gela.Elements.Context_Items; with Gela.Elements.With_Clauses; with Gela.Elements.Program_Unit_Names; with Gela.Elements.Identifiers; with Gela.Elements.Selected_Identifiers; with Gela.Elements.Selector_Names; with Gela.Elements.Library_Unit_Bodies; with Gela.Elements.Package_Bodies; with Gela.Elements.Procedure_Bodies; with Gela.Elements.Function_Bodies; with Gela.Elements.Defining_Program_Unit_Names; with Gela.Elements.Defining_Identifiers; with Gela.Elements.Defining_Expanded_Unit_Names; with Gela.Elements.Procedure_Declarations; with Gela.Elements.Procedure_Instantiations; with Gela.Elements.Function_Declarations; with Gela.Elements.Function_Instantiations; with Gela.Elements.Package_Declarations; with Gela.Elements.Package_Instantiations; with Gela.Elements.Generic_Procedure_Declarations; with Gela.Elements.Generic_Procedure_Renamings; with Gela.Elements.Generic_Function_Declarations; with Gela.Elements.Generic_Function_Renamings; with Gela.Elements.Generic_Package_Declarations; with Gela.Elements.Generic_Package_Renamings; with Gela.Elements.Package_Renaming_Declarations; with Gela.Elements.Defining_Designators; with Gela.Elements.Proper_Bodies; with Gela.Elements.Task_Bodies; with Gela.Elements.Protected_Bodies; with Gela.Debug_Properties; package body Gela.Plain_Compilation_Managers is procedure Read (Self : in out Compilation_Manager'Class; File : League.Strings.Universal_String; Source : League.Strings.Universal_String); procedure Add_Depend_Units (Comp : Gela.Compilations.Compilation_Access; Root : Gela.Elements.Compilations.Compilation_Access); procedure Look_Into_Unit (Comp : Gela.Compilations.Compilation_Access; Unit : Gela.Elements.Compilation_Units.Compilation_Unit_Access; Value : out Gela.Dependency_Lists.Unit_Data); ---------------- -- Initialize -- ---------------- not overriding procedure Initialize (Self : in out Compilation_Manager; Debug : League.Strings.Universal_String) is begin Self.Debug := Debug; end Initialize; -------------------- -- Look_Into_Unit -- -------------------- procedure Look_Into_Unit (Comp : Gela.Compilations.Compilation_Access; Unit : Gela.Elements.Compilation_Units.Compilation_Unit_Access; Value : out Gela.Dependency_Lists.Unit_Data) is package Get is type Visiter is new Gela.Element_Visiters.Visiter with record Is_Package : Boolean := False; Is_Subprogram : Boolean := False; Symbol : Gela.Lexical_Types.Symbol := 0; Withed : Gela.Lexical_Types.Symbol_List := Gela.Lexical_Types.Empty_Symbol_List; end record; procedure Add_With (Self : in out Visiter; List : Gela.Elements.Context_Items.Context_Item_Sequence_Access); overriding procedure Compilation_Unit_Body (Self : in out Visiter; Node : not null Gela.Elements.Compilation_Unit_Bodies. Compilation_Unit_Body_Access); overriding procedure Compilation_Unit_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Compilation_Unit_Declarations. Compilation_Unit_Declaration_Access); overriding procedure Defining_Expanded_Unit_Name (Self : in out Visiter; Node : not null Gela.Elements.Defining_Expanded_Unit_Names. Defining_Expanded_Unit_Name_Access); overriding procedure Defining_Identifier (Self : in out Visiter; Node : not null Gela.Elements.Defining_Identifiers. Defining_Identifier_Access); overriding procedure Function_Body (Self : in out Visiter; Node : not null Gela.Elements.Function_Bodies. Function_Body_Access); overriding procedure Function_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Function_Declarations. Function_Declaration_Access); overriding procedure Function_Instantiation (Self : in out Visiter; Node : not null Gela.Elements.Function_Instantiations. Function_Instantiation_Access); overriding procedure Generic_Function_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Generic_Function_Declarations. Generic_Function_Declaration_Access); overriding procedure Generic_Function_Renaming (Self : in out Visiter; Node : not null Gela.Elements.Generic_Function_Renamings. Generic_Function_Renaming_Access); overriding procedure Generic_Package_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Generic_Package_Declarations. Generic_Package_Declaration_Access); overriding procedure Generic_Package_Renaming (Self : in out Visiter; Node : not null Gela.Elements.Generic_Package_Renamings. Generic_Package_Renaming_Access); overriding procedure Generic_Procedure_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Generic_Procedure_Declarations. Generic_Procedure_Declaration_Access); overriding procedure Generic_Procedure_Renaming (Self : in out Visiter; Node : not null Gela.Elements.Generic_Procedure_Renamings. Generic_Procedure_Renaming_Access); overriding procedure Identifier (Self : in out Visiter; Node : not null Gela.Elements.Identifiers.Identifier_Access); overriding procedure Package_Body (Self : in out Visiter; Node : not null Gela.Elements.Package_Bodies.Package_Body_Access); overriding procedure Package_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Package_Declarations. Package_Declaration_Access); overriding procedure Package_Instantiation (Self : in out Visiter; Node : not null Gela.Elements.Package_Instantiations. Package_Instantiation_Access); overriding procedure Package_Renaming_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Package_Renaming_Declarations. Package_Renaming_Declaration_Access); overriding procedure Procedure_Body (Self : in out Visiter; Node : not null Gela.Elements.Procedure_Bodies. Procedure_Body_Access); overriding procedure Procedure_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Procedure_Declarations. Procedure_Declaration_Access); overriding procedure Procedure_Instantiation (Self : in out Visiter; Node : not null Gela.Elements.Procedure_Instantiations. Procedure_Instantiation_Access); overriding procedure Protected_Body (Self : in out Visiter; Node : not null Gela.Elements.Protected_Bodies. Protected_Body_Access); overriding procedure Selected_Identifier (Self : in out Visiter; Node : not null Gela.Elements.Selected_Identifiers. Selected_Identifier_Access); overriding procedure Subunit (Self : in out Visiter; Node : not null Gela.Elements.Subunits.Subunit_Access); overriding procedure Task_Body (Self : in out Visiter; Node : not null Gela.Elements.Task_Bodies.Task_Body_Access); overriding procedure With_Clause (Self : in out Visiter; Node : not null Gela.Elements.With_Clauses.With_Clause_Access); end Get; package body Get is -------------- -- Add_With -- -------------- procedure Add_With (Self : in out Visiter; List : Gela.Elements.Context_Items.Context_Item_Sequence_Access) is Cursor : Gela.Elements.Context_Items.Context_Item_Sequence_Cursor := List.First; begin while Cursor.Has_Element loop Cursor.Element.Visit (Self); Cursor.Next; end loop; end Add_With; --------------------------- -- Compilation_Unit_Body -- --------------------------- overriding procedure Compilation_Unit_Body (Self : in out Visiter; Node : not null Gela.Elements.Compilation_Unit_Bodies. Compilation_Unit_Body_Access) is Decl : constant Gela.Elements.Library_Unit_Bodies. Library_Unit_Body_Access := Node.Unit_Declaration; begin Self.Withed := Gela.Lexical_Types.Empty_Symbol_List; Self.Add_With (Node.Context_Clause_Elements); Decl.Visit (Self); Value := (Kind => Gela.Dependency_Lists.Unit_Body, Name => Self.Symbol, Withed => Self.Withed, Limited_With => Gela.Lexical_Types.Empty_Symbol_List, Unit_Body => Node, Is_Subprogram => Self.Is_Subprogram); end Compilation_Unit_Body; ---------------------------------- -- Compilation_Unit_Declaration -- ---------------------------------- overriding procedure Compilation_Unit_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Compilation_Unit_Declarations. Compilation_Unit_Declaration_Access) is Decl : constant Gela.Elements.Library_Unit_Declarations. Library_Unit_Declaration_Access := Node.Unit_Declaration; begin Self.Withed := Gela.Lexical_Types.Empty_Symbol_List; Self.Add_With (Node.Context_Clause_Elements); Decl.Visit (Self); Value := (Kind => Gela.Dependency_Lists.Unit_Declaration, Name => Self.Symbol, Withed => Self.Withed, Limited_With => Gela.Lexical_Types.Empty_Symbol_List, Is_Package => Self.Is_Package, Unit_Declaration => Node); end Compilation_Unit_Declaration; --------------------------------- -- Defining_Expanded_Unit_Name -- --------------------------------- overriding procedure Defining_Expanded_Unit_Name (Self : in out Visiter; Node : not null Gela.Elements.Defining_Expanded_Unit_Names. Defining_Expanded_Unit_Name_Access) is Prefix : constant Gela.Elements.Program_Unit_Names. Program_Unit_Name_Access := Node.Defining_Prefix; Selector : constant Gela.Elements.Defining_Identifiers. Defining_Identifier_Access := Node.Defining_Selector; Symbol : Gela.Lexical_Types.Symbol; begin Prefix.Visit (Self); Symbol := Self.Symbol; Selector.Visit (Self); Comp.Context.Symbols.Join (Left => Symbol, Right => Self.Symbol, Value => Self.Symbol); end Defining_Expanded_Unit_Name; ------------------------- -- Defining_Identifier -- ------------------------- overriding procedure Defining_Identifier (Self : in out Visiter; Node : not null Gela.Elements.Defining_Identifiers. Defining_Identifier_Access) is begin Self.Symbol := Comp.Get_Token (Node.Identifier_Token).Symbol; end Defining_Identifier; ------------------- -- Function_Body -- ------------------- overriding procedure Function_Body (Self : in out Visiter; Node : not null Gela.Elements.Function_Bodies. Function_Body_Access) is Name : constant Gela.Elements.Defining_Designators. Defining_Designator_Access := Node.Names; begin Self.Is_Subprogram := True; Name.Visit (Self); end Function_Body; -------------------------- -- Function_Declaration -- -------------------------- overriding procedure Function_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Function_Declarations. Function_Declaration_Access) is Name : constant Gela.Elements.Defining_Designators. Defining_Designator_Access := Node.Names; begin Name.Visit (Self); end Function_Declaration; ---------------------------- -- Function_Instantiation -- ---------------------------- overriding procedure Function_Instantiation (Self : in out Visiter; Node : not null Gela.Elements.Function_Instantiations. Function_Instantiation_Access) is Name : constant Gela.Elements.Defining_Designators. Defining_Designator_Access := Node.Names; begin Name.Visit (Self); end Function_Instantiation; ---------------------------------- -- Generic_Function_Declaration -- ---------------------------------- overriding procedure Generic_Function_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Generic_Function_Declarations. Generic_Function_Declaration_Access) is Name : constant Gela.Elements.Defining_Designators. Defining_Designator_Access := Node.Names; begin Name.Visit (Self); end Generic_Function_Declaration; ------------------------------- -- Generic_Function_Renaming -- ------------------------------- overriding procedure Generic_Function_Renaming (Self : in out Visiter; Node : not null Gela.Elements.Generic_Function_Renamings. Generic_Function_Renaming_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); end Generic_Function_Renaming; overriding procedure Generic_Package_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Generic_Package_Declarations. Generic_Package_Declaration_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); Self.Is_Package := True; end Generic_Package_Declaration; overriding procedure Generic_Package_Renaming (Self : in out Visiter; Node : not null Gela.Elements.Generic_Package_Renamings. Generic_Package_Renaming_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); end Generic_Package_Renaming; overriding procedure Generic_Procedure_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Generic_Procedure_Declarations. Generic_Procedure_Declaration_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); end Generic_Procedure_Declaration; -------------------------------- -- Generic_Procedure_Renaming -- -------------------------------- overriding procedure Generic_Procedure_Renaming (Self : in out Visiter; Node : not null Gela.Elements.Generic_Procedure_Renamings. Generic_Procedure_Renaming_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); end Generic_Procedure_Renaming; ---------------- -- Identifier -- ---------------- overriding procedure Identifier (Self : in out Visiter; Node : not null Gela.Elements.Identifiers.Identifier_Access) is begin Self.Symbol := Comp.Get_Token (Node.Identifier_Token).Symbol; end Identifier; ------------------ -- Package_Body -- ------------------ overriding procedure Package_Body (Self : in out Visiter; Node : not null Gela.Elements.Package_Bodies.Package_Body_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); end Package_Body; ------------------------- -- Package_Declaration -- ------------------------- overriding procedure Package_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Package_Declarations. Package_Declaration_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); Self.Is_Package := True; end Package_Declaration; --------------------------- -- Package_Instantiation -- --------------------------- overriding procedure Package_Instantiation (Self : in out Visiter; Node : not null Gela.Elements.Package_Instantiations. Package_Instantiation_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); Self.Is_Package := True; end Package_Instantiation; ---------------------------------- -- Package_Renaming_Declaration -- ---------------------------------- overriding procedure Package_Renaming_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Package_Renaming_Declarations. Package_Renaming_Declaration_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); end Package_Renaming_Declaration; -------------------- -- Procedure_Body -- -------------------- overriding procedure Procedure_Body (Self : in out Visiter; Node : not null Gela.Elements.Procedure_Bodies. Procedure_Body_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Self.Is_Subprogram := True; Name.Visit (Self); end Procedure_Body; --------------------------- -- Procedure_Declaration -- --------------------------- overriding procedure Procedure_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Procedure_Declarations. Procedure_Declaration_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); end Procedure_Declaration; ----------------------------- -- Procedure_Instantiation -- ----------------------------- overriding procedure Procedure_Instantiation (Self : in out Visiter; Node : not null Gela.Elements.Procedure_Instantiations. Procedure_Instantiation_Access) is Name : constant Gela.Elements.Defining_Program_Unit_Names. Defining_Program_Unit_Name_Access := Node.Names; begin Name.Visit (Self); end Procedure_Instantiation; -------------------- -- Protected_Body -- -------------------- overriding procedure Protected_Body (Self : in out Visiter; Node : not null Gela.Elements.Protected_Bodies. Protected_Body_Access) is Name : constant Gela.Elements.Defining_Identifiers. Defining_Identifier_Access := Node.Names; begin Name.Visit (Self); end Protected_Body; ------------------------- -- Selected_Identifier -- ------------------------- overriding procedure Selected_Identifier (Self : in out Visiter; Node : not null Gela.Elements.Selected_Identifiers. Selected_Identifier_Access) is Selector : constant Gela.Elements.Selector_Names. Selector_Name_Access := Node.Selector; Symbol : Gela.Lexical_Types.Symbol; begin Node.Prefix.Visit (Self); Symbol := Self.Symbol; Selector.Visit (Self); Comp.Context.Symbols.Join (Left => Symbol, Right => Self.Symbol, Value => Self.Symbol); end Selected_Identifier; ------------- -- Subunit -- ------------- overriding procedure Subunit (Self : in out Visiter; Node : not null Gela.Elements.Subunits.Subunit_Access) is Symbol : Gela.Lexical_Types.Symbol; Parent : constant Gela.Elements.Program_Unit_Names. Program_Unit_Name_Access := Node.Parent_Unit_Name; Decl : constant Gela.Elements.Proper_Bodies.Proper_Body_Access := Node.Unit_Declaration; begin Parent.Visit (Self); Symbol := Self.Symbol; Self.Withed := Gela.Lexical_Types.Empty_Symbol_List; Self.Add_With (Node.Context_Clause_Elements); Decl.Visit (Self); Comp.Context.Symbols.Join (Left => Symbol, Right => Self.Symbol, Value => Self.Symbol); Value := (Kind => Gela.Dependency_Lists.Subunit, Name => Self.Symbol, Withed => Self.Withed, Limited_With => Gela.Lexical_Types.Empty_Symbol_List, Subunit => Node); end Subunit; --------------- -- Task_Body -- --------------- overriding procedure Task_Body (Self : in out Visiter; Node : not null Gela.Elements.Task_Bodies.Task_Body_Access) is Name : constant Gela.Elements.Defining_Identifiers. Defining_Identifier_Access := Node.Names; begin Name.Visit (Self); end Task_Body; ----------------- -- With_Clause -- ----------------- overriding procedure With_Clause (Self : in out Visiter; Node : not null Gela.Elements.With_Clauses.With_Clause_Access) is List : constant Gela.Elements.Program_Unit_Names .Program_Unit_Name_Sequence_Access := Node.With_Clause_Names; Cursor : Gela.Elements.Program_Unit_Names. Program_Unit_Name_Sequence_Cursor := List.First; begin while Cursor.Has_Element loop Cursor.Element.Visit (Self); Comp.Context.Symbols.Create_List (Head => Self.Symbol, Tail => Self.Withed, Value => Self.Withed); Cursor.Next; end loop; end With_Clause; end Get; V : Get.Visiter; begin Unit.Visit (V); end Look_Into_Unit; ---------------------- -- Add_Depend_Units -- ---------------------- procedure Add_Depend_Units (Comp : Gela.Compilations.Compilation_Access; Root : Gela.Elements.Compilations.Compilation_Access) is Deps : constant Gela.Dependency_Lists.Dependency_List_Access := Comp.Context.Dependency_List; Units : constant Gela.Elements.Compilation_Units .Compilation_Unit_Sequence_Access := Root.Units; Cursor : Gela.Elements.Compilation_Units .Compilation_Unit_Sequence_Cursor := Units.First; Value : Gela.Dependency_Lists.Unit_Data; begin while Cursor.Has_Element loop Look_Into_Unit (Comp, Cursor.Element, Value); Deps.Add_Compilation_Unit (Value); Cursor.Next; end loop; end Add_Depend_Units; ------------- -- Context -- ------------- overriding function Context (Self : Compilation_Manager) return Gela.Contexts.Context_Access is begin return Self.Context; end Context; ------------------ -- Create_Units -- ------------------ not overriding procedure Create_Unit (Self : in out Compilation_Manager; Item : Gela.Dependency_Lists.Unit_Data) is use all type Gela.Dependency_Lists.Unit_Kinds; use type Gela.Lexical_Types.Symbol; Up : Gela.Lexical_Types.Symbol; Set : constant Gela.Symbol_Sets.Symbol_Set_Access := Self.Context.Symbols; Upper : Gela.Compilation_Units.Library_Package_Declaration_Access; Decl : Gela.Compilation_Units.Library_Unit_Declaration_Access; Parent : Gela.Compilation_Units.Library_Unit_Body_Access; Sub : Gela.Compilation_Units.Subunit_Access; Symbol : Gela.Lexical_Types.Symbol; begin case Item.Kind is when Unit_Declaration => Up := Set.Parent (Item.Name); if Up /= Gela.Lexical_Types.No_Symbol then Upper := Self.Packages.Element (Up); end if; Decl := Self.Factory.Create_Library_Unit_Declaration (Parent => Upper, Name => Item.Name, Node => Item.Unit_Declaration); Self.Specs.Insert (Item.Name, Decl); if Item.Is_Package then Upper := Gela.Compilation_Units. Library_Package_Declaration_Access (Decl); Self.Packages.Insert (Item.Name, Upper); end if; when Unit_Body => if Self.Specs.Contains (Item.Name) then Decl := Self.Specs.Element (Item.Name); Parent := Self.Factory.Create_Library_Unit_Body (Declaration => Decl, Name => Item.Name, Node => Item.Unit_Body); else Up := Set.Prefix (Item.Name); if Up /= Gela.Lexical_Types.No_Symbol then Upper := Self.Packages.Element (Up); end if; Parent := Self.Factory.Create_Subprogram_Without_Declaration (Parent => Upper, Name => Item.Name, Node => Item.Unit_Body); end if; Self.Bodies.Insert (Item.Name, Parent); when Subunit => Symbol := Set.Prefix (Item.Name); if Self.Bodies.Contains (Symbol) then Parent := Self.Bodies.Element (Symbol); Sub := Self.Factory.Create_Subunit (Parent => Parent, Name => Item.Name, Node => Item.Subunit); else Sub := Self.Subunits.Element (Symbol); Sub := Self.Factory.Create_Subunit (Parent => Sub, Name => Item.Name, Node => Item.Subunit); end if; Self.Subunits.Insert (Item.Name, Sub); end case; end Create_Unit; ---------- -- Hash -- ---------- function Hash (Item : Gela.Lexical_Types.Symbol) return Ada.Containers.Hash_Type is begin return Ada.Containers.Hash_Type (Item); end Hash; ---------- -- Read -- ---------- procedure Read (Self : in out Compilation_Manager'Class; File : League.Strings.Universal_String; Source : League.Strings.Universal_String) is Lexer : constant Gela.Lexers.Lexer_Access := Self.Context.Lexer; Comp : constant Gela.Plain_Compilations.Compilation_Access := new Gela.Plain_Compilations.Compilation (Self.Context); C : constant Gela.Compilations.Compilation_Access := Gela.Compilations.Compilation_Access (Comp); Parser : Gela.LARL_Parsers.Parser (Self.Context); Root : Gela.Elements.Compilations.Compilation_Access; Last : Gela.Lexical_Types.Token_Index; Factory : constant Gela.Fix_Node_Factories.Element_Factory_Access := new Gela.Fix_Node_Factories.Element_Factory (C); begin Comp.Initialize (Text_Name => File, Source => Source, Factory => Gela.Element_Factories.Element_Factory_Access (Factory)); Lexer.Scan (Source, Comp); Parser.Parse (Input => Comp, Factory => Gela.Element_Factories.Element_Factory_Access (Factory), Root => Root, Last_Token => Last); Add_Depend_Units (C, Root); Self.Read_Dependency (Self.Context.Dependency_List); end Read; --------------- -- Read_Body -- --------------- overriding procedure Read_Body (Self : in out Compilation_Manager; Symbol : Gela.Lexical_Types.Symbol) is Source_Finder : constant Gela.Source_Finders.Source_Finder_Access := Self.Context.Source_Finder; Found : Boolean; File : League.Strings.Universal_String; Source : League.Strings.Universal_String; begin Source_Finder.Lookup_Body (Symbol => Symbol, Found => Found, File => File, Source => Source); if not Found then raise Constraint_Error; end if; Read (Self, File, Source); end Read_Body; ---------------------- -- Read_Compilation -- ---------------------- overriding procedure Read_Compilation (Self : in out Compilation_Manager; Name : League.Strings.Universal_String) is Source_Finder : constant Gela.Source_Finders.Source_Finder_Access := Self.Context.Source_Finder; Found : Boolean; File : League.Strings.Universal_String; Source : League.Strings.Universal_String; begin Source_Finder.Lookup_Compilation (Name => Name, Found => Found, File => File, Source => Source); if not Found then raise Constraint_Error; end if; Read (Self, File, Source); end Read_Compilation; ---------------------- -- Read_Declaration -- ---------------------- overriding procedure Read_Declaration (Self : in out Compilation_Manager; Symbol : Gela.Lexical_Types.Symbol) is Source_Finder : constant Gela.Source_Finders.Source_Finder_Access := Self.Context.Source_Finder; Deps : Gela.Dependency_Lists.Dependency_List_Access; Found : Boolean; File : League.Strings.Universal_String; Source : League.Strings.Universal_String; begin Source_Finder.Lookup_Declaration (Symbol => Symbol, Found => Found, File => File, Source => Source); if Found then Read (Self, File, Source); else Deps := Self.Context.Dependency_List; Deps.No_Library_Unit_Declaration (Symbol); end if; end Read_Declaration; --------------------- -- Read_Dependency -- --------------------- overriding procedure Read_Dependency (Self : in out Compilation_Manager; List : Gela.Dependency_Lists.Dependency_List_Access) is Action : Gela.Dependency_Lists.Action; begin loop List.Next_Action (Action); case Action.Action_Kind is when Gela.Dependency_Lists.Complete => exit; when Gela.Dependency_Lists.Unit_Required => case Action.Unit_Kind is when Gela.Dependency_Lists.Unit_Declaration => Self.Read_Declaration (Action.Full_Name); when Gela.Dependency_Lists.Unit_Body => Self.Read_Body (Action.Full_Name); when Gela.Dependency_Lists.Subunit => raise Constraint_Error; end case; when Gela.Dependency_Lists.Unit_Ready => Self.Create_Unit (Action.Unit); case Action.Unit.Kind is when Gela.Dependency_Lists.Subunit => declare PL : constant Gela.Pass_List.Visiter_Access := new Gela.Pass_List.Visiter (Action.Unit.Subunit.Enclosing_Compilation); begin PL.Subunit_1 (Action.Unit.Subunit); end; when Gela.Dependency_Lists.Unit_Body => declare PL : constant Gela.Pass_List.Visiter_Access := new Gela.Pass_List.Visiter (Action.Unit.Unit_Body.Enclosing_Compilation); begin PL.Compilation_Unit_Body_1 (Action.Unit.Unit_Body); if not Self.Debug.Is_Empty then Gela.Debug_Properties.Dump (Gela.Elements.Element_Access (Action.Unit.Unit_Body), Self.Debug); end if; end; when Gela.Dependency_Lists.Unit_Declaration => declare PL : constant Gela.Pass_List.Visiter_Access := new Gela.Pass_List.Visiter (Action.Unit.Unit_Declaration. Enclosing_Compilation); begin PL.Compilation_Unit_Declaration_1 (Action.Unit.Unit_Declaration); end; end case; end case; end loop; end Read_Dependency; end Gela.Plain_Compilation_Managers;
AdaCore/Ada_Drivers_Library
Ada
5,209
adb
------------------------------------------------------------------------------ -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ with STM32_SVD.RCC; use STM32_SVD.RCC; with STM32_SVD.WWDG; use STM32_SVD.WWDG; package body STM32.WWDG is --------------------------- -- Enable_Watchdog_Clock -- --------------------------- procedure Enable_Watchdog_Clock is begin RCC_Periph.APB1ENR.WWDGEN := True; end Enable_Watchdog_Clock; -------------------- -- Reset_Watchdog -- -------------------- procedure Reset_Watchdog is begin RCC_Periph.APB1RSTR.WWDGRST := True; RCC_Periph.APB1RSTR.WWDGRST := False; end Reset_Watchdog; ---------------------------- -- Set_Watchdog_Prescaler -- ---------------------------- procedure Set_Watchdog_Prescaler (Value : Prescalers) is begin WWDG_Periph.CFR.WDGTB.Val := Value'Enum_Rep; end Set_Watchdog_Prescaler; ------------------------- -- Set_Watchdog_Window -- ------------------------- procedure Set_Watchdog_Window (Window_Start_Count : Downcounter) is begin WWDG_Periph.CFR.W := Window_Start_Count; end Set_Watchdog_Window; ----------------------- -- Activate_Watchdog -- ----------------------- procedure Activate_Watchdog (New_Count : Downcounter) is begin WWDG_Periph.CR.T := New_Count; WWDG_Periph.CR.WDGA := True; end Activate_Watchdog; ------------------------------ -- Refresh_Watchdog_Counter -- ------------------------------ procedure Refresh_Watchdog_Counter (New_Count : Downcounter) is begin WWDG_Periph.CR.T := New_Count; end Refresh_Watchdog_Counter; ----------------------------------- -- Enable_Early_Wakeup_Interrupt -- ----------------------------------- procedure Enable_Early_Wakeup_Interrupt is begin WWDG_Periph.CFR.EWI := True; end Enable_Early_Wakeup_Interrupt; -------------------------------------- -- Early_Wakeup_Interrupt_Indicated -- -------------------------------------- function Early_Wakeup_Interrupt_Indicated return Boolean is (WWDG_Periph.SR.EWIF); ---------------------------------- -- Clear_Early_Wakeup_Interrupt -- ---------------------------------- procedure Clear_Early_Wakeup_Interrupt is begin WWDG_Periph.SR.EWIF := False; end Clear_Early_Wakeup_Interrupt; -------------------------- -- WWDG_Reset_Indicated -- -------------------------- function WWDG_Reset_Indicated return Boolean is (RCC_Periph.CSR.WWDGRSTF); --------------------------- -- Clear_WWDG_Reset_Flag -- --------------------------- procedure Clear_WWDG_Reset_Flag is begin RCC_Periph.CSR.RMVF := True; end Clear_WWDG_Reset_Flag; ------------------ -- Reset_System -- ------------------ procedure Reset_System is begin WWDG_Periph.CR.T := 0; WWDG_Periph.CR.WDGA := True; end Reset_System; end STM32.WWDG;
annexi-strayline/AURA
Ada
6,051
ads
------------------------------------------------------------------------------ -- -- -- Ada User Repository Annex (AURA) -- -- Reference Implementation -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This package manages the generation of collective Implementation_Hash -- component of all Library_Units in the Registry that are not Requested. -- -- The Implementation_Hash tracks which units can be recompiled without -- recompiling units that depend on those units. If the implementation has been -- modified, but the specification has not, only the bodies of the -- implementation of that unit need to be recompiled. with Progress; with Registrar.Library_Units; package Registrar.Implementation_Hashing is procedure Hash_All; procedure Hash_Configurations; -- Hash_All is intended to be executed prior to the build phase of AURA, -- and takes a subset of all Library_Units (including any Subunits) -- that do not have a state of Requested. -- -- Hash_Configurations is intended to be used during the checkout cycle -- of AURA, and hases on the configuration and manifest units of each -- Subsystem with a state of "Aquired" -- -- For both executions, an appropriate library unit subset is generated and -- work orders are dispatched to collect the hashes for the bodies and -- subunits and enter them into the appropriate collection queue, which are -- finally reduced to the collective hash, which is then set per library -- unit (not for any subunits), and updated in the registry -- -- To assist in Last_Run hash comparisons, Hash_Subset also copies the -- Hash property of the Spec_File to the Specification_Hash property. -- -- Note that for units that do not have bodies or subunits, the resulting -- Implementation_Hash will not be valid, but the Specification_Hash will -- still be copied-out. Similarily, for units such as subunits that do not -- have specifications, Specification_Hash will not be valid. -- -- Calling Hash_Subset when a pass is already running, but is not yet -- complete, causes Program_Error to be propegated -- Trackers -- -------------- Collection_Phase_Progress: aliased Progress.Progress_Tracker; -- Collection_Phase_Progress tracks the number of units that have their -- hashes collected. The total is equal to the size of the subset -- (in Library_Units) Crunch_Phase_Progress : aliased Progress.Progress_Tracker; -- Crunch_Phase_Progress tracks the library units (excluding subunits) that -- will receive a collective hash value for Implementation_Hash, and have -- that hash updated in the Registry -- Both trackers are set before work orders are submitted to the worker pool -- and so waiting on Crunch_Phase_Progress may be done without first waiting -- for Collection_Phase_Progress to complete end Registrar.Implementation_Hashing;
reznikmm/matreshka
Ada
3,806
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.ODF_Attributes.FO.Font_Style; package ODF.DOM.Attributes.FO.Font_Style.Internals is function Create (Node : Matreshka.ODF_Attributes.FO.Font_Style.FO_Font_Style_Access) return ODF.DOM.Attributes.FO.Font_Style.ODF_FO_Font_Style; function Wrap (Node : Matreshka.ODF_Attributes.FO.Font_Style.FO_Font_Style_Access) return ODF.DOM.Attributes.FO.Font_Style.ODF_FO_Font_Style; end ODF.DOM.Attributes.FO.Font_Style.Internals;
zhmu/ananas
Ada
305
ads
-- { dg-do compile } with Pack10_Pkg; use Pack10_Pkg; package Pack10 is type Boolean_Vector is array (Positive range <>) of Boolean; type Packed_Boolean_Vector is new Boolean_Vector; pragma Pack (Packed_Boolean_Vector); procedure My_Proc is new Proc (Packed_Boolean_Vector); end Pack10;
zhmu/ananas
Ada
26,194
adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- G P R E P -- -- -- -- B o d y -- -- -- -- Copyright (C) 2002-2022, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- -- for more details. You should have received a copy of the GNU General -- -- Public License distributed with GNAT; see file COPYING3. If not, go to -- -- http://www.gnu.org/licenses for a complete copy of the license. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Atree; use Atree; with Csets; with Errutil; with Namet; use Namet; with Opt; with Osint; use Osint; with Output; use Output; with Prep; use Prep; with Scng; with Sinput.C; with Snames; with Stringt; use Stringt; with Switch; use Switch; with Types; use Types; with Ada.Command_Line; use Ada.Command_Line; with Ada.Text_IO; use Ada.Text_IO; with GNAT.Case_Util; use GNAT.Case_Util; with GNAT.Command_Line; with GNAT.Directory_Operations; use GNAT.Directory_Operations; with System.OS_Lib; use System.OS_Lib; package body GPrep is Copyright_Displayed : Boolean := False; -- Used to prevent multiple displays of the copyright notice ------------------------ -- Argument Line Data -- ------------------------ Unix_Line_Terminators : Boolean := False; -- Set to True with option -T type String_Array is array (Boolean) of String_Access; Yes_No : constant String_Array := (False => new String'("YES"), True => new String'("NO")); Infile_Name : Name_Id := No_Name; Outfile_Name : Name_Id := No_Name; Deffile_Name : Name_Id := No_Name; Output_Directory : Name_Id := No_Name; -- Used when the specified output is an existing directory Input_Directory : Name_Id := No_Name; -- Used when the specified input and output are existing directories Source_Ref_Pragma : Boolean := False; -- Record command line options (set if -r switch set) Text_Outfile : aliased Ada.Text_IO.File_Type; Outfile : constant File_Access := Text_Outfile'Access; File_Name_Buffer_Initial_Size : constant := 50; File_Name_Buffer : String_Access := new String (1 .. File_Name_Buffer_Initial_Size); -- A buffer to build output file names from input file names ----------------- -- Subprograms -- ----------------- procedure Display_Copyright; -- Display the copyright notice procedure Post_Scan; -- Null procedure, needed by instantiation of Scng below package Scanner is new Scng (Post_Scan, Errutil.Error_Msg, Errutil.Error_Msg_S, Errutil.Error_Msg_SC, Errutil.Error_Msg_SP, Errutil.Style); -- The scanner for the preprocessor function Is_ASCII_Letter (C : Character) return Boolean; -- True if C is in 'a' .. 'z' or in 'A' .. 'Z' procedure Double_File_Name_Buffer; -- Double the size of the file name buffer procedure Preprocess_Infile_Name; -- When the specified output is a directory, preprocess the infile name -- for symbol substitution, to get the output file name. procedure Process_Files; -- Process the single input file or all the files in the directory tree -- rooted at the input directory. procedure Process_Command_Line_Symbol_Definition (S : String); -- Process a -D switch on the command line procedure Put_Char_To_Outfile (C : Character); -- Output one character to the output file. Used to initialize the -- preprocessor. procedure New_EOL_To_Outfile; -- Output a new line to the output file. Used to initialize the -- preprocessor. procedure Scan_Command_Line; -- Scan the switches and the file names procedure Usage; -- Display the usage ----------------------- -- Display_Copyright -- ----------------------- procedure Display_Copyright is begin if not Copyright_Displayed then Display_Version ("GNAT Preprocessor", "1996"); Copyright_Displayed := True; end if; end Display_Copyright; ----------------------------- -- Double_File_Name_Buffer -- ----------------------------- procedure Double_File_Name_Buffer is New_Buffer : constant String_Access := new String (1 .. 2 * File_Name_Buffer'Length); begin New_Buffer (File_Name_Buffer'Range) := File_Name_Buffer.all; Free (File_Name_Buffer); File_Name_Buffer := New_Buffer; end Double_File_Name_Buffer; -------------- -- Gnatprep -- -------------- procedure Gnatprep is begin -- Do some initializations (order is important here) Csets.Initialize; Snames.Initialize; Stringt.Initialize; Prep.Initialize; -- Initialize the preprocessor Prep.Setup_Hooks (Error_Msg => Errutil.Error_Msg'Access, Scan => Scanner.Scan'Access, Set_Ignore_Errors => Errutil.Set_Ignore_Errors'Access, Put_Char => Put_Char_To_Outfile'Access, New_EOL => New_EOL_To_Outfile'Access); -- Set the scanner characteristics for the preprocessor Scanner.Set_Special_Character ('#'); Scanner.Set_Special_Character ('$'); Scanner.Set_End_Of_Line_As_Token (True); -- Initialize the mapping table of symbols to values Prep.Symbol_Table.Init (Prep.Mapping); -- Parse the switches and arguments Scan_Command_Line; if Opt.Verbose_Mode then Display_Copyright; end if; -- Test we had all the arguments needed if Infile_Name = No_Name then -- No input file specified, just output the usage and exit if Argument_Count = 0 then Usage; else GNAT.Command_Line.Try_Help; end if; return; elsif Outfile_Name = No_Name then -- No output file specified, exit GNAT.Command_Line.Try_Help; return; end if; -- If a pragma Source_File_Name, we need to keep line numbers. So, if -- the deleted lines are not put as comment, we must output them as -- blank lines. if Source_Ref_Pragma and (not Opt.Comment_Deleted_Lines) then Opt.Blank_Deleted_Lines := True; end if; -- If we have a definition file, parse it if Deffile_Name /= No_Name then declare Deffile : Source_File_Index; begin Errutil.Initialize; Deffile := Sinput.C.Load_File (Get_Name_String (Deffile_Name)); -- Set Main_Source_File to the definition file for the benefit of -- Errutil.Finalize. Sinput.Main_Source_File := Deffile; if Deffile = No_Source_File then Fail ("unable to find definition file """ & Get_Name_String (Deffile_Name) & """"); elsif Deffile = No_Access_To_Source_File then Fail ("unabled to read definition file """ & Get_Name_String (Deffile_Name) & """"); end if; Scanner.Initialize_Scanner (Deffile); -- Parse the definition file without "replace in comments" declare Replace : constant Boolean := Opt.Replace_In_Comments; begin Opt.Replace_In_Comments := False; Prep.Parse_Def_File; Opt.Replace_In_Comments := Replace; end; end; end if; -- If there are errors in the definition file, output them and exit if Total_Errors_Detected > 0 then Errutil.Finalize (Source_Type => "definition"); Fail ("errors in definition file """ & Get_Name_String (Deffile_Name) & """"); end if; -- If -s switch was specified, print a sorted list of symbol names and -- values, if any. if Opt.List_Preprocessing_Symbols then Prep.List_Symbols (Foreword => ""); end if; Output_Directory := No_Name; Input_Directory := No_Name; -- Check if the specified output is an existing directory if Is_Directory (Get_Name_String (Outfile_Name)) then Output_Directory := Outfile_Name; -- As the output is an existing directory, check if the input too -- is a directory. if Is_Directory (Get_Name_String (Infile_Name)) then Input_Directory := Infile_Name; end if; end if; -- And process the single input or the files in the directory tree -- rooted at the input directory. Process_Files; end Gnatprep; --------------------- -- Is_ASCII_Letter -- --------------------- function Is_ASCII_Letter (C : Character) return Boolean is begin return C in 'A' .. 'Z' or else C in 'a' .. 'z'; end Is_ASCII_Letter; ------------------------ -- New_EOL_To_Outfile -- ------------------------ procedure New_EOL_To_Outfile is begin New_Line (Outfile.all); end New_EOL_To_Outfile; --------------- -- Post_Scan -- --------------- procedure Post_Scan is begin null; end Post_Scan; ---------------------------- -- Preprocess_Infile_Name -- ---------------------------- procedure Preprocess_Infile_Name is Len : Natural; First : Positive; Last : Natural; Symbol : Name_Id; Data : Symbol_Data; begin -- Initialize the buffer with the name of the input file Get_Name_String (Infile_Name); Len := Name_Len; while File_Name_Buffer'Length < Len loop Double_File_Name_Buffer; end loop; File_Name_Buffer (1 .. Len) := Name_Buffer (1 .. Len); -- Look for possible symbols in the file name First := 1; while First < Len loop -- A symbol starts with a dollar sign followed by a letter if File_Name_Buffer (First) = '$' and then Is_ASCII_Letter (File_Name_Buffer (First + 1)) then Last := First + 1; -- Find the last letter of the symbol while Last < Len and then Is_ASCII_Letter (File_Name_Buffer (Last + 1)) loop Last := Last + 1; end loop; -- Get the symbol name id Name_Len := Last - First; Name_Buffer (1 .. Name_Len) := File_Name_Buffer (First + 1 .. Last); To_Lower (Name_Buffer (1 .. Name_Len)); Symbol := Name_Find; -- And look for this symbol name in the symbol table for Index in 1 .. Symbol_Table.Last (Mapping) loop Data := Mapping.Table (Index); if Data.Symbol = Symbol then -- We found the symbol. If its value is not a string, -- replace the symbol in the file name with the value of -- the symbol. if not Data.Is_A_String then String_To_Name_Buffer (Data.Value); declare Sym_Len : constant Positive := Last - First + 1; Offset : constant Integer := Name_Len - Sym_Len; New_Len : constant Natural := Len + Offset; begin while New_Len > File_Name_Buffer'Length loop Double_File_Name_Buffer; end loop; File_Name_Buffer (Last + 1 + Offset .. New_Len) := File_Name_Buffer (Last + 1 .. Len); Len := New_Len; Last := Last + Offset; File_Name_Buffer (First .. Last) := Name_Buffer (1 .. Name_Len); end; end if; exit; end if; end loop; -- Skip over the symbol name or its value: we are not checking -- for another symbol name in the value. First := Last + 1; else First := First + 1; end if; end loop; -- We now have the output file name in the buffer. Get the output -- path and put it in Outfile_Name. Get_Name_String (Output_Directory); Add_Char_To_Name_Buffer (Directory_Separator); Add_Str_To_Name_Buffer (File_Name_Buffer (1 .. Len)); Outfile_Name := Name_Find; end Preprocess_Infile_Name; -------------------------------------------- -- Process_Command_Line_Symbol_Definition -- -------------------------------------------- procedure Process_Command_Line_Symbol_Definition (S : String) is Data : Symbol_Data; Symbol : Symbol_Id; begin -- Check the symbol definition and get the symbol and its value. -- Fail if symbol definition is illegal. Check_Command_Line_Symbol_Definition (S, Data); Symbol := Index_Of (Data.Symbol); -- If symbol does not already exist, create a new entry in the mapping -- table. if Symbol = No_Symbol then Symbol_Table.Increment_Last (Mapping); Symbol := Symbol_Table.Last (Mapping); end if; Mapping.Table (Symbol) := Data; end Process_Command_Line_Symbol_Definition; ------------------- -- Process_Files -- ------------------- procedure Process_Files is procedure Process_One_File; -- Process input file Infile_Name and put the result in file -- Outfile_Name. procedure Recursive_Process (In_Dir : String; Out_Dir : String); -- Process recursively files in In_Dir. Results go to Out_Dir ---------------------- -- Process_One_File -- ---------------------- procedure Process_One_File is Infile : Source_File_Index; Modified : Boolean; pragma Warnings (Off, Modified); begin -- Create the output file (fails if this does not work) begin Create (File => Text_Outfile, Mode => Out_File, Name => Get_Name_String (Outfile_Name), Form => "Text_Translation=" & Yes_No (Unix_Line_Terminators).all); exception when others => Fail ("unable to create output file """ & Get_Name_String (Outfile_Name) & """"); end; -- Load the input file Infile := Sinput.C.Load_File (Get_Name_String (Infile_Name)); if Infile = No_Source_File then Fail ("unable to find input file """ & Get_Name_String (Infile_Name) & """"); elsif Infile = No_Access_To_Source_File then Fail ("unable to read input file """ & Get_Name_String (Infile_Name) & """"); end if; -- Set Main_Source_File to the input file for the benefit of -- Errutil.Finalize. Sinput.Main_Source_File := Infile; Scanner.Initialize_Scanner (Infile); -- Output the pragma Source_Reference if asked to if Source_Ref_Pragma then Put_Line (Outfile.all, "pragma Source_Reference (1, """ & Get_Name_String (Sinput.Full_File_Name (Infile)) & """);"); end if; -- Preprocess the input file Prep.Preprocess (Modified); -- In verbose mode, if there is no error, report it if Opt.Verbose_Mode and then Total_Errors_Detected = 0 then Errutil.Finalize (Source_Type => "input"); end if; -- If we had some errors, delete the output file, and report them if Total_Errors_Detected > 0 then if Outfile /= Standard_Output then Delete (Text_Outfile); end if; Errutil.Finalize (Source_Type => "input"); OS_Exit (0); -- Otherwise, close the output file, and we are done elsif Outfile /= Standard_Output then Close (Text_Outfile); end if; end Process_One_File; ----------------------- -- Recursive_Process -- ----------------------- procedure Recursive_Process (In_Dir : String; Out_Dir : String) is Dir_In : Dir_Type; Name : String (1 .. 255); Last : Natural; In_Dir_Name : Name_Id; Out_Dir_Name : Name_Id; procedure Set_Directory_Names; -- Establish or reestablish the current input and output directories ------------------------- -- Set_Directory_Names -- ------------------------- procedure Set_Directory_Names is begin Input_Directory := In_Dir_Name; Output_Directory := Out_Dir_Name; end Set_Directory_Names; -- Start of processing for Recursive_Process begin -- Open the current input directory begin Open (Dir_In, In_Dir); exception when Directory_Error => Fail ("could not read directory " & In_Dir); end; -- Set the new input and output directory names Name_Len := In_Dir'Length; Name_Buffer (1 .. Name_Len) := In_Dir; In_Dir_Name := Name_Find; Name_Len := Out_Dir'Length; Name_Buffer (1 .. Name_Len) := Out_Dir; Out_Dir_Name := Name_Find; Set_Directory_Names; -- Traverse the input directory loop Read (Dir_In, Name, Last); exit when Last = 0; if Name (1 .. Last) /= "." and then Name (1 .. Last) /= ".." then declare Input : constant String := In_Dir & Directory_Separator & Name (1 .. Last); Output : constant String := Out_Dir & Directory_Separator & Name (1 .. Last); begin -- If input is an ordinary file, process it if Is_Regular_File (Input) then -- First get the output file name Name_Len := Last; Name_Buffer (1 .. Name_Len) := Name (1 .. Last); Infile_Name := Name_Find; Preprocess_Infile_Name; -- Set the input file name and process the file Name_Len := Input'Length; Name_Buffer (1 .. Name_Len) := Input; Infile_Name := Name_Find; Process_One_File; elsif Is_Directory (Input) then -- Input is a directory. If the corresponding output -- directory does not already exist, create it. if not Is_Directory (Output) then begin Make_Dir (Dir_Name => Output); exception when Directory_Error => Fail ("could not create directory """ & Output & """"); end; end if; -- And process this new input directory Recursive_Process (Input, Output); -- Reestablish the input and output directory names -- that have been modified by the recursive call. Set_Directory_Names; end if; end; end if; end loop; end Recursive_Process; -- Start of processing for Process_Files begin if Output_Directory = No_Name then -- If the output is not a directory, fail if the input is -- an existing directory, to avoid possible problems. if Is_Directory (Get_Name_String (Infile_Name)) then Fail ("input file """ & Get_Name_String (Infile_Name) & """ is a directory"); end if; -- Just process the single input file Process_One_File; elsif Input_Directory = No_Name then -- Get the output file name from the input file name, and process -- the single input file. Preprocess_Infile_Name; Process_One_File; else -- Recursively process files in the directory tree rooted at the -- input directory. Recursive_Process (In_Dir => Get_Name_String (Input_Directory), Out_Dir => Get_Name_String (Output_Directory)); end if; end Process_Files; ------------------------- -- Put_Char_To_Outfile -- ------------------------- procedure Put_Char_To_Outfile (C : Character) is begin Put (Outfile.all, C); end Put_Char_To_Outfile; ----------------------- -- Scan_Command_Line -- ----------------------- procedure Scan_Command_Line is Switch : Character; procedure Check_Version_And_Help is new Check_Version_And_Help_G (Usage); -- Start of processing for Scan_Command_Line begin -- First check for --version or --help Check_Version_And_Help ("GNATPREP", "1996"); -- Now scan the other switches GNAT.Command_Line.Initialize_Option_Scan; loop begin Switch := GNAT.Command_Line.Getopt ("D: a b c C r s T u v"); case Switch is when ASCII.NUL => exit; when 'D' => Process_Command_Line_Symbol_Definition (S => GNAT.Command_Line.Parameter); when 'a' => Opt.No_Deletion := True; Opt.Undefined_Symbols_Are_False := True; when 'b' => Opt.Blank_Deleted_Lines := True; when 'c' => Opt.Comment_Deleted_Lines := True; when 'C' => Opt.Replace_In_Comments := True; when 'r' => Source_Ref_Pragma := True; when 's' => Opt.List_Preprocessing_Symbols := True; when 'T' => Unix_Line_Terminators := True; when 'u' => Opt.Undefined_Symbols_Are_False := True; when 'v' => Opt.Verbose_Mode := True; when others => Fail ("Invalid Switch: -" & Switch); end case; exception when GNAT.Command_Line.Invalid_Switch => Write_Str ("Invalid Switch: -"); Write_Line (GNAT.Command_Line.Full_Switch); GNAT.Command_Line.Try_Help; OS_Exit (1); end; end loop; -- Get the file names loop declare S : constant String := GNAT.Command_Line.Get_Argument; begin exit when S'Length = 0; Name_Len := S'Length; Name_Buffer (1 .. Name_Len) := S; if Infile_Name = No_Name then Infile_Name := Name_Find; elsif Outfile_Name = No_Name then Outfile_Name := Name_Find; elsif Deffile_Name = No_Name then Deffile_Name := Name_Find; else Fail ("too many arguments specified"); end if; end; end loop; end Scan_Command_Line; ----------- -- Usage -- ----------- procedure Usage is begin Display_Copyright; Write_Line ("Usage: gnatprep [-bcrsuv] [-Dsymbol=value] " & "infile outfile [deffile]"); Write_Eol; Write_Line (" infile Name of the input file"); Write_Line (" outfile Name of the output file"); Write_Line (" deffile Name of the definition file"); Write_Eol; Write_Line ("gnatprep switches:"); Display_Usage_Version_And_Help; Write_Line (" -b Replace preprocessor lines by blank lines"); Write_Line (" -c Keep preprocessor lines as comments"); Write_Line (" -C Do symbol replacements within comments"); Write_Line (" -D Associate symbol with value"); Write_Line (" -r Generate Source_Reference pragma"); Write_Line (" -s Print a sorted list of symbol names and values"); Write_Line (" -T Use LF as line terminators"); Write_Line (" -u Treat undefined symbols as FALSE"); Write_Line (" -v Verbose mode"); Write_Eol; end Usage; end GPrep;
fnarenji/BezierToSTL
Ada
23,960
ads
pragma Ada_95; with System; package ada_main is pragma Warnings (Off); gnat_argc : Integer; gnat_argv : System.Address; gnat_envp : System.Address; pragma Import (C, gnat_argc); pragma Import (C, gnat_argv); pragma Import (C, gnat_envp); gnat_exit_status : Integer; pragma Import (C, gnat_exit_status); GNAT_Version : constant String := "GNAT Version: 5.3.0" & ASCII.NUL; pragma Export (C, GNAT_Version, "__gnat_version"); Ada_Main_Program_Name : constant String := "_ada_main" & ASCII.NUL; pragma Export (C, Ada_Main_Program_Name, "__gnat_ada_main_program_name"); procedure adainit; pragma Export (C, adainit, "adainit"); procedure adafinal; pragma Export (C, adafinal, "adafinal"); function main (argc : Integer; argv : System.Address; envp : System.Address) return Integer; pragma Export (C, main, "main"); type Version_32 is mod 2 ** 32; u00001 : constant Version_32 := 16#eaeed2ac#; pragma Export (C, u00001, "mainB"); u00002 : constant Version_32 := 16#fbff4c67#; pragma Export (C, u00002, "system__standard_libraryB"); u00003 : constant Version_32 := 16#1ec6fd90#; pragma Export (C, u00003, "system__standard_libraryS"); u00004 : constant Version_32 := 16#3ffc8e18#; pragma Export (C, u00004, "adaS"); u00005 : constant Version_32 := 16#9b14b3ac#; pragma Export (C, u00005, "ada__command_lineB"); u00006 : constant Version_32 := 16#d59e21a4#; pragma Export (C, u00006, "ada__command_lineS"); u00007 : constant Version_32 := 16#1d274481#; pragma Export (C, u00007, "systemS"); u00008 : constant Version_32 := 16#b19b6653#; pragma Export (C, u00008, "system__secondary_stackB"); u00009 : constant Version_32 := 16#b6468be8#; pragma Export (C, u00009, "system__secondary_stackS"); u00010 : constant Version_32 := 16#b01dad17#; pragma Export (C, u00010, "system__parametersB"); u00011 : constant Version_32 := 16#630d49fe#; pragma Export (C, u00011, "system__parametersS"); u00012 : constant Version_32 := 16#a207fefe#; pragma Export (C, u00012, "system__soft_linksB"); u00013 : constant Version_32 := 16#467d9556#; pragma Export (C, u00013, "system__soft_linksS"); u00014 : constant Version_32 := 16#2c143749#; pragma Export (C, u00014, "ada__exceptionsB"); u00015 : constant Version_32 := 16#f4f0cce8#; pragma Export (C, u00015, "ada__exceptionsS"); u00016 : constant Version_32 := 16#a46739c0#; pragma Export (C, u00016, "ada__exceptions__last_chance_handlerB"); u00017 : constant Version_32 := 16#3aac8c92#; pragma Export (C, u00017, "ada__exceptions__last_chance_handlerS"); u00018 : constant Version_32 := 16#393398c1#; pragma Export (C, u00018, "system__exception_tableB"); u00019 : constant Version_32 := 16#b33e2294#; pragma Export (C, u00019, "system__exception_tableS"); u00020 : constant Version_32 := 16#ce4af020#; pragma Export (C, u00020, "system__exceptionsB"); u00021 : constant Version_32 := 16#75442977#; pragma Export (C, u00021, "system__exceptionsS"); u00022 : constant Version_32 := 16#37d758f1#; pragma Export (C, u00022, "system__exceptions__machineS"); u00023 : constant Version_32 := 16#b895431d#; pragma Export (C, u00023, "system__exceptions_debugB"); u00024 : constant Version_32 := 16#aec55d3f#; pragma Export (C, u00024, "system__exceptions_debugS"); u00025 : constant Version_32 := 16#570325c8#; pragma Export (C, u00025, "system__img_intB"); u00026 : constant Version_32 := 16#1ffca443#; pragma Export (C, u00026, "system__img_intS"); u00027 : constant Version_32 := 16#39a03df9#; pragma Export (C, u00027, "system__storage_elementsB"); u00028 : constant Version_32 := 16#30e40e85#; pragma Export (C, u00028, "system__storage_elementsS"); u00029 : constant Version_32 := 16#b98c3e16#; pragma Export (C, u00029, "system__tracebackB"); u00030 : constant Version_32 := 16#831a9d5a#; pragma Export (C, u00030, "system__tracebackS"); u00031 : constant Version_32 := 16#9ed49525#; pragma Export (C, u00031, "system__traceback_entriesB"); u00032 : constant Version_32 := 16#1d7cb2f1#; pragma Export (C, u00032, "system__traceback_entriesS"); u00033 : constant Version_32 := 16#8c33a517#; pragma Export (C, u00033, "system__wch_conB"); u00034 : constant Version_32 := 16#065a6653#; pragma Export (C, u00034, "system__wch_conS"); u00035 : constant Version_32 := 16#9721e840#; pragma Export (C, u00035, "system__wch_stwB"); u00036 : constant Version_32 := 16#2b4b4a52#; pragma Export (C, u00036, "system__wch_stwS"); u00037 : constant Version_32 := 16#92b797cb#; pragma Export (C, u00037, "system__wch_cnvB"); u00038 : constant Version_32 := 16#09eddca0#; pragma Export (C, u00038, "system__wch_cnvS"); u00039 : constant Version_32 := 16#6033a23f#; pragma Export (C, u00039, "interfacesS"); u00040 : constant Version_32 := 16#ece6fdb6#; pragma Export (C, u00040, "system__wch_jisB"); u00041 : constant Version_32 := 16#899dc581#; pragma Export (C, u00041, "system__wch_jisS"); u00042 : constant Version_32 := 16#41837d1e#; pragma Export (C, u00042, "system__stack_checkingB"); u00043 : constant Version_32 := 16#93982f69#; pragma Export (C, u00043, "system__stack_checkingS"); u00044 : constant Version_32 := 16#12c8cd7d#; pragma Export (C, u00044, "ada__tagsB"); u00045 : constant Version_32 := 16#ce72c228#; pragma Export (C, u00045, "ada__tagsS"); u00046 : constant Version_32 := 16#c3335bfd#; pragma Export (C, u00046, "system__htableB"); u00047 : constant Version_32 := 16#99e5f76b#; pragma Export (C, u00047, "system__htableS"); u00048 : constant Version_32 := 16#089f5cd0#; pragma Export (C, u00048, "system__string_hashB"); u00049 : constant Version_32 := 16#3bbb9c15#; pragma Export (C, u00049, "system__string_hashS"); u00050 : constant Version_32 := 16#807fe041#; pragma Export (C, u00050, "system__unsigned_typesS"); u00051 : constant Version_32 := 16#06052bd0#; pragma Export (C, u00051, "system__val_lluB"); u00052 : constant Version_32 := 16#fa8db733#; pragma Export (C, u00052, "system__val_lluS"); u00053 : constant Version_32 := 16#27b600b2#; pragma Export (C, u00053, "system__val_utilB"); u00054 : constant Version_32 := 16#b187f27f#; pragma Export (C, u00054, "system__val_utilS"); u00055 : constant Version_32 := 16#d1060688#; pragma Export (C, u00055, "system__case_utilB"); u00056 : constant Version_32 := 16#392e2d56#; pragma Export (C, u00056, "system__case_utilS"); u00057 : constant Version_32 := 16#28f088c2#; pragma Export (C, u00057, "ada__text_ioB"); u00058 : constant Version_32 := 16#f372c8ac#; pragma Export (C, u00058, "ada__text_ioS"); u00059 : constant Version_32 := 16#10558b11#; pragma Export (C, u00059, "ada__streamsB"); u00060 : constant Version_32 := 16#2e6701ab#; pragma Export (C, u00060, "ada__streamsS"); u00061 : constant Version_32 := 16#db5c917c#; pragma Export (C, u00061, "ada__io_exceptionsS"); u00062 : constant Version_32 := 16#84a27f0d#; pragma Export (C, u00062, "interfaces__c_streamsB"); u00063 : constant Version_32 := 16#8bb5f2c0#; pragma Export (C, u00063, "interfaces__c_streamsS"); u00064 : constant Version_32 := 16#6db6928f#; pragma Export (C, u00064, "system__crtlS"); u00065 : constant Version_32 := 16#431faf3c#; pragma Export (C, u00065, "system__file_ioB"); u00066 : constant Version_32 := 16#ba56a5e4#; pragma Export (C, u00066, "system__file_ioS"); u00067 : constant Version_32 := 16#b7ab275c#; pragma Export (C, u00067, "ada__finalizationB"); u00068 : constant Version_32 := 16#19f764ca#; pragma Export (C, u00068, "ada__finalizationS"); u00069 : constant Version_32 := 16#95817ed8#; pragma Export (C, u00069, "system__finalization_rootB"); u00070 : constant Version_32 := 16#52d53711#; pragma Export (C, u00070, "system__finalization_rootS"); u00071 : constant Version_32 := 16#769e25e6#; pragma Export (C, u00071, "interfaces__cB"); u00072 : constant Version_32 := 16#4a38bedb#; pragma Export (C, u00072, "interfaces__cS"); u00073 : constant Version_32 := 16#07e6ee66#; pragma Export (C, u00073, "system__os_libB"); u00074 : constant Version_32 := 16#d7b69782#; pragma Export (C, u00074, "system__os_libS"); u00075 : constant Version_32 := 16#1a817b8e#; pragma Export (C, u00075, "system__stringsB"); u00076 : constant Version_32 := 16#639855e7#; pragma Export (C, u00076, "system__stringsS"); u00077 : constant Version_32 := 16#e0b8de29#; pragma Export (C, u00077, "system__file_control_blockS"); u00078 : constant Version_32 := 16#0758d1fc#; pragma Export (C, u00078, "courbesS"); u00079 : constant Version_32 := 16#d8cedace#; pragma Export (C, u00079, "mathB"); u00080 : constant Version_32 := 16#70dc6f09#; pragma Export (C, u00080, "mathS"); u00081 : constant Version_32 := 16#5e7381e4#; pragma Export (C, u00081, "vecteursB"); u00082 : constant Version_32 := 16#adaf9663#; pragma Export (C, u00082, "vecteursS"); u00083 : constant Version_32 := 16#608e2cd1#; pragma Export (C, u00083, "system__concat_5B"); u00084 : constant Version_32 := 16#9a7907af#; pragma Export (C, u00084, "system__concat_5S"); u00085 : constant Version_32 := 16#932a4690#; pragma Export (C, u00085, "system__concat_4B"); u00086 : constant Version_32 := 16#63436fa1#; pragma Export (C, u00086, "system__concat_4S"); u00087 : constant Version_32 := 16#2b70b149#; pragma Export (C, u00087, "system__concat_3B"); u00088 : constant Version_32 := 16#16571824#; pragma Export (C, u00088, "system__concat_3S"); u00089 : constant Version_32 := 16#fd83e873#; pragma Export (C, u00089, "system__concat_2B"); u00090 : constant Version_32 := 16#1f879351#; pragma Export (C, u00090, "system__concat_2S"); u00091 : constant Version_32 := 16#46899fd1#; pragma Export (C, u00091, "system__concat_7B"); u00092 : constant Version_32 := 16#e1e01f9e#; pragma Export (C, u00092, "system__concat_7S"); u00093 : constant Version_32 := 16#a83b7c85#; pragma Export (C, u00093, "system__concat_6B"); u00094 : constant Version_32 := 16#cfe06933#; pragma Export (C, u00094, "system__concat_6S"); u00095 : constant Version_32 := 16#f0df9003#; pragma Export (C, u00095, "system__img_realB"); u00096 : constant Version_32 := 16#da8f1563#; pragma Export (C, u00096, "system__img_realS"); u00097 : constant Version_32 := 16#19b0ff72#; pragma Export (C, u00097, "system__fat_llfS"); u00098 : constant Version_32 := 16#1b28662b#; pragma Export (C, u00098, "system__float_controlB"); u00099 : constant Version_32 := 16#fddb07bd#; pragma Export (C, u00099, "system__float_controlS"); u00100 : constant Version_32 := 16#f1f88835#; pragma Export (C, u00100, "system__img_lluB"); u00101 : constant Version_32 := 16#c9b6e082#; pragma Export (C, u00101, "system__img_lluS"); u00102 : constant Version_32 := 16#eef535cd#; pragma Export (C, u00102, "system__img_unsB"); u00103 : constant Version_32 := 16#1f8bdcb6#; pragma Export (C, u00103, "system__img_unsS"); u00104 : constant Version_32 := 16#4d5722f6#; pragma Export (C, u00104, "system__powten_tableS"); u00105 : constant Version_32 := 16#08ec0c09#; pragma Export (C, u00105, "liste_generiqueB"); u00106 : constant Version_32 := 16#97c69cab#; pragma Export (C, u00106, "liste_generiqueS"); u00107 : constant Version_32 := 16#ab2d7ed8#; pragma Export (C, u00107, "courbes__droitesB"); u00108 : constant Version_32 := 16#cf757770#; pragma Export (C, u00108, "courbes__droitesS"); u00109 : constant Version_32 := 16#6d4d969a#; pragma Export (C, u00109, "system__storage_poolsB"); u00110 : constant Version_32 := 16#e87cc305#; pragma Export (C, u00110, "system__storage_poolsS"); u00111 : constant Version_32 := 16#d8628a63#; pragma Export (C, u00111, "normalisationB"); u00112 : constant Version_32 := 16#7121c556#; pragma Export (C, u00112, "normalisationS"); u00113 : constant Version_32 := 16#7aa6c482#; pragma Export (C, u00113, "parser_svgB"); u00114 : constant Version_32 := 16#b3ea5ce2#; pragma Export (C, u00114, "parser_svgS"); u00115 : constant Version_32 := 16#12c24a43#; pragma Export (C, u00115, "ada__charactersS"); u00116 : constant Version_32 := 16#8f637df8#; pragma Export (C, u00116, "ada__characters__handlingB"); u00117 : constant Version_32 := 16#3b3f6154#; pragma Export (C, u00117, "ada__characters__handlingS"); u00118 : constant Version_32 := 16#4b7bb96a#; pragma Export (C, u00118, "ada__characters__latin_1S"); u00119 : constant Version_32 := 16#af50e98f#; pragma Export (C, u00119, "ada__stringsS"); u00120 : constant Version_32 := 16#e2ea8656#; pragma Export (C, u00120, "ada__strings__mapsB"); u00121 : constant Version_32 := 16#1e526bec#; pragma Export (C, u00121, "ada__strings__mapsS"); u00122 : constant Version_32 := 16#a87ab9e2#; pragma Export (C, u00122, "system__bit_opsB"); u00123 : constant Version_32 := 16#0765e3a3#; pragma Export (C, u00123, "system__bit_opsS"); u00124 : constant Version_32 := 16#92f05f13#; pragma Export (C, u00124, "ada__strings__maps__constantsS"); u00125 : constant Version_32 := 16#e18a47a0#; pragma Export (C, u00125, "ada__float_text_ioB"); u00126 : constant Version_32 := 16#e61b3c6c#; pragma Export (C, u00126, "ada__float_text_ioS"); u00127 : constant Version_32 := 16#d5f9759f#; pragma Export (C, u00127, "ada__text_io__float_auxB"); u00128 : constant Version_32 := 16#f854caf5#; pragma Export (C, u00128, "ada__text_io__float_auxS"); u00129 : constant Version_32 := 16#181dc502#; pragma Export (C, u00129, "ada__text_io__generic_auxB"); u00130 : constant Version_32 := 16#a6c327d3#; pragma Export (C, u00130, "ada__text_io__generic_auxS"); u00131 : constant Version_32 := 16#faa9a7b2#; pragma Export (C, u00131, "system__val_realB"); u00132 : constant Version_32 := 16#e30e3390#; pragma Export (C, u00132, "system__val_realS"); u00133 : constant Version_32 := 16#0be1b996#; pragma Export (C, u00133, "system__exn_llfB"); u00134 : constant Version_32 := 16#9ca35a6e#; pragma Export (C, u00134, "system__exn_llfS"); u00135 : constant Version_32 := 16#45525895#; pragma Export (C, u00135, "system__fat_fltS"); u00136 : constant Version_32 := 16#e5480ede#; pragma Export (C, u00136, "ada__strings__fixedB"); u00137 : constant Version_32 := 16#a86b22b3#; pragma Export (C, u00137, "ada__strings__fixedS"); u00138 : constant Version_32 := 16#3bc8a117#; pragma Export (C, u00138, "ada__strings__searchB"); u00139 : constant Version_32 := 16#c1ab8667#; pragma Export (C, u00139, "ada__strings__searchS"); u00140 : constant Version_32 := 16#f78329ae#; pragma Export (C, u00140, "ada__strings__unboundedB"); u00141 : constant Version_32 := 16#e303cf90#; pragma Export (C, u00141, "ada__strings__unboundedS"); u00142 : constant Version_32 := 16#5b9edcc4#; pragma Export (C, u00142, "system__compare_array_unsigned_8B"); u00143 : constant Version_32 := 16#b424350c#; pragma Export (C, u00143, "system__compare_array_unsigned_8S"); u00144 : constant Version_32 := 16#5f72f755#; pragma Export (C, u00144, "system__address_operationsB"); u00145 : constant Version_32 := 16#0e2bfab2#; pragma Export (C, u00145, "system__address_operationsS"); u00146 : constant Version_32 := 16#6a859064#; pragma Export (C, u00146, "system__storage_pools__subpoolsB"); u00147 : constant Version_32 := 16#e3b008dc#; pragma Export (C, u00147, "system__storage_pools__subpoolsS"); u00148 : constant Version_32 := 16#57a37a42#; pragma Export (C, u00148, "system__address_imageB"); u00149 : constant Version_32 := 16#bccbd9bb#; pragma Export (C, u00149, "system__address_imageS"); u00150 : constant Version_32 := 16#b5b2aca1#; pragma Export (C, u00150, "system__finalization_mastersB"); u00151 : constant Version_32 := 16#69316dc1#; pragma Export (C, u00151, "system__finalization_mastersS"); u00152 : constant Version_32 := 16#7268f812#; pragma Export (C, u00152, "system__img_boolB"); u00153 : constant Version_32 := 16#e8fe356a#; pragma Export (C, u00153, "system__img_boolS"); u00154 : constant Version_32 := 16#d7aac20c#; pragma Export (C, u00154, "system__ioB"); u00155 : constant Version_32 := 16#8365b3ce#; pragma Export (C, u00155, "system__ioS"); u00156 : constant Version_32 := 16#63f11652#; pragma Export (C, u00156, "system__storage_pools__subpools__finalizationB"); u00157 : constant Version_32 := 16#fe2f4b3a#; pragma Export (C, u00157, "system__storage_pools__subpools__finalizationS"); u00158 : constant Version_32 := 16#afc64758#; pragma Export (C, u00158, "system__atomic_countersB"); u00159 : constant Version_32 := 16#d05bd04b#; pragma Export (C, u00159, "system__atomic_countersS"); u00160 : constant Version_32 := 16#f4e1c091#; pragma Export (C, u00160, "system__stream_attributesB"); u00161 : constant Version_32 := 16#221dd20d#; pragma Export (C, u00161, "system__stream_attributesS"); u00162 : constant Version_32 := 16#f08789ae#; pragma Export (C, u00162, "ada__text_io__enumeration_auxB"); u00163 : constant Version_32 := 16#52f1e0af#; pragma Export (C, u00163, "ada__text_io__enumeration_auxS"); u00164 : constant Version_32 := 16#d0432c8d#; pragma Export (C, u00164, "system__img_enum_newB"); u00165 : constant Version_32 := 16#7c6b4241#; pragma Export (C, u00165, "system__img_enum_newS"); u00166 : constant Version_32 := 16#4b37b589#; pragma Export (C, u00166, "system__val_enumB"); u00167 : constant Version_32 := 16#a63d0614#; pragma Export (C, u00167, "system__val_enumS"); u00168 : constant Version_32 := 16#2261c2e2#; pragma Export (C, u00168, "stlB"); u00169 : constant Version_32 := 16#96280b15#; pragma Export (C, u00169, "stlS"); u00170 : constant Version_32 := 16#84ad4a42#; pragma Export (C, u00170, "ada__numericsS"); u00171 : constant Version_32 := 16#03e83d1c#; pragma Export (C, u00171, "ada__numerics__elementary_functionsB"); u00172 : constant Version_32 := 16#00443200#; pragma Export (C, u00172, "ada__numerics__elementary_functionsS"); u00173 : constant Version_32 := 16#3e0cf54d#; pragma Export (C, u00173, "ada__numerics__auxB"); u00174 : constant Version_32 := 16#9f6e24ed#; pragma Export (C, u00174, "ada__numerics__auxS"); u00175 : constant Version_32 := 16#129c3f4f#; pragma Export (C, u00175, "system__machine_codeS"); u00176 : constant Version_32 := 16#9d39c675#; pragma Export (C, u00176, "system__memoryB"); u00177 : constant Version_32 := 16#445a22b5#; pragma Export (C, u00177, "system__memoryS"); -- BEGIN ELABORATION ORDER -- ada%s -- ada.characters%s -- ada.characters.handling%s -- ada.characters.latin_1%s -- ada.command_line%s -- interfaces%s -- system%s -- system.address_operations%s -- system.address_operations%b -- system.atomic_counters%s -- system.atomic_counters%b -- system.case_util%s -- system.case_util%b -- system.exn_llf%s -- system.exn_llf%b -- system.float_control%s -- system.float_control%b -- system.htable%s -- system.img_bool%s -- system.img_bool%b -- system.img_enum_new%s -- system.img_enum_new%b -- system.img_int%s -- system.img_int%b -- system.img_real%s -- system.io%s -- system.io%b -- system.machine_code%s -- system.parameters%s -- system.parameters%b -- system.crtl%s -- interfaces.c_streams%s -- interfaces.c_streams%b -- system.powten_table%s -- system.standard_library%s -- system.exceptions_debug%s -- system.exceptions_debug%b -- system.storage_elements%s -- system.storage_elements%b -- system.stack_checking%s -- system.stack_checking%b -- system.string_hash%s -- system.string_hash%b -- system.htable%b -- system.strings%s -- system.strings%b -- system.os_lib%s -- system.traceback_entries%s -- system.traceback_entries%b -- ada.exceptions%s -- system.soft_links%s -- system.unsigned_types%s -- system.fat_flt%s -- system.fat_llf%s -- system.img_llu%s -- system.img_llu%b -- system.img_uns%s -- system.img_uns%b -- system.img_real%b -- system.val_enum%s -- system.val_llu%s -- system.val_real%s -- system.val_util%s -- system.val_util%b -- system.val_real%b -- system.val_llu%b -- system.val_enum%b -- system.wch_con%s -- system.wch_con%b -- system.wch_cnv%s -- system.wch_jis%s -- system.wch_jis%b -- system.wch_cnv%b -- system.wch_stw%s -- system.wch_stw%b -- ada.exceptions.last_chance_handler%s -- ada.exceptions.last_chance_handler%b -- system.address_image%s -- system.bit_ops%s -- system.bit_ops%b -- system.compare_array_unsigned_8%s -- system.compare_array_unsigned_8%b -- system.concat_2%s -- system.concat_2%b -- system.concat_3%s -- system.concat_3%b -- system.concat_4%s -- system.concat_4%b -- system.concat_5%s -- system.concat_5%b -- system.concat_6%s -- system.concat_6%b -- system.concat_7%s -- system.concat_7%b -- system.exception_table%s -- system.exception_table%b -- ada.io_exceptions%s -- ada.numerics%s -- ada.numerics.aux%s -- ada.numerics.aux%b -- ada.numerics.elementary_functions%s -- ada.numerics.elementary_functions%b -- ada.strings%s -- ada.strings.maps%s -- ada.strings.fixed%s -- ada.strings.maps.constants%s -- ada.strings.search%s -- ada.strings.search%b -- ada.tags%s -- ada.streams%s -- ada.streams%b -- interfaces.c%s -- system.exceptions%s -- system.exceptions%b -- system.exceptions.machine%s -- system.file_control_block%s -- system.file_io%s -- system.finalization_root%s -- system.finalization_root%b -- ada.finalization%s -- ada.finalization%b -- system.storage_pools%s -- system.storage_pools%b -- system.finalization_masters%s -- system.storage_pools.subpools%s -- system.storage_pools.subpools.finalization%s -- system.storage_pools.subpools.finalization%b -- system.stream_attributes%s -- system.stream_attributes%b -- system.memory%s -- system.memory%b -- system.standard_library%b -- system.secondary_stack%s -- system.storage_pools.subpools%b -- system.finalization_masters%b -- system.file_io%b -- interfaces.c%b -- ada.tags%b -- ada.strings.fixed%b -- ada.strings.maps%b -- system.soft_links%b -- system.os_lib%b -- ada.command_line%b -- ada.characters.handling%b -- system.secondary_stack%b -- system.address_image%b -- ada.strings.unbounded%s -- ada.strings.unbounded%b -- system.traceback%s -- ada.exceptions%b -- system.traceback%b -- ada.text_io%s -- ada.text_io%b -- ada.text_io.enumeration_aux%s -- ada.text_io.float_aux%s -- ada.float_text_io%s -- ada.float_text_io%b -- ada.text_io.generic_aux%s -- ada.text_io.generic_aux%b -- ada.text_io.float_aux%b -- ada.text_io.enumeration_aux%b -- liste_generique%s -- liste_generique%b -- vecteurs%s -- vecteurs%b -- math%s -- math%b -- courbes%s -- courbes.droites%s -- courbes.droites%b -- normalisation%s -- normalisation%b -- parser_svg%s -- parser_svg%b -- stl%s -- stl%b -- main%b -- END ELABORATION ORDER end ada_main;
zhmu/ananas
Ada
710
adb
-- { dg-do compile } procedure Loopvar (S : String) is J : Integer := S'First; begin while J < S'Last loop pragma Loop_Variant (J); -- { dg-error "expect name \"Increases\"" } pragma Loop_Variant (Increasing => J); -- { dg-error "expect name \"Increases\"" } pragma Loop_Variant (J + 1); -- { dg-error "expect name \"Increases\"" } pragma Loop_Variant (incr => -J + 1); -- { dg-error "expect name \"Increases\"" } pragma Loop_Variant (decr => -J + 1); -- { dg-error "expect name \"Decreases\"" } pragma Loop_Variant (foof => -J + 1); -- { dg-error "expect name \"Increases\" or \"Decreases\"" } J := J + 2; end loop; end Loopvar;
reznikmm/matreshka
Ada
4,639
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Text.Sort_Algorithm_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Text_Sort_Algorithm_Attribute_Node is begin return Self : Text_Sort_Algorithm_Attribute_Node do Matreshka.ODF_Text.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Text_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Text_Sort_Algorithm_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Sort_Algorithm_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Text_URI, Matreshka.ODF_String_Constants.Sort_Algorithm_Attribute, Text_Sort_Algorithm_Attribute_Node'Tag); end Matreshka.ODF_Text.Sort_Algorithm_Attributes;
sungyeon/drake
Ada
935
ads
pragma License (Unrestricted); -- separated and auto-loaded by compiler private generic type Num is range <>; package Ada.Wide_Wide_Text_IO.Integer_IO is Default_Width : Field := Num'Width; Default_Base : Number_Base := 10; -- procedure Get ( -- File : File_Type; -- Input_File_Type -- Item : out Num; -- Width : Field := 0); -- procedure Get ( -- Item : out Num; -- Width : Field := 0); -- procedure Put ( -- File : File_Type; -- Output_File_Type -- Item : Num; -- Width : Field := Default_Width; -- Base : Number_Base := Default_Base); -- procedure Put ( -- Item : Num; -- Width : Field := Default_Width; -- Base : Number_Base := Default_Base); -- procedure Get ( -- From : String; -- Item : out Num; -- Last : out Positive); -- procedure Put ( -- To : out String; -- Item : Num; -- Base : Number_Base := Default_Base); end Ada.Wide_Wide_Text_IO.Integer_IO;
reznikmm/matreshka
Ada
3,694
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Draw_Engine_Attributes is pragma Preelaborate; type ODF_Draw_Engine_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Draw_Engine_Attribute_Access is access all ODF_Draw_Engine_Attribute'Class with Storage_Size => 0; end ODF.DOM.Draw_Engine_Attributes;
stcarrez/dynamo
Ada
4,281
ads
------------------------------------------------------------------------------ -- -- -- ASIS-for-GNAT IMPLEMENTATION COMPONENTS -- -- -- -- A 4 G . A _ A L L O C -- -- -- -- S p e c -- -- -- -- Version : 1.00 -- -- -- -- Copyright (c) 1995-1999, Free Software Foundation, Inc. -- -- -- -- ASIS-for-GNAT is free software; you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 2, or (at your option) any later -- -- version. ASIS-for-GNAT is distributed in the hope that it will be use- -- -- ful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- -- -- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with ASIS-for-GNAT; see file -- -- COPYING. If not, write to the Free Software Foundation, 59 Temple Place -- -- - Suite 330, Boston, MA 02111-1307, USA. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ASIS-for-GNAT was originally developed by the ASIS-for-GNAT team at the -- -- Software Engineering Laboratory of the Swiss Federal Institute of -- -- Technology (LGL-EPFL) in Lausanne, Switzerland, in cooperation with the -- -- Scientific Research Computer Center of Moscow State University (SRCC -- -- MSU), Russia, with funding partially provided by grants from the Swiss -- -- National Science Foundation and the Swiss Academy of Engineering -- -- Sciences. ASIS-for-GNAT is now maintained by Ada Core Technologies Inc -- -- (http://www.gnat.com). -- -- -- ------------------------------------------------------------------------------ package A4G.A_Alloc is -- This package contains definitions for initial sizes and growth increments -- for the various dynamic arrays used for principle ASIS Context -- Model data strcutures. The indicated initial size is allocated for the -- start of each file, and the increment factor is a percentage used -- to increase the table size when it needs expanding -- (e.g. a value of 100 = 100% increase = double) -- This package is the ASIS implementation's analog of the GNAT Alloc package Alloc_ASIS_Units_Initial : constant := 1_000; -- Initial allocation for unit tables Alloc_ASIS_Units_Increment : constant := 150; -- Incremental allocation factor for unit tables Alloc_Contexts_Initial : constant := 20; -- Initial allocation for Context table (A4G.Contt) Alloc_Contexts_Increment : constant := 150; -- Incremental allocation factor for Context table (Contt) Alloc_ASIS_Trees_Initial : constant := 1_000; -- Initial allocation for tree tables Alloc_ASIS_Trees_Increment : constant := 150; -- Incremental allocation factor for tree tables end A4G.A_Alloc;
ekoeppen/STM32_Generic_Ada_Drivers
Ada
3,904
ads
-- This spec has been automatically generated from STM32F303xE.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with System; package STM32_SVD.IWDG is pragma Preelaborate; --------------- -- Registers -- --------------- subtype KR_KEY_Field is STM32_SVD.UInt16; -- Key register type KR_Register is record -- Write-only. Key value KEY : KR_KEY_Field := 16#0#; -- unspecified Reserved_16_31 : STM32_SVD.UInt16 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for KR_Register use record KEY at 0 range 0 .. 15; Reserved_16_31 at 0 range 16 .. 31; end record; subtype PR_PR_Field is STM32_SVD.UInt3; -- Prescaler register type PR_Register is record -- Prescaler divider PR : PR_PR_Field := 16#0#; -- unspecified Reserved_3_31 : STM32_SVD.UInt29 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for PR_Register use record PR at 0 range 0 .. 2; Reserved_3_31 at 0 range 3 .. 31; end record; subtype RLR_RL_Field is STM32_SVD.UInt12; -- Reload register type RLR_Register is record -- Watchdog counter reload value RL : RLR_RL_Field := 16#FFF#; -- unspecified Reserved_12_31 : STM32_SVD.UInt20 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for RLR_Register use record RL at 0 range 0 .. 11; Reserved_12_31 at 0 range 12 .. 31; end record; subtype SR_PVU_Field is STM32_SVD.Bit; subtype SR_RVU_Field is STM32_SVD.Bit; subtype SR_WVU_Field is STM32_SVD.Bit; -- Status register type SR_Register is record -- Read-only. Watchdog prescaler value update PVU : SR_PVU_Field; -- Read-only. Watchdog counter reload value update RVU : SR_RVU_Field; -- Read-only. Watchdog counter window value update WVU : SR_WVU_Field; -- unspecified Reserved_3_31 : STM32_SVD.UInt29; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for SR_Register use record PVU at 0 range 0 .. 0; RVU at 0 range 1 .. 1; WVU at 0 range 2 .. 2; Reserved_3_31 at 0 range 3 .. 31; end record; subtype WINR_WIN_Field is STM32_SVD.UInt12; -- Window register type WINR_Register is record -- Watchdog counter window value WIN : WINR_WIN_Field := 16#FFF#; -- unspecified Reserved_12_31 : STM32_SVD.UInt20 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for WINR_Register use record WIN at 0 range 0 .. 11; Reserved_12_31 at 0 range 12 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- Independent watchdog type IWDG_Peripheral is record -- Key register KR : aliased KR_Register; -- Prescaler register PR : aliased PR_Register; -- Reload register RLR : aliased RLR_Register; -- Status register SR : aliased SR_Register; -- Window register WINR : aliased WINR_Register; end record with Volatile; for IWDG_Peripheral use record KR at 16#0# range 0 .. 31; PR at 16#4# range 0 .. 31; RLR at 16#8# range 0 .. 31; SR at 16#C# range 0 .. 31; WINR at 16#10# range 0 .. 31; end record; -- Independent watchdog IWDG_Periph : aliased IWDG_Peripheral with Import, Address => System'To_Address (16#40003000#); end STM32_SVD.IWDG;
RREE/ada-util
Ada
2,706
ads
----------------------------------------------------------------------- -- util-properties-json -- read json files into properties -- Copyright (C) 2013, 2018 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- -- == Reading JSON property files == -- The `Util.Properties.JSON` package provides operations to read a JSON -- content and put the result in a property manager. The JSON content is flattened -- into a set of name/value pairs. The JSON structure is reflected in the name. -- Example: -- -- { "id": "1", id -> 1 -- "info": { "name": "search", info.name -> search -- "count", "12", info.count -> 12 -- "data": { "value": "empty" }}, info.data.value -> empty -- "count": 1 info.count -> 1 -- } -- -- To get the value of a JSON property, the user can use the flatten name. For example: -- -- Value : constant String := Props.Get ("info.data.value"); -- -- The default separator to construct a flatten name is the dot (`.`) but this can be -- changed easily when loading the JSON file by specifying the desired separator: -- -- Util.Properties.JSON.Read_JSON (Props, "config.json", "|"); -- -- Then, the property will be fetch by using: -- -- Value : constant String := Props.Get ("info|data|value"); -- package Util.Properties.JSON is -- Parse the JSON content and put the flattened content in the property manager. procedure Parse_JSON (Manager : in out Util.Properties.Manager'Class; Content : in String; Flatten_Separator : in String := "."); -- Read the JSON file into the property manager. -- The JSON content is flatten into Flatten the JSON content and add the properties. procedure Read_JSON (Manager : in out Util.Properties.Manager'Class; Path : in String; Flatten_Separator : in String := "."); end Util.Properties.JSON;
jhumphry/Ada_BinToAsc
Ada
13,483
adb
-- BinToAsc_Suite.Base64_Tests -- Unit tests for BinToAsc -- Copyright (c) 2015, James Humphry - see LICENSE file for details with AUnit.Assertions; with System.Storage_Elements; with Ada.Assertions; package body BinToAsc_Suite.Base64_Tests is use AUnit.Assertions; use System.Storage_Elements; use RFC4648; use type RFC4648.Codec_State; -------------------- -- Register_Tests -- -------------------- procedure Register_Tests (T: in out Base64_Test) is use AUnit.Test_Cases.Registration; begin Register_Routine (T, Check_Symmetry'Access, "Check the Encoder and Decoder are a symmetrical pair"); Register_Routine (T, Check_Length'Access, "Check the Encoder and Decoder handle variable-length input successfully"); Register_Routine (T, Check_Test_Vectors_To_String'Access, "Check test vectors from RFC4648, binary -> string"); Register_Routine (T, Check_Test_Vectors_To_Bin'Access, "Check test vectors from RFC4648, string -> binary"); Register_Routine (T, Check_Test_Vectors_Incremental_To_String'Access, "Check test vectors from RFC4648, incrementally, binary -> string"); Register_Routine (T, Check_Test_Vectors_Incremental_To_Bin'Access, "Check test vectors from RFC4648, incrementally, string -> binary"); Register_Routine (T, Check_Test_Vectors_By_Char_To_String'Access, "Check test vectors from RFC4648, character-by-character, binary -> string"); Register_Routine (T, Check_Test_Vectors_By_Char_To_Bin'Access, "Check test vectors from RFC4648, character-by-character, string -> binary"); Register_Routine (T, Check_Padding'Access, "Check correct Base64 padding is enforced"); Register_Routine (T, Check_Junk_Rejection'Access, "Check Base64 decoder will reject junk input"); Register_Routine (T, Check_Junk_Rejection_By_Char'Access, "Check Base64 decoder will reject junk input (single character)"); end Register_Tests; ---------- -- Name -- ---------- function Name (T : Base64_Test) return Test_String is pragma Unreferenced (T); begin return Format ("Tests of Base64 codec from RFC4648"); end Name; ------------ -- Set_Up -- ------------ procedure Set_Up (T : in out Base64_Test) is begin null; end Set_Up; ------------------- -- Check_Padding -- ------------------- -- These procedures cannot be nested inside Check_Padding due to access -- level restrictions procedure Should_Raise_Exception_Excess_Padding is Discard : Storage_Array(1..6); begin Discard := RFC4648.Base64.To_Bin("Zm9vYg==="); end; procedure Should_Raise_Exception_Insufficient_Padding is Discard : Storage_Array(1..6); begin Discard := RFC4648.Base64.To_Bin("Zm9vYg="); end; procedure Check_Padding (T : in out Test_Cases.Test_Case'Class) is pragma Unreferenced (T); Base64_Decoder : RFC4648.Base64.Base64_To_Bin; Result_Bin : Storage_Array(1..20); Result_Length : Storage_Offset; begin Assert_Exception(Should_Raise_Exception_Excess_Padding'Access, "Base64 decoder did not reject excessive padding"); Assert_Exception(Should_Raise_Exception_Insufficient_Padding'Access, "Base64 decoder did not reject insufficient padding"); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9vYg===", Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed or Result_Length /= 0, "Base64 decoder did not reject excessive padding"); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9vYg==", Output => Result_Bin, Output_Length => Result_Length); Base64_Decoder.Process(Input => "=", Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed or Result_Length /= 0, "Base64 decoder did not reject excessive padding when presented " & "as a one-char string after the initial valid input"); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9vYg=", Output => Result_Bin, Output_Length => Result_Length); Base64_Decoder.Process(Input => "==", Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed or Result_Length /= 0, "Base64 decoder did not reject excessive padding when presented " & "as a == after the initial valid but incompletely padded " & "input"); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9vYg==", Output => Result_Bin, Output_Length => Result_Length); Base64_Decoder.Process(Input => '=', Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed or Result_Length /= 0, "Base64 decoder did not reject excessive padding when presented " & "as a separate character after the initial valid input"); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9vYg=", Output => Result_Bin, Output_Length => Result_Length); Base64_Decoder.Complete(Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed or Result_Length /= 0, "Base64 decoder did not reject inadequate padding"); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9vYg", Output => Result_Bin, Output_Length => Result_Length); Base64_Decoder.Complete(Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed or Result_Length /= 0, "Base64 decoder did not reject inadequate padding"); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9v=Yg==", Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed or Result_Length /= 0, "Base64 decoder did not reject non-padding characters appearing " & " after the first padding Character in a single input"); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9v=", Output => Result_Bin, Output_Length => Result_Length); Base64_Decoder.Process(Input => "Zm9", Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed or Result_Length /= 0, "Base64 decoder did not reject non-padding input presented " & " after an initial input ended with padding"); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9v=", Output => Result_Bin, Output_Length => Result_Length); Base64_Decoder.Process(Input => 'C', Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed or Result_Length /= 0, "Base64 decoder did not reject non-padding input char presented " & " after an initial input ended with padding"); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9vYg", Output => Result_Bin, Output_Length => Result_Length); Base64_Decoder.Process(Input => '=', Output => Result_Bin, Output_Length => Result_Length); Base64_Decoder.Process(Input => "Zm", Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed or Result_Length /= 0, "Base64 decoder did not reject non-padding string presented " & " after a padding char presented on its own"); end Check_Padding; -------------------------- -- Check_Junk_Rejection -- -------------------------- -- This procedure cannot be nested inside Check_Junk_Rejection due to access -- level restrictions procedure Should_Raise_Exception_From_Junk is Discard : Storage_Array(1..6); begin Discard := RFC4648.Base64.To_Bin("Zm9v:mFy"); end; procedure Check_Junk_Rejection (T : in out Test_Cases.Test_Case'Class) is pragma Unreferenced (T); Base64_Decoder : RFC4648.Base64.Base64_To_Bin; Result_Bin : Storage_Array(1..20); Result_Length : Storage_Offset; begin Assert_Exception(Should_Raise_Exception_From_Junk'Access, "Base64 decoder did not reject junk input."); Base64_Decoder.Reset; Base64_Decoder.Process(Input => "Zm9v:mFy", Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed, "Base64 decoder did not reject junk input."); Assert(Result_Length = 0, "Base64 decoder rejected junk input but did not return 0 " & "length output."); begin Base64_Decoder.Process(Input => "Zm", Output => Result_Bin, Output_Length => Result_Length); exception when Ada.Assertions.Assertion_Error => null; -- Preconditions (if active) will not allow Process to be run -- on a codec with state /= Ready. end; Assert(Base64_Decoder.State = Failed, "Base64 decoder reset its state on valid input after junk input."); Assert(Result_Length = 0, "Base64 decoder rejected input after a junk input but did " & "not return 0 length output."); begin Base64_Decoder.Complete(Output => Result_Bin, Output_Length => Result_Length); exception when Ada.Assertions.Assertion_Error => null; -- Preconditions (if active) will not allow Completed to be run -- on a codec with state /= Ready. end; Assert(Base64_Decoder.State = Failed, "Base16 decoder allowed successful completion after junk input."); Assert(Result_Length = 0, "Base64 decoder completed after a junk input did " & "not return 0 length output."); end Check_Junk_Rejection; ---------------------------------- -- Check_Junk_Rejection_By_Char -- ---------------------------------- procedure Check_Junk_Rejection_By_Char (T : in out Test_Cases.Test_Case'Class) is pragma Unreferenced (T); Base64_Decoder : RFC4648.Base64.Base64_To_Bin; Result_Bin : Storage_Array(1..20); Result_Length : Storage_Offset; begin Base64_Decoder.Reset; Base64_Decoder.Process(Input => '@', Output => Result_Bin, Output_Length => Result_Length); Assert(Base64_Decoder.State = Failed, "Base64 decoder did not reject junk input character."); Assert(Result_Length = 0, "Base64 decoder rejected junk input but did not return 0 " & "length output."); begin Base64_Decoder.Process(Input => '6', Output => Result_Bin, Output_Length => Result_Length); exception when Ada.Assertions.Assertion_Error => null; -- Preconditions (if active) will not allow Process to be run -- on a codec with state /= Ready. end; Assert(Base64_Decoder.State = Failed, "Base64 decoder reset its state on valid input after junk input " & "character."); Assert(Result_Length = 0, "Base64 decoder rejected input after a junk input char but did " & "not return 0 length output."); begin Base64_Decoder.Complete(Output => Result_Bin, Output_Length => Result_Length); exception when Ada.Assertions.Assertion_Error => null; -- Preconditions (if active) will not allow Completed to be run -- on a codec with state /= Ready. end; Assert(Base64_Decoder.State = Failed, "Base64 decoder allowed successful completion after junk input " & "char."); Assert(Result_Length = 0, "Base64 decoder completed after a junk input char did " & "not return 0 length output."); end Check_Junk_Rejection_By_Char; end BinToAsc_Suite.Base64_Tests;
stcarrez/ada-awa
Ada
1,869
adb
----------------------------------------------------------------------- -- awa-mail-clients-aws_smtp-initialize -- Initialize SMTP client without SSL support -- Copyright (C) 2016 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- separate (AWA.Mail.Clients.AWS_SMTP) procedure Initialize (Client : in out AWS_Mail_Manager'Class; Props : in Util.Properties.Manager'Class) is Server : constant String := Props.Get (Name => "smtp.host", Default => "localhost"); User : constant String := Props.Get (Name => "smtp.user", Default => ""); Passwd : constant String := Props.Get (Name => "smtp.password", Default => ""); begin if User'Length > 0 then Client.Creds := AWS.SMTP.Authentication.Plain.Initialize (User, Passwd); Client.Server := AWS.SMTP.Client.Initialize (Server_Name => Server, Port => Client.Port, Credential => Client.Creds'Unchecked_Access); else Client.Server := AWS.SMTP.Client.Initialize (Server_Name => Server, Port => Client.Port); end if; end Initialize;
jhumphry/Ada_BinToAsc
Ada
3,929
adb
-- BinToAsc_Example -- Binary data to/from ASCII codecs example -- Copyright (c) 2015, James Humphry - see LICENSE file for details with Ada.Text_IO; use Ada.Text_IO; with String_To_Storage_Array; with Storage_Array_To_String; with Storage_Array_To_Hex_String; with RFC4648, ASCII85; use RFC4648, ASCII85; with System.Storage_Elements; procedure BinToAsc_Example is Z85_Test_Vector : constant System.Storage_Elements.Storage_Array := (16#86#, 16#4F#, 16#D2#, 16#6F#, 16#B5#, 16#59#, 16#F7#, 16#5B#); begin Put_Line("Examples of using the BinToAsc package."); New_Line; -- Demonstrate coding into Base16 Put_Line("According to RFC4648 Base16('foobar') = '666F6F626172'"); Put("According to this package Base16('foobar') = '"); Put(Base16.To_String(String_To_Storage_Array("foobar"))); Put_Line("'"); New_Line; -- Demonstrate decoding from Base16 Put_Line("According to RFC4648 Base16^{-1}('666F6F626172') = 'foobar'"); Put("According to this package Base16^{-1}('666F6F626172') = '"); Put(Storage_Array_To_String(Base16.To_Bin("666F6F626172"))); Put_Line("'"); New_Line; -- Demonstrate coding into Base32 Put_Line("According to RFC4648 Base32('foobar') = 'MZXW6YTBOI======'"); Put("According to this package Base32('foobar') = '"); Put(Base32.To_String(String_To_Storage_Array("foobar"))); Put_Line("'"); New_Line; -- Demonstrate decoding from Base32 Put_Line("According to RFC4648 Base32^{-1}('MZXW6YTBOI======') = 'foobar'"); Put("According to this package Base32^{-1}('MZXW6YTBOI======') = '"); Put(Storage_Array_To_String(Base32.To_Bin("MZXW6YTBOI======"))); Put_Line("'"); New_Line; -- Demonstrate decoding from Base32 with homoglyphs Put_Line("According to RFC4648 with homoglphs permitted Base32^{-1}('MZXW6YTB01======') = 'foobar'"); Put("According to this package with homoglphs permitted Base32^{-1}('MZXW6YTB01======') = '"); Put(Storage_Array_To_String(Base32_Allow_Homoglyphs.To_Bin("MZXW6YTB01======"))); Put_Line("'"); New_Line; -- Demonstrate coding into Base32Hex Put_Line("According to RFC4648 Base32Hex('foobar') = 'CPNMUOJ1E8======'"); Put("According to this package Base32Hex('foobar') = '"); Put(Base32Hex.To_String(String_To_Storage_Array("foobar"))); Put_Line("'"); New_Line; -- Demonstrate decoding from Base32Hex Put_Line("According to RFC4648 Base32Hex^{-1}('CPNMUOJ1E8======') = 'foobar'"); Put("According to this package Base32Hex^{-1}('CPNMUOJ1E8======') = '"); Put(Storage_Array_To_String(Base32Hex.To_Bin("CPNMUOJ1E8======"))); Put_Line("'"); New_Line; -- Demonstrate coding into Base64 Put_Line("According to RFC4648 Base64('foobar') = 'Zm9vYmFy'"); Put("According to this package Base16('foobar') = '"); Put(Base64.To_String(String_To_Storage_Array("foobar"))); Put_Line("'"); New_Line; Put_Line("According to RFC4648 Base64('foob') = 'Zm9vYg=='"); Put("According to this package Base16('foob') = '"); Put(Base64.To_String(String_To_Storage_Array("foob"))); Put_Line("'"); New_Line; -- Demonstrate decoding from Base64 Put_Line("According to RFC4648 Base64^{-1}('Zm8=') = 'fo'"); Put("According to this package Base64^{-1}('Zm8=') = '"); Put(Storage_Array_To_String(Base64.To_Bin("Zm8="))); Put_Line("'"); New_Line; -- Demonstrate coding into Z85 Put_Line("According to Z85 spec Z85(86,4F,D2,6F,B5,59,F7,5B) = 'HelloWorld'"); Put("According to this package Z85(86,4F,D2,6F,B5,59,F7,5B) = '"); Put(Z85.To_String(Z85_Test_Vector)); Put_Line("'"); New_Line; -- Demonstrate decoding from Z85 Put_Line("According to Z85 spec Z85^{-1}('HelloWorld') = '86,4F,D2,6F,B5,59,F7,5B'"); Put("According to this package Z85^{-1}('HelloWorld') = '"); Put(Storage_Array_To_Hex_String(Z85.To_Bin("HelloWorld"))); Put_Line("'"); New_Line; end BinToAsc_Example;
reznikmm/matreshka
Ada
4,049
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Draw_Fill_Hatch_Solid_Attributes; package Matreshka.ODF_Draw.Fill_Hatch_Solid_Attributes is type Draw_Fill_Hatch_Solid_Attribute_Node is new Matreshka.ODF_Draw.Abstract_Draw_Attribute_Node and ODF.DOM.Draw_Fill_Hatch_Solid_Attributes.ODF_Draw_Fill_Hatch_Solid_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Draw_Fill_Hatch_Solid_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Draw_Fill_Hatch_Solid_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Draw.Fill_Hatch_Solid_Attributes;
sungyeon/drake
Ada
22,335
adb
with Ada.Unchecked_Conversion; with System.Address_To_Named_Access_Conversions; with System.Growth; with System.Standard_Allocators; with System.Storage_Elements; with System.System_Allocators.Allocated_Size; package body Ada.Strings.Generic_Unbounded is use type Streams.Stream_Element_Offset; use type System.Address; use type System.Storage_Elements.Storage_Offset; package FSA_Conv is new System.Address_To_Named_Access_Conversions ( Fixed_String, Fixed_String_Access); package DA_Conv is new System.Address_To_Named_Access_Conversions (Data, Data_Access); subtype Nonnull_Data_Access is not null Data_Access; function Upcast is new Unchecked_Conversion ( Nonnull_Data_Access, System.Reference_Counting.Container); function Downcast is new Unchecked_Conversion ( System.Reference_Counting.Container, Nonnull_Data_Access); type Data_Access_Access is access all Nonnull_Data_Access; type Container_Access is access all System.Reference_Counting.Container; function Upcast is new Unchecked_Conversion (Data_Access_Access, Container_Access); function Allocation_Size ( Capacity : System.Reference_Counting.Length_Type) return System.Storage_Elements.Storage_Count; function Allocation_Size ( Capacity : System.Reference_Counting.Length_Type) return System.Storage_Elements.Storage_Count is Header_Size : constant System.Storage_Elements.Storage_Count := Data'Size / Standard'Storage_Unit; Item_Size : System.Storage_Elements.Storage_Count; begin if String_Type'Component_Size rem Standard'Storage_Unit = 0 then -- optimized for packed Item_Size := Capacity * (String_Type'Component_Size / Standard'Storage_Unit); else -- unpacked Item_Size := (Capacity * String_Type'Component_Size + (Standard'Storage_Unit - 1)) / Standard'Storage_Unit; end if; return Header_Size + Item_Size; end Allocation_Size; procedure Adjust_Allocated (Data : not null Data_Access); procedure Adjust_Allocated (Data : not null Data_Access) is Header_Size : constant System.Storage_Elements.Storage_Count := Generic_Unbounded.Data'Size / Standard'Storage_Unit; M : constant System.Address := DA_Conv.To_Address (Data); Usable_Size : constant System.Storage_Elements.Storage_Count := System.System_Allocators.Allocated_Size (M) - Header_Size; begin if String_Type'Component_Size rem Standard'Storage_Unit = 0 then -- optimized for packed Data.Capacity := Integer ( Usable_Size / (String_Type'Component_Size / Standard'Storage_Unit)); else -- unpacked Data.Capacity := Integer ( Usable_Size * Standard'Storage_Unit / String_Type'Component_Size); end if; Data.Items := FSA_Conv.To_Pointer (M + Header_Size); end Adjust_Allocated; function Allocate_Data ( Max_Length : System.Reference_Counting.Length_Type; Capacity : System.Reference_Counting.Length_Type) return not null Data_Access; function Allocate_Data ( Max_Length : System.Reference_Counting.Length_Type; Capacity : System.Reference_Counting.Length_Type) return not null Data_Access is M : constant System.Address := System.Standard_Allocators.Allocate (Allocation_Size (Capacity)); Result : constant not null Data_Access := DA_Conv.To_Pointer (M); begin Result.Reference_Count := 1; Result.Max_Length := Max_Length; Adjust_Allocated (Result); return Result; end Allocate_Data; procedure Free_Data (Data : in out System.Reference_Counting.Data_Access); procedure Free_Data (Data : in out System.Reference_Counting.Data_Access) is begin System.Standard_Allocators.Free (DA_Conv.To_Address (Downcast (Data))); Data := null; end Free_Data; procedure Reallocate_Data ( Data : aliased in out not null System.Reference_Counting.Data_Access; Length : System.Reference_Counting.Length_Type; Max_Length : System.Reference_Counting.Length_Type; Capacity : System.Reference_Counting.Length_Type); procedure Reallocate_Data ( Data : aliased in out not null System.Reference_Counting.Data_Access; Length : System.Reference_Counting.Length_Type; Max_Length : System.Reference_Counting.Length_Type; Capacity : System.Reference_Counting.Length_Type) is pragma Unreferenced (Length); M : constant System.Address := System.Standard_Allocators.Reallocate ( DA_Conv.To_Address (Downcast (Data)), Allocation_Size (Capacity)); begin Data := Upcast (DA_Conv.To_Pointer (M)); Downcast (Data).Max_Length := Max_Length; Adjust_Allocated (Downcast (Data)); end Reallocate_Data; procedure Copy_Data ( Target : out not null System.Reference_Counting.Data_Access; Source : not null System.Reference_Counting.Data_Access; Length : System.Reference_Counting.Length_Type; Max_Length : System.Reference_Counting.Length_Type; Capacity : System.Reference_Counting.Length_Type); procedure Copy_Data ( Target : out not null System.Reference_Counting.Data_Access; Source : not null System.Reference_Counting.Data_Access; Length : System.Reference_Counting.Length_Type; Max_Length : System.Reference_Counting.Length_Type; Capacity : System.Reference_Counting.Length_Type) is Data : constant not null Data_Access := Allocate_Data (Max_Length, Capacity); subtype R is Integer range 1 .. Integer (Length); begin declare pragma Suppress (Access_Check); begin Data.Items (R) := Downcast (Source).Items (R); end; Target := Upcast (Data); end Copy_Data; procedure Reallocate ( Source : in out Unbounded_String; Length : Natural; Capacity : Natural); procedure Reallocate ( Source : in out Unbounded_String; Length : Natural; Capacity : Natural) is begin System.Reference_Counting.Unique ( Target => Upcast (Source.Data'Unchecked_Access), Target_Length => System.Reference_Counting.Length_Type (Source.Length), Target_Capacity => System.Reference_Counting.Length_Type ( Generic_Unbounded.Capacity (Source)), New_Length => System.Reference_Counting.Length_Type (Length), New_Capacity => System.Reference_Counting.Length_Type (Capacity), Sentinel => Upcast (Empty_Data'Unrestricted_Access), Reallocate => Reallocate_Data'Access, Copy => Copy_Data'Access, Free => Free_Data'Access); end Reallocate; function Create (Data : not null Data_Access; Length : Natural) return Unbounded_String; function Create (Data : not null Data_Access; Length : Natural) return Unbounded_String is begin return (Finalization.Controlled with Data => Data, Length => Length); end Create; -- implementation function Null_Unbounded_String return Unbounded_String is begin return Create (Data => Empty_Data'Unrestricted_Access, Length => 0); end Null_Unbounded_String; function Is_Null (Source : Unbounded_String) return Boolean is begin return Source.Length = 0; end Is_Null; function Length (Source : Unbounded_String) return Natural is begin return Source.Length; end Length; procedure Set_Length (Source : in out Unbounded_String; Length : Natural) is pragma Suppress (Access_Check); -- dereferencing Source.Data Old_Capacity : constant Natural := Capacity (Source); Failure : Boolean; begin System.Reference_Counting.In_Place_Set_Length ( Target_Data => Upcast (Source.Data), Target_Length => System.Reference_Counting.Length_Type (Source.Length), Target_Max_Length => Source.Data.Max_Length, Target_Capacity => System.Reference_Counting.Length_Type (Old_Capacity), New_Length => System.Reference_Counting.Length_Type (Length), Failure => Failure); if Failure then declare function Grow is new System.Growth.Good_Grow ( Natural, Component_Size => String_Type'Component_Size); New_Capacity : Natural; begin if Old_Capacity >= Length then -- Old_Capacity is possibly a large value by Generic_Constant New_Capacity := Length; -- shrinking else New_Capacity := Integer'Max (Grow (Old_Capacity), Length); end if; Reallocate (Source, Length, New_Capacity); end; end if; Source.Length := Length; end Set_Length; function Capacity (Source : Unbounded_String) return Natural is pragma Suppress (Access_Check); begin return Source.Data.Capacity; end Capacity; procedure Reserve_Capacity ( Source : in out Unbounded_String; Capacity : Natural) is New_Capacity : constant Natural := Integer'Max (Capacity, Source.Length); begin Reallocate (Source, Source.Length, New_Capacity); end Reserve_Capacity; function To_Unbounded_String (Source : String_Type) return Unbounded_String is Length : constant Natural := Source'Length; New_Data : constant not null Data_Access := Allocate_Data ( System.Reference_Counting.Length_Type (Length), System.Reference_Counting.Length_Type (Length)); begin declare pragma Suppress (Access_Check); begin New_Data.Items (1 .. Length) := Source; end; return Create (Data => New_Data, Length => Length); end To_Unbounded_String; function To_Unbounded_String (Length : Natural) return Unbounded_String is New_Data : constant not null Data_Access := Allocate_Data ( System.Reference_Counting.Length_Type (Length), System.Reference_Counting.Length_Type (Length)); begin return Create (Data => New_Data, Length => Length); end To_Unbounded_String; function To_String (Source : Unbounded_String) return String_Type is pragma Suppress (Access_Check); begin return Source.Data.Items (1 .. Source.Length); end To_String; procedure Set_Unbounded_String ( Target : out Unbounded_String; Source : String_Type) is pragma Suppress (Access_Check); Length : constant Natural := Source'Length; begin Target.Length := 0; Set_Length (Target, Length); Target.Data.Items (1 .. Length) := Source; end Set_Unbounded_String; procedure Append ( Source : in out Unbounded_String; New_Item : Unbounded_String) is pragma Suppress (Access_Check); New_Item_Length : constant Natural := New_Item.Length; Old_Length : constant Natural := Source.Length; begin if Old_Length = 0 and then Capacity (Source) < New_Item_Length then Assign (Source, New_Item); else declare Total_Length : constant Natural := Old_Length + New_Item_Length; begin Set_Length (Source, Total_Length); Source.Data.Items (Old_Length + 1 .. Total_Length) := New_Item.Data.Items (1 .. New_Item_Length); -- Do not use New_Item.Length in here for Append (X, X). end; end if; end Append; procedure Append ( Source : in out Unbounded_String; New_Item : String_Type) is pragma Suppress (Access_Check); Old_Length : constant Natural := Source.Length; Total_Length : constant Natural := Old_Length + New_Item'Length; begin Set_Length (Source, Total_Length); Source.Data.Items (Old_Length + 1 .. Total_Length) := New_Item; end Append; procedure Append_Element ( Source : in out Unbounded_String; New_Item : Character_Type) is pragma Suppress (Access_Check); Old_Length : constant Natural := Source.Length; Total_Length : constant Natural := Old_Length + 1; begin Set_Length (Source, Total_Length); Source.Data.Items (Total_Length) := New_Item; end Append_Element; function "&" (Left, Right : Unbounded_String) return Unbounded_String is begin return Result : Unbounded_String := Left do Append (Result, Right); end return; end "&"; function "&" (Left : Unbounded_String; Right : String_Type) return Unbounded_String is begin return Result : Unbounded_String := Left do Append (Result, Right); end return; end "&"; function "&" (Left : String_Type; Right : Unbounded_String) return Unbounded_String is begin return Result : Unbounded_String do if Left'Length > 0 then Reallocate (Result, 0, Left'Length + Right.Length); Append (Result, Left); end if; Append (Result, Right); end return; end "&"; function "&" (Left : Unbounded_String; Right : Character_Type) return Unbounded_String is begin return Result : Unbounded_String := Left do Append_Element (Result, Right); end return; end "&"; function "&" (Left : Character_Type; Right : Unbounded_String) return Unbounded_String is begin return Result : Unbounded_String do Reallocate (Result, 0, 1 + Right.Length); Append_Element (Result, Left); Append (Result, Right); end return; end "&"; function Element (Source : Unbounded_String; Index : Positive) return Character_Type is pragma Check (Pre, Index <= Source.Length or else raise Index_Error); pragma Suppress (Access_Check); begin return Source.Data.Items (Index); end Element; procedure Replace_Element ( Source : in out Unbounded_String; Index : Positive; By : Character_Type) is pragma Check (Pre, Index <= Source.Length or else raise Index_Error); pragma Suppress (Access_Check); begin Unique (Source); Source.Data.Items (Index) := By; end Replace_Element; function Slice ( Source : Unbounded_String; Low : Positive; High : Natural) return String_Type is pragma Check (Pre, Check => (Low <= Source.Length + 1 and then High <= Source.Length) or else raise Index_Error); pragma Suppress (Access_Check); begin return Source.Data.Items (Low .. High); end Slice; function Unbounded_Slice ( Source : Unbounded_String; Low : Positive; High : Natural) return Unbounded_String is begin return Result : Unbounded_String do Unbounded_Slice (Source, Result, Low, High); -- checking Index_Error end return; end Unbounded_Slice; procedure Unbounded_Slice ( Source : Unbounded_String; Target : out Unbounded_String; Low : Positive; High : Natural) is pragma Check (Pre, Check => (Low <= Source.Length + 1 and then High <= Source.Length) or else raise Index_Error); pragma Suppress (Access_Check); begin if Low = 1 then Assign (Target, Source); Set_Length (Target, High); else Set_Unbounded_String (Target, Source.Data.Items (Low .. High)); end if; end Unbounded_Slice; overriding function "=" (Left, Right : Unbounded_String) return Boolean is pragma Suppress (Access_Check); begin return Left.Data.Items (1 .. Left.Length) = Right.Data.Items (1 .. Right.Length); end "="; function "=" (Left : Unbounded_String; Right : String_Type) return Boolean is pragma Suppress (Access_Check); begin return Left.Data.Items (1 .. Left.Length) = Right; end "="; function "=" (Left : String_Type; Right : Unbounded_String) return Boolean is pragma Suppress (Access_Check); begin return Left = Right.Data.Items (1 .. Right.Length); end "="; function "<" (Left, Right : Unbounded_String) return Boolean is pragma Suppress (Access_Check); begin return Left.Data.Items (1 .. Left.Length) < Right.Data.Items (1 .. Right.Length); end "<"; function "<" (Left : Unbounded_String; Right : String_Type) return Boolean is pragma Suppress (Access_Check); begin return Left.Data.Items (1 .. Left.Length) < Right; end "<"; function "<" (Left : String_Type; Right : Unbounded_String) return Boolean is pragma Suppress (Access_Check); begin return Left < Right.Data.Items (1 .. Right.Length); end "<"; function "<=" (Left, Right : Unbounded_String) return Boolean is begin return not (Right < Left); end "<="; function "<=" (Left : Unbounded_String; Right : String_Type) return Boolean is begin return not (Right < Left); end "<="; function "<=" (Left : String_Type; Right : Unbounded_String) return Boolean is begin return not (Right < Left); end "<="; function ">" (Left, Right : Unbounded_String) return Boolean is begin return Right < Left; end ">"; function ">" (Left : Unbounded_String; Right : String_Type) return Boolean is begin return Right < Left; end ">"; function ">" (Left : String_Type; Right : Unbounded_String) return Boolean is begin return Right < Left; end ">"; function ">=" (Left, Right : Unbounded_String) return Boolean is begin return not (Left < Right); end ">="; function ">=" (Left : Unbounded_String; Right : String_Type) return Boolean is begin return not (Left < Right); end ">="; function ">=" (Left : String_Type; Right : Unbounded_String) return Boolean is begin return not (Left < Right); end ">="; procedure Assign ( Target : in out Unbounded_String; Source : Unbounded_String) is begin System.Reference_Counting.Assign ( Upcast (Target.Data'Unchecked_Access), Upcast (Source.Data'Unrestricted_Access), Free => Free_Data'Access); Target.Length := Source.Length; end Assign; procedure Move ( Target : in out Unbounded_String; Source : in out Unbounded_String) is begin System.Reference_Counting.Move ( Upcast (Target.Data'Unchecked_Access), Upcast (Source.Data'Unrestricted_Access), Sentinel => Upcast (Empty_Data'Unrestricted_Access), Free => Free_Data'Access); Target.Length := Source.Length; Source.Length := 0; end Move; function Constant_Reference ( Source : aliased Unbounded_String) return Slicing.Constant_Reference_Type is pragma Suppress (Access_Check); begin return Slicing.Constant_Slice ( String_Access'(Source.Data.Items.all'Unrestricted_Access).all, 1, Source.Length); end Constant_Reference; function Reference ( Source : aliased in out Unbounded_String) return Slicing.Reference_Type is pragma Suppress (Access_Check); begin Unique (Source); return Slicing.Slice ( String_Access'(Source.Data.Items.all'Unrestricted_Access).all, 1, Source.Length); end Reference; procedure Unique (Source : in out Unbounded_String'Class) is begin if System.Reference_Counting.Shared (Upcast (Source.Data)) then Reallocate ( Unbounded_String (Source), Source.Length, Source.Length); -- shrinking end if; end Unique; procedure Unique_And_Set_Length ( Source : in out Unbounded_String'Class; Length : Natural) is begin if System.Reference_Counting.Shared (Upcast (Source.Data)) then Reallocate (Unbounded_String (Source), Length, Length); -- shrinking else Set_Length (Unbounded_String (Source), Length); end if; end Unique_And_Set_Length; overriding procedure Adjust (Object : in out Unbounded_String) is begin System.Reference_Counting.Adjust (Upcast (Object.Data'Unchecked_Access)); end Adjust; overriding procedure Finalize (Object : in out Unbounded_String) is begin System.Reference_Counting.Clear ( Upcast (Object.Data'Unchecked_Access), Free => Free_Data'Access); Object.Data := Empty_Data'Unrestricted_Access; Object.Length := 0; end Finalize; package body Generic_Constant is S_Data : aliased constant Data := ( Reference_Count => System.Reference_Counting.Static, Capacity => Integer'Last, Max_Length => System.Reference_Counting.Length_Type (Integer'Last), Items => S.all'Unrestricted_Access); function Value return Unbounded_String is begin return Create ( Data => S_Data'Unrestricted_Access, Length => S'Length); end Value; end Generic_Constant; package body Streaming is procedure Read ( Stream : not null access Streams.Root_Stream_Type'Class; Item : out Unbounded_String) is pragma Suppress (Access_Check); First : Integer; Last : Integer; begin Integer'Read (Stream, First); Integer'Read (Stream, Last); declare Length : constant Integer := Last - First + 1; begin Item.Length := 0; Set_Length (Item, Length); Read (Stream, Item.Data.Items (1 .. Length)); end; end Read; procedure Write ( Stream : not null access Streams.Root_Stream_Type'Class; Item : Unbounded_String) is pragma Suppress (Access_Check); begin Integer'Write (Stream, 1); Integer'Write (Stream, Item.Length); Write (Stream, Item.Data.Items (1 .. Item.Length)); end Write; end Streaming; end Ada.Strings.Generic_Unbounded;
reznikmm/matreshka
Ada
6,940
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Text.Toc_Mark_Start_Elements is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Text_Toc_Mark_Start_Element_Node is begin return Self : Text_Toc_Mark_Start_Element_Node do Matreshka.ODF_Text.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Text_Prefix); end return; end Create; ---------------- -- Enter_Node -- ---------------- overriding procedure Enter_Node (Self : not null access Text_Toc_Mark_Start_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Enter_Text_Toc_Mark_Start (ODF.DOM.Text_Toc_Mark_Start_Elements.ODF_Text_Toc_Mark_Start_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Enter_Node (Visitor, Control); end if; end Enter_Node; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Text_Toc_Mark_Start_Element_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Toc_Mark_Start_Element; end Get_Local_Name; ---------------- -- Leave_Node -- ---------------- overriding procedure Leave_Node (Self : not null access Text_Toc_Mark_Start_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Visitor in ODF.DOM.Visitors.Abstract_ODF_Visitor'Class then ODF.DOM.Visitors.Abstract_ODF_Visitor'Class (Visitor).Leave_Text_Toc_Mark_Start (ODF.DOM.Text_Toc_Mark_Start_Elements.ODF_Text_Toc_Mark_Start_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Leave_Node (Visitor, Control); end if; end Leave_Node; ---------------- -- Visit_Node -- ---------------- overriding procedure Visit_Node (Self : not null access Text_Toc_Mark_Start_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control) is begin if Iterator in ODF.DOM.Iterators.Abstract_ODF_Iterator'Class then ODF.DOM.Iterators.Abstract_ODF_Iterator'Class (Iterator).Visit_Text_Toc_Mark_Start (Visitor, ODF.DOM.Text_Toc_Mark_Start_Elements.ODF_Text_Toc_Mark_Start_Access (Self), Control); else Matreshka.DOM_Elements.Abstract_Element_Node (Self.all).Visit_Node (Iterator, Visitor, Control); end if; end Visit_Node; begin Matreshka.DOM_Documents.Register_Element (Matreshka.ODF_String_Constants.Text_URI, Matreshka.ODF_String_Constants.Toc_Mark_Start_Element, Text_Toc_Mark_Start_Element_Node'Tag); end Matreshka.ODF_Text.Toc_Mark_Start_Elements;
zhmu/ananas
Ada
75
ads
-- { dg-excess-errors "no code generated" } generic procedure Elab4_Proc;
AdaCore/gpr
Ada
146
adb
package body A.P2 is --------- -- Msg -- --------- function Msg return String is begin return "P2"; end Msg; end A.P2;
mirror/ncurses
Ada
3,815
ads
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright 2020 Thomas E. Dickey -- -- Copyright 1999-2002,2003 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: -- $Revision: 1.12 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type T is (<>); package Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada); function Create (Set : Type_Set := Mixed_Case; Case_Sensitive : Boolean := False; Must_Be_Unique : Boolean := False) return Enumeration_Field; function Value (Fld : Field; Buf : Buffer_Number := Buffer_Number'First) return T; -- Translate the content of the fields buffer - indicated by the -- buffer number - into an enumeration value. If the buffer is empty -- or the content is invalid, a Constraint_Error is raises. end Terminal_Interface.Curses.Forms.Field_Types.Enumeration.Ada;
reznikmm/matreshka
Ada
3,719
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Style_Font_Pitch_Attributes is pragma Preelaborate; type ODF_Style_Font_Pitch_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Style_Font_Pitch_Attribute_Access is access all ODF_Style_Font_Pitch_Attribute'Class with Storage_Size => 0; end ODF.DOM.Style_Font_Pitch_Attributes;
AdaCore/Ada_Drivers_Library
Ada
10,507
ads
-- This spec has been automatically generated from cm0.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package Cortex_M_SVD.SCB is pragma Preelaborate; --------------- -- Registers -- --------------- -- Revision number, the p value in the rnpn product revision identifier. type CPUID_Revision_Field is ( -- Patch 0 P0, -- Patch 1 P1, -- Patch 2 P2) with Size => 4; for CPUID_Revision_Field use (P0 => 0, P1 => 1, P2 => 2); -- Part number of the processor. type CPUID_PartNo_Field is ( -- Cortes-M7 Cortex_M7) with Size => 12; for CPUID_PartNo_Field use (Cortex_M7 => 3111); subtype CPUID_Constant_Field is HAL.UInt4; -- Variant number, the r value in the rnpn product revision identifier. type CPUID_Variant_Field is ( -- Revision 0 R0, -- Revision 1 R1) with Size => 4; for CPUID_Variant_Field use (R0 => 0, R1 => 1); -- Implementer code. type CPUID_Implementer_Field is ( -- ARM Arm) with Size => 8; for CPUID_Implementer_Field use (Arm => 65); -- CPUID Base Register type CPUID_Register is record -- Read-only. Revision number, the p value in the rnpn product revision -- identifier. Revision : CPUID_Revision_Field; -- Read-only. Part number of the processor. PartNo : CPUID_PartNo_Field; -- Read-only. Reads as 0xF. Constant_k : CPUID_Constant_Field; -- Read-only. Variant number, the r value in the rnpn product revision -- identifier. Variant : CPUID_Variant_Field; -- Read-only. Implementer code. Implementer : CPUID_Implementer_Field; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CPUID_Register use record Revision at 0 range 0 .. 3; PartNo at 0 range 4 .. 15; Constant_k at 0 range 16 .. 19; Variant at 0 range 20 .. 23; Implementer at 0 range 24 .. 31; end record; subtype ICSR_VECTACTIVE_Field is HAL.UInt6; subtype ICSR_VECTPENDING_Field is HAL.UInt6; -- Interrupt Control and State Register type ICSR_Register is record -- Read-only. Contains the active exception number. Subtract 16 from -- this value to obtain the CMSIS IRQ number required to index into the -- Interrupt Clear-Enable, Set-Enable, Clear-Pending, Set-Pending or -- Priority Registers. VECTACTIVE : ICSR_VECTACTIVE_Field := 16#0#; -- unspecified Reserved_6_11 : HAL.UInt6 := 16#0#; -- Read-only. Indicates the exception number of the highest priority -- pending enabled exception. VECTPENDING : ICSR_VECTPENDING_Field := 16#0#; -- unspecified Reserved_18_21 : HAL.UInt4 := 16#0#; -- Interrupt pending flag, excluding NMI and Faults ISRPENDING : Boolean := False; -- unspecified Reserved_23_24 : HAL.UInt2 := 16#0#; -- Write-only. SysTick exception clear-pending bit. PENDSTCLR : Boolean := False; -- SysTick exception set-pending bit. PENDSTSET : Boolean := False; -- Write-only. PendSV clear-pending bit. PENDSVCLR : Boolean := False; -- PendSV set-pending bit. PENDSVSET : Boolean := False; -- unspecified Reserved_29_30 : HAL.UInt2 := 16#0#; -- NMI set-pending bit. NMIPENDSET : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for ICSR_Register use record VECTACTIVE at 0 range 0 .. 5; Reserved_6_11 at 0 range 6 .. 11; VECTPENDING at 0 range 12 .. 17; Reserved_18_21 at 0 range 18 .. 21; ISRPENDING at 0 range 22 .. 22; Reserved_23_24 at 0 range 23 .. 24; PENDSTCLR at 0 range 25 .. 25; PENDSTSET at 0 range 26 .. 26; PENDSVCLR at 0 range 27 .. 27; PENDSVSET at 0 range 28 .. 28; Reserved_29_30 at 0 range 29 .. 30; NMIPENDSET at 0 range 31 .. 31; end record; -- Data endianness bit setting is implementation defined. type AIRCR_ENDIANNESS_Field is ( -- Data is little endian Little_Endian, -- Data is big endian Big_Endian) with Size => 1; for AIRCR_ENDIANNESS_Field use (Little_Endian => 0, Big_Endian => 1); -- Register key. On write, write 0x5FA to VECTKEY, otherwise the write is -- ignored. Reads as 0xFA05 type AIRCR_VECTKEY_Field is ( -- The write key Key, -- The read key Key_Read) with Size => 16; for AIRCR_VECTKEY_Field use (Key => 1530, Key_Read => 64005); -- Application Interrupt and Reset Control Register type AIRCR_Register is record -- unspecified Reserved_0_0 : HAL.Bit := 16#0#; -- Write-only. Reserved for debug use. This bit reads as 0. When writing -- to the register youmust write 0 to this bit, otherwise behavior is -- Unpredictable. VECTCLRACTIVE : Boolean := False; -- Write-only. System reset request bit setting is implementation -- defined. SYSRESETREQ : Boolean := False; -- unspecified Reserved_3_14 : HAL.UInt12 := 16#0#; -- Read-only. Data endianness bit setting is implementation defined. ENDIANNESS : AIRCR_ENDIANNESS_Field := Cortex_M_SVD.SCB.Little_Endian; -- Register key. On write, write 0x5FA to VECTKEY, otherwise the write -- is ignored. Reads as 0xFA05 VECTKEY : AIRCR_VECTKEY_Field := Cortex_M_SVD.SCB.Key_Read; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for AIRCR_Register use record Reserved_0_0 at 0 range 0 .. 0; VECTCLRACTIVE at 0 range 1 .. 1; SYSRESETREQ at 0 range 2 .. 2; Reserved_3_14 at 0 range 3 .. 14; ENDIANNESS at 0 range 15 .. 15; VECTKEY at 0 range 16 .. 31; end record; -- System Control Register type SCR_Register is record -- unspecified Reserved_0_0 : HAL.Bit := 16#0#; -- Indicates sleep-on-exit when returning from Handler mode to Thread -- mode SLEEPONEXIT : Boolean := False; -- Controls whether the processor uses sleep or deep sleep as its -- low-power mode SLEEPDEEP : Boolean := False; -- unspecified Reserved_3_3 : HAL.Bit := 16#0#; -- Send event on pending bit SEVONPEND : Boolean := False; -- unspecified Reserved_5_31 : HAL.UInt27 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for SCR_Register use record Reserved_0_0 at 0 range 0 .. 0; SLEEPONEXIT at 0 range 1 .. 1; SLEEPDEEP at 0 range 2 .. 2; Reserved_3_3 at 0 range 3 .. 3; SEVONPEND at 0 range 4 .. 4; Reserved_5_31 at 0 range 5 .. 31; end record; -- Configuration and Control Register type CCR_Register is record -- unspecified Reserved_0_2 : HAL.UInt3 := 16#0#; -- Enables unalign access traps. UNALIGNED_TRP : Boolean := False; -- unspecified Reserved_4_8 : HAL.UInt5 := 16#0#; -- Read-only. Always reads-as-one. It indicates stack alignment on -- exception entry is 8-byte aligned. STKALIGN : Boolean := True; -- unspecified Reserved_10_31 : HAL.UInt22 := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for CCR_Register use record Reserved_0_2 at 0 range 0 .. 2; UNALIGNED_TRP at 0 range 3 .. 3; Reserved_4_8 at 0 range 4 .. 8; STKALIGN at 0 range 9 .. 9; Reserved_10_31 at 0 range 10 .. 31; end record; subtype SHPR2_PRI_11_Field is HAL.UInt8; -- System Handler Priority Register 2 type SHPR2_Register is record -- unspecified Reserved_0_23 : HAL.UInt24 := 16#0#; -- Priority of the system handler, SVCall PRI_11 : SHPR2_PRI_11_Field := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for SHPR2_Register use record Reserved_0_23 at 0 range 0 .. 23; PRI_11 at 0 range 24 .. 31; end record; subtype SHPR3_PRI_14_Field is HAL.UInt8; subtype SHPR3_PRI_15_Field is HAL.UInt8; -- System Handler Priority Register 3 type SHPR3_Register is record -- unspecified Reserved_0_15 : HAL.UInt16 := 16#0#; -- Priority of the system handler, PendSV PRI_14 : SHPR3_PRI_14_Field := 16#0#; -- Priority of the system handler, SysTick PRI_15 : SHPR3_PRI_15_Field := 16#0#; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for SHPR3_Register use record Reserved_0_15 at 0 range 0 .. 15; PRI_14 at 0 range 16 .. 23; PRI_15 at 0 range 24 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- System control block type SCB_Peripheral is record -- CPUID Base Register CPUID : aliased CPUID_Register; -- Interrupt Control and State Register ICSR : aliased ICSR_Register; -- Application Interrupt and Reset Control Register AIRCR : aliased AIRCR_Register; -- System Control Register SCR : aliased SCR_Register; -- Configuration and Control Register CCR : aliased CCR_Register; -- System Handler Priority Register 2 SHPR2 : aliased SHPR2_Register; -- System Handler Priority Register 3 SHPR3 : aliased SHPR3_Register; end record with Volatile; for SCB_Peripheral use record CPUID at 16#0# range 0 .. 31; ICSR at 16#4# range 0 .. 31; AIRCR at 16#C# range 0 .. 31; SCR at 16#10# range 0 .. 31; CCR at 16#14# range 0 .. 31; SHPR2 at 16#1C# range 0 .. 31; SHPR3 at 16#20# range 0 .. 31; end record; -- System control block SCB_Periph : aliased SCB_Peripheral with Import, Address => System'To_Address (16#E000ED00#); end Cortex_M_SVD.SCB;
AdaCore/libadalang
Ada
46
adb
procedure No_Missing is begin end No_Missing;
reznikmm/matreshka
Ada
3,724
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Svg_V_Ideographic_Attributes is pragma Preelaborate; type ODF_Svg_V_Ideographic_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Svg_V_Ideographic_Attribute_Access is access all ODF_Svg_V_Ideographic_Attribute'Class with Storage_Size => 0; end ODF.DOM.Svg_V_Ideographic_Attributes;
reznikmm/matreshka
Ada
4,744
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Style.Percentage_Data_Style_Name_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Style_Percentage_Data_Style_Name_Attribute_Node is begin return Self : Style_Percentage_Data_Style_Name_Attribute_Node do Matreshka.ODF_Style.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Style_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Style_Percentage_Data_Style_Name_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Percentage_Data_Style_Name_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Style_URI, Matreshka.ODF_String_Constants.Percentage_Data_Style_Name_Attribute, Style_Percentage_Data_Style_Name_Attribute_Node'Tag); end Matreshka.ODF_Style.Percentage_Data_Style_Name_Attributes;
sungyeon/drake
Ada
279
ads
pragma License (Unrestricted); with Ada.Numerics.Complex_Types; with Ada.Numerics.Generic_Complex_Arrays; with Ada.Numerics.Real_Arrays; package Ada.Numerics.Complex_Arrays is new Generic_Complex_Arrays (Real_Arrays, Complex_Types); pragma Pure (Ada.Numerics.Complex_Arrays);
reznikmm/matreshka
Ada
5,064
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.UML.Connector_Ends.Collections is pragma Preelaborate; package UML_Connector_End_Collections is new AMF.Generic_Collections (UML_Connector_End, UML_Connector_End_Access); type Set_Of_UML_Connector_End is new UML_Connector_End_Collections.Set with null record; Empty_Set_Of_UML_Connector_End : constant Set_Of_UML_Connector_End; type Ordered_Set_Of_UML_Connector_End is new UML_Connector_End_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Connector_End : constant Ordered_Set_Of_UML_Connector_End; type Bag_Of_UML_Connector_End is new UML_Connector_End_Collections.Bag with null record; Empty_Bag_Of_UML_Connector_End : constant Bag_Of_UML_Connector_End; type Sequence_Of_UML_Connector_End is new UML_Connector_End_Collections.Sequence with null record; Empty_Sequence_Of_UML_Connector_End : constant Sequence_Of_UML_Connector_End; private Empty_Set_Of_UML_Connector_End : constant Set_Of_UML_Connector_End := (UML_Connector_End_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Connector_End : constant Ordered_Set_Of_UML_Connector_End := (UML_Connector_End_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Connector_End : constant Bag_Of_UML_Connector_End := (UML_Connector_End_Collections.Bag with null record); Empty_Sequence_Of_UML_Connector_End : constant Sequence_Of_UML_Connector_End := (UML_Connector_End_Collections.Sequence with null record); end AMF.UML.Connector_Ends.Collections;
stcarrez/ada-asf
Ada
4,917
adb
----------------------------------------------------------------------- -- asf-contexts-faces-mockups - Mockup for faces context -- Copyright (C) 2013 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with ASF.Tests; package body ASF.Contexts.Faces.Mockup is -- ------------------------------ -- Initialize the mockup context. -- ------------------------------ overriding procedure Initialize (Context : in out Mockup_Faces_Context) is begin Faces_Context (Context).Initialize; Context.Prev_Context := Current; Context.Request := Context.Mock_Request'Unchecked_Access; Context.Response := Context.Mock_Response'Unchecked_Access; Context.Flash := Context.Flash_Ctx'Unchecked_Access; Context.Resolver.Initialize (ASF.Tests.Get_Application, Context.Request); Context.ELContext.Set_Resolver (Context.Resolver'Unchecked_Access); Context.ELContext.Set_Variable_Mapper (Context.Variables'Unchecked_Access); Context.Set_ELContext (Context.ELContext'Unchecked_Access); Context.Set_Response_Writer (Context.Output'Unchecked_Access); Context.Output.Initialize ("text/html", "UTF-8", Context.Response.Get_Output_Stream); Set_Current (Context => Context'Unchecked_Access, Application => ASF.Tests.Get_Application.all'Access); end Initialize; -- ------------------------------ -- Release any storage held by this context. -- ------------------------------ overriding procedure Finalize (Context : in out Mockup_Faces_Context) is begin Faces_Context (Context).Finalize; Restore (Context.Prev_Context); end Finalize; -- ------------------------------ -- Set the path info -- ------------------------------ procedure Set_Path_Info (Req : in out Mockup_Faces_Context; Path : in String) is begin Req.Mock_Request.Set_Path_Info (Path); end Set_Path_Info; -- ------------------------------ -- Set the parameter -- ------------------------------ procedure Set_Parameter (Req : in out Mockup_Faces_Context; Name : in String; Value : in String) is begin Req.Mock_Request.Set_Parameter (Name, Value); end Set_Parameter; -- ------------------------------ -- Sets the HTTP method. -- ------------------------------ procedure Set_Method (Req : in out Mockup_Faces_Context; Method : in String) is begin Req.Mock_Request.Set_Method (Method); end Set_Method; -- ------------------------------ -- Sets the protocol version -- ------------------------------ procedure Set_Protocol (Req : in out Mockup_Faces_Context; Protocol : in String) is begin Req.Mock_Request.Set_Protocol (Protocol); end Set_Protocol; -- ------------------------------ -- Set the request URI. -- ------------------------------ procedure Set_Request_URI (Req : in out Mockup_Faces_Context; URI : in String) is begin Req.Mock_Request.Set_Request_URI (URI); end Set_Request_URI; -- ------------------------------ -- Sets the peer address -- ------------------------------ procedure Set_Remote_Addr (Req : in out Mockup_Faces_Context; Addr : in String) is begin Req.Mock_Request.Set_Remote_Addr (Addr); end Set_Remote_Addr; -- ------------------------------ -- Set the request cookie by using the cookie returned in the response. -- ------------------------------ procedure Set_Cookie (Req : in out Mockup_Faces_Context; From : in ASF.Responses.Mockup.Response'Class) is begin Req.Mock_Request.Set_Cookie (From); end Set_Cookie; -- ------------------------------ -- Get the content written to the mockup output stream. -- ------------------------------ procedure Read_Response (Resp : in out Mockup_Faces_Context; Into : out Ada.Strings.Unbounded.Unbounded_String) is begin Resp.Mock_Response.Read_Content (Into); end Read_Response; end ASF.Contexts.Faces.Mockup;
reznikmm/gela
Ada
78,532
adb
with Ada.Containers.Hashed_Maps; with Ada.Containers.Vectors; with Gela.Defining_Name_Cursors; with Gela.Element_Visiters; with Gela.Elements.Composite_Constraints; with Gela.Elements.Defining_Identifiers; with Gela.Elements.Formal_Object_Declarations; with Gela.Elements.Formal_Type_Declarations; with Gela.Elements.Generic_Formals; with Gela.Elements.Generic_Package_Declarations; with Gela.Elements.Range_Attribute_References; with Gela.Elements.Simple_Expression_Ranges; with Gela.Environments; with Gela.Profiles; with Gela.Resolve.Type_Matchers; with Gela.Type_Managers; with Gela.Types.Arrays; with Gela.Types.Simple; with Gela.Types.Untagged_Records; with Gela.Types.Visitors; with Gela.Resolve.Each; package body Gela.Resolve is procedure To_Type_Category (Comp : Gela.Compilations.Compilation_Access; Up : Gela.Interpretations.Interpretation_Set_Index; Tipe : Gela.Semantic_Types.Type_View_Index; Result : out Gela.Interpretations.Interpretation_Index); -- Fetch Type_Category interpretation from Up that match given Tipe. procedure Get_Subtype (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Set : Gela.Interpretations.Interpretation_Set_Index; Index : out Gela.Interpretations.Interpretation_Index; Result : out Gela.Semantic_Types.Type_View_Index); procedure To_Type (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Type_Up : access Gela.Types.Type_View'Class; Expr_Up : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index); procedure Discrete_Range (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Left : Gela.Interpretations.Interpretation_Set_Index; Right : Gela.Interpretations.Interpretation_Set_Index; Down_Left : out Gela.Interpretations.Interpretation_Index; Down_Right : out Gela.Interpretations.Interpretation_Index; Tipe : out Gela.Semantic_Types.Type_View_Index); function Array_Matcher return not null Gela.Interpretations.Type_Matcher_Access is Result : constant Type_Matchers.Type_Matcher_Access := new Type_Matchers.Array_Type_Matcher; begin return Gela.Interpretations.Type_Matcher_Access (Result); end Array_Matcher; ---------------------- -- Assignment_Right -- ---------------------- procedure Assignment_Right (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Left : Gela.Interpretations.Interpretation_Set_Index; Right : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is begin -- ARM 5.2 (4/2) To_Type_Or_The_Same_Type (Comp => Comp, Env => Env, Type_Up => Left, Expr_Up => Right, Result => Result); end Assignment_Right; ------------------------- -- Attribute_Reference -- ------------------------- procedure Attribute_Reference (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Prefix : Gela.Interpretations.Interpretation_Set_Index; Symbol : Gela.Lexical_Types.Symbol; Set : out Gela.Interpretations.Interpretation_Set_Index) is use type Gela.Lexical_Types.Symbol; use type Gela.Semantic_Types.Type_View_Index; IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; Index : Gela.Interpretations.Interpretation_Index; Is_Length : constant Boolean := Symbol = Gela.Lexical_Types.Predefined_Symbols.Length; Type_Index : Gela.Semantic_Types.Type_View_Index; begin Set := 0; case Symbol is when Gela.Lexical_Types.Predefined_Symbols.Length | Gela.Lexical_Types.Predefined_Symbols.First | Gela.Lexical_Types.Predefined_Symbols.Range_Symbol | Gela.Lexical_Types.Predefined_Symbols.Last => Get_Subtype (Comp, Env => Env, Set => Prefix, Index => Index, Result => Type_Index); if Type_Index = 0 then for J in Each.Prefix (IM, TM, Env, Prefix) loop if Is_Length then IM.Add_Expression (Tipe => TM.Universal_Integer, Down => (1 => Index), Result => Set); else declare View : constant Gela.Types.Type_View_Access := TM.Get (J.Expression_Type); begin if View.Assigned and then View.Is_Array then declare Index_Types : constant Gela.Types.Simple.Discrete_Type_Array := Gela.Types.Arrays.Array_Type_Access (View) .all.Index_Types; begin if Index_Types (1).Assigned then IM.Add_Expression (Tipe => Index_Types (1).Type_View_Index, Down => (1 => Index), Result => Set); end if; end; end if; end; end if; end loop; elsif Is_Length then IM.Add_Expression (Tipe => TM.Universal_Integer, Down => (1 => Index), Result => Set); else IM.Add_Expression (Tipe => Type_Index, Down => (1 => Index), Result => Set); end if; when -- Gela.Lexical_Types.Predefined_Symbols.Adjacent | Gela.Lexical_Types.Predefined_Symbols.Ceiling | -- Gela.Lexical_Types.Predefined_Symbols.Compose | -- Gela.Lexical_Types.Predefined_Symbols.Copy_Sign | -- Gela.Lexical_Types.Predefined_Symbols.Exponent | Gela.Lexical_Types.Predefined_Symbols.Floor | Gela.Lexical_Types.Predefined_Symbols.Fraction | -- Gela.Lexical_Types.Predefined_Symbols.Image | -- Gela.Lexical_Types.Predefined_Symbols.Input | -- Gela.Lexical_Types.Predefined_Symbols.Leading_Part | Gela.Lexical_Types.Predefined_Symbols.Machine | Gela.Lexical_Types.Predefined_Symbols.Machine_Rounding | -- Gela.Lexical_Types.Predefined_Symbols.Max | -- Gela.Lexical_Types.Predefined_Symbols.Min | Gela.Lexical_Types.Predefined_Symbols.Mod_Symbol | Gela.Lexical_Types.Predefined_Symbols.Model | Gela.Lexical_Types.Predefined_Symbols.Pos | Gela.Lexical_Types.Predefined_Symbols.Pred | -- Gela.Lexical_Types.Predefined_Symbols.Remainder | -- Gela.Lexical_Types.Predefined_Symbols.Round | Gela.Lexical_Types.Predefined_Symbols.Rounding | -- Gela.Lexical_Types.Predefined_Symbols.Scaling | Gela.Lexical_Types.Predefined_Symbols.Succ | Gela.Lexical_Types.Predefined_Symbols.Truncation | Gela.Lexical_Types.Predefined_Symbols.Unbiased_Rounding | Gela.Lexical_Types.Predefined_Symbols.Val => -- Gela.Lexical_Types.Predefined_Symbols.Value | -- Gela.Lexical_Types.Predefined_Symbols.Wide_Image | -- Gela.Lexical_Types.Predefined_Symbols.Wide_Value | -- Gela.Lexical_Types.Predefined_Symbols.Wide_Wide_Image | -- Gela.Lexical_Types.Predefined_Symbols.Wide_Wide_Value => Get_Subtype (Comp, Env => Env, Set => Prefix, Index => Index, Result => Type_Index); IM.Add_Attr_Function (Kind => Symbol, Tipe => TM.Get (Type_Index), Down => (1 => Index), Result => Set); when Gela.Lexical_Types.Predefined_Symbols.Size => Get_Subtype (Comp, Env => Env, Set => Prefix, Index => Index, Result => Type_Index); IM.Add_Expression (Tipe => TM.Universal_Integer, Down => (1 => Index), Result => Set); when others => null; end case; end Attribute_Reference; -------------------- -- Case_Statement -- -------------------- procedure Case_Statement (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Expr_Up : Gela.Interpretations.Interpretation_Set_Index; Tuple : Gela.Interpretations.Interpretation_Tuple_List_Index; Result : out Gela.Interpretations.Interpretation_Index) is IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; Tuples : constant Gela.Interpretations.Interpretation_Tuple_Index_Array := IM.Get_Tuple_List (Tuple); Output : Gela.Interpretations.Interpretation_Index_Array (Tuples'Range); Chosen : Gela.Interpretations.Interpretation_Index := 0; begin Result := 0; for X in Each.Expression (IM, TM, Env, Expr_Up) loop for J in Tuples'Range loop declare Value : constant Gela.Interpretations .Interpretation_Set_Index_Array := IM.Get_Tuple (Tuples (J)); List : Gela.Interpretations.Interpretation_Index_Array (Value'Range); begin for K in Value'Range loop To_Type (Comp => Comp, Env => Env, Type_Up => TM.Get (X.Expression_Type), Expr_Up => Value (K), Result => List (K)); end loop; Chosen := 0; for K in reverse List'Range loop IM.Get_Tuple_Index (List (K), Chosen, Chosen); end loop; Output (J) := Chosen; end; end loop; for J in reverse Output'Range loop IM.Get_Tuple_Index (Output (J), Result, Result); end loop; exit; end loop; end Case_Statement; ----------------------- -- Character_Literal -- ----------------------- procedure Character_Literal (Comp : Gela.Compilations.Compilation_Access; Result : out Gela.Interpretations.Interpretation_Set_Index) is Type_Matcher : constant Type_Matchers.Type_Matcher_Access := new Type_Matchers.Character_Type_Matcher; begin Result := 0; Comp.Context.Interpretation_Manager.Add_Expression_Category (Match => Gela.Interpretations.Type_Matcher_Access (Type_Matcher), Down => (1 .. 0 => 0), Result => Result); end Character_Literal; ---------------- -- Constraint -- ---------------- procedure Constraint (Comp : Gela.Compilations.Compilation_Access; Constraint : access Gela.Elements.Element'Class; Env : Gela.Semantic_Types.Env_Index; Type_Up : Gela.Interpretations.Interpretation_Set_Index; Constr : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is package Each_Constraint is type Visiter is new Gela.Element_Visiters.Visiter with null record; overriding procedure Range_Attribute_Reference (Self : in out Visiter; Node : not null Gela.Elements.Range_Attribute_References. Range_Attribute_Reference_Access); overriding procedure Simple_Expression_Range (Self : in out Visiter; Node : not null Gela.Elements.Simple_Expression_Ranges. Simple_Expression_Range_Access); end Each_Constraint; package body Each_Constraint is overriding procedure Range_Attribute_Reference (Self : in out Visiter; Node : not null Gela.Elements.Range_Attribute_References. Range_Attribute_Reference_Access) is pragma Unreferenced (Node, Self); begin -- 3.5 (5) Gela.Resolve.To_Type (Comp => Comp, Env => Env, Type_Up => Type_Up, Expr_Up => Constr, Result => Result); end Range_Attribute_Reference; overriding procedure Simple_Expression_Range (Self : in out Visiter; Node : not null Gela.Elements.Simple_Expression_Ranges. Simple_Expression_Range_Access) is pragma Unreferenced (Node, Self); begin -- 3.5 (5) Gela.Resolve.To_Type (Comp => Comp, Env => Env, Type_Up => Type_Up, Expr_Up => Constr, Result => Result); end Simple_Expression_Range; end Each_Constraint; V : Each_Constraint.Visiter; begin Result := 0; if not Constraint.Assigned then return; end if; Constraint.Visit (V); end Constraint; procedure Constraint (Comp : Gela.Compilations.Compilation_Access; Constraint : access Gela.Elements.Element'Class; Env : Gela.Semantic_Types.Env_Index; Type_Up : Gela.Interpretations.Interpretation_Set_Index; Constr : Gela.Interpretations.Interpretation_Tuple_List_Index; Result : out Gela.Interpretations.Interpretation_Index) is package Each_Constraint is type Visiter is new Gela.Element_Visiters.Visiter with null record; overriding procedure Composite_Constraint (Self : in out Visiter; Node : not null Gela.Elements.Composite_Constraints. Composite_Constraint_Access); end Each_Constraint; IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; Type_Index : Gela.Semantic_Types.Type_View_Index; package body Each_Constraint is overriding procedure Composite_Constraint (Self : in out Visiter; Node : not null Gela.Elements.Composite_Constraints. Composite_Constraint_Access) is pragma Unreferenced (Node, Self); Tuples : constant Gela.Interpretations .Interpretation_Tuple_Index_Array := IM.Get_Tuple_List (Constr); Output : Gela.Interpretations.Interpretation_Index_Array (Tuples'Range); package Type_Visiters is type Type_Visitor is new Gela.Types.Visitors.Type_Visitor with null record; overriding procedure Array_Type (Self : in out Type_Visitor; Value : not null Gela.Types.Arrays.Array_Type_Access); overriding procedure Untagged_Record (Self : in out Type_Visitor; Value : not null Gela.Types.Untagged_Records .Untagged_Record_Type_Access); overriding procedure Object_Access_Type (Self : in out Type_Visitor; Value : not null Gela.Types.Simple .Object_Access_Type_Access); end Type_Visiters; package body Type_Visiters is overriding procedure Array_Type (Self : in out Type_Visitor; Value : not null Gela.Types.Arrays.Array_Type_Access) is pragma Unreferenced (Self); IT : constant Gela.Types.Simple.Discrete_Type_Array := Value.Index_Types; Count : Natural := 0; Chosen : Gela.Interpretations.Interpretation_Index; begin if not (for all X of IT => X.Assigned) then Result := 0; return; end if; for K in Tuples'Range loop declare Tuple : constant Gela.Interpretations .Interpretation_Set_Index_Array := IM.Get_Tuple (Tuples (K)); begin Count := Count + 1; To_Type (Comp => Comp, Env => Env, Type_Up => IT (Count), Expr_Up => Tuple (Tuple'Last), Result => Chosen); IM.Get_Tuple_Index (Chosen, 0, Chosen); if Tuple'Length = 2 then -- Put some interpretation to placeholder item IM.Get_Tuple_Index (0, Chosen, Chosen); end if; Output (K) := Chosen; end; end loop; Chosen := 0; for J in reverse Output'Range loop IM.Get_Tuple_Index (Output (J), Chosen, Chosen); end loop; Result := Chosen; end Array_Type; overriding procedure Object_Access_Type (Self : in out Type_Visitor; Value : not null Gela.Types.Simple .Object_Access_Type_Access) is Des_Index : constant Gela.Semantic_Types.Type_View_Index := TM.Type_From_Subtype_Mark (Env, Value.Get_Designated); Des_View : constant Gela.Types.Type_View_Access := TM.Get (Des_Index); begin Des_View.Visit_If_Assigned (Self); end Object_Access_Type; overriding procedure Untagged_Record (Self : in out Type_Visitor; Value : not null Gela.Types.Untagged_Records .Untagged_Record_Type_Access) is pragma Unreferenced (Self); Chosen : Gela.Interpretations.Interpretation_Index; begin for K in Tuples'Range loop declare use type Gela.Semantic_Types.Type_View_Index; Tuple : constant Gela.Interpretations. Interpretation_Set_Index_Array := IM.Get_Tuple (Tuples (K)); Exp : Gela.Semantic_Types.Type_View_Index := 0; List : Gela.Interpretations.Interpretation_Index_Array (Tuple'Range) := (others => 0); Name : Gela.Elements.Defining_Names. Defining_Name_Access; begin -- Resolve choices of association Output (K) := 0; for J in List'First + 1 .. List'Last loop for S in IM.Symbols (Tuple (J)) loop Name := Value.Get_Discriminant (S.Symbol); if Name.Assigned then IM.Get_Defining_Name_Index (Name, List (J)); if Exp = 0 then Exp := TM.Type_Of_Object_Declaration (Env, Name.Enclosing_Element); end if; end if; end loop; end loop; -- Resolve expression of association To_Type (Comp => Comp, Env => Env, Type_Up => TM.Get (Exp), Expr_Up => Tuple (Tuple'First), Result => List (List'First)); for J in reverse List'Range loop IM.Get_Tuple_Index (List (J), Output (K), Output (K)); end loop; end; end loop; Chosen := 0; for J in reverse Output'Range loop IM.Get_Tuple_Index (Output (J), Chosen, Chosen); end loop; Result := Chosen; end Untagged_Record; end Type_Visiters; Type_View : Gela.Types.Type_View_Access; Visiter : Type_Visiters.Type_Visitor; Ignore : Gela.Interpretations.Interpretation_Index; begin Get_Subtype (Comp, Env => Env, Set => Type_Up, Index => Ignore, Result => Type_Index); Type_View := TM.Get (Type_Index); Type_View.Visit_If_Assigned (Visiter); end Composite_Constraint; end Each_Constraint; V : Each_Constraint.Visiter; begin Result := 0; if not Constraint.Assigned then return; end if; Constraint.Visit (V); end Constraint; ----------------- -- Direct_Name -- ----------------- procedure Direct_Name (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Symbol : Gela.Lexical_Types.Symbol; Set : out Gela.Interpretations.Interpretation_Set_Index) is procedure Add_Function (Name : Gela.Elements.Defining_Names.Defining_Name_Access); TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; ES : constant Gela.Environments.Environment_Set_Access := Comp.Context.Environment_Set; ------------------ -- Add_Function -- ------------------ procedure Add_Function (Name : Gela.Elements.Defining_Names.Defining_Name_Access) is Index : Gela.Interpretations.Interpretation_Index; Tipe : Gela.Semantic_Types.Type_View_Index; Profile : constant Gela.Profiles.Profile_Access := TM.Get_Profile (Env, Name); begin if Profile not in null and then Profile.Is_Function and then Profile.Allow_Empty_Argument_List and then Profile.Return_Type.Assigned then Tipe := Profile.Return_Type.Type_View_Index; if Tipe not in 0 then IM.Get_Defining_Name_Index (Name, Index); IM.Add_Expression (Tipe => Tipe, Kind => Gela.Interpretations.Function_Call, Down => (1 => Index), Result => Set); end if; end if; end Add_Function; DV : Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class := ES.Direct_Visible (Env, Symbol); Have_Direct_Visible : constant Boolean := DV.Has_Element; begin Set := 0; IM.Add_Symbol (Symbol, Set); while DV.Has_Element loop IM.Add_Defining_Name (Name => DV.Element, Down => (1 .. 0 => 0), Result => Set); Add_Function (DV.Element); DV.Next; end loop; if Have_Direct_Visible then return; end if; declare UV : Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class := ES.Use_Visible (Env, Symbol); begin while UV.Has_Element loop IM.Add_Defining_Name (Name => UV.Element, Down => (1 .. 0 => 0), Result => Set); Add_Function (UV.Element); UV.Next; end loop; end; end Direct_Name; ------------------- -- Function_Call -- ------------------- procedure Function_Call (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Prefix : Gela.Interpretations.Interpretation_Set_Index; Args : Gela.Interpretations.Interpretation_Tuple_List_Index; Set : out Gela.Interpretations.Interpretation_Set_Index) is use type Gela.Interpretations.Interpretation_Index; use type Gela.Interpretations.Interpretation_Index_Array; procedure On_Call (Profile : Gela.Profiles.Profile_Access; Cursor : Gela.Interpretations.Abstract_Cursor'Class); IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; Tuples : constant Gela.Interpretations.Interpretation_Tuple_Index_Array := IM.Get_Tuple_List (Args); ------------- -- On_Call -- ------------- procedure On_Call (Profile : Gela.Profiles.Profile_Access; Cursor : Gela.Interpretations.Abstract_Cursor'Class) is Chosen : Gela.Interpretations.Interpretation_Index := 0; Count : Natural := 0; Output : Gela.Interpretations.Interpretation_Index_Array (Tuples'Range); Return_Type : Gela.Semantic_Types.Type_View_Index := 0; begin if not Profile.Assigned then return; elsif Profile.Return_Type.Assigned then Return_Type := Profile.Return_Type.Type_View_Index; end if; for J in Tuples'Range loop declare Tuple : constant Gela.Interpretations .Interpretation_Set_Index_Array := IM.Get_Tuple (Tuples (J)); Tipe : Gela.Types.Type_View_Access; List : Gela.Interpretations.Interpretation_Index_Array (Tuple'Range); begin -- Check if this is positional association if Tuple'Length = 1 then if Count < Profile.Length then Count := Count + 1; Tipe := Profile.Get_Type (Count); To_Type (Comp, Env, Tipe, Tuple (Tuple'First), Chosen); if Chosen = 0 then return; else List (List'First) := Chosen; end if; else return; end if; else for J in Tuple'Range loop Interpretation (Comp => Comp, Env => Env, Set => Tuple (J), Result => List (J)); end loop; end if; Chosen := 0; for K in reverse List'Range loop IM.Get_Tuple_Index (List (K), Chosen, Chosen); end loop; Output (J) := Chosen; end; end loop; Chosen := 0; for K in reverse Output'Range loop IM.Get_Tuple_Index (Output (K), Chosen, Chosen); end loop; if Chosen /= 0 then Comp.Context.Interpretation_Manager.Add_Expression (Tipe => Return_Type, Kind => Gela.Interpretations.Function_Call, Down => Cursor.Get_Index & Chosen, Result => Set); elsif Tuples'Length = 0 and then Profile.Allow_Empty_Argument_List then Comp.Context.Interpretation_Manager.Add_Expression (Tipe => Return_Type, Kind => Gela.Interpretations.Function_Call, Down => Cursor.Get_Index & 0, Result => Set); end if; end On_Call; Profile : Gela.Profiles.Profile_Access; begin Set := 0; for J in IM.Profiles (Prefix) loop if J.Corresponding_Type.Assigned then Profile := TM.Get_Profile (J.Corresponding_Type.Type_View_Index, J.Attribute_Kind); On_Call (Profile, J); end if; end loop; for J in IM.Defining_Names (Prefix) loop Profile := TM.Get_Profile (Env, J.Defining_Name); On_Call (Profile, J); end loop; for J in Each.Prefix (IM, TM, Env, Prefix) loop declare View : constant Gela.Types.Type_View_Access := TM.Get (J.Expression_Type); Arr : Gela.Types.Arrays.Array_Type_Access; Chosen : Gela.Interpretations.Interpretation_Index := 0; Count : Natural := 0; Output : Gela.Interpretations.Interpretation_Index_Array (Tuples'Range); begin if not View.Assigned or else not View.Is_Array then return; end if; Arr := Gela.Types.Arrays.Array_Type_Access (View); for J in Tuples'Range loop declare Tuple : constant Gela.Interpretations .Interpretation_Set_Index_Array := IM.Get_Tuple (Tuples (J)); Index_Types : constant Gela.Types.Simple.Discrete_Type_Array := Arr.all.Index_Types; begin -- Check if this is positional association -- Check agains Constraint_Error in case of slice FIXME if Tuple'Length = 1 and Count + 1 <= Index_Types'Last then Count := Count + 1; if not Index_Types (Count).Assigned then return; end if; To_Type (Comp, Env, Index_Types (Count), Tuple (Tuple'First), Chosen); if Chosen = 0 then return; else IM.Get_Tuple_Index (Chosen, 0, Chosen); end if; else return; end if; Output (J) := Chosen; end; end loop; Chosen := 0; for K in reverse Output'Range loop IM.Get_Tuple_Index (Output (K), Chosen, Chosen); end loop; if Chosen /= 0 and Arr.Component_Type.Assigned then Comp.Context.Interpretation_Manager.Add_Expression (Tipe => Arr.Component_Type.Type_View_Index, Kind => Gela.Interpretations.Indexed_Component, Down => J.Get_Index & Chosen, Result => Set); end if; end; end loop; -- Type Convertion if Tuples'Length = 1 then declare Tipe : Gela.Interpretations.Interpretation_Index; Chosen : Gela.Interpretations.Interpretation_Index; Type_Index : Gela.Semantic_Types.Type_View_Index; Tuple : constant Gela.Interpretations .Interpretation_Set_Index_Array := IM.Get_Tuple (Tuples (1)); begin if Tuple'Length = 1 then -- Single expression without choices Get_Subtype (Comp => Comp, Env => Env, Set => Prefix, Index => Tipe, Result => Type_Index); if Type_Index not in 0 then Interpretation (Comp, Env, Set => Tuple (1), Result => Chosen); IM.Get_Tuple_Index (Chosen, 0, Chosen); IM.Get_Tuple_Index (Chosen, 0, Chosen); Comp.Context.Interpretation_Manager.Add_Expression (Tipe => Type_Index, Kind => Gela.Interpretations.Type_Convertion, Down => Tipe & Chosen, Result => Set); end if; end if; end; end if; end Function_Call; -------------------------- -- Qualified_Expression -- -------------------------- procedure Qualified_Expression (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Prefix : Gela.Interpretations.Interpretation_Set_Index; Arg : Gela.Interpretations.Interpretation_Set_Index; Set : out Gela.Interpretations.Interpretation_Set_Index) is pragma Unreferenced (Arg); Tipe : Gela.Interpretations.Interpretation_Index; Type_Index : Gela.Semantic_Types.Type_View_Index; begin Set := 0; Get_Subtype (Comp => Comp, Env => Env, Set => Prefix, Index => Tipe, Result => Type_Index); if Type_Index not in 0 then Comp.Context.Interpretation_Manager.Add_Expression (Tipe => Type_Index, Kind => Gela.Interpretations.Type_Convertion, Down => (1 .. 0 => 0), Result => Set); end if; end Qualified_Expression; ------------------------- -- Generic_Association -- ------------------------- procedure Generic_Association (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; -- Actual_Part : Gela.Elements.Generic_Associations. -- Generic_Association_Sequence_Access; Up : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is begin Interpretation (Comp, Env, Up, Result); end Generic_Association; ------------------------------ -- Generic_Association_List -- ------------------------------ procedure Generic_Association_List (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Instance : Gela.Elements.Element_Access; Generic_Name : Gela.Elements.Defining_Names.Defining_Name_Access; Actual_Part : Gela.Elements.Generic_Associations. Generic_Association_Sequence_Access; Associations : Gela.Interpretations.Interpretation_Tuple_Index; Result : out Gela.Interpretations.Interpretation_Index) is pragma Unreferenced (Env); function Hash (Value : Gela.Lexical_Types.Symbol) return Ada.Containers.Hash_Type is (Ada.Containers.Hash_Type (Value)); type Name_Index is new Positive; package Symbol_To_Name_Index_Maps is new Ada.Containers.Hashed_Maps (Key_Type => Gela.Lexical_Types.Symbol, Element_Type => Name_Index, Hash => Hash, Equivalent_Keys => Gela.Lexical_Types."="); package Name_Vectors is new Ada.Containers.Vectors (Index_Type => Name_Index, Element_Type => Gela.Elements.Defining_Names.Defining_Name_Access, "=" => Gela.Elements.Defining_Names."="); type Formal_Defining_Names is record Names : Name_Vectors.Vector; Map : Symbol_To_Name_Index_Maps.Map; end record; procedure Resolve_Formal (Formal : Formal_Defining_Names; Value : Gela.Interpretations.Interpretation_Set_Index; Name : out Gela.Elements.Defining_Names.Defining_Name_Access); IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; package Visiters is type Visiter is new Gela.Element_Visiters.Visiter with record Formal : Formal_Defining_Names; end record; overriding procedure Formal_Object_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Formal_Object_Declarations. Formal_Object_Declaration_Access); overriding procedure Formal_Type_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Formal_Type_Declarations. Formal_Type_Declaration_Access); overriding procedure Generic_Package_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Generic_Package_Declarations. Generic_Package_Declaration_Access); end Visiters; package body Visiters is overriding procedure Formal_Object_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Formal_Object_Declarations. Formal_Object_Declaration_Access) is List : constant Gela.Elements.Defining_Identifiers. Defining_Identifier_Sequence_Access := Node.Names; Item : Gela.Elements.Defining_Names.Defining_Name_Access; Cursor : Gela.Elements.Defining_Identifiers. Defining_Identifier_Sequence_Cursor := List.First; begin while Cursor.Has_Element loop Item := Gela.Elements.Defining_Names.Defining_Name_Access (Cursor.Element); Self.Formal.Names.Append (Item); Self.Formal.Map.Include (Item.Full_Name, Self.Formal.Names.Last_Index); Cursor.Next; end loop; end Formal_Object_Declaration; ----------------------------- -- Formal_Type_Declaration -- ----------------------------- overriding procedure Formal_Type_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Formal_Type_Declarations. Formal_Type_Declaration_Access) is Name : constant Gela.Elements.Defining_Identifiers. Defining_Identifier_Access := Node.Names; Item : constant Gela.Elements.Defining_Names.Defining_Name_Access := Gela.Elements.Defining_Names.Defining_Name_Access (Name); begin Self.Formal.Names.Append (Item); Self.Formal.Map.Include (Item.Full_Name, Self.Formal.Names.Last_Index); end Formal_Type_Declaration; --------------------------------- -- Generic_Package_Declaration -- --------------------------------- overriding procedure Generic_Package_Declaration (Self : in out Visiter; Node : not null Gela.Elements.Generic_Package_Declarations. Generic_Package_Declaration_Access) is Formal_Part : constant Gela.Elements.Generic_Formals. Generic_Formal_Sequence_Access := Node.Generic_Formal_Part; Cursor : Gela.Elements.Generic_Formals. Generic_Formal_Sequence_Cursor := Formal_Part.First; Element : Gela.Elements.Generic_Formals.Generic_Formal_Access; begin while Cursor.Has_Element loop Element := Cursor.Element; Element.Visit (Self); Cursor.Next; end loop; end Generic_Package_Declaration; end Visiters; -------------------- -- Resolve_Formal -- -------------------- procedure Resolve_Formal (Formal : Formal_Defining_Names; Value : Gela.Interpretations.Interpretation_Set_Index; Name : out Gela.Elements.Defining_Names.Defining_Name_Access) is begin Result := 0; for J in IM.Symbols (Value) loop declare Found : constant Symbol_To_Name_Index_Maps.Cursor := Formal.Map.Find (J.Symbol); begin if Symbol_To_Name_Index_Maps.Has_Element (Found) then Name := Formal.Names (Symbol_To_Name_Index_Maps.Element (Found)); end if; end; end loop; end Resolve_Formal; Visitor : Visiters.Visiter; Tuples : constant Gela.Interpretations.Interpretation_Set_Index_Array := IM.Get_Tuple (Associations); Name : Gela.Elements.Defining_Names.Defining_Name_Access; Formal : Gela.Interpretations.Interpretation_Index_Array (Tuples'Range) := (others => 0); Chosen : Gela.Interpretations.Interpretation_Index; Element : Gela.Elements.Defining_Names.Defining_Name_Access; Cursor : Gela.Elements.Generic_Associations .Generic_Association_Sequence_Cursor := Actual_Part.First; begin if not Generic_Name.Assigned or not Instance.Assigned then Result := 0; return; end if; -- Collect defining names of formal declarations in the instance Instance.Visit (Visitor); for J in Tuples'Range loop Resolve_Formal (Visitor.Formal, Tuples (J), Name); if Name.Assigned then Name.Set_Corresponding_View (Gela.Elements.Element_Access (Cursor.Element.Actual_Parameter)); Element := Gela.Elements.Defining_Names.Defining_Name_Access (Name.Corresponding_Generic_Element); IM.Get_Defining_Name_Index (Element, Formal (J)); end if; Cursor.Next; end loop; Chosen := 0; for K in reverse Formal'Range loop IM.Get_Tuple_Index (Formal (K), Chosen, Chosen); end loop; Result := Chosen; end Generic_Association_List; ----------------- -- Get_Subtype -- ----------------- procedure Get_Subtype (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Set : Gela.Interpretations.Interpretation_Set_Index; Index : out Gela.Interpretations.Interpretation_Index; Result : out Gela.Semantic_Types.Type_View_Index) is IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; begin Index := 0; Result := 0; for J in IM.Defining_Names (Set) loop Result := TM.Type_By_Name (Env, J.Defining_Name); Index := J.Get_Index; end loop; end Get_Subtype; -------------------- -- Interpretation -- -------------------- procedure Interpretation (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Set : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is pragma Unreferenced (Env); IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; begin Result := 0; for J in IM.Each (Set) loop if not J.Is_Symbol then Result := J.Get_Index; end if; end loop; end Interpretation; --------------------- -- Membership_Test -- --------------------- procedure Membership_Test (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Left : Gela.Interpretations.Interpretation_Set_Index; Right : Gela.Interpretations.Interpretation_Set_Index; Set : out Gela.Interpretations.Interpretation_Set_Index) is IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; use type Gela.Interpretations.Interpretation_Index_Array; begin Set := 0; for R in Each.Expression (IM, TM, Env, Right) loop declare Right_Type : constant Gela.Types.Type_View_Access := TM.Get (R.Expression_Type); begin for L in Each.Expression (IM, TM, Env, Left) loop declare Left_Type : constant Gela.Types.Type_View_Access := TM.Get (L.Expression_Type); begin if Left_Type.Is_Expected_Type (Expected => Right_Type) then Comp.Context.Interpretation_Manager.Add_Expression (Tipe => TM.Boolean, Down => L.Get_Index & R.Get_Index, Result => Set); end if; end; end loop; end; end loop; end Membership_Test; --------------------- -- Numeric_Literal -- --------------------- procedure Numeric_Literal (Comp : Gela.Compilations.Compilation_Access; Token : Gela.Lexical_Types.Token_Count; Result : out Gela.Interpretations.Interpretation_Set_Index) is Value : constant Gela.Lexical_Types.Token := Comp.Get_Token (Token); Type_Index : Gela.Semantic_Types.Type_View_Index; begin Result := 0; if Comp.Source.Index (Value.First, Value.Last, '.') = 0 then Type_Index := Comp.Context.Types.Universal_Integer; else Type_Index := Comp.Context.Types.Universal_Real; end if; Comp.Context.Interpretation_Manager.Add_Expression (Tipe => Type_Index, Down => (1 .. 0 => 0), Result => Result); end Numeric_Literal; ----------------- -- Placeholder -- ----------------- function Placeholder (Comp : Gela.Compilations.Compilation_Access) return Gela.Interpretations.Interpretation_Set_Index is Result : Gela.Interpretations.Interpretation_Set_Index := 0; begin Comp.Context.Interpretation_Manager.Add_Placeholder (Kind => Gela.Interpretations.Absent, Result => Result); return Result; end Placeholder; --------------- -- Real_Type -- --------------- procedure Real_Type (Comp : Gela.Compilations.Compilation_Access; Up : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; begin To_Type_Category (Comp, Up, TM.Universal_Real, Result); end Real_Type; ---------------------- -- Record_Aggregate -- ---------------------- procedure Record_Aggregate (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Up : Gela.Interpretations.Interpretation_Index; Tuple : Gela.Interpretations.Interpretation_Tuple_List_Index; Result : out Gela.Interpretations.Interpretation_Index) is package Each is type Visiter is new Gela.Interpretations.Down_Visiter with record Result : Gela.Interpretations.Interpretation_Index := 0; end record; overriding procedure On_Expression (Self : in out Visiter; Tipe : Gela.Semantic_Types.Type_View_Index; Kind : Gela.Interpretations.Unknown_Auxiliary_Apply_Kinds; Down : Gela.Interpretations.Interpretation_Index_Array); end Each; IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; package body Each is overriding procedure On_Expression (Self : in out Visiter; Tipe : Gela.Semantic_Types.Type_View_Index; Kind : Gela.Interpretations.Unknown_Auxiliary_Apply_Kinds; Down : Gela.Interpretations.Interpretation_Index_Array) is pragma Unreferenced (Down, Kind); View : constant Gela.Types.Type_View_Access := TM.Get (Tipe); Tuples : constant Gela.Interpretations .Interpretation_Tuple_Index_Array := IM.Get_Tuple_List (Tuple); Output : Gela.Interpretations.Interpretation_Index_Array (Tuples'Range); Comp_Type : Gela.Types.Type_View_Access; begin if View.Assigned and then View.Is_Array then declare Arr : constant Gela.Types.Arrays.Array_Type_Access := Gela.Types.Arrays.Array_Type_Access (View); begin Comp_Type := Arr.Component_Type; end; elsif not View.Is_Record then return; end if; for J in Tuples'Range loop declare Exp : Gela.Types.Type_View_Access; Chosen : Gela.Interpretations.Interpretation_Index := 0; Value : constant Gela.Interpretations .Interpretation_Set_Index_Array := IM.Get_Tuple (Tuples (J)); List : Gela.Interpretations.Interpretation_Index_Array (Value'Range); begin for K in 2 .. Value'Last loop declare Name : Gela.Interpretations.Interpretation_Index := 0; Component : Gela.Elements.Defining_Names. Defining_Name_Access; begin for S in IM.Symbols (Value (K)) loop if View.Is_Record then Component := Gela.Types.Untagged_Records. Untagged_Record_Type_Access (View). Get_Component (S.Symbol); end if; if Component.Assigned then IM.Get_Defining_Name_Index (Component, Name); Exp := TM.Get (TM.Type_Of_Object_Declaration (Env, Component.Enclosing_Element)); end if; end loop; List (K) := Name; end; end loop; if View.Is_Record then Comp_Type := Exp; end if; To_Type (Comp => Comp, Env => Env, Type_Up => Comp_Type, Expr_Up => Value (Value'First), Result => List (List'First)); Chosen := 0; for K in reverse List'Range loop IM.Get_Tuple_Index (List (K), Chosen, Chosen); end loop; Output (J) := Chosen; end; end loop; for J in reverse Output'Range loop IM.Get_Tuple_Index (Output (J), Self.Result, Self.Result); end loop; end On_Expression; end Each; V : Each.Visiter; begin IM.Visit (Up, V); Result := V.Result; end Record_Aggregate; -------------------- -- Record_Matcher -- -------------------- function Record_Matcher return not null Gela.Interpretations.Type_Matcher_Access is Result : constant Type_Matchers.Type_Matcher_Access := new Type_Matchers.Record_Type_Matcher; begin return Gela.Interpretations.Type_Matcher_Access (Result); end Record_Matcher; ------------------------ -- Selected_Component -- ------------------------ procedure Selected_Component (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Prefix : Gela.Interpretations.Interpretation_Set_Index; Symbol : Gela.Lexical_Types.Symbol; Set : out Gela.Interpretations.Interpretation_Set_Index) is IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; ES : constant Gela.Environments.Environment_Set_Access := Comp.Context.Environment_Set; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; Is_Expanded_Name : Boolean := False; begin Set := 0; for Cursor in IM.Defining_Names (Prefix) loop declare Found : aliased Boolean := False; NC : Gela.Defining_Name_Cursors.Defining_Name_Cursor'Class := ES.Visible (Env, Cursor.Defining_Name, Symbol, Found'Access); begin if Found then -- ARM 4.1.3(4) Is_Expanded_Name := True; while NC.Has_Element loop IM.Add_Defining_Name (Name => NC.Element, Down => (1 => Cursor.Get_Index), Result => Set); NC.Next; end loop; end if; end; end loop; if not Is_Expanded_Name then for J in Each.Prefix (IM, TM, Env, Prefix) loop declare package Type_Visiters is type Type_Visitor is new Gela.Types.Visitors.Type_Visitor with null record; overriding procedure Untagged_Record (Self : in out Type_Visitor; Value : not null Gela.Types.Untagged_Records .Untagged_Record_Type_Access); end Type_Visiters; package body Type_Visiters is overriding procedure Untagged_Record (Self : in out Type_Visitor; Value : not null Gela.Types.Untagged_Records .Untagged_Record_Type_Access) is pragma Unreferenced (Self); Name : Gela.Elements.Defining_Names.Defining_Name_Access; begin Name := Value.Get_Component (Symbol); if Name.Assigned then IM.Add_Defining_Name (Name => Name, Down => (1 => J.Get_Index), Result => Set); end if; end Untagged_Record; end Type_Visiters; Type_View : constant Gela.Types.Type_View_Access := TM.Get (J.Expression_Type); Visiter : Type_Visiters.Type_Visitor; begin Type_View.Visit_If_Assigned (Visiter); end; end loop; end if; end Selected_Component; ---------------------- -- Shall_Be_Subtype -- ---------------------- procedure Shall_Be_Subtype (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Set : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is Type_Index : Gela.Semantic_Types.Type_View_Index; begin Get_Subtype (Comp, Env => Env, Set => Set, Index => Result, Result => Type_Index); end Shall_Be_Subtype; ------------------------- -- Signed_Integer_Type -- ------------------------- procedure Signed_Integer_Type (Comp : Gela.Compilations.Compilation_Access; Up : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; begin To_Type_Category (Comp, Up, TM.Universal_Integer, Result); end Signed_Integer_Type; ----------------------------- -- Simple_Expression_Range -- ----------------------------- procedure Simple_Expression_Range (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Left : Gela.Interpretations.Interpretation_Set_Index; Right : Gela.Interpretations.Interpretation_Set_Index; Set : out Gela.Interpretations.Interpretation_Set_Index) is type Counter is record Count : Natural := 0; Index : Gela.Interpretations.Interpretation_Index; end record; type Type_Kind is (Integer, Float); type Counter_By_Type is array (Type_Kind) of Counter; procedure Increment (Value : in out Counter_By_Type; Index : Gela.Interpretations.Interpretation_Index; Tipe : Type_Kind); procedure Increment (L_Val : in out Counter_By_Type; R_Val : in out Counter_By_Type; Index : Gela.Interpretations.Interpretation_Index; Count : Counter_By_Type; Tipe : Type_Kind); IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; --------------- -- Increment -- --------------- procedure Increment (Value : in out Counter_By_Type; Index : Gela.Interpretations.Interpretation_Index; Tipe : Type_Kind) is begin Value (Tipe).Count := Value (Tipe).Count + 1; Value (Tipe).Index := Index; end Increment; --------------- -- Increment -- --------------- procedure Increment (L_Val : in out Counter_By_Type; R_Val : in out Counter_By_Type; Index : Gela.Interpretations.Interpretation_Index; Count : Counter_By_Type; Tipe : Type_Kind) is begin Increment (L_Val, Index, Tipe); R_Val (Tipe) := Count (Tipe); end Increment; L_Val : Counter_By_Type; R_Val : Counter_By_Type; begin Set := 0; for L in Each.Expression (IM, TM, Env, Left) loop declare L_Tipe : constant Gela.Semantic_Types.Type_View_Index := L.Expression_Type; L_Type_View : constant Gela.Types.Type_View_Access := TM.Get (L_Tipe); begin if not L_Type_View.Assigned then return; end if; for R in Each.Expression (IM, TM, Env, Right) loop declare Chosen : Gela.Semantic_Types.Type_View_Index; Type_View : constant Gela.Types.Type_View_Access := TM.Get (R.Expression_Type); begin if not Type_View.Assigned then return; else -- FIXME Return after implementation of types null; end if; if Type_View.Is_Expected_Type (L_Type_View) then if Type_View.Is_Universal and then Type_View.Is_Numeric then Chosen := L_Tipe; else Chosen := R.Expression_Type; end if; Comp.Context.Interpretation_Manager.Add_Expression (Tipe => Chosen, Down => (L.Get_Index, R.Get_Index), Result => Set); end if; end; end loop; for R in IM.Categories (Right) loop declare Match : constant Gela.Interpretations.Type_Matcher_Access := R.Matcher; begin L_Type_View.Visit (Match.all); if Match.Is_Matched then Comp.Context.Interpretation_Manager.Add_Expression (Tipe => L_Tipe, Down => (L.Get_Index, R.Get_Index), Result => Set); end if; end; end loop; end; end loop; for L in IM.Categories (Left) loop for R in Each.Expression (IM, TM, Env, Right) loop declare Match : constant Gela.Interpretations.Type_Matcher_Access := L.Matcher; Type_View : constant Gela.Types.Type_View_Access := TM.Get (R.Expression_Type); begin Type_View.Visit (Match.all); if Match.Is_Matched then Comp.Context.Interpretation_Manager.Add_Expression (Tipe => R.Expression_Type, Down => (L.Get_Index, R.Get_Index), Result => Set); end if; end; end loop; end loop; for L in Each.Prefer_Root (IM, TM, Env, Left) loop declare R_Counters : Counter_By_Type; L_Type_View : constant Gela.Types.Type_View_Access := TM.Get (L.Expression_Type); begin for R in Each.Prefer_Root (IM, TM, Env, Right) loop declare Type_View : constant Gela.Types.Type_View_Access := TM.Get (R.Expression_Type); begin if Type_View.Is_Integer then Increment (R_Counters, R.Get_Index, Integer); elsif Type_View.Is_Real then Increment (R_Counters, R.Get_Index, Float); else -- FIXME Return after implementation of types null; end if; end; end loop; if L_Type_View.Is_Integer then Increment (L_Val, R_Val, L.Get_Index, R_Counters, Integer); elsif L_Type_View.Is_Real then Increment (L_Val, R_Val, L.Get_Index, R_Counters, Float); else -- FIXME Drop after implementation of types null; end if; end; end loop; if L_Val (Integer).Count = 1 and R_Val (Integer).Count = 1 then declare Matcher : constant Type_Matchers.Type_Matcher_Access := new Type_Matchers.Integer_Type_Matcher; begin Comp.Context.Interpretation_Manager.Add_Expression_Category (Match => Gela.Interpretations.Type_Matcher_Access (Matcher), Down => (L_Val (Integer).Index, R_Val (Integer).Index), Result => Set); end; end if; if L_Val (Float).Count = 1 and R_Val (Float).Count = 1 then declare Matcher : constant Type_Matchers.Type_Matcher_Access := new Type_Matchers.Float_Type_Matcher; begin Comp.Context.Interpretation_Manager.Add_Expression_Category (Match => Gela.Interpretations.Type_Matcher_Access (Matcher), Down => (L_Val (Float).Index, R_Val (Float).Index), Result => Set); end; end if; end Simple_Expression_Range; -------------------- -- Discrete_Range -- -------------------- procedure Discrete_Range (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Left : Gela.Interpretations.Interpretation_Set_Index; Right : Gela.Interpretations.Interpretation_Set_Index; Down_Left : out Gela.Interpretations.Interpretation_Index; Down_Right : out Gela.Interpretations.Interpretation_Index; Tipe : out Gela.Semantic_Types.Type_View_Index) is IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; L_Count : Natural := 0; begin for L in Each.Prefer_Root (IM, TM, Env, Left) loop declare L_Tipe : constant Gela.Semantic_Types.Type_View_Index := L.Expression_Type; L_Type_View : constant Gela.Types.Type_View_Access := TM.Get (L_Tipe); R_Count : Natural := 0; begin if L_Type_View.Assigned and then L_Type_View.Is_Discrete then for R in Each.Prefer_Root (IM, TM, Env, Right) loop declare use type Gela.Semantic_Types.Type_View_Index; R_Tipe : constant Gela.Semantic_Types.Type_View_Index := R.Expression_Type; Type_View : constant Gela.Types.Type_View_Access := TM.Get (R_Tipe); begin if not Type_View.Assigned or else not Type_View.Is_Discrete then null; elsif not Type_View.Is_Universal then if L_Type_View.Is_Expected_Type (Type_View) then Tipe := R_Tipe; R_Count := R_Count + 1; Down_Right := R.Get_Index; end if; elsif L_Type_View.Is_Universal then if Type_View.Is_Expected_Type (L_Type_View) then Tipe := L_Tipe; R_Count := R_Count + 1; Down_Right := R.Get_Index; end if; elsif R_Tipe = L_Tipe and Type_View.Is_Integer then Tipe := TM.Universal_Integer; -- FIXME Root_Int R_Count := R_Count + 1; Down_Right := R.Get_Index; else null; end if; end; end loop; -- FIXME .Is_Discrete if R_Count > 0 then L_Count := L_Count + R_Count; Down_Left := L.Get_Index; end if; end if; end; end loop; if L_Count /= 1 then Down_Left := 0; Down_Right := 0; Tipe := 0; end if; end Discrete_Range; -------------------- -- Discrete_Range -- -------------------- procedure Discrete_Range (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Left : Gela.Interpretations.Interpretation_Set_Index; Right : Gela.Interpretations.Interpretation_Set_Index; Tipe : out Gela.Semantic_Types.Type_View_Index) is Ignore_Left : Gela.Interpretations.Interpretation_Index; Ignore_Right : Gela.Interpretations.Interpretation_Index; begin Discrete_Range (Comp => Comp, Env => Env, Left => Left, Right => Right, Tipe => Tipe, Down_Left => Ignore_Left, Down_Right => Ignore_Right); end Discrete_Range; -------------------------- -- Discrete_Range_Lower -- -------------------------- procedure Discrete_Range_Lower (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Left : Gela.Interpretations.Interpretation_Set_Index; Right : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is Ignore_Tipe : Gela.Semantic_Types.Type_View_Index; Ignore_Right : Gela.Interpretations.Interpretation_Index; begin Discrete_Range (Comp => Comp, Env => Env, Left => Left, Right => Right, Tipe => Ignore_Tipe, Down_Left => Result, Down_Right => Ignore_Right); end Discrete_Range_Lower; -------------------------- -- Discrete_Range_Upper -- -------------------------- procedure Discrete_Range_Upper (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Left : Gela.Interpretations.Interpretation_Set_Index; Right : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is Ignore_Tipe : Gela.Semantic_Types.Type_View_Index; Ignore_Left : Gela.Interpretations.Interpretation_Index; begin Discrete_Range (Comp => Comp, Env => Env, Left => Left, Right => Right, Tipe => Ignore_Tipe, Down_Left => Ignore_Left, Down_Right => Result); end Discrete_Range_Upper; -------------------- -- String_Literal -- -------------------- procedure String_Literal (Comp : Gela.Compilations.Compilation_Access; Token : Gela.Lexical_Types.Token_Count; Result : out Gela.Interpretations.Interpretation_Set_Index) is pragma Unreferenced (Token); Matcher : constant Type_Matchers.Type_Matcher_Access := new Type_Matchers.String_Type_Matcher; begin Result := 0; Comp.Context.Interpretation_Manager.Add_Expression_Category (Match => Gela.Interpretations.Type_Matcher_Access (Matcher), Down => (1 .. 0 => 0), Result => Result); end String_Literal; ---------------------- -- To_The_Same_Type -- ---------------------- procedure To_The_Same_Type (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Type_Up : Gela.Interpretations.Interpretation_Set_Index; Expr_Up : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; begin Result := 0; for J in Each.Expression (IM, TM, Env, Type_Up) loop To_Type (Comp => Comp, Env => Env, Type_Up => TM.Get (J.Expression_Type), Expr_Up => Expr_Up, Result => Result); exit; end loop; end To_The_Same_Type; ------------- -- To_Type -- ------------- procedure To_Type (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Type_Up : Gela.Interpretations.Interpretation_Set_Index; Expr_Up : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; Index : Gela.Interpretations.Interpretation_Index; Type_Index : Gela.Semantic_Types.Type_View_Index; begin Get_Subtype (Comp, Env => Env, Set => Type_Up, Index => Index, Result => Type_Index); To_Type (Comp => Comp, Env => Env, Type_Up => TM.Get (Type_Index), Expr_Up => Expr_Up, Result => Result); end To_Type; ------------- -- To_Type -- ------------- procedure To_Type (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Type_Up : access Gela.Types.Type_View'Class; Expr_Up : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is pragma Unreferenced (Env); IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; begin Result := 0; if not Type_Up.Assigned then return; end if; for J in IM.Each (Expr_Up) loop if J.Is_Defining_Name then Result := J.Get_Index; -- ??? elsif J.Is_Expression then declare This_Type : constant Gela.Types.Type_View_Access := TM.Get (J.Expression_Type); begin if This_Type.Assigned and then This_Type.Is_Expected_Type (Type_Up) then Result := J.Get_Index; end if; end; elsif J.Is_Expression_Category then declare use type Gela.Interpretations.Interpretation_Index; Match : constant Gela.Interpretations.Type_Matcher_Access := J.Matcher; begin Type_Up.Visit (Match.all); if Match.Is_Matched and Result = 0 then IM.Get_Expression_Index (Tipe => Type_Up.Type_View_Index, Result => Result); end if; end; end if; end loop; end To_Type; ---------------------- -- To_Type_Category -- ---------------------- procedure To_Type_Category (Comp : Gela.Compilations.Compilation_Access; Up : Gela.Interpretations.Interpretation_Set_Index; Tipe : Gela.Semantic_Types.Type_View_Index; Result : out Gela.Interpretations.Interpretation_Index) is TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; View : constant Gela.Types.Type_View_Access := TM.Get (Tipe); IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; Matcher : Gela.Interpretations.Type_Matcher_Access; begin Result := 0; for J in IM.Categories (Up) loop Matcher := J.Matcher; View.Visit (Matcher.all); if Matcher.Is_Matched then Result := J.Get_Index; end if; end loop; end To_Type_Category; ------------------------------ -- To_Type_Or_The_Same_Type -- ------------------------------ procedure To_Type_Or_The_Same_Type (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Type_Up : Gela.Interpretations.Interpretation_Set_Index; Expr_Up : Gela.Interpretations.Interpretation_Set_Index; Result : out Gela.Interpretations.Interpretation_Index) is use type Gela.Semantic_Types.Type_View_Index; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; Index : Gela.Interpretations.Interpretation_Index; Type_Index : Gela.Semantic_Types.Type_View_Index; begin Get_Subtype (Comp, Env => Env, Set => Type_Up, Index => Index, Result => Type_Index); if Type_Index = 0 then To_The_Same_Type (Comp => Comp, Env => Env, Type_Up => Type_Up, Expr_Up => Expr_Up, Result => Result); else To_Type (Comp => Comp, Env => Env, Type_Up => TM.Get (Type_Index), Expr_Up => Expr_Up, Result => Result); end if; end To_Type_Or_The_Same_Type; ------------------ -- Variant_Part -- ------------------ procedure Variant_Part (Comp : Gela.Compilations.Compilation_Access; Env : Gela.Semantic_Types.Env_Index; Name_Up : Gela.Interpretations.Interpretation_Set_Index; Variants : Gela.Interpretations.Interpretation_Tuple_List_Index; Result : out Gela.Interpretations.Interpretation_Index) is IM : constant Gela.Interpretations.Interpretation_Manager_Access := Comp.Context.Interpretation_Manager; TM : constant Gela.Type_Managers.Type_Manager_Access := Comp.Context.Types; Tuples : constant Gela.Interpretations.Interpretation_Tuple_Index_Array := IM.Get_Tuple_List (Variants); Output : Gela.Interpretations.Interpretation_Index_Array (Tuples'Range); Chosen : Gela.Interpretations.Interpretation_Index := 0; begin Result := 0; for E in Each.Expression (IM, TM, Env, Name_Up) loop for J in Tuples'Range loop declare Tuple : constant Gela.Interpretations .Interpretation_Set_Index_Array := IM.Get_Tuple (Tuples (J)); List : Gela.Interpretations.Interpretation_Index_Array (Tuple'Range); begin for K in Tuple'Range loop To_Type (Comp => Comp, Env => Env, Type_Up => TM.Get (E.Expression_Type), Expr_Up => Tuple (K), Result => List (K)); end loop; Chosen := 0; for K in reverse List'Range loop IM.Get_Tuple_Index (List (K), Chosen, Chosen); end loop; Output (J) := Chosen; end; end loop; Chosen := 0; for J in reverse Output'Range loop IM.Get_Tuple_Index (Output (J), Chosen, Chosen); end loop; Result := Chosen; exit; end loop; end Variant_Part; end Gela.Resolve;
MinimSecure/unum-sdk
Ada
1,823
ads
-- Copyright 2012-2019 Free Software Foundation, Inc. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. package Ops is type Int is private; function Make (X: Natural) return Int; function "+" (I1, I2 : Int) return Int; function "-" (I1, I2 : Int) return Int; function "*" (I1, I2 : Int) return Int; function "/" (I1, I2 : Int) return Int; function "mod" (I1, I2 : Int) return Int; function "rem" (I1, I2 : Int) return Int; function "**" (I1, I2 : Int) return Int; function "<" (I1, I2 : Int) return Boolean; function "<=" (I1, I2 : Int) return Boolean; function ">" (I1, I2 : Int) return Boolean; function ">=" (I1, I2 : Int) return Boolean; function "=" (I1, I2 : Int) return Boolean; function "and" (I1, I2 : Int) return Int; function "or" (I1, I2 : Int) return Int; function "xor" (I1, I2 : Int) return Int; function "&" (I1, I2 : Int) return Int; function "abs" (I1 : Int) return Int; function "not" (I1 : Int) return Int; function "+" (I1 : Int) return Int; function "-" (I1 : Int) return Int; procedure Dummy (B1 : Boolean); procedure Dummy (I1 : Int); private type IntRep is mod 2**31; type Int is new IntRep; end Ops;
GauBen/Arbre-Genealogique
Ada
5,092
adb
package body Arbre_Genealogique is procedure Initialiser (Arbre : out T_Arbre_Genealogique) is begin Initialiser (Arbre.Registre); Initialiser (Arbre.Graphe); Arbre.Auto_Increment := 1; end Initialiser; procedure Detruire (Arbre : in out T_Arbre_Genealogique) is begin Detruire (Arbre.Registre); Detruire (Arbre.Graphe); end Detruire; procedure Ajouter_Personne (Arbre : in out T_Arbre_Genealogique; Personne : in T_Personne; Cle : out Integer) is begin Cle := Arbre.Auto_Increment; Attribuer (Arbre.Registre, Cle, Personne); Ajouter_Sommet (Arbre.Graphe, Cle); Arbre.Auto_Increment := Arbre.Auto_Increment + 1; end Ajouter_Personne; function Lire_Registre (Arbre : T_Arbre_Genealogique; Cle : Integer) return T_Personne is begin return Acceder (Arbre.Registre, Cle); end Lire_Registre; procedure Ajouter_Relation (Arbre : in out T_Arbre_Genealogique; Personne_Origine : in T_Etiquette_Sommet; Relation : in T_Etiquette_Arete; Personne_Destination : in T_Etiquette_Sommet) is Chaine : T_Liste_Adjacence; Arete : T_Arete_Etiquetee; begin if Personne_Destination = Personne_Origine then raise Relation_Existante; end if; Chaine_Adjacence (Chaine, Arbre.Graphe, Personne_Origine); while Adjacence_Non_Vide (Chaine) loop Arete_Suivante (Chaine, Arete); if Arete.Destination = Personne_Destination then raise Relation_Existante; end if; end loop; case Relation is when A_Pour_Parent => Ajouter_Arete (Arbre.Graphe, Personne_Origine, A_Pour_Parent, Personne_Destination); Ajouter_Arete (Arbre.Graphe, Personne_Destination, A_Pour_Enfant, Personne_Origine); when A_Pour_Enfant => Ajouter_Arete (Arbre.Graphe, Personne_Origine, A_Pour_Enfant, Personne_Destination); Ajouter_Arete (Arbre.Graphe, Personne_Destination, A_Pour_Parent, Personne_Origine); when others => Ajouter_Arete (Arbre.Graphe, Personne_Origine, Relation, Personne_Destination); Ajouter_Arete (Arbre.Graphe, Personne_Destination, Relation, Personne_Origine); end case; end Ajouter_Relation; procedure Liste_Relations (Adjacence : out T_Liste_Relations; Arbre : in T_Arbre_Genealogique; Origine : in T_Etiquette_Sommet) is begin Chaine_Adjacence (Adjacence, Arbre.Graphe, Origine); end Liste_Relations; function Liste_Non_Vide (Adjacence : T_Liste_Relations) return Boolean is begin return Adjacence_Non_Vide (Adjacence); end Liste_Non_Vide; procedure Relation_Suivante (Adjacence : in out T_Liste_Relations; Arete : out T_Arete_Etiquetee) is begin Arete_Suivante (Adjacence, Arete); end Relation_Suivante; procedure Supprimer_Relation (Arbre : in out T_Arbre_Genealogique; Personne_Origine : in T_Etiquette_Sommet; Relation : in T_Etiquette_Arete; Personne_Destination : in T_Etiquette_Sommet) is begin case Relation is when A_Pour_Parent => Supprimer_Arete (Arbre.Graphe, Personne_Origine, A_Pour_Parent, Personne_Destination); Supprimer_Arete (Arbre.Graphe, Personne_Destination, A_Pour_Enfant, Personne_Origine); when A_Pour_Enfant => Supprimer_Arete (Arbre.Graphe, Personne_Origine, A_Pour_Enfant, Personne_Destination); Supprimer_Arete (Arbre.Graphe, Personne_Destination, A_Pour_Parent, Personne_Origine); when others => Supprimer_Arete (Arbre.Graphe, Personne_Origine, Relation, Personne_Destination); Supprimer_Arete (Arbre.Graphe, Personne_Destination, Relation, Personne_Origine); end case; end Supprimer_Relation; procedure Attribuer_Registre (Arbre : in out T_Arbre_Genealogique; Cle : in Integer; Element : in T_Personne) is begin Attribuer (Arbre.Registre, Cle, Element); end Attribuer_Registre; function Existe_Registre (Arbre : T_Arbre_Genealogique; Cle : Integer) return Boolean is begin return Existe (Arbre.Registre, Cle); end Existe_Registre; procedure Appliquer_Sur_Registre (Arbre : in out T_Arbre_Genealogique) is procedure Appliquer is new Appliquer_Sur_Tous (P); begin Appliquer (Arbre.Registre); end Appliquer_Sur_Registre; procedure Appliquer_Sur_Graphe (Arbre : in out T_Arbre_Genealogique) is procedure Appliquer is new Appliquer_Sur_Tous_Sommets (P); begin Appliquer (Arbre.Graphe); end Appliquer_Sur_Graphe; end Arbre_Genealogique;
97kovacspeter/ADA
Ada
131
ads
package Card_Dir is type Cardinal_Direction is (N, NE, E, SE, S, SW, W, NW); --enumerator for cardinal directions end Card_Dir;
AdaCore/training_material
Ada
2,878
ads
----------------------------------------------------------------------- -- Ada Labs -- -- -- -- Copyright (C) 2008-2009, AdaCore -- -- -- -- Labs is free software; you can redistribute it and/or modify it -- -- under the terms of the GNU General Public License as published by -- -- the Free Software Foundation; either version 2 of the License, or -- -- (at your option) any later version. -- -- -- -- This program is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -- -- General Public License for more details. You should have received -- -- a copy of the GNU General Public License along with this program; -- -- if not, write to the Free Software Foundation, Inc., 59 Temple -- -- Place - Suite 330, Boston, MA 02111-1307, USA. -- ----------------------------------------------------------------------- with Display; use Display; with Display.Basic; use Display.Basic; package Solar_System is -- define type Bodies_Enum as an enumeration of Sun, Earth, Moon, Satellite type Bodies_Enum_T is (Sun, Earth, Moon, Satellite, Comet, Black_Hole, Asteroid_1, Asteroid_2); type Body_T is private; type Body_Access_T is access all Body_T; type Bodies_Array_T is private; function Get_Body (B : Bodies_Enum_T; Bodies : access Bodies_Array_T) return Body_Access_T; procedure Init_Body (B : Body_Access_T; Radius : Float; Color : RGBA_T; Distance : Float; Angle : Float; Speed : Float; Turns_Around : Body_Access_T; Visible : Boolean := True); procedure Move_All (Bodies : access Bodies_Array_T); private -- define a type Body_Type to store every information about a body -- X, Y, Distance, Speed, Angle, Radius, Color type Body_T is record X : Float := 0.0; Y : Float := 0.0; Distance : Float; Speed : Float; Angle : Float; Radius : Float; Color : RGBA_T; Visible : Boolean := True; Turns_Around : Body_Access_T; end record; pragma Convention (C, Body_T); pragma Pack (Body_T); -- define type Bodies_Array as an array of Body_Type indexed by bodies enumeration type Bodies_Array_T is array (Bodies_Enum_T) of aliased Body_T; procedure Move (Body_To_Move : Body_Access_T); end Solar_System;
persan/a-vulkan
Ada
1,370
ads
pragma Ada_2012; pragma Style_Checks (Off); with System; package Vulkan.Low_Level.vulkan_xcb_h is VULKAN_XCB_H_u : constant := 1; -- vulkan_xcb.h:2 VK_KHR_xcb_surface : constant := 1; -- vulkan_xcb.h:32 VK_KHR_XCB_SURFACE_SPEC_VERSION : constant := 6; -- vulkan_xcb.h:33 VK_KHR_XCB_SURFACE_EXTENSION_NAME : aliased constant String := "VK_KHR_xcb_surface" & ASCII.NUL; -- vulkan_xcb.h:34 --** Copyright (c) 2015-2019 The Khronos Group Inc. --** --** 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. -- --** This header is generated from the Khronos Vulkan XML API Registry. --** -- type VkXcbSurfaceCreateInfoKHR is record pNext : System.Address; -- vulkan_xcb.h:38 end record with Convention => C_Pass_By_Copy; -- vulkan_xcb.h:36 end Vulkan.Low_Level.vulkan_xcb_h;
tum-ei-rcs/StratoX
Ada
3,317
ads
with HAL.Bitmap; package HAL.Framebuffer is subtype FB_Color_Mode is HAL.Bitmap.Bitmap_Color_Mode range HAL.Bitmap.ARGB_8888 .. HAL.Bitmap.AL_88; type Display_Orientation is (Default, Landscape, Portrait); type Wait_Mode is (Polling, Interrupt); type Frame_Buffer_Display is limited interface; type Frame_Buffer_Display_Access is access all Frame_Buffer_Display'Class; function Get_Max_Layers (Display : Frame_Buffer_Display) return Positive is abstract; function Is_Supported (Display : Frame_Buffer_Display; Mode : FB_Color_Mode) return Boolean is abstract; procedure Initialize (Display : in out Frame_Buffer_Display; Orientation : Display_Orientation := Default; Mode : Wait_Mode := Interrupt) is abstract; procedure Set_Orientation (Display : in out Frame_Buffer_Display; Orientation : Display_Orientation) is abstract; procedure Set_Mode (Display : in out Frame_Buffer_Display; Mode : Wait_Mode) is abstract; function Initialized (Display : Frame_Buffer_Display) return Boolean is abstract; function Get_Width (Display : Frame_Buffer_Display) return Positive is abstract; function Get_Height (Display : Frame_Buffer_Display) return Positive is abstract; function Is_Swapped (Display : Frame_Buffer_Display) return Boolean is abstract; -- Whether X/Y coordinates are considered Swapped by the drawing primitives -- This simulates Landscape/Portrait orientation on displays not supporting -- hardware orientation change procedure Set_Background (Display : Frame_Buffer_Display; R, G, B : Byte) is abstract; procedure Initialize_Layer (Display : in out Frame_Buffer_Display; Layer : Positive; Mode : FB_Color_Mode; X : Natural := 0; Y : Natural := 0; Width : Positive := Positive'Last; Height : Positive := Positive'Last) is abstract; -- All layers are double buffered, so an explicit call to Update_Layer -- needs to be performed to actually display the current buffer attached -- to the layer. -- Alloc is called to create the actual buffer. function Initialized (Display : Frame_Buffer_Display; Layer : Positive) return Boolean is abstract; procedure Update_Layer (Display : in out Frame_Buffer_Display; Layer : Positive; Copy_Back : Boolean := False) is abstract; -- Updates the layer so that the hidden buffer is displayed. procedure Update_Layers (Display : in out Frame_Buffer_Display) is abstract; -- Updates all initialized layers at once with their respective hidden -- buffer function Get_Color_Mode (Display : Frame_Buffer_Display; Layer : Positive) return FB_Color_Mode is abstract; -- Retrieves the current color mode for the layer. function Get_Hidden_Buffer (Display : Frame_Buffer_Display; Layer : Positive) return HAL.Bitmap.Bitmap_Buffer'Class is abstract; -- Retrieves the current hidden buffer for the layer. function Get_Pixel_Size (Display : Frame_Buffer_Display; Layer : Positive) return Positive is abstract; -- Retrieves the current hidden buffer for the layer. end HAL.Framebuffer;
joakim-strandberg/wayland_ada_binding
Ada
582
adb
with Wayland_Client; with Ada.Text_IO; -- See section 6.3 at: -- https://jan.newmarch.name/Wayland/ProgrammingClient/ package body Client_Examples.Connect_To_Server is procedure Run is Display : Wayland_Client.Display; begin Display.Connect; if not Display.Is_Connected then Ada.Text_IO.Put_Line ("Can't connect to display"); return; end if; Ada.Text_IO.Put_Line ("Connected to display"); Display.Disconnect; Ada.Text_IO.Put_Line ("Disconnected from display"); end Run; end Client_Examples.Connect_To_Server;
gabemgem/LITEC
Ada
14,764
adb
M:Lab5 F:G$SYSCLK_Init$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$UART0_Init$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$Sys_Init$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$putchar$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$getchar$0$0({2}DF,SC:U),C,0,0,0,0,0 F:G$getchar_nw$0$0({2}DF,SC:U),C,0,0,0,0,0 F:G$lcd_print$0$0({2}DF,SV:S),Z,0,0,0,0,0 S:LLab5.lcd_print$fmt$1$80({3}DG,SC:U),B,1,-5 S:LLab5.lcd_print$len$1$81({1}SC:U),R,0,0,[r6] S:LLab5.lcd_print$i$1$81({1}SC:U),R,0,0,[] S:LLab5.lcd_print$ap$1$81({1}DD,SC:U),R,0,0,[] F:G$lcd_clear$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$read_keypad$0$0({2}DF,SC:U),C,0,0,0,0,0 F:G$kpd_input$0$0({2}DF,SI:U),Z,0,0,0,0,0 F:G$delay_time$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$i2c_start$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$i2c_write$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$i2c_write_and_stop$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$i2c_read$0$0({2}DF,SC:U),Z,0,0,0,0,0 F:G$i2c_read_and_stop$0$0({2}DF,SC:U),Z,0,0,0,0,0 F:G$i2c_write_data$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$i2c_read_data$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$Accel_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$Accel_Init_C$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$main$0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$Port_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$XBR0_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$SMB_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$ADC_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$ADC_Convert$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$PCA_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$Interrupt_Init$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$PCA_ISR$0$0({2}DF,SV:S),Z,0,0,1,9,0 F:G$calibrateAccel$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$read_accels$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$set_servo_PWM$0$0({2}DF,SV:S),Z,0,0,0,0,0 F:G$set_drive_PWM$0$0({2}DF,SV:S),Z,0,0,0,0,0 S:LLab5.getchar$c$1$10({1}SC:U),R,0,0,[] S:LLab5.getchar_nw$c$1$12({1}SC:U),R,0,0,[] S:G$Data2$0$0({3}DA3d,SC:U),E,0,0 S:LLab5.aligned_alloc$size$1$39({2}SI:U),E,0,0 S:LLab5.aligned_alloc$alignment$1$39({2}SI:U),E,0,0 S:LLab5.lcd_clear$NumBytes$1$85({1}SC:U),E,0,0 S:LLab5.lcd_clear$Cmd$1$85({2}DA2d,SC:U),E,0,0 S:LLab5.read_keypad$i$1$86({1}SC:U),R,0,0,[r7] S:LLab5.read_keypad$Data$1$86({2}DA2d,SC:U),E,0,0 S:LLab5.kpd_input$mode$1$88({1}SC:U),R,0,0,[r7] S:LLab5.kpd_input$sum$1$89({2}SI:U),R,0,0,[r5,r6] S:LLab5.kpd_input$key$1$89({1}SC:U),R,0,0,[r3] S:LLab5.kpd_input$i$1$89({1}SC:U),R,0,0,[] S:LLab5.i2c_write_data$start_reg$1$105({1}SC:U),E,0,0 S:LLab5.i2c_write_data$buffer$1$105({3}DG,SC:U),E,0,0 S:LLab5.i2c_write_data$num_bytes$1$105({1}SC:U),E,0,0 S:LLab5.i2c_write_data$addr$1$105({1}SC:U),R,0,0,[r7] S:LLab5.i2c_write_data$i$1$106({1}SC:U),R,0,0,[] S:LLab5.i2c_read_data$start_reg$1$107({1}SC:U),E,0,0 S:LLab5.i2c_read_data$buffer$1$107({3}DG,SC:U),E,0,0 S:LLab5.i2c_read_data$num_bytes$1$107({1}SC:U),E,0,0 S:LLab5.i2c_read_data$addr$1$107({1}SC:U),R,0,0,[r7] S:LLab5.i2c_read_data$j$1$108({1}SC:U),R,0,0,[] S:G$acount$0$0({1}SC:U),E,0,0 S:G$pcount$0$0({1}SC:U),E,0,0 S:G$bcount$0$0({1}SC:U),E,0,0 S:G$moving$0$0({1}SC:U),E,0,0 S:G$print_count$0$0({2}SI:U),E,0,0 S:G$input$0$0({1}SC:U),E,0,0 S:G$Data$0$0({4}DA4d,SC:U),E,0,0 S:G$adc$0$0({1}SC:U),E,0,0 S:G$SERVO_PW$0$0({2}SI:S),E,0,0 S:G$kx$0$0({1}SC:U),E,0,0 S:G$ky$0$0({1}SC:U),E,0,0 S:G$maxslope$0$0({2}SI:S),E,0,0 S:G$gx$0$0({2}SI:S),E,0,0 S:G$gy$0$0({2}SI:S),E,0,0 S:G$offsetx$0$0({2}SI:S),E,0,0 S:G$offsety$0$0({2}SI:S),E,0,0 S:G$ksteering$0$0({4}SF:S),E,0,0 S:G$newReading$0$0({1}SC:U),E,0,0 S:G$buzzOn$0$0({1}SC:U),E,0,0 S:G$DRIVE_PW$0$0({2}SI:S),E,0,0 S:LLab5.calibrateAccel$avg_gx$1$150({2}SI:S),R,0,0,[r6,r7] S:LLab5.calibrateAccel$avg_gy$1$150({2}SI:S),E,0,0 S:LLab5.calibrateAccel$i$1$150({2}SI:U),R,0,0,[] S:LLab5.read_accels$avg_gx$1$156({2}SI:S),E,0,0 S:LLab5.read_accels$avg_gy$1$156({2}SI:S),E,0,0 S:LLab5.read_accels$i$1$156({2}SI:U),R,0,0,[] S:LLab5.read_accels$j$1$156({2}SI:U),R,0,0,[r2,r3] S:LLab5.read_accels$sloc0$1$0({2}SI:U),E,0,0 S:LLab5.lcd_print$text$1$81({80}DA80d,SC:U),F,0,0 S:G$P0$0$0({1}SC:U),I,0,0 S:G$SP$0$0({1}SC:U),I,0,0 S:G$DPL$0$0({1}SC:U),I,0,0 S:G$DPH$0$0({1}SC:U),I,0,0 S:G$P4$0$0({1}SC:U),I,0,0 S:G$P5$0$0({1}SC:U),I,0,0 S:G$P6$0$0({1}SC:U),I,0,0 S:G$PCON$0$0({1}SC:U),I,0,0 S:G$TCON$0$0({1}SC:U),I,0,0 S:G$TMOD$0$0({1}SC:U),I,0,0 S:G$TL0$0$0({1}SC:U),I,0,0 S:G$TL1$0$0({1}SC:U),I,0,0 S:G$TH0$0$0({1}SC:U),I,0,0 S:G$TH1$0$0({1}SC:U),I,0,0 S:G$CKCON$0$0({1}SC:U),I,0,0 S:G$PSCTL$0$0({1}SC:U),I,0,0 S:G$P1$0$0({1}SC:U),I,0,0 S:G$TMR3CN$0$0({1}SC:U),I,0,0 S:G$TMR3RLL$0$0({1}SC:U),I,0,0 S:G$TMR3RLH$0$0({1}SC:U),I,0,0 S:G$TMR3L$0$0({1}SC:U),I,0,0 S:G$TMR3H$0$0({1}SC:U),I,0,0 S:G$P7$0$0({1}SC:U),I,0,0 S:G$SCON$0$0({1}SC:U),I,0,0 S:G$SCON0$0$0({1}SC:U),I,0,0 S:G$SBUF$0$0({1}SC:U),I,0,0 S:G$SBUF0$0$0({1}SC:U),I,0,0 S:G$SPI0CFG$0$0({1}SC:U),I,0,0 S:G$SPI0DAT$0$0({1}SC:U),I,0,0 S:G$ADC1$0$0({1}SC:U),I,0,0 S:G$SPI0CKR$0$0({1}SC:U),I,0,0 S:G$CPT0CN$0$0({1}SC:U),I,0,0 S:G$CPT1CN$0$0({1}SC:U),I,0,0 S:G$P2$0$0({1}SC:U),I,0,0 S:G$EMI0TC$0$0({1}SC:U),I,0,0 S:G$EMI0CF$0$0({1}SC:U),I,0,0 S:G$PRT0CF$0$0({1}SC:U),I,0,0 S:G$P0MDOUT$0$0({1}SC:U),I,0,0 S:G$PRT1CF$0$0({1}SC:U),I,0,0 S:G$P1MDOUT$0$0({1}SC:U),I,0,0 S:G$PRT2CF$0$0({1}SC:U),I,0,0 S:G$P2MDOUT$0$0({1}SC:U),I,0,0 S:G$PRT3CF$0$0({1}SC:U),I,0,0 S:G$P3MDOUT$0$0({1}SC:U),I,0,0 S:G$IE$0$0({1}SC:U),I,0,0 S:G$SADDR0$0$0({1}SC:U),I,0,0 S:G$ADC1CN$0$0({1}SC:U),I,0,0 S:G$ADC1CF$0$0({1}SC:U),I,0,0 S:G$AMX1SL$0$0({1}SC:U),I,0,0 S:G$P3IF$0$0({1}SC:U),I,0,0 S:G$SADEN1$0$0({1}SC:U),I,0,0 S:G$EMI0CN$0$0({1}SC:U),I,0,0 S:G$_XPAGE$0$0({1}SC:U),I,0,0 S:G$P3$0$0({1}SC:U),I,0,0 S:G$OSCXCN$0$0({1}SC:U),I,0,0 S:G$OSCICN$0$0({1}SC:U),I,0,0 S:G$P74OUT$0$0({1}SC:U),I,0,0 S:G$FLSCL$0$0({1}SC:U),I,0,0 S:G$FLACL$0$0({1}SC:U),I,0,0 S:G$IP$0$0({1}SC:U),I,0,0 S:G$SADEN0$0$0({1}SC:U),I,0,0 S:G$AMX0CF$0$0({1}SC:U),I,0,0 S:G$AMX0SL$0$0({1}SC:U),I,0,0 S:G$ADC0CF$0$0({1}SC:U),I,0,0 S:G$P1MDIN$0$0({1}SC:U),I,0,0 S:G$ADC0L$0$0({1}SC:U),I,0,0 S:G$ADC0H$0$0({1}SC:U),I,0,0 S:G$SMB0CN$0$0({1}SC:U),I,0,0 S:G$SMB0STA$0$0({1}SC:U),I,0,0 S:G$SMB0DAT$0$0({1}SC:U),I,0,0 S:G$SMB0ADR$0$0({1}SC:U),I,0,0 S:G$ADC0GTL$0$0({1}SC:U),I,0,0 S:G$ADC0GTH$0$0({1}SC:U),I,0,0 S:G$ADC0LTL$0$0({1}SC:U),I,0,0 S:G$ADC0LTH$0$0({1}SC:U),I,0,0 S:G$T2CON$0$0({1}SC:U),I,0,0 S:G$T4CON$0$0({1}SC:U),I,0,0 S:G$RCAP2L$0$0({1}SC:U),I,0,0 S:G$RCAP2H$0$0({1}SC:U),I,0,0 S:G$TL2$0$0({1}SC:U),I,0,0 S:G$TH2$0$0({1}SC:U),I,0,0 S:G$SMB0CR$0$0({1}SC:U),I,0,0 S:G$PSW$0$0({1}SC:U),I,0,0 S:G$REF0CN$0$0({1}SC:U),I,0,0 S:G$DAC0L$0$0({1}SC:U),I,0,0 S:G$DAC0H$0$0({1}SC:U),I,0,0 S:G$DAC0CN$0$0({1}SC:U),I,0,0 S:G$DAC1L$0$0({1}SC:U),I,0,0 S:G$DAC1H$0$0({1}SC:U),I,0,0 S:G$DAC1CN$0$0({1}SC:U),I,0,0 S:G$PCA0CN$0$0({1}SC:U),I,0,0 S:G$PCA0MD$0$0({1}SC:U),I,0,0 S:G$PCA0CPM0$0$0({1}SC:U),I,0,0 S:G$PCA0CPM1$0$0({1}SC:U),I,0,0 S:G$PCA0CPM2$0$0({1}SC:U),I,0,0 S:G$PCA0CPM3$0$0({1}SC:U),I,0,0 S:G$PCA0CPM4$0$0({1}SC:U),I,0,0 S:G$ACC$0$0({1}SC:U),I,0,0 S:G$XBR0$0$0({1}SC:U),I,0,0 S:G$XBR1$0$0({1}SC:U),I,0,0 S:G$XBR2$0$0({1}SC:U),I,0,0 S:G$RCAP4L$0$0({1}SC:U),I,0,0 S:G$RCAP4H$0$0({1}SC:U),I,0,0 S:G$EIE1$0$0({1}SC:U),I,0,0 S:G$EIE2$0$0({1}SC:U),I,0,0 S:G$ADC0CN$0$0({1}SC:U),I,0,0 S:G$PCA0L$0$0({1}SC:U),I,0,0 S:G$PCA0CPL0$0$0({1}SC:U),I,0,0 S:G$PCA0CPL1$0$0({1}SC:U),I,0,0 S:G$PCA0CPL2$0$0({1}SC:U),I,0,0 S:G$PCA0CPL3$0$0({1}SC:U),I,0,0 S:G$PCA0CPL4$0$0({1}SC:U),I,0,0 S:G$RSTSRC$0$0({1}SC:U),I,0,0 S:G$B$0$0({1}SC:U),I,0,0 S:G$SCON1$0$0({1}SC:U),I,0,0 S:G$SBUF1$0$0({1}SC:U),I,0,0 S:G$SADDR1$0$0({1}SC:U),I,0,0 S:G$TL4$0$0({1}SC:U),I,0,0 S:G$TH4$0$0({1}SC:U),I,0,0 S:G$EIP1$0$0({1}SC:U),I,0,0 S:G$EIP2$0$0({1}SC:U),I,0,0 S:G$SPI0CN$0$0({1}SC:U),I,0,0 S:G$PCA0H$0$0({1}SC:U),I,0,0 S:G$PCA0CPH0$0$0({1}SC:U),I,0,0 S:G$PCA0CPH1$0$0({1}SC:U),I,0,0 S:G$PCA0CPH2$0$0({1}SC:U),I,0,0 S:G$PCA0CPH3$0$0({1}SC:U),I,0,0 S:G$PCA0CPH4$0$0({1}SC:U),I,0,0 S:G$WDTCN$0$0({1}SC:U),I,0,0 S:G$TMR0$0$0({2}SI:U),I,0,0 S:G$TMR1$0$0({2}SI:U),I,0,0 S:G$TMR2$0$0({2}SI:U),I,0,0 S:G$RCAP2$0$0({2}SI:U),I,0,0 S:G$TMR3$0$0({2}SI:U),I,0,0 S:G$TMR3RL$0$0({2}SI:U),I,0,0 S:G$TMR4$0$0({2}SI:U),I,0,0 S:G$RCAP4$0$0({2}SI:U),I,0,0 S:G$ADC0$0$0({2}SI:U),I,0,0 S:G$ADC0GT$0$0({2}SI:U),I,0,0 S:G$ADC0LT$0$0({2}SI:U),I,0,0 S:G$DAC0$0$0({2}SI:U),I,0,0 S:G$DAC1$0$0({2}SI:U),I,0,0 S:G$PCA0$0$0({2}SI:U),I,0,0 S:G$PCA0CP0$0$0({2}SI:U),I,0,0 S:G$PCA0CP1$0$0({2}SI:U),I,0,0 S:G$PCA0CP2$0$0({2}SI:U),I,0,0 S:G$PCA0CP3$0$0({2}SI:U),I,0,0 S:G$PCA0CP4$0$0({2}SI:U),I,0,0 S:G$P0_0$0$0({1}SX:U),J,0,0 S:G$P0_1$0$0({1}SX:U),J,0,0 S:G$P0_2$0$0({1}SX:U),J,0,0 S:G$P0_3$0$0({1}SX:U),J,0,0 S:G$P0_4$0$0({1}SX:U),J,0,0 S:G$P0_5$0$0({1}SX:U),J,0,0 S:G$P0_6$0$0({1}SX:U),J,0,0 S:G$P0_7$0$0({1}SX:U),J,0,0 S:G$IT0$0$0({1}SX:U),J,0,0 S:G$IE0$0$0({1}SX:U),J,0,0 S:G$IT1$0$0({1}SX:U),J,0,0 S:G$IE1$0$0({1}SX:U),J,0,0 S:G$TR0$0$0({1}SX:U),J,0,0 S:G$TF0$0$0({1}SX:U),J,0,0 S:G$TR1$0$0({1}SX:U),J,0,0 S:G$TF1$0$0({1}SX:U),J,0,0 S:G$P1_0$0$0({1}SX:U),J,0,0 S:G$P1_1$0$0({1}SX:U),J,0,0 S:G$P1_2$0$0({1}SX:U),J,0,0 S:G$P1_3$0$0({1}SX:U),J,0,0 S:G$P1_4$0$0({1}SX:U),J,0,0 S:G$P1_5$0$0({1}SX:U),J,0,0 S:G$P1_6$0$0({1}SX:U),J,0,0 S:G$P1_7$0$0({1}SX:U),J,0,0 S:G$RI$0$0({1}SX:U),J,0,0 S:G$RI0$0$0({1}SX:U),J,0,0 S:G$TI$0$0({1}SX:U),J,0,0 S:G$TI0$0$0({1}SX:U),J,0,0 S:G$RB8$0$0({1}SX:U),J,0,0 S:G$RB80$0$0({1}SX:U),J,0,0 S:G$TB8$0$0({1}SX:U),J,0,0 S:G$TB80$0$0({1}SX:U),J,0,0 S:G$REN$0$0({1}SX:U),J,0,0 S:G$REN0$0$0({1}SX:U),J,0,0 S:G$SM2$0$0({1}SX:U),J,0,0 S:G$SM20$0$0({1}SX:U),J,0,0 S:G$MCE0$0$0({1}SX:U),J,0,0 S:G$SM1$0$0({1}SX:U),J,0,0 S:G$SM10$0$0({1}SX:U),J,0,0 S:G$SM0$0$0({1}SX:U),J,0,0 S:G$SM00$0$0({1}SX:U),J,0,0 S:G$S0MODE$0$0({1}SX:U),J,0,0 S:G$P2_0$0$0({1}SX:U),J,0,0 S:G$P2_1$0$0({1}SX:U),J,0,0 S:G$P2_2$0$0({1}SX:U),J,0,0 S:G$P2_3$0$0({1}SX:U),J,0,0 S:G$P2_4$0$0({1}SX:U),J,0,0 S:G$P2_5$0$0({1}SX:U),J,0,0 S:G$P2_6$0$0({1}SX:U),J,0,0 S:G$P2_7$0$0({1}SX:U),J,0,0 S:G$EX0$0$0({1}SX:U),J,0,0 S:G$ET0$0$0({1}SX:U),J,0,0 S:G$EX1$0$0({1}SX:U),J,0,0 S:G$ET1$0$0({1}SX:U),J,0,0 S:G$ES0$0$0({1}SX:U),J,0,0 S:G$ES$0$0({1}SX:U),J,0,0 S:G$ET2$0$0({1}SX:U),J,0,0 S:G$EA$0$0({1}SX:U),J,0,0 S:G$P3_0$0$0({1}SX:U),J,0,0 S:G$P3_1$0$0({1}SX:U),J,0,0 S:G$P3_2$0$0({1}SX:U),J,0,0 S:G$P3_3$0$0({1}SX:U),J,0,0 S:G$P3_4$0$0({1}SX:U),J,0,0 S:G$P3_5$0$0({1}SX:U),J,0,0 S:G$P3_6$0$0({1}SX:U),J,0,0 S:G$P3_7$0$0({1}SX:U),J,0,0 S:G$PX0$0$0({1}SX:U),J,0,0 S:G$PT0$0$0({1}SX:U),J,0,0 S:G$PX1$0$0({1}SX:U),J,0,0 S:G$PT1$0$0({1}SX:U),J,0,0 S:G$PS0$0$0({1}SX:U),J,0,0 S:G$PS$0$0({1}SX:U),J,0,0 S:G$PT2$0$0({1}SX:U),J,0,0 S:G$SMBTOE$0$0({1}SX:U),J,0,0 S:G$SMBFTE$0$0({1}SX:U),J,0,0 S:G$AA$0$0({1}SX:U),J,0,0 S:G$SI$0$0({1}SX:U),J,0,0 S:G$STO$0$0({1}SX:U),J,0,0 S:G$STA$0$0({1}SX:U),J,0,0 S:G$ENSMB$0$0({1}SX:U),J,0,0 S:G$BUSY$0$0({1}SX:U),J,0,0 S:G$CPRL2$0$0({1}SX:U),J,0,0 S:G$CT2$0$0({1}SX:U),J,0,0 S:G$TR2$0$0({1}SX:U),J,0,0 S:G$EXEN2$0$0({1}SX:U),J,0,0 S:G$TCLK$0$0({1}SX:U),J,0,0 S:G$RCLK$0$0({1}SX:U),J,0,0 S:G$EXF2$0$0({1}SX:U),J,0,0 S:G$TF2$0$0({1}SX:U),J,0,0 S:G$P$0$0({1}SX:U),J,0,0 S:G$F1$0$0({1}SX:U),J,0,0 S:G$OV$0$0({1}SX:U),J,0,0 S:G$RS0$0$0({1}SX:U),J,0,0 S:G$RS1$0$0({1}SX:U),J,0,0 S:G$F0$0$0({1}SX:U),J,0,0 S:G$AC$0$0({1}SX:U),J,0,0 S:G$CY$0$0({1}SX:U),J,0,0 S:G$CCF0$0$0({1}SX:U),J,0,0 S:G$CCF1$0$0({1}SX:U),J,0,0 S:G$CCF2$0$0({1}SX:U),J,0,0 S:G$CCF3$0$0({1}SX:U),J,0,0 S:G$CCF4$0$0({1}SX:U),J,0,0 S:G$CR$0$0({1}SX:U),J,0,0 S:G$CF$0$0({1}SX:U),J,0,0 S:G$ADLJST$0$0({1}SX:U),J,0,0 S:G$AD0LJST$0$0({1}SX:U),J,0,0 S:G$ADWINT$0$0({1}SX:U),J,0,0 S:G$AD0WINT$0$0({1}SX:U),J,0,0 S:G$ADSTM0$0$0({1}SX:U),J,0,0 S:G$AD0CM0$0$0({1}SX:U),J,0,0 S:G$ADSTM1$0$0({1}SX:U),J,0,0 S:G$AD0CM1$0$0({1}SX:U),J,0,0 S:G$ADBUSY$0$0({1}SX:U),J,0,0 S:G$AD0BUSY$0$0({1}SX:U),J,0,0 S:G$ADCINT$0$0({1}SX:U),J,0,0 S:G$AD0INT$0$0({1}SX:U),J,0,0 S:G$ADCTM$0$0({1}SX:U),J,0,0 S:G$AD0TM$0$0({1}SX:U),J,0,0 S:G$ADCEN$0$0({1}SX:U),J,0,0 S:G$AD0EN$0$0({1}SX:U),J,0,0 S:G$SPIEN$0$0({1}SX:U),J,0,0 S:G$MSTEN$0$0({1}SX:U),J,0,0 S:G$SLVSEL$0$0({1}SX:U),J,0,0 S:G$TXBSY$0$0({1}SX:U),J,0,0 S:G$RXOVRN$0$0({1}SX:U),J,0,0 S:G$MODF$0$0({1}SX:U),J,0,0 S:G$WCOL$0$0({1}SX:U),J,0,0 S:G$SPIF$0$0({1}SX:U),J,0,0 S:G$BUS_BUSY$0$0({1}SX:U),J,0,0 S:G$BUS_EN$0$0({1}SX:U),J,0,0 S:G$BUS_START$0$0({1}SX:U),J,0,0 S:G$BUS_STOP$0$0({1}SX:U),J,0,0 S:G$BUS_INT$0$0({1}SX:U),J,0,0 S:G$BUS_AA$0$0({1}SX:U),J,0,0 S:G$BUS_FTE$0$0({1}SX:U),J,0,0 S:G$BUS_TOE$0$0({1}SX:U),J,0,0 S:G$BUS_SCL$0$0({1}SX:U),J,0,0 S:G$SS$0$0({1}SX:U),J,0,0 S:G$BUZZ$0$0({1}SX:U),J,0,0 S:G$SYSCLK_Init$0$0({2}DF,SV:S),C,0,0 S:G$UART0_Init$0$0({2}DF,SV:S),C,0,0 S:G$Sys_Init$0$0({2}DF,SV:S),C,0,0 S:G$getchar_nw$0$0({2}DF,SC:U),C,0,0 S:G$_print_format$0$0({2}DF,SI:S),C,0,0 S:G$printf_small$0$0({2}DF,SV:S),C,0,0 S:G$printf$0$0({2}DF,SI:S),C,0,0 S:G$vprintf$0$0({2}DF,SI:S),C,0,0 S:G$sprintf$0$0({2}DF,SI:S),C,0,0 S:G$vsprintf$0$0({2}DF,SI:S),C,0,0 S:G$puts$0$0({2}DF,SI:S),C,0,0 S:G$getchar$0$0({2}DF,SC:U),C,0,0 S:G$putchar$0$0({2}DF,SV:S),C,0,0 S:G$printf_fast$0$0({2}DF,SV:S),C,0,0 S:G$printf_fast_f$0$0({2}DF,SV:S),C,0,0 S:G$printf_tiny$0$0({2}DF,SV:S),C,0,0 S:G$atof$0$0({2}DF,SF:S),C,0,0 S:G$atoi$0$0({2}DF,SI:S),C,0,0 S:G$atol$0$0({2}DF,SL:S),C,0,0 S:G$_uitoa$0$0({2}DF,SV:S),C,0,0 S:G$_itoa$0$0({2}DF,SV:S),C,0,0 S:G$_ultoa$0$0({2}DF,SV:S),C,0,0 S:G$_ltoa$0$0({2}DF,SV:S),C,0,0 S:G$rand$0$0({2}DF,SI:S),C,0,0 S:G$srand$0$0({2}DF,SV:S),C,0,0 S:G$calloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$malloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$realloc$0$0({2}DF,DX,SV:S),C,0,0 S:G$aligned_alloc$0$0({2}DF,DG,SV:S),C,0,0 S:G$free$0$0({2}DF,SV:S),C,0,0 S:G$abs$0$0({2}DF,SI:S),C,0,0 S:G$labs$0$0({2}DF,SL:S),C,0,0 S:G$mblen$0$0({2}DF,SI:S),C,0,0 S:G$mbtowc$0$0({2}DF,SI:S),C,0,0 S:G$wctomb$0$0({2}DF,SI:S),C,0,0 S:G$memcpy$0$0({2}DF,DG,SV:S),C,0,0 S:G$memmove$0$0({2}DF,DG,SV:S),C,0,0 S:G$strcpy$0$0({2}DF,DG,SC:U),C,0,0 S:G$strncpy$0$0({2}DF,DG,SC:U),C,0,0 S:G$strcat$0$0({2}DF,DG,SC:U),C,0,0 S:G$strncat$0$0({2}DF,DG,SC:U),C,0,0 S:G$memcmp$0$0({2}DF,SI:S),C,0,0 S:G$strcmp$0$0({2}DF,SI:S),C,0,0 S:G$strncmp$0$0({2}DF,SI:S),C,0,0 S:G$strxfrm$0$0({2}DF,SI:U),C,0,0 S:G$memchr$0$0({2}DF,DG,SV:S),C,0,0 S:G$strchr$0$0({2}DF,DG,SC:U),C,0,0 S:G$strcspn$0$0({2}DF,SI:U),C,0,0 S:G$strpbrk$0$0({2}DF,DG,SC:U),C,0,0 S:G$strrchr$0$0({2}DF,DG,SC:U),C,0,0 S:G$strspn$0$0({2}DF,SI:U),C,0,0 S:G$strstr$0$0({2}DF,DG,SC:U),C,0,0 S:G$strtok$0$0({2}DF,DG,SC:U),C,0,0 S:G$memset$0$0({2}DF,DG,SV:S),C,0,0 S:G$strlen$0$0({2}DF,SI:U),C,0,0 S:G$key_test$0$0({2}DF,SV:S),C,0,0 S:G$i2c_stop_and_read$0$0({2}DF,SC:U),C,0,0 S:G$read_keypad$0$0({2}DF,SC:U),C,0,0 S:G$main$0$0({2}DF,SV:S),C,0,0 S:FLab5$__str_0$0$0({22}DA22d,SC:S),D,0,0 S:FLab5$__str_1$0$0({16}DA16d,SC:S),D,0,0 S:FLab5$__str_2$0$0({3}DA3d,SC:S),D,0,0 S:FLab5$__str_3$0$0({32}DA32d,SC:S),D,0,0 S:FLab5$__str_4$0$0({29}DA29d,SC:S),D,0,0 S:FLab5$__str_5$0$0({26}DA26d,SC:S),D,0,0 S:FLab5$__str_6$0$0({30}DA30d,SC:S),D,0,0 S:FLab5$__str_7$0$0({32}DA32d,SC:S),D,0,0 S:FLab5$__str_8$0$0({39}DA39d,SC:S),D,0,0 S:FLab5$__str_9$0$0({60}DA60d,SC:S),D,0,0 S:FLab5$__str_10$0$0({11}DA11d,SC:S),D,0,0 S:FLab5$__str_11$0$0({68}DA68d,SC:S),D,0,0 S:FLab5$__str_12$0$0({23}DA23d,SC:S),D,0,0 S:FLab5$__str_13$0$0({36}DA36d,SC:S),D,0,0 S:FLab5$__str_14$0$0({20}DA20d,SC:S),D,0,0 S:FLab5$__str_15$0$0({17}DA17d,SC:S),D,0,0
sungyeon/drake
Ada
2,106
adb
with Ada.Strings.Naked_Maps.Case_Folding; function Ada.Strings.Generic_Equal_Case_Insensitive (Left, Right : String_Type) return Boolean is Mapping : constant not null Naked_Maps.Character_Mapping_Access := Naked_Maps.Case_Folding.Case_Folding_Map; Left_Last : Natural := Left'First - 1; Right_Last : Natural := Right'First - 1; begin while Left_Last < Left'Last and then Right_Last < Right'Last loop declare Left_Index : constant Positive := Left_Last + 1; Left_Code : Wide_Wide_Character; Left_Is_Illegal_Sequence : Boolean; Right_Index : constant Positive := Right_Last + 1; Right_Code : Wide_Wide_Character; Right_Is_Illegal_Sequence : Boolean; begin Get ( Left (Left_Index .. Left'Last), Left_Last, Left_Code, Left_Is_Illegal_Sequence); Get ( Right (Right_Index .. Right'Last), Right_Last, Right_Code, Right_Is_Illegal_Sequence); if not Left_Is_Illegal_Sequence then if not Right_Is_Illegal_Sequence then -- Left and Right are legal Left_Code := Naked_Maps.Value (Mapping.all, Left_Code); Right_Code := Naked_Maps.Value (Mapping.all, Right_Code); if Left_Code /= Right_Code then return False; end if; else -- Left is legal, Right is illegal return False; end if; else if not Right_Is_Illegal_Sequence then -- Left is illegal, Right is legal return False; else -- Left and Right are illegal if Left (Left_Index .. Left_Last) /= Right (Right_Index .. Right_Last) then return False; end if; end if; end if; end; end loop; return (Left_Last >= Left'Last) and then (Right_Last >= Right'Last); end Ada.Strings.Generic_Equal_Case_Insensitive;
Fabien-Chouteau/samd51-hal
Ada
26,914
ads
-- ============================================================================ -- Atmel Microcontroller Software Support -- ============================================================================ -- Copyright (c) 2017 Atmel Corporation, -- a wholly owned subsidiary of Microchip Technology Inc. -- -- 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 Licence 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. -- ============================================================================ -- This spec has been automatically generated from ATSAMD51J19A.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with HAL; with System; package SAM_SVD.ADC is pragma Preelaborate; --------------- -- Registers -- --------------- -- Dual Mode Trigger Selection type CTRLA_DUALSELSelect is (-- Start event or software trigger will start a conversion on both ADCs Both, -- START event or software trigger will alternatingly start a conversion on -- ADC0 and ADC1 Interleave) with Size => 2; for CTRLA_DUALSELSelect use (Both => 0, Interleave => 1); -- Prescaler Configuration type CTRLA_PRESCALERSelect is (-- Peripheral clock divided by 2 Div2, -- Peripheral clock divided by 4 Div4, -- Peripheral clock divided by 8 Div8, -- Peripheral clock divided by 16 Div16, -- Peripheral clock divided by 32 Div32, -- Peripheral clock divided by 64 Div64, -- Peripheral clock divided by 128 Div128, -- Peripheral clock divided by 256 Div256) with Size => 3; for CTRLA_PRESCALERSelect use (Div2 => 0, Div4 => 1, Div8 => 2, Div16 => 3, Div32 => 4, Div64 => 5, Div128 => 6, Div256 => 7); -- Control A type ADC_CTRLA_Register is record -- Software Reset SWRST : Boolean := False; -- Enable ENABLE : Boolean := False; -- unspecified Reserved_2_2 : HAL.Bit := 16#0#; -- Dual Mode Trigger Selection DUALSEL : CTRLA_DUALSELSelect := SAM_SVD.ADC.Both; -- Slave Enable SLAVEEN : Boolean := False; -- Run in Standby RUNSTDBY : Boolean := False; -- On Demand Control ONDEMAND : Boolean := False; -- Prescaler Configuration PRESCALER : CTRLA_PRESCALERSelect := SAM_SVD.ADC.Div2; -- unspecified Reserved_11_14 : HAL.UInt4 := 16#0#; -- Rail to Rail Operation Enable R2R : Boolean := False; end record with Volatile_Full_Access, Size => 16, Bit_Order => System.Low_Order_First; for ADC_CTRLA_Register use record SWRST at 0 range 0 .. 0; ENABLE at 0 range 1 .. 1; Reserved_2_2 at 0 range 2 .. 2; DUALSEL at 0 range 3 .. 4; SLAVEEN at 0 range 5 .. 5; RUNSTDBY at 0 range 6 .. 6; ONDEMAND at 0 range 7 .. 7; PRESCALER at 0 range 8 .. 10; Reserved_11_14 at 0 range 11 .. 14; R2R at 0 range 15 .. 15; end record; -- Event Control type ADC_EVCTRL_Register is record -- Flush Event Input Enable FLUSHEI : Boolean := False; -- Start Conversion Event Input Enable STARTEI : Boolean := False; -- Flush Event Invert Enable FLUSHINV : Boolean := False; -- Start Conversion Event Invert Enable STARTINV : Boolean := False; -- Result Ready Event Out RESRDYEO : Boolean := False; -- Window Monitor Event Out WINMONEO : Boolean := False; -- unspecified Reserved_6_7 : HAL.UInt2 := 16#0#; end record with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First; for ADC_EVCTRL_Register use record FLUSHEI at 0 range 0 .. 0; STARTEI at 0 range 1 .. 1; FLUSHINV at 0 range 2 .. 2; STARTINV at 0 range 3 .. 3; RESRDYEO at 0 range 4 .. 4; WINMONEO at 0 range 5 .. 5; Reserved_6_7 at 0 range 6 .. 7; end record; -- Debug Control type ADC_DBGCTRL_Register is record -- Debug Run DBGRUN : Boolean := False; -- unspecified Reserved_1_7 : HAL.UInt7 := 16#0#; end record with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First; for ADC_DBGCTRL_Register use record DBGRUN at 0 range 0 .. 0; Reserved_1_7 at 0 range 1 .. 7; end record; -- Positive Mux Input Selection type INPUTCTRL_MUXPOSSelect is (-- ADC AIN0 Pin Ain0, -- ADC AIN1 Pin Ain1, -- ADC AIN2 Pin Ain2, -- ADC AIN3 Pin Ain3, -- ADC AIN4 Pin Ain4, -- ADC AIN5 Pin Ain5, -- ADC AIN6 Pin Ain6, -- ADC AIN7 Pin Ain7, -- ADC AIN8 Pin Ain8, -- ADC AIN9 Pin Ain9, -- ADC AIN10 Pin Ain10, -- ADC AIN11 Pin Ain11, -- ADC AIN12 Pin Ain12, -- ADC AIN13 Pin Ain13, -- ADC AIN14 Pin Ain14, -- ADC AIN15 Pin Ain15, -- ADC AIN16 Pin Ain16, -- ADC AIN17 Pin Ain17, -- ADC AIN18 Pin Ain18, -- ADC AIN19 Pin Ain19, -- ADC AIN20 Pin Ain20, -- ADC AIN21 Pin Ain21, -- ADC AIN22 Pin Ain22, -- ADC AIN23 Pin Ain23, -- 1/4 Scaled Core Supply Scaledcorevcc, -- 1/4 Scaled VBAT Supply Scaledvbat, -- 1/4 Scaled I/O Supply Scalediovcc, -- Bandgap Voltage Bandgap, -- Temperature Sensor Ptat, -- Temperature Sensor Ctat, -- DAC Output Dac, -- PTC output (only on ADC0) Ptc) with Size => 5; for INPUTCTRL_MUXPOSSelect use (Ain0 => 0, Ain1 => 1, Ain2 => 2, Ain3 => 3, Ain4 => 4, Ain5 => 5, Ain6 => 6, Ain7 => 7, Ain8 => 8, Ain9 => 9, Ain10 => 10, Ain11 => 11, Ain12 => 12, Ain13 => 13, Ain14 => 14, Ain15 => 15, Ain16 => 16, Ain17 => 17, Ain18 => 18, Ain19 => 19, Ain20 => 20, Ain21 => 21, Ain22 => 22, Ain23 => 23, Scaledcorevcc => 24, Scaledvbat => 25, Scalediovcc => 26, Bandgap => 27, Ptat => 28, Ctat => 29, Dac => 30, Ptc => 31); -- Negative Mux Input Selection type INPUTCTRL_MUXNEGSelect is (-- ADC AIN0 Pin Ain0, -- ADC AIN1 Pin Ain1, -- ADC AIN2 Pin Ain2, -- ADC AIN3 Pin Ain3, -- ADC AIN4 Pin Ain4, -- ADC AIN5 Pin Ain5, -- ADC AIN6 Pin Ain6, -- ADC AIN7 Pin Ain7, -- Internal Ground Gnd) with Size => 5; for INPUTCTRL_MUXNEGSelect use (Ain0 => 0, Ain1 => 1, Ain2 => 2, Ain3 => 3, Ain4 => 4, Ain5 => 5, Ain6 => 6, Ain7 => 7, Gnd => 24); -- Input Control type ADC_INPUTCTRL_Register is record -- Positive Mux Input Selection MUXPOS : INPUTCTRL_MUXPOSSelect := SAM_SVD.ADC.Ain0; -- unspecified Reserved_5_6 : HAL.UInt2 := 16#0#; -- Differential Mode DIFFMODE : Boolean := False; -- Negative Mux Input Selection MUXNEG : INPUTCTRL_MUXNEGSelect := SAM_SVD.ADC.Ain0; -- unspecified Reserved_13_14 : HAL.UInt2 := 16#0#; -- Stop DMA Sequencing DSEQSTOP : Boolean := False; end record with Volatile_Full_Access, Size => 16, Bit_Order => System.Low_Order_First; for ADC_INPUTCTRL_Register use record MUXPOS at 0 range 0 .. 4; Reserved_5_6 at 0 range 5 .. 6; DIFFMODE at 0 range 7 .. 7; MUXNEG at 0 range 8 .. 12; Reserved_13_14 at 0 range 13 .. 14; DSEQSTOP at 0 range 15 .. 15; end record; -- Conversion Result Resolution type CTRLB_RESSELSelect is (-- 12-bit result Val_12Bit, -- For averaging mode output Val_16Bit, -- 10-bit result Val_10Bit, -- 8-bit result Val_8Bit) with Size => 2; for CTRLB_RESSELSelect use (Val_12Bit => 0, Val_16Bit => 1, Val_10Bit => 2, Val_8Bit => 3); -- Window Monitor Mode type CTRLB_WINMODESelect is (-- No window mode (default) Disable, -- RESULT > WINLT Mode1, -- RESULT < WINUT Mode2, -- WINLT < RESULT < WINUT Mode3, -- !(WINLT < RESULT < WINUT) Mode4) with Size => 3; for CTRLB_WINMODESelect use (Disable => 0, Mode1 => 1, Mode2 => 2, Mode3 => 3, Mode4 => 4); -- Control B type ADC_CTRLB_Register is record -- Left-Adjusted Result LEFTADJ : Boolean := False; -- Free Running Mode FREERUN : Boolean := False; -- Digital Correction Logic Enable CORREN : Boolean := False; -- Conversion Result Resolution RESSEL : CTRLB_RESSELSelect := SAM_SVD.ADC.Val_12Bit; -- unspecified Reserved_5_7 : HAL.UInt3 := 16#0#; -- Window Monitor Mode WINMODE : CTRLB_WINMODESelect := SAM_SVD.ADC.Disable; -- Window Single Sample WINSS : Boolean := False; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 16, Bit_Order => System.Low_Order_First; for ADC_CTRLB_Register use record LEFTADJ at 0 range 0 .. 0; FREERUN at 0 range 1 .. 1; CORREN at 0 range 2 .. 2; RESSEL at 0 range 3 .. 4; Reserved_5_7 at 0 range 5 .. 7; WINMODE at 0 range 8 .. 10; WINSS at 0 range 11 .. 11; Reserved_12_15 at 0 range 12 .. 15; end record; -- Reference Selection type REFCTRL_REFSELSelect is (-- Internal Bandgap Reference Intref, -- 1/2 VDDANA Intvcc0, -- VDDANA Intvcc1, -- External Reference Arefa, -- External Reference Arefb, -- External Reference (only on ADC1) Arefc) with Size => 4; for REFCTRL_REFSELSelect use (Intref => 0, Intvcc0 => 2, Intvcc1 => 3, Arefa => 4, Arefb => 5, Arefc => 6); -- Reference Control type ADC_REFCTRL_Register is record -- Reference Selection REFSEL : REFCTRL_REFSELSelect := SAM_SVD.ADC.Intref; -- unspecified Reserved_4_6 : HAL.UInt3 := 16#0#; -- Reference Buffer Offset Compensation Enable REFCOMP : Boolean := False; end record with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First; for ADC_REFCTRL_Register use record REFSEL at 0 range 0 .. 3; Reserved_4_6 at 0 range 4 .. 6; REFCOMP at 0 range 7 .. 7; end record; -- Number of Samples to be Collected type AVGCTRL_SAMPLENUMSelect is (-- 1 sample Val_1, -- 2 samples Val_2, -- 4 samples Val_4, -- 8 samples Val_8, -- 16 samples Val_16, -- 32 samples Val_32, -- 64 samples Val_64, -- 128 samples Val_128, -- 256 samples Val_256, -- 512 samples Val_512, -- 1024 samples Val_1024) with Size => 4; for AVGCTRL_SAMPLENUMSelect use (Val_1 => 0, Val_2 => 1, Val_4 => 2, Val_8 => 3, Val_16 => 4, Val_32 => 5, Val_64 => 6, Val_128 => 7, Val_256 => 8, Val_512 => 9, Val_1024 => 10); subtype ADC_AVGCTRL_ADJRES_Field is HAL.UInt3; -- Average Control type ADC_AVGCTRL_Register is record -- Number of Samples to be Collected SAMPLENUM : AVGCTRL_SAMPLENUMSelect := SAM_SVD.ADC.Val_1; -- Adjusting Result / Division Coefficient ADJRES : ADC_AVGCTRL_ADJRES_Field := 16#0#; -- unspecified Reserved_7_7 : HAL.Bit := 16#0#; end record with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First; for ADC_AVGCTRL_Register use record SAMPLENUM at 0 range 0 .. 3; ADJRES at 0 range 4 .. 6; Reserved_7_7 at 0 range 7 .. 7; end record; subtype ADC_SAMPCTRL_SAMPLEN_Field is HAL.UInt6; -- Sample Time Control type ADC_SAMPCTRL_Register is record -- Sampling Time Length SAMPLEN : ADC_SAMPCTRL_SAMPLEN_Field := 16#0#; -- unspecified Reserved_6_6 : HAL.Bit := 16#0#; -- Comparator Offset Compensation Enable OFFCOMP : Boolean := False; end record with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First; for ADC_SAMPCTRL_Register use record SAMPLEN at 0 range 0 .. 5; Reserved_6_6 at 0 range 6 .. 6; OFFCOMP at 0 range 7 .. 7; end record; subtype ADC_GAINCORR_GAINCORR_Field is HAL.UInt12; -- Gain Correction type ADC_GAINCORR_Register is record -- Gain Correction Value GAINCORR : ADC_GAINCORR_GAINCORR_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 16, Bit_Order => System.Low_Order_First; for ADC_GAINCORR_Register use record GAINCORR at 0 range 0 .. 11; Reserved_12_15 at 0 range 12 .. 15; end record; subtype ADC_OFFSETCORR_OFFSETCORR_Field is HAL.UInt12; -- Offset Correction type ADC_OFFSETCORR_Register is record -- Offset Correction Value OFFSETCORR : ADC_OFFSETCORR_OFFSETCORR_Field := 16#0#; -- unspecified Reserved_12_15 : HAL.UInt4 := 16#0#; end record with Volatile_Full_Access, Size => 16, Bit_Order => System.Low_Order_First; for ADC_OFFSETCORR_Register use record OFFSETCORR at 0 range 0 .. 11; Reserved_12_15 at 0 range 12 .. 15; end record; -- Software Trigger type ADC_SWTRIG_Register is record -- ADC Conversion Flush FLUSH : Boolean := False; -- Start ADC Conversion START : Boolean := False; -- unspecified Reserved_2_7 : HAL.UInt6 := 16#0#; end record with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First; for ADC_SWTRIG_Register use record FLUSH at 0 range 0 .. 0; START at 0 range 1 .. 1; Reserved_2_7 at 0 range 2 .. 7; end record; -- Interrupt Enable Clear type ADC_INTENCLR_Register is record -- Result Ready Interrupt Disable RESRDY : Boolean := False; -- Overrun Interrupt Disable OVERRUN : Boolean := False; -- Window Monitor Interrupt Disable WINMON : Boolean := False; -- unspecified Reserved_3_7 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First; for ADC_INTENCLR_Register use record RESRDY at 0 range 0 .. 0; OVERRUN at 0 range 1 .. 1; WINMON at 0 range 2 .. 2; Reserved_3_7 at 0 range 3 .. 7; end record; -- Interrupt Enable Set type ADC_INTENSET_Register is record -- Result Ready Interrupt Enable RESRDY : Boolean := False; -- Overrun Interrupt Enable OVERRUN : Boolean := False; -- Window Monitor Interrupt Enable WINMON : Boolean := False; -- unspecified Reserved_3_7 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First; for ADC_INTENSET_Register use record RESRDY at 0 range 0 .. 0; OVERRUN at 0 range 1 .. 1; WINMON at 0 range 2 .. 2; Reserved_3_7 at 0 range 3 .. 7; end record; -- Interrupt Flag Status and Clear type ADC_INTFLAG_Register is record -- Result Ready Interrupt Flag RESRDY : Boolean := False; -- Overrun Interrupt Flag OVERRUN : Boolean := False; -- Window Monitor Interrupt Flag WINMON : Boolean := False; -- unspecified Reserved_3_7 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First; for ADC_INTFLAG_Register use record RESRDY at 0 range 0 .. 0; OVERRUN at 0 range 1 .. 1; WINMON at 0 range 2 .. 2; Reserved_3_7 at 0 range 3 .. 7; end record; subtype ADC_STATUS_WCC_Field is HAL.UInt6; -- Status type ADC_STATUS_Register is record -- Read-only. ADC Busy Status ADCBUSY : Boolean; -- unspecified Reserved_1_1 : HAL.Bit; -- Read-only. Window Comparator Counter WCC : ADC_STATUS_WCC_Field; end record with Volatile_Full_Access, Size => 8, Bit_Order => System.Low_Order_First; for ADC_STATUS_Register use record ADCBUSY at 0 range 0 .. 0; Reserved_1_1 at 0 range 1 .. 1; WCC at 0 range 2 .. 7; end record; -- Synchronization Busy type ADC_SYNCBUSY_Register is record -- Read-only. SWRST Synchronization Busy SWRST : Boolean; -- Read-only. ENABLE Synchronization Busy ENABLE : Boolean; -- Read-only. Input Control Synchronization Busy INPUTCTRL : Boolean; -- Read-only. Control B Synchronization Busy CTRLB : Boolean; -- Read-only. Reference Control Synchronization Busy REFCTRL : Boolean; -- Read-only. Average Control Synchronization Busy AVGCTRL : Boolean; -- Read-only. Sampling Time Control Synchronization Busy SAMPCTRL : Boolean; -- Read-only. Window Monitor Lower Threshold Synchronization Busy WINLT : Boolean; -- Read-only. Window Monitor Upper Threshold Synchronization Busy WINUT : Boolean; -- Read-only. Gain Correction Synchronization Busy GAINCORR : Boolean; -- Read-only. Offset Correction Synchronization Busy OFFSETCORR : Boolean; -- Read-only. Software Trigger Synchronization Busy SWTRIG : Boolean; -- unspecified Reserved_12_31 : HAL.UInt20; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for ADC_SYNCBUSY_Register use record SWRST at 0 range 0 .. 0; ENABLE at 0 range 1 .. 1; INPUTCTRL at 0 range 2 .. 2; CTRLB at 0 range 3 .. 3; REFCTRL at 0 range 4 .. 4; AVGCTRL at 0 range 5 .. 5; SAMPCTRL at 0 range 6 .. 6; WINLT at 0 range 7 .. 7; WINUT at 0 range 8 .. 8; GAINCORR at 0 range 9 .. 9; OFFSETCORR at 0 range 10 .. 10; SWTRIG at 0 range 11 .. 11; Reserved_12_31 at 0 range 12 .. 31; end record; -- DMA Sequential Control type ADC_DSEQCTRL_Register is record -- Input Control INPUTCTRL : Boolean := False; -- Control B CTRLB : Boolean := False; -- Reference Control REFCTRL : Boolean := False; -- Average Control AVGCTRL : Boolean := False; -- Sampling Time Control SAMPCTRL : Boolean := False; -- Window Monitor Lower Threshold WINLT : Boolean := False; -- Window Monitor Upper Threshold WINUT : Boolean := False; -- Gain Correction GAINCORR : Boolean := False; -- Offset Correction OFFSETCORR : Boolean := False; -- unspecified Reserved_9_30 : HAL.UInt22 := 16#0#; -- ADC Auto-Start Conversion AUTOSTART : Boolean := False; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for ADC_DSEQCTRL_Register use record INPUTCTRL at 0 range 0 .. 0; CTRLB at 0 range 1 .. 1; REFCTRL at 0 range 2 .. 2; AVGCTRL at 0 range 3 .. 3; SAMPCTRL at 0 range 4 .. 4; WINLT at 0 range 5 .. 5; WINUT at 0 range 6 .. 6; GAINCORR at 0 range 7 .. 7; OFFSETCORR at 0 range 8 .. 8; Reserved_9_30 at 0 range 9 .. 30; AUTOSTART at 0 range 31 .. 31; end record; -- DMA Sequencial Status type ADC_DSEQSTAT_Register is record -- Read-only. Input Control INPUTCTRL : Boolean; -- Read-only. Control B CTRLB : Boolean; -- Read-only. Reference Control REFCTRL : Boolean; -- Read-only. Average Control AVGCTRL : Boolean; -- Read-only. Sampling Time Control SAMPCTRL : Boolean; -- Read-only. Window Monitor Lower Threshold WINLT : Boolean; -- Read-only. Window Monitor Upper Threshold WINUT : Boolean; -- Read-only. Gain Correction GAINCORR : Boolean; -- Read-only. Offset Correction OFFSETCORR : Boolean; -- unspecified Reserved_9_30 : HAL.UInt22; -- Read-only. DMA Sequencing Busy BUSY : Boolean; end record with Volatile_Full_Access, Size => 32, Bit_Order => System.Low_Order_First; for ADC_DSEQSTAT_Register use record INPUTCTRL at 0 range 0 .. 0; CTRLB at 0 range 1 .. 1; REFCTRL at 0 range 2 .. 2; AVGCTRL at 0 range 3 .. 3; SAMPCTRL at 0 range 4 .. 4; WINLT at 0 range 5 .. 5; WINUT at 0 range 6 .. 6; GAINCORR at 0 range 7 .. 7; OFFSETCORR at 0 range 8 .. 8; Reserved_9_30 at 0 range 9 .. 30; BUSY at 0 range 31 .. 31; end record; subtype ADC_CALIB_BIASCOMP_Field is HAL.UInt3; subtype ADC_CALIB_BIASR2R_Field is HAL.UInt3; subtype ADC_CALIB_BIASREFBUF_Field is HAL.UInt3; -- Calibration type ADC_CALIB_Register is record -- Bias Comparator Scaling BIASCOMP : ADC_CALIB_BIASCOMP_Field := 16#0#; -- unspecified Reserved_3_3 : HAL.Bit := 16#0#; -- Bias R2R Ampli scaling BIASR2R : ADC_CALIB_BIASR2R_Field := 16#0#; -- unspecified Reserved_7_7 : HAL.Bit := 16#0#; -- Bias Reference Buffer Scaling BIASREFBUF : ADC_CALIB_BIASREFBUF_Field := 16#0#; -- unspecified Reserved_11_15 : HAL.UInt5 := 16#0#; end record with Volatile_Full_Access, Size => 16, Bit_Order => System.Low_Order_First; for ADC_CALIB_Register use record BIASCOMP at 0 range 0 .. 2; Reserved_3_3 at 0 range 3 .. 3; BIASR2R at 0 range 4 .. 6; Reserved_7_7 at 0 range 7 .. 7; BIASREFBUF at 0 range 8 .. 10; Reserved_11_15 at 0 range 11 .. 15; end record; ----------------- -- Peripherals -- ----------------- -- Analog Digital Converter 0 type ADC_Peripheral is record -- Control A CTRLA : aliased ADC_CTRLA_Register; -- Event Control EVCTRL : aliased ADC_EVCTRL_Register; -- Debug Control DBGCTRL : aliased ADC_DBGCTRL_Register; -- Input Control INPUTCTRL : aliased ADC_INPUTCTRL_Register; -- Control B CTRLB : aliased ADC_CTRLB_Register; -- Reference Control REFCTRL : aliased ADC_REFCTRL_Register; -- Average Control AVGCTRL : aliased ADC_AVGCTRL_Register; -- Sample Time Control SAMPCTRL : aliased ADC_SAMPCTRL_Register; -- Window Monitor Lower Threshold WINLT : aliased HAL.UInt16; -- Window Monitor Upper Threshold WINUT : aliased HAL.UInt16; -- Gain Correction GAINCORR : aliased ADC_GAINCORR_Register; -- Offset Correction OFFSETCORR : aliased ADC_OFFSETCORR_Register; -- Software Trigger SWTRIG : aliased ADC_SWTRIG_Register; -- Interrupt Enable Clear INTENCLR : aliased ADC_INTENCLR_Register; -- Interrupt Enable Set INTENSET : aliased ADC_INTENSET_Register; -- Interrupt Flag Status and Clear INTFLAG : aliased ADC_INTFLAG_Register; -- Status STATUS : aliased ADC_STATUS_Register; -- Synchronization Busy SYNCBUSY : aliased ADC_SYNCBUSY_Register; -- DMA Sequencial Data DSEQDATA : aliased HAL.UInt32; -- DMA Sequential Control DSEQCTRL : aliased ADC_DSEQCTRL_Register; -- DMA Sequencial Status DSEQSTAT : aliased ADC_DSEQSTAT_Register; -- Result Conversion Value RESULT : aliased HAL.UInt16; -- Last Sample Result RESS : aliased HAL.UInt16; -- Calibration CALIB : aliased ADC_CALIB_Register; end record with Volatile; for ADC_Peripheral use record CTRLA at 16#0# range 0 .. 15; EVCTRL at 16#2# range 0 .. 7; DBGCTRL at 16#3# range 0 .. 7; INPUTCTRL at 16#4# range 0 .. 15; CTRLB at 16#6# range 0 .. 15; REFCTRL at 16#8# range 0 .. 7; AVGCTRL at 16#A# range 0 .. 7; SAMPCTRL at 16#B# range 0 .. 7; WINLT at 16#C# range 0 .. 15; WINUT at 16#E# range 0 .. 15; GAINCORR at 16#10# range 0 .. 15; OFFSETCORR at 16#12# range 0 .. 15; SWTRIG at 16#14# range 0 .. 7; INTENCLR at 16#2C# range 0 .. 7; INTENSET at 16#2D# range 0 .. 7; INTFLAG at 16#2E# range 0 .. 7; STATUS at 16#2F# range 0 .. 7; SYNCBUSY at 16#30# range 0 .. 31; DSEQDATA at 16#34# range 0 .. 31; DSEQCTRL at 16#38# range 0 .. 31; DSEQSTAT at 16#3C# range 0 .. 31; RESULT at 16#40# range 0 .. 15; RESS at 16#44# range 0 .. 15; CALIB at 16#48# range 0 .. 15; end record; -- Analog Digital Converter 0 ADC0_Periph : aliased ADC_Peripheral with Import, Address => ADC0_Base; -- Analog Digital Converter 1 ADC1_Periph : aliased ADC_Peripheral with Import, Address => ADC1_Base; end SAM_SVD.ADC;
mhendren/HelloWorlds
Ada
96
adb
with Ada.Text_IO; procedure hello is begin Ada.Text_IO.Put_Line ("hello, world"); end hello;
charlie5/cBound
Ada
1,600
ads
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_glx_get_visual_configs_request_t is -- Item -- type Item is record major_opcode : aliased Interfaces.Unsigned_8; minor_opcode : aliased Interfaces.Unsigned_8; length : aliased Interfaces.Unsigned_16; screen : aliased Interfaces.Unsigned_32; end record; -- Item_Array -- type Item_Array is array (Interfaces.C .size_t range <>) of aliased xcb.xcb_glx_get_visual_configs_request_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_glx_get_visual_configs_request_t.Item, Element_Array => xcb.xcb_glx_get_visual_configs_request_t.Item_Array, Default_Terminator => (others => <>)); subtype Pointer is C_Pointers.Pointer; -- Pointer_Array -- type Pointer_Array is array (Interfaces.C .size_t range <>) of aliased xcb.xcb_glx_get_visual_configs_request_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_glx_get_visual_configs_request_t.Pointer, Element_Array => xcb.xcb_glx_get_visual_configs_request_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_glx_get_visual_configs_request_t;
JohnYang97/Space-Convoy
Ada
807
ads
-- -- Jan & Uwe R. Zimmer, Australia, July 2011 -- with Swarm_Configuration; use Swarm_Configuration; with Swarm_Configurations; use Swarm_Configurations; pragma Elaborate_All (Swarm_Configurations); with Swarm_Structures; use Swarm_Structures; with Swarm_Structures_Base; use Swarm_Structures_Base; package Swarm_Data is -- The Swarm_State is an unprotected, dynamic vector for maximal concurrency. -- Different tasks can update different parts of this vector concurrently. -- Critical operations (like deletions or insertions) -- are handled via the Swarm_Monitor in Swarm_Control. -- Swarm_State : Swarm_Vectors.Vector := Swarm_Vectors.Empty_Vector; Globes : constant Energy_Globes_Protected := Default_Protected_Globes (Configuration); end Swarm_Data;
kkirstein/proglang-playground
Ada
1,779
adb
with Ada.Numerics.Big_Numbers.Big_Integers; use Ada.Numerics.Big_Numbers.Big_Integers; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Perfect_Number; use Perfect_Number; with Primes; use Primes; package body Aux_Image is function Generic_Image (X : T) return String is Res : Unbounded_String := Null_Unbounded_String; begin Res := Res & "["; for E of X loop Res := Res & To_String (E) & ","; end loop; Res := Res & "]"; return To_String (Res); end Generic_Image; --function Img is new Generic_Image (T => Pn_Vectors.Element_Type, -- I => Pn_Vectors.Index_Type, -- A => Pn_Vectors.Vector, -- To_String => Integer'Image); function Img (X : Pn_Vectors.Vector) return String is Res : Unbounded_String := Null_Unbounded_String; begin Res := Res & "["; for E of X loop Res := Res & Img (E) & ","; end loop; Res := Res & "]"; return To_String (Res); end Img; function Img (X : Prime_Vectors.Vector) return String is Res : Unbounded_String := Null_Unbounded_String; begin Res := Res & "["; for E of X loop Res := Res & Img (E) & ","; end loop; Res := Res & "]"; return To_String (Res); end Img; function Img (X : Big_Prime_Vectors.Vector) return String is Res : Unbounded_String := Null_Unbounded_String; begin Res := Res & "["; for E of X loop Res := Res & Img (E) & ","; end loop; Res := Res & "]"; return To_String (Res); end Img; end Aux_Image;
onox/orka
Ada
1,891
adb
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2012 Felix Krause <[email protected]> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. with GL.API; package body GL.Toggles is procedure Enable (Subject : Toggle) is begin API.Enable.Ref (Subject); end Enable; procedure Disable (Subject : Toggle) is begin API.Disable.Ref (Subject); end Disable; procedure Set (Subject : Toggle; Enable : Boolean) is begin if Enable then API.Enable.Ref (Subject); else API.Disable.Ref (Subject); end if; end Set; function Is_Enabled (Subject : Toggle) return Boolean is (Boolean (API.Is_Enabled.Ref (Subject))); procedure Enable (Subject : Toggle_Indexed; Index : Types.UInt) is begin API.Enable_I.Ref (Subject, Index); end Enable; procedure Disable (Subject : Toggle_Indexed; Index : Types.UInt) is begin API.Disable_I.Ref (Subject, Index); end Disable; procedure Set (Subject : Toggle_Indexed; Index : Types.UInt; Enable : Boolean) is begin if Enable then API.Enable_I.Ref (Subject, Index); else API.Disable_I.Ref (Subject, Index); end if; end Set; function Is_Enabled (Subject : Toggle_Indexed; Index : Types.UInt) return Boolean is (Boolean (API.Is_Enabled_I.Ref (Subject, Index))); end GL.Toggles;
reznikmm/matreshka
Ada
4,655
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Documents; with Matreshka.ODF_String_Constants; with ODF.DOM.Iterators; with ODF.DOM.Visitors; package body Matreshka.ODF_Text.Sort_By_Position_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Text_Sort_By_Position_Attribute_Node is begin return Self : Text_Sort_By_Position_Attribute_Node do Matreshka.ODF_Text.Constructors.Initialize (Self'Unchecked_Access, Parameters.Document, Matreshka.ODF_String_Constants.Text_Prefix); end return; end Create; -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Text_Sort_By_Position_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Sort_By_Position_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Text_URI, Matreshka.ODF_String_Constants.Sort_By_Position_Attribute, Text_Sort_By_Position_Attribute_Node'Tag); end Matreshka.ODF_Text.Sort_By_Position_Attributes;
AdaCore/ada-traits-containers
Ada
8,453
adb
-- -- Copyright (C) 2015-2016, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -- pragma Ada_2012; with Ada.Unchecked_Conversion; with System; use System; package body Conts.Lists.Impl with SPARK_Mode => Off is use Storage; pragma Assertion_Policy (Pre => Suppressible, Ghost => Suppressible, Post => Ignore); --------------- -- Positions -- --------------- function Positions (Self : Base_List'Class) return P_Map is Position : Cursor := (Current => Self.Head); R : P.Map; I : Count_Type := 1; begin while Position.Current /= Null_Access loop R := P.Add (R, Position, I); Position := (Current => Get_Next (Self, Position.Current)); I := I + 1; end loop; return P_Map'(Content => R); end Positions; ----------- -- Model -- ----------- function Model (Self : Base_List'Class) return M.Sequence is Position : Cursor := (Current => Self.Head); R : M.Sequence; begin -- Can't use First, Next or Element here, since they depend -- on Model for their postconditions while Position.Current /= Null_Access loop R := M.Add (R, Storage.Elements.To_Element (Storage.Elements.To_Constant_Returned (Get_Element (Self, Position.Current)))); Position := (Current => Get_Next (Self, Position.Current)); end loop; return R; end Model; ---------------------------- -- Lift_Abstraction_Level -- ---------------------------- procedure Lift_Abstraction_Level (Self : Base_List'Class) is null; ----------- -- Clear -- ----------- procedure Clear (Self : in out Base_List'Class) is C : Cursor := Self.First; N : Cursor; E : Stored_Type; begin while C.Current /= Null_Access loop N := (Current => Get_Next (Self, C.Current)); E := Get_Element (Self, C.Current); Elements.Release (E); Storage.Release_Node (Self, C.Current); C := N; end loop; Storage.Release (Self); Self.Head := Storage.Null_Access; Self.Tail := Storage.Null_Access; Self.Size := 0; end Clear; ----------- -- First -- ----------- function First (Self : Base_List'Class) return Cursor is begin return (Current => Self.Head); end First; ------------- -- Element -- ------------- function Element (Self : Base_List'Class; Position : Cursor) return Constant_Returned_Type is begin return Storage.Elements.To_Constant_Returned (Get_Element (Self, Position.Current)); end Element; ----------------- -- Has_Element -- ----------------- function Has_Element (Self : Base_List'Class; Position : Cursor) return Boolean is pragma Unreferenced (Self); begin return Position.Current /= Null_Access; end Has_Element; ----------- -- Last -- ----------- function Last (Self : Base_List'Class) return Cursor is begin return (Current => Self.Tail); end Last; ---------- -- Next -- ---------- function Next (Self : Base_List'Class; Position : Cursor) return Cursor is begin return (Current => Get_Next (Self, Position.Current)); end Next; ---------- -- Next -- ---------- procedure Next (Self : Base_List'Class; Position : in out Cursor) is begin Position := Next (Self, Position); end Next; -------------- -- Previous -- -------------- function Previous (Self : Base_List'Class; Position : Cursor) return Cursor is begin if Position.Current = Null_Access then return Position; else return (Current => Get_Previous (Self, Position.Current)); end if; end Previous; ------------ -- Append -- ------------ procedure Append (Self : in out Base_List'Class; Element : Element_Type; Count : Count_Type := 1) is N : Node_Access; begin for C in 1 .. Count loop Allocate (Self, Storage.Elements.To_Stored (Element), New_Node => N); if Self.Tail = Null_Access then Self.Tail := N; Self.Head := Self.Tail; else Set_Next (Self, Self.Tail, Next => N); Set_Previous (Self, N, Previous => Self.Tail); Self.Tail := N; end if; end loop; Self.Size := Self.Size + Count; end Append; ------------ -- Insert -- ------------ procedure Insert (Self : in out Base_List'Class; Before : Cursor; Element : Element_Type; Count : Count_Type := 1) is Prev : Node_Access; N : Node_Access; begin if Before = No_Element then Append (Self, Element, Count); else -- Insert the first one, which might become the new head Allocate (Self, Storage.Elements.To_Stored (Element), New_Node => N); Prev := Get_Previous (Self, Before.Current); if Prev = Null_Access then Self.Head := N; else Set_Previous (Self, N, Previous => Prev); Set_Next (Self, Prev, Next => N); end if; -- Then allocate remaining elements, which cannot become the head for C in 2 .. Count loop Prev := N; Allocate (Self, Storage.Elements.To_Stored (Element), New_Node => N); Set_Previous (Self, N, Previous => Prev); Set_Next (Self, Prev, Next => N); end loop; -- Set the final link Set_Next (Self, N, Next => Before.Current); Set_Previous (Self, Before.Current, Previous => N); Self.Size := Self.Size + Count; end if; end Insert; ------------------------- -- Replacement_Element -- ------------------------- procedure Replace_Element (Self : in out Base_List'Class; Position : Cursor; Element : Element_Type) is P : constant Node_Access := Position.Current; E : Stored_Type := Get_Element (Self, P); begin Storage.Elements.Release (E); Set_Element (Self, P, Storage.Elements.To_Stored (Element)); end Replace_Element; ------------ -- Delete -- ------------ procedure Delete (Self : in out Base_List'Class; Position : in out Cursor; Count : Count_Type := 1) is N : Node_Access := Position.Current; N2 : Node_Access; Prev : constant Node_Access := Get_Previous (Self, N); E : Stored_Type; begin -- Find first element the range for C in 1 .. Count loop E := Get_Element (Self, N); N2 := Get_Next (Self, N); Storage.Elements.Release (E); Storage.Release_Node (Self, N); N := N2; Self.Size := Self.Size - 1; exit when N = Null_Access; end loop; if Prev = Null_Access then Self.Head := N; else Set_Next (Self, Prev, N); end if; if N /= Null_Access then Set_Previous (Self, N, Prev); else Self.Tail := Prev; end if; Position.Current := N; end Delete; ------------ -- Length -- ------------ function Length (Self : Base_List'Class) return Count_Type is begin return Self.Size; end Length; ------------ -- Adjust -- ------------ procedure Adjust (Self : in out Base_List) is begin Storage.Assign (Self, Self, Self.Head, Self.Head, Self.Tail, Self.Tail); end Adjust; -------------- -- Finalize -- -------------- procedure Finalize (Self : in out Base_List) is begin Clear (Self); end Finalize; ------------ -- Assign -- ------------ procedure Assign (Self : in out Base_List'Class; Source : Base_List'Class) is begin if Self'Address = Source'Address then -- Tagged types are always passed by reference, so we know they -- are the same, and do nothing. return; end if; Storage.Assign (Self, Source, Self.Head, Source.Head, Self.Tail, Source.Tail); Self.Size := Source.Size; end Assign; end Conts.Lists.Impl;
Kidev/Ada_Drivers_Library
Ada
1,741
ads
-- This package was generated by the Ada_Drivers_Library project wizard script package ADL_Config is Vendor : constant String := "STMicro"; -- From board definition Max_Mount_Points : constant := 2; -- From default value Max_Mount_Name_Length : constant := 128; -- From default value Runtime_Profile : constant String := "ravenscar-sfp"; -- From command line Device_Name : constant String := "STM32F429ZITx"; -- From board definition Device_Family : constant String := "STM32F4"; -- From board definition Runtime_Name : constant String := "ravenscar-sfp-stm32f429disco"; -- From default value Has_Ravenscar_Full_Runtime : constant String := "True"; -- From board definition CPU_Core : constant String := "ARM Cortex-M4F"; -- From mcu definition Board : constant String := "STM32F429_Discovery"; -- From command line Has_ZFP_Runtime : constant String := "False"; -- From board definition Has_Ravenscar_SFP_Runtime : constant String := "True"; -- From board definition High_Speed_External_Clock : constant := 8000000; -- From board definition Max_Path_Length : constant := 1024; -- From default value Runtime_Name_Suffix : constant String := "stm32f429disco"; -- From board definition Architecture : constant String := "ARM"; -- From board definition end ADL_Config;
RREE/ada-util
Ada
1,260
ads
----------------------------------------------------------------------- -- locales.tests -- Unit tests for Locales -- Copyright (C) 2009, 2010, 2011 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Util.Tests; package Util.Locales.Tests is procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite); type Test is new Util.Tests.Test with null record; procedure Test_Get_Locale (T : in out Test); procedure Test_Hash_Locale (T : in out Test); procedure Test_Compare_Locale (T : in out Test); procedure Test_Get_Locales (T : in out Test); end Util.Locales.Tests;
zhmu/ananas
Ada
5,706
ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . E X C E P T I O N _ T R A C E S -- -- -- -- S p e c -- -- -- -- Copyright (C) 2000-2022, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package provides an interface allowing to control *automatic* output -- to standard error upon exception occurrences (as opposed to explicit -- generation of traceback information using System.Traceback). -- This output includes the basic information associated with the exception -- (name, message) as well as a backtrace of the call chain at the point -- where the exception occurred. This backtrace is only output if the call -- chain information is available, depending if the binder switch dedicated -- to that purpose has been used or not. -- The default backtrace is in the form of absolute code locations which may -- be converted to corresponding source locations using the addr2line utility -- or from within GDB. Please refer to System.Traceback for information about -- what is necessary to be able to exploit this possibility. -- The backtrace output can also be customized by way of a "decorator" which -- may return any string output in association with a provided call chain. -- The decorator replaces the default backtrace mentioned above. -- On systems that use DWARF debugging output, then if the "-g" compiler -- switch and the "-Es" binder switch are used, the decorator is automatically -- set to Symbolic_Traceback. with System.Traceback_Entries; package System.Exception_Traces is -- The following defines the exact situations in which raises will -- cause automatic output of trace information. type Trace_Kind is (Every_Raise, -- Denotes the initial raise event for any exception occurrence, either -- explicit or due to a specific language rule, within the context of a -- task or not. Unhandled_Raise, -- Denotes the raise events corresponding to exceptions for which there -- is no user defined handler. This includes unhandled exceptions in -- task bodies. Unhandled_Raise_In_Main -- Same as Unhandled_Raise, except exceptions in task bodies are not -- included. ); -- The following procedures can be used to activate and deactivate -- traces identified by the above trace kind values. procedure Trace_On (Kind : Trace_Kind); -- Activate the traces denoted by Kind procedure Trace_Off; -- Stop the tracing requested by the last call to Trace_On. -- Has no effect if no such call has ever occurred. -- The following provide the backtrace decorating facilities type Traceback_Decorator is access function (Traceback : Traceback_Entries.Tracebacks_Array) return String; -- A backtrace decorator is a function which returns the string to be -- output for a call chain provided by way of a tracebacks array. procedure Set_Trace_Decorator (Decorator : Traceback_Decorator); -- Set the decorator to be used for future automatic outputs. Restore the -- default behavior if the provided access value is null. -- -- Note: System.Traceback.Symbolic.Symbolic_Traceback may be used as the -- Decorator, to get a symbolic traceback. This will cause a significant -- cpu and memory overhead on some platforms. -- -- Note: The Decorator is called when constructing the -- Exception_Information; that needs to be taken into account -- if the Decorator has any side effects. end System.Exception_Traces;
jscparker/math_packages
Ada
13,365
adb
----------------------------------------------------------------------- -- package body Runge_5th, 5th order Runge-Kutta -- Copyright (C) 2008-2018 Jonathan S. Parker. -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ----------------------------------------------------------------------- with Ada.Numerics.Generic_Elementary_Functions; with Runge_Coeffs_pd_5; package body Runge_5th is Real_Small : constant Real := Two * Real'Small; package mth is new Ada.Numerics.Generic_Elementary_Functions(Real); use mth; package Prince_Dormand_Coeffs is new Runge_Coeffs_pd_5 (Real); use Prince_Dormand_Coeffs; type K_type1 is array (RK_Range) of Real; type K_type is array (Dyn_Index) of K_type1; --------------- -- Runge_Sum -- --------------- -- Function to multiply vector G times matrix K. -- -- This works only for the RKPD coefficients given above. -- It's optimized to take into account all of -- Zero's in array A; review A in the package above. -- The general formula is: -- -- Result := A(Stage)(0) * K(0); -- for j in 1..Stage-1 loop -- Result := Result + A(Stage)(j) * K(j); -- end loop; -- -- Notice uses only the lower triangle of A; no diagonal elements of A. -- The above loop can be used for arbitrary RK coefficients. -- See Runge_Sum0. -- -- What follows is optimized for the Prince-Dormond Coefficients. procedure Runge_Sum (Y : in Dynamical_Variable; Next_Y : out Dynamical_Variable; Stage : in Stages; K : in K_type) is Stage2 : Stages; Sum : Real; begin case Stage is when 1 => Stage2 := 1; for l in Dyn_Index loop Sum := A(Stage2)(0) * K(l)(0); Next_Y(l) := Y(l) + Sum; end loop; when 2 => Stage2 := 2; for l in Dyn_Index loop Sum := A(Stage2)(0) * K(l)(0) + A(Stage2)(1) * K(l)(1); Next_Y(l) := Y(l) + Sum; end loop; when 3 => Stage2 := 3; for l in Dyn_Index loop Sum := A(Stage2)(0) * K(l)(0) + A(Stage2)(1) * K(l)(1) + A(Stage2)(2) * K(l)(2); Next_Y(l) := Y(l) + Sum; end loop; when 4 => Stage2 := 4; for l in Dyn_Index loop Sum := A(Stage2)(0) * K(l)(0) + A(Stage2)(1) * K(l)(1) + A(Stage2)(2) * K(l)(2) + A(Stage2)(3) * K(l)(3); Next_Y(l) := Y(l) + Sum; end loop; when 5 => Stage2 := 5; for l in Dyn_Index loop Sum := A(Stage2)(0) * K(l)(0) + A(Stage2)(1) * K(l)(1) + A(Stage2)(2) * K(l)(2) + A(Stage2)(3) * K(l)(3) + A(Stage2)(4) * K(l)(4); Next_Y(l) := Y(l) + Sum; end loop; when 6 => Stage2 := 6; for l in Dyn_Index loop Sum := A(Stage2)(0) * K(l)(0) + A(Stage2)(1) * K(l)(1) + A(Stage2)(2) * K(l)(2) + A(Stage2)(3) * K(l)(3) + A(Stage2)(4) * K(l)(4) + A(Stage2)(5) * K(l)(5); Next_Y(l) := Y(l) + Sum; end loop; when others => null; end case; end Runge_Sum; pragma Inline (Runge_Sum); ---------------- -- Runge_Sum0 -- ---------------- procedure Runge_Sum0 (Y : in Dynamical_Variable; Next_Y : out Dynamical_Variable; Stage : in Stages; K : in K_type) is Stage2 : Stages; Sum : Real; begin Stage2 := Stage; for l in Dyn_Index loop Sum := Zero; for n in RK_Range range 0..Stage2-1 loop --check: 0..Stages2-2? Sum := Sum + A(Stage2)(n) * K(l)(n); end loop; Next_Y(l) := Y(l) + Sum; end loop; end Runge_Sum0; --------------- -- Integrate -- --------------- -- Integrate to 5th order. procedure Integrate (Final_State : out Dynamical_Variable; Final_Time : in Real; Initial_State : in Dynamical_Variable; Initial_Time : in Real; No_Of_Steps : in Step_Integer; Error_Control_Desired : in Boolean := False; Error_Tolerance : in Real := 1.0E-6) is N : constant Real := Real (No_Of_Steps); Static_Delta_t : constant Real := (Final_Time - Initial_Time) / N; Final_Time_Test : constant Real := Final_Time - Static_Delta_t*Half; Error_Tolerance_Sqr : constant Real := Error_Tolerance**2; type Step_Type is new Natural; Step_id : Step_Type; Delta_t, Error : Real; Present_t, Time1 : Real; Next_Deriv, Next_Y : Dynamical_Variable; Y, Error_Y, Delta_Y : Dynamical_Variable; This_Is_The_Final_Time_Step : Boolean := False; -- Increments of Independent variable -- so K(13) = Delta_t*F (Time + Dt(13), Y + SUM (A(13), K)) K : K_type; Dt : Coefficient; -------------------------- -- Fourth_Order_Delta_Y -- -------------------------- -- function to Sum Series For Delta Y efficiently function Fourth_Order_Delta_Y return Dynamical_Variable is Result : Dynamical_Variable; begin for l in Dyn_Index loop Result(l) := B4(0) * K(l)(0) + --B4(1) * K(l)(1) + -- B4(1) = 0 B4(2) * K(l)(2) + B4(3) * K(l)(3) + B4(4) * K(l)(4) + B4(5) * K(l)(5) + B4(6) * K(l)(6); end loop; return Result; end Fourth_Order_Delta_Y; ------------------------- -- Fifth_Order_Delta_Y -- ------------------------- -- function to Sum Series For Delta Y efficiently function Fifth_Order_Delta_Y return Dynamical_Variable is Result : Dynamical_Variable; begin for l in Dyn_Index loop Result(l) := B5(0) * K(l)(0) + --B5(1) * K(l)(1) + -- 0 for the pd coeffs B5(2) * K(l)(2) + B5(3) * K(l)(3) + B5(4) * K(l)(4) + B5(5) * K(l)(5); --B5(6) * K(l)(6); -- 0 for the pd coeffs end loop; return Result; end Fifth_Order_Delta_Y; ------------------------------- -- Get_New_Y_to_Fifth_Order -- ------------------------------- procedure Get_New_Y_to_Fifth_Order (Y : in out Dynamical_Variable) is begin for l in Dyn_Index loop Y(l) := Y(l) + B5(0) * K(l)(0) + --B5(1) * K(l)(1) + -- 0 for the pd coeffs B5(2) * K(l)(2) + B5(3) * K(l)(3) + B5(4) * K(l)(4) + B5(5) * K(l)(5); --B5(6) * K(l)(6); -- 0 for the pd coeffs end loop; end Get_New_Y_to_Fifth_Order; ----------------------------- -- Get_New_Delta_t_and_Dt -- ----------------------------- -- Modifies Delta_t and Dt(i). -- Make Error_Tolerance 4 times smaller than requested for safety: Inverse_Error_Tolerance : constant Real := Four / Error_Tolerance; procedure Get_New_Delta_t_and_Dt (Error : in Real; Delta_t : in out Real; Dt : out Coefficient) is Error_Epsilon : constant Real := Error_Tolerance * 1.0E-6 + Real_Small; New_Delta_t_Factor : Real := One; Delta_t_Fractional_Change : Real := One; begin Delta_t_Fractional_Change := Four_Fifths * Exp (-One_Fifth * Log ( Inverse_Error_Tolerance * (Error + Error_Epsilon))); if Delta_t_Fractional_Change < One_Sixteenth then New_Delta_t_Factor := One_Sixteenth; elsif Delta_t_Fractional_Change > Four then New_Delta_t_Factor := Four; else New_Delta_t_Factor := Delta_t_Fractional_Change; end if; Delta_t := New_Delta_t_Factor * Delta_t; for i in Stages Loop Dt(i) := Delta_t * C(i); end loop; end Get_New_Delta_t_and_Dt; begin Y := Initial_State; Present_t := Initial_Time; Delta_t := Static_Delta_t; Step_id := Step_Type'First; for i in Stages loop Dt(i) := Delta_t * C(i); end loop; Time_Steps: loop -- First get Delta_Y to 5th Order by calculating the -- Runge-Kutta corrections K. -- -- K(Stages'First) := Delta_t * F (Time, Y); -- for Stage in Stages'First+1 .. Stages'Last loop -- K(Stage) := Delta_t * F (Time + Dt(Stage), Y + Sum (Stage)); -- end loop; -- Special Case: Stage = Stages'First; -- In the initial stage the prince-dormand method allows us to -- reuse the most recently calculated Next_Deriv (from the previous -- step). That's why it's effectively a 6 stage method, rather than 7. Make_New_Corrections_K: declare Next_t : Real := Present_t; --local to K calculation. begin -- optimization only for prince-dormand 5th order coeffs: if Error_Control_Desired or else Step_id = Step_Type'First then Next_Deriv := F (Next_t, Y); end if; for l in Dyn_Index loop K(l)(Stages'First) := Delta_t * Next_Deriv(l); end loop; Step_id := Step_id + 1; for Stage in Stages'First+1 .. Stages'Last loop Runge_Sum (Y, Next_Y, Stage, K); Next_t := Present_t + Dt(Stage); Next_Deriv := F (Next_t, Next_Y); for l in Dyn_Index loop K(l)(Stage) := Delta_t * Next_Deriv(l); end loop; end loop; end Make_New_Corrections_K; if This_Is_The_Final_Time_Step then --used only if error control is enabled. Get_New_Y_to_Fifth_Order (Y); exit Time_Steps; end if; -- Now increment Y and Time, and if desired, Delta_t. -- There are two algorithms below: with and -- without error control. if not Error_Control_Desired then -- Increment time and sum the Runge-Kutta series to increment Y. -- With the new Y, we can exit if Time is very near Final_Time. -- (Notice that Delta_t is negative if we integrate back in time.) -- use globally updated K to get new Y: Get_New_Y_to_Fifth_Order (Y); Present_t := Present_t + Static_Delta_t; exit Time_Steps when Abs (Final_Time-Present_t) < Abs (0.125*Static_Delta_t); else -- Error control desired, so first calculate error. Delta_Y := Fifth_Order_Delta_Y; -- used below Error_Y := Delta_Y - Fourth_Order_Delta_Y; Error := Norm (Error_Y); -- Error in 4th order Y really; scales as dt**5 (per step) -- Next increment Y and Time if error is OK. if Error <= Error_Tolerance then -- error is OK. Time1 := Present_t + Delta_t; if Abs (Time1-Initial_Time) < Abs (Final_Time-Initial_Time) then -- Increment both Time and Y. Afterwards -- get the new step size Delta_t. Present_t := Time1; Y := Y + Delta_Y; -- 5th order elsif Abs (Time1-Initial_Time) > Abs (Final_Time-Initial_Time) then -- Have to go through the loop again even -- though the error was small, because overshot -- the end. Decrease Delta_t here, so there's -- no need to check error again after final Loop. This_Is_The_Final_Time_Step := True; Delta_t := Final_Time - Present_t; for i in Stages loop Dt(i) := Delta_t * C(i); end loop; else -- Time1 = Final_Time, to just about the maximum accuracy -- of the floating point, so get the final Y and exit. Y := Y + Delta_Y; exit Time_Steps; end if; end if; -- If this isn't the final loop, then want to adjust Delta_t. -- We want to make Delta_t smaller if necessary for accuracy, and -- larger if possible for speed. If function ** is too slow then -- modify code so that this stuff is done only when we flunk -- the error test above. But as is, it is done each time step. if not This_Is_The_Final_Time_Step then Get_New_Delta_t_and_Dt (Error, Delta_t, Dt); end if; end if; -- not error_control_desired end loop Time_Steps; Final_State := Y; end Integrate; begin if Test_of_Runge_Coeffs_Desired then Prince_Dormand_Coeffs.Test_Runge_Coeffs; end if; end Runge_5th;
reznikmm/matreshka
Ada
3,719
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Table_Data_Field_Attributes is pragma Preelaborate; type ODF_Table_Data_Field_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Table_Data_Field_Attribute_Access is access all ODF_Table_Data_Field_Attribute'Class with Storage_Size => 0; end ODF.DOM.Table_Data_Field_Attributes;
Spohn/LegendOfZelba
Ada
501
ads
with NPC_PC; use NPC_PC; with ada.text_io; use ada.text_io; with enemy_BST; use enemy_bst; package Combat_package is ------------------------------- -- Name: Jon Spohn -- David Rogina -- Combat Package Specification ------------------------------- --Combat procedure Procedure Combat(Hero : in out HeroClass; Enemy : in out EnemyClass;ET : in out EnemyTree; Run : in out integer); --Draw Monster picture procedure draw_enemy(file:in file_type); end Combat_package;
AdaDoom3/wayland_ada_binding
Ada
3,509
ads
------------------------------------------------------------------------------ -- Copyright (C) 2015-2016, AdaCore -- -- -- -- This library is free software; you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 3, or (at your option) any later -- -- version. This library is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- -- TABILITY 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/>. -- -- -- ------------------------------------------------------------------------------ -- Unbounded controlled vectors of unconstrained elements pragma Ada_2012; with Conts.Elements.Indefinite_SPARK; with Conts.Vectors.Generics; with Conts.Vectors.Storage.Unbounded; with Conts.Properties.SPARK; generic type Index_Type is (<>); type Element_Type (<>) is private; package Conts.Vectors.Indefinite_Unbounded_SPARK with SPARK_Mode is pragma Assertion_Policy (Pre => Suppressible, Ghost => Suppressible, Post => Ignore); package Elements is new Conts.Elements.Indefinite_SPARK (Element_Type, Pool => Conts.Global_Pool); package Storage is new Conts.Vectors.Storage.Unbounded (Elements => Elements.Traits, Container_Base_Type => Limited_Base, Resize_Policy => Conts.Vectors.Resize_1_5); package Vectors is new Conts.Vectors.Generics (Index_Type, Storage.Traits); subtype Vector is Vectors.Vector; subtype Cursor is Vectors.Cursor; subtype Constant_Returned is Elements.Traits.Constant_Returned; subtype Extended_Index is Vectors.Extended_Index; package Cursors renames Vectors.Cursors; package Maps renames Vectors.Maps; subtype Element_Sequence is Vectors.Impl.M.Sequence with Ghost; use type Element_Sequence; function Copy (Self : Vector'Class) return Vector'Class; -- Return a deep copy of Self procedure Swap (Self : in out Cursors.Forward.Container; Left, Right : Index_Type) renames Vectors.Swap; package Content_Models is new Conts.Properties.SPARK.Content_Models (Map_Type => Vectors.Base_Vector'Class, Element_Type => Element_Type, Model_Type => Element_Sequence, Index_Type => Vectors.Impl.M.Extended_Index, Model => Vectors.Impl.Model, Get => Vectors.Impl.M.Get, First => Vectors.Impl.M.First, Last => Vectors.Impl.M.Last); end Conts.Vectors.Indefinite_Unbounded_SPARK;
reznikmm/matreshka
Ada
3,654
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Elements; package ODF.DOM.Draw_Object_Elements is pragma Preelaborate; type ODF_Draw_Object is limited interface and XML.DOM.Elements.DOM_Element; type ODF_Draw_Object_Access is access all ODF_Draw_Object'Class with Storage_Size => 0; end ODF.DOM.Draw_Object_Elements;
ytomino/gnat4drake
Ada
202
ads
pragma License (Unrestricted); with System.File_Control_Block; package System.File_IO is pragma Preelaborate; procedure Check_File_Open (File : File_Control_Block.AFCB_Ptr); end System.File_IO;
micahwelf/FLTK-Ada
Ada
831
ads
package FLTK.Widgets.Valuators.Dials.Line is type Line_Dial is new Dial with private; type Line_Dial_Reference (Data : not null access Line_Dial'Class) is limited null record with Implicit_Dereference => Data; package Forge is function Create (X, Y, W, H : in Integer; Text : in String) return Line_Dial; end Forge; procedure Draw (This : in out Line_Dial); function Handle (This : in out Line_Dial; Event : in Event_Kind) return Event_Outcome; private type Line_Dial is new Dial with null record; overriding procedure Finalize (This : in out Line_Dial); pragma Inline (Draw); pragma Inline (Handle); end FLTK.Widgets.Valuators.Dials.Line;
sparre/Command-Line-Parser-Generator
Ada
948
ads
-- Copyright: JSA Research & Innovation <[email protected]> -- License: Beer Ware pragma License (Unrestricted); with Asis, Asis.Elements; package Command_Line_Parser_Generator.Help is use Asis, Asis.Elements; subtype Package_Specification is Asis.Declaration with Dynamic_Predicate => Declaration_Kind (Package_Specification) = A_Package_Declaration; subtype Procedure_Specification is Asis.Declaration with Dynamic_Predicate => Declaration_Kind (Procedure_Specification) in A_Procedure_Declaration | A_Procedure_Renaming_Declaration; function Generate_Show_Help (Item : in Package_Specification) return Boolean; function Generate_Help_Texts (Item : in Package_Specification) return Boolean; end Command_Line_Parser_Generator.Help;
AdaCore/gpr
Ada
1,960
adb
-- -- Copyright (C) 2019-2023, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 -- with Ada.Strings.Fixed; with Ada.Text_IO; with GPR2.Unit; with GPR2.Context; with GPR2.Path_Name; with GPR2.Project.Source.Set; with GPR2.Project.View; with GPR2.Project.Tree; with GPR2.Source_Info.Parser.Ada_Language; procedure Main is use Ada; use GPR2; use GPR2.Project; procedure Check (Project_Name : Filename_Type); -- Do check the given project's sources procedure Output_Filename (Filename : Path_Name.Full_Name); -- Remove the leading tmp directory ----------- -- Check -- ----------- procedure Check (Project_Name : Filename_Type) is Prj : Project.Tree.Object; Ctx : Context.Object; View : Project.View.Object; begin Project.Tree.Load (Prj, Create (Project_Name), Ctx); Prj.Load_Configuration (Create ("config.cgpr")); View := Prj.Root_Project; Text_IO.Put_Line ("Project: " & String (View.Name)); for Source of View.Sources loop declare U : constant Optional_Name_Type := Source.Unit_Name; begin Output_Filename (Source.Path_Name.Value); Text_IO.Set_Col (16); Text_IO.Put (" language: " & Image (Source.Language)); Text_IO.Set_Col (33); Text_IO.Put (" Kind: " & GPR2.Unit.Library_Unit_Type'Image (Source.Kind)); if U /= "" then Text_IO.Put (" unit: " & String (U)); end if; Text_IO.New_Line; end; end loop; end Check; --------------------- -- Output_Filename -- --------------------- procedure Output_Filename (Filename : Path_Name.Full_Name) is I : constant Positive := Strings.Fixed.Index (Filename, "source2"); begin Text_IO.Put (" > " & Filename (I + 8 .. Filename'Last)); end Output_Filename; begin Check ("demo.gpr"); end Main;
reznikmm/matreshka
Ada
79,571
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.CMOF; with AMF.Internals.Tables.CMOF_Attributes; with AMF.Internals.Tables.Utp_String_Data_00; package body AMF.Internals.Tables.Utp_Metamodel.Properties is ---------------- -- Initialize -- ---------------- procedure Initialize is begin Initialize_1; Initialize_2; Initialize_3; Initialize_4; Initialize_5; Initialize_6; Initialize_7; Initialize_8; Initialize_9; Initialize_10; Initialize_11; Initialize_12; Initialize_13; Initialize_14; Initialize_15; Initialize_16; Initialize_17; Initialize_18; Initialize_19; Initialize_20; Initialize_21; Initialize_22; Initialize_23; Initialize_24; Initialize_25; Initialize_26; Initialize_27; Initialize_28; Initialize_29; Initialize_30; Initialize_31; Initialize_32; Initialize_33; Initialize_34; Initialize_35; Initialize_36; Initialize_37; Initialize_38; Initialize_39; Initialize_40; Initialize_41; Initialize_42; Initialize_43; Initialize_44; Initialize_45; Initialize_46; Initialize_47; Initialize_48; Initialize_49; Initialize_50; Initialize_51; Initialize_52; Initialize_53; Initialize_54; Initialize_55; Initialize_56; Initialize_57; Initialize_58; Initialize_59; Initialize_60; Initialize_61; Initialize_62; Initialize_63; Initialize_64; Initialize_65; Initialize_66; Initialize_67; Initialize_68; Initialize_69; Initialize_70; Initialize_71; Initialize_72; Initialize_73; Initialize_74; Initialize_75; Initialize_76; Initialize_77; Initialize_78; Initialize_79; Initialize_80; Initialize_81; Initialize_82; Initialize_83; Initialize_84; Initialize_85; Initialize_86; Initialize_87; Initialize_88; Initialize_89; Initialize_90; Initialize_91; Initialize_92; Initialize_93; Initialize_94; Initialize_95; Initialize_96; Initialize_97; Initialize_98; Initialize_99; Initialize_100; Initialize_101; Initialize_102; Initialize_103; Initialize_104; Initialize_105; Initialize_106; Initialize_107; Initialize_108; Initialize_109; Initialize_110; Initialize_111; Initialize_112; Initialize_113; Initialize_114; Initialize_115; Initialize_116; Initialize_117; Initialize_118; Initialize_119; Initialize_120; Initialize_121; Initialize_122; Initialize_123; Initialize_124; Initialize_125; Initialize_126; Initialize_127; Initialize_128; Initialize_129; Initialize_130; Initialize_131; Initialize_132; Initialize_133; Initialize_134; Initialize_135; Initialize_136; Initialize_137; Initialize_138; Initialize_139; Initialize_140; Initialize_141; Initialize_142; Initialize_143; Initialize_144; Initialize_145; Initialize_146; Initialize_147; Initialize_148; Initialize_149; Initialize_150; Initialize_151; Initialize_152; Initialize_153; Initialize_154; Initialize_155; Initialize_156; Initialize_157; Initialize_158; Initialize_159; Initialize_160; Initialize_161; Initialize_162; Initialize_163; Initialize_164; Initialize_165; Initialize_166; Initialize_167; Initialize_168; Initialize_169; Initialize_170; Initialize_171; Initialize_172; end Initialize; ------------------ -- Initialize_1 -- ------------------ procedure Initialize_1 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 1, AMF.Internals.Tables.Utp_String_Data_00.MS_000D'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 1, (False, AMF.CMOF.Public_Visibility)); end Initialize_1; ------------------ -- Initialize_2 -- ------------------ procedure Initialize_2 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 2, AMF.Internals.Tables.Utp_String_Data_00.MS_0019'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 2, (False, AMF.CMOF.Public_Visibility)); end Initialize_2; ------------------ -- Initialize_3 -- ------------------ procedure Initialize_3 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 3, AMF.Internals.Tables.Utp_String_Data_00.MS_002D'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 3, (False, AMF.CMOF.Public_Visibility)); end Initialize_3; ------------------ -- Initialize_4 -- ------------------ procedure Initialize_4 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 4, AMF.Internals.Tables.Utp_String_Data_00.MS_0065'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 4, (False, AMF.CMOF.Public_Visibility)); end Initialize_4; ------------------ -- Initialize_5 -- ------------------ procedure Initialize_5 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 5, AMF.Internals.Tables.Utp_String_Data_00.MS_001F'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 5, (False, AMF.CMOF.Public_Visibility)); end Initialize_5; ------------------ -- Initialize_6 -- ------------------ procedure Initialize_6 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 6, AMF.Internals.Tables.Utp_String_Data_00.MS_0057'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 6, (False, AMF.CMOF.Public_Visibility)); end Initialize_6; ------------------ -- Initialize_7 -- ------------------ procedure Initialize_7 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 7, AMF.Internals.Tables.Utp_String_Data_00.MS_0061'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 7, (False, AMF.CMOF.Public_Visibility)); end Initialize_7; ------------------ -- Initialize_8 -- ------------------ procedure Initialize_8 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 8, AMF.Internals.Tables.Utp_String_Data_00.MS_0060'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 8, (False, AMF.CMOF.Public_Visibility)); end Initialize_8; ------------------ -- Initialize_9 -- ------------------ procedure Initialize_9 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 9, AMF.Internals.Tables.Utp_String_Data_00.MS_004D'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 9, (False, AMF.CMOF.Public_Visibility)); end Initialize_9; ------------------- -- Initialize_10 -- ------------------- procedure Initialize_10 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 10, AMF.Internals.Tables.Utp_String_Data_00.MS_0028'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 10, (False, AMF.CMOF.Public_Visibility)); end Initialize_10; ------------------- -- Initialize_11 -- ------------------- procedure Initialize_11 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 11, AMF.Internals.Tables.Utp_String_Data_00.MS_0050'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 11, (False, AMF.CMOF.Public_Visibility)); end Initialize_11; ------------------- -- Initialize_12 -- ------------------- procedure Initialize_12 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 12, AMF.Internals.Tables.Utp_String_Data_00.MS_0023'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 12, (False, AMF.CMOF.Public_Visibility)); end Initialize_12; ------------------- -- Initialize_13 -- ------------------- procedure Initialize_13 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 13, AMF.Internals.Tables.Utp_String_Data_00.MS_0058'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 13, (False, AMF.CMOF.Public_Visibility)); end Initialize_13; ------------------- -- Initialize_14 -- ------------------- procedure Initialize_14 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 14, AMF.Internals.Tables.Utp_String_Data_00.MS_0004'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 14, (False, AMF.CMOF.Public_Visibility)); end Initialize_14; ------------------- -- Initialize_15 -- ------------------- procedure Initialize_15 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 15, AMF.Internals.Tables.Utp_String_Data_00.MS_003E'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 15, (False, AMF.CMOF.Public_Visibility)); end Initialize_15; ------------------- -- Initialize_16 -- ------------------- procedure Initialize_16 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 16, AMF.Internals.Tables.Utp_String_Data_00.MS_0002'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 16, (False, AMF.CMOF.Public_Visibility)); end Initialize_16; ------------------- -- Initialize_17 -- ------------------- procedure Initialize_17 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 17, AMF.Internals.Tables.Utp_String_Data_00.MS_0062'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 17, (False, AMF.CMOF.Public_Visibility)); end Initialize_17; ------------------- -- Initialize_18 -- ------------------- procedure Initialize_18 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 18, AMF.Internals.Tables.Utp_String_Data_00.MS_0054'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 18, (False, AMF.CMOF.Public_Visibility)); end Initialize_18; ------------------- -- Initialize_19 -- ------------------- procedure Initialize_19 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 19, AMF.Internals.Tables.Utp_String_Data_00.MS_0017'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 19, (False, AMF.CMOF.Public_Visibility)); end Initialize_19; ------------------- -- Initialize_20 -- ------------------- procedure Initialize_20 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 20, AMF.Internals.Tables.Utp_String_Data_00.MS_004E'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 20, (False, AMF.CMOF.Public_Visibility)); end Initialize_20; ------------------- -- Initialize_21 -- ------------------- procedure Initialize_21 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 21, AMF.Internals.Tables.Utp_String_Data_00.MS_0067'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 21, (False, AMF.CMOF.Public_Visibility)); end Initialize_21; ------------------- -- Initialize_22 -- ------------------- procedure Initialize_22 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 22, AMF.Internals.Tables.Utp_String_Data_00.MS_006C'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 22, (False, AMF.CMOF.Public_Visibility)); end Initialize_22; ------------------- -- Initialize_23 -- ------------------- procedure Initialize_23 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 23, AMF.Internals.Tables.Utp_String_Data_00.MS_001B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 23, (False, AMF.CMOF.Public_Visibility)); end Initialize_23; ------------------- -- Initialize_24 -- ------------------- procedure Initialize_24 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 24, AMF.Internals.Tables.Utp_String_Data_00.MS_0035'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 24, (False, AMF.CMOF.Public_Visibility)); end Initialize_24; ------------------- -- Initialize_25 -- ------------------- procedure Initialize_25 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 25, AMF.Internals.Tables.Utp_String_Data_00.MS_0048'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 25, (False, AMF.CMOF.Public_Visibility)); end Initialize_25; ------------------- -- Initialize_26 -- ------------------- procedure Initialize_26 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 26, AMF.Internals.Tables.Utp_String_Data_00.MS_0055'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 26, (False, AMF.CMOF.Public_Visibility)); end Initialize_26; ------------------- -- Initialize_27 -- ------------------- procedure Initialize_27 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 27, AMF.Internals.Tables.Utp_String_Data_00.MS_005A'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 27, (False, AMF.CMOF.Public_Visibility)); end Initialize_27; ------------------- -- Initialize_28 -- ------------------- procedure Initialize_28 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 28, AMF.Internals.Tables.Utp_String_Data_00.MS_0015'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 28, (False, AMF.CMOF.Public_Visibility)); end Initialize_28; ------------------- -- Initialize_29 -- ------------------- procedure Initialize_29 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 29, AMF.Internals.Tables.Utp_String_Data_00.MS_0068'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 29, (False, AMF.CMOF.Public_Visibility)); end Initialize_29; ------------------- -- Initialize_30 -- ------------------- procedure Initialize_30 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 30, AMF.Internals.Tables.Utp_String_Data_00.MS_005C'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 30, (False, AMF.CMOF.Public_Visibility)); end Initialize_30; ------------------- -- Initialize_31 -- ------------------- procedure Initialize_31 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 31, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 31, AMF.Internals.Tables.Utp_String_Data_00.MS_0005'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 31, (False, (Unlimited => True))); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 31, (False, AMF.CMOF.Public_Visibility)); end Initialize_31; ------------------- -- Initialize_32 -- ------------------- procedure Initialize_32 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 32, AMF.Internals.Tables.Utp_String_Data_00.MS_0036'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 32, (False, AMF.CMOF.Public_Visibility)); end Initialize_32; ------------------- -- Initialize_33 -- ------------------- procedure Initialize_33 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 33, AMF.Internals.Tables.Utp_String_Data_00.MS_0026'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 33, (False, AMF.CMOF.Public_Visibility)); end Initialize_33; ------------------- -- Initialize_34 -- ------------------- procedure Initialize_34 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 34, AMF.Internals.Tables.Utp_String_Data_00.MS_001C'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 34, (False, AMF.CMOF.Public_Visibility)); end Initialize_34; ------------------- -- Initialize_35 -- ------------------- procedure Initialize_35 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 35, AMF.Internals.Tables.Utp_String_Data_00.MS_0056'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 35, (False, AMF.CMOF.Public_Visibility)); end Initialize_35; ------------------- -- Initialize_36 -- ------------------- procedure Initialize_36 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 36, AMF.Internals.Tables.Utp_String_Data_00.MS_004A'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 36, (False, AMF.CMOF.Public_Visibility)); end Initialize_36; ------------------- -- Initialize_37 -- ------------------- procedure Initialize_37 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 37, AMF.Internals.Tables.Utp_String_Data_00.MS_004A'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 37, (False, AMF.CMOF.Public_Visibility)); end Initialize_37; ------------------- -- Initialize_38 -- ------------------- procedure Initialize_38 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 38, AMF.Internals.Tables.Utp_String_Data_00.MS_0026'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 38, (False, AMF.CMOF.Public_Visibility)); end Initialize_38; ------------------- -- Initialize_39 -- ------------------- procedure Initialize_39 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 39, AMF.Internals.Tables.Utp_String_Data_00.MS_0059'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 39, (False, AMF.CMOF.Public_Visibility)); end Initialize_39; ------------------- -- Initialize_40 -- ------------------- procedure Initialize_40 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 40, AMF.Internals.Tables.Utp_String_Data_00.MS_005B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 40, (False, AMF.CMOF.Public_Visibility)); end Initialize_40; ------------------- -- Initialize_41 -- ------------------- procedure Initialize_41 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 41, AMF.Internals.Tables.Utp_String_Data_00.MS_006A'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 41, (False, AMF.CMOF.Public_Visibility)); end Initialize_41; ------------------- -- Initialize_42 -- ------------------- procedure Initialize_42 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 42, AMF.Internals.Tables.Utp_String_Data_00.MS_003A'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 42, (False, AMF.CMOF.Public_Visibility)); end Initialize_42; ------------------- -- Initialize_43 -- ------------------- procedure Initialize_43 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 43, AMF.Internals.Tables.Utp_String_Data_00.MS_0039'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 43, (False, AMF.CMOF.Public_Visibility)); end Initialize_43; ------------------- -- Initialize_44 -- ------------------- procedure Initialize_44 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 44, AMF.Internals.Tables.Utp_String_Data_00.MS_003C'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 44, (False, AMF.CMOF.Public_Visibility)); end Initialize_44; ------------------- -- Initialize_45 -- ------------------- procedure Initialize_45 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 45, AMF.Internals.Tables.Utp_String_Data_00.MS_001E'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 45, (False, AMF.CMOF.Public_Visibility)); end Initialize_45; ------------------- -- Initialize_46 -- ------------------- procedure Initialize_46 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 46, AMF.Internals.Tables.Utp_String_Data_00.MS_003B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 46, (False, AMF.CMOF.Public_Visibility)); end Initialize_46; ------------------- -- Initialize_47 -- ------------------- procedure Initialize_47 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 47, AMF.Internals.Tables.Utp_String_Data_00.MS_0066'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 47, (False, AMF.CMOF.Public_Visibility)); end Initialize_47; ------------------- -- Initialize_48 -- ------------------- procedure Initialize_48 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 48, AMF.Internals.Tables.Utp_String_Data_00.MS_0066'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 48, (False, AMF.CMOF.Public_Visibility)); end Initialize_48; ------------------- -- Initialize_49 -- ------------------- procedure Initialize_49 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 49, AMF.Internals.Tables.Utp_String_Data_00.MS_0031'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 49, (False, AMF.CMOF.Public_Visibility)); end Initialize_49; ------------------- -- Initialize_50 -- ------------------- procedure Initialize_50 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 50, AMF.Internals.Tables.Utp_String_Data_00.MS_001A'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 50, (False, AMF.CMOF.Public_Visibility)); end Initialize_50; ------------------- -- Initialize_51 -- ------------------- procedure Initialize_51 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 51, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 51, AMF.Internals.Tables.Utp_String_Data_00.MS_0022'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 51, (False, AMF.CMOF.Public_Visibility)); end Initialize_51; ------------------- -- Initialize_52 -- ------------------- procedure Initialize_52 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 52, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 52, AMF.Internals.Tables.Utp_String_Data_00.MS_0069'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 52, (False, AMF.CMOF.Public_Visibility)); end Initialize_52; ------------------- -- Initialize_53 -- ------------------- procedure Initialize_53 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 53, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 53, AMF.Internals.Tables.Utp_String_Data_00.MS_0020'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 53, (False, AMF.CMOF.Public_Visibility)); end Initialize_53; ------------------- -- Initialize_54 -- ------------------- procedure Initialize_54 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 54, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 54, AMF.Internals.Tables.Utp_String_Data_00.MS_0032'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 54, (False, AMF.CMOF.Public_Visibility)); end Initialize_54; ------------------- -- Initialize_55 -- ------------------- procedure Initialize_55 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 55, AMF.Internals.Tables.Utp_String_Data_00.MS_0018'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 55, (False, AMF.CMOF.Public_Visibility)); end Initialize_55; ------------------- -- Initialize_56 -- ------------------- procedure Initialize_56 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 56, AMF.Internals.Tables.Utp_String_Data_00.MS_0026'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 56, (False, AMF.CMOF.Public_Visibility)); end Initialize_56; ------------------- -- Initialize_57 -- ------------------- procedure Initialize_57 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 57, AMF.Internals.Tables.Utp_String_Data_00.MS_000A'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 57, (False, AMF.CMOF.Public_Visibility)); end Initialize_57; ------------------- -- Initialize_58 -- ------------------- procedure Initialize_58 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 58, AMF.Internals.Tables.Utp_String_Data_00.MS_0018'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 58, (False, AMF.CMOF.Public_Visibility)); end Initialize_58; ------------------- -- Initialize_59 -- ------------------- procedure Initialize_59 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 59, AMF.Internals.Tables.Utp_String_Data_00.MS_0018'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 59, (False, AMF.CMOF.Public_Visibility)); end Initialize_59; ------------------- -- Initialize_60 -- ------------------- procedure Initialize_60 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 60, AMF.Internals.Tables.Utp_String_Data_00.MS_005B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 60, (False, AMF.CMOF.Public_Visibility)); end Initialize_60; ------------------- -- Initialize_61 -- ------------------- procedure Initialize_61 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 61, AMF.Internals.Tables.Utp_String_Data_00.MS_0059'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 61, (False, AMF.CMOF.Public_Visibility)); end Initialize_61; ------------------- -- Initialize_62 -- ------------------- procedure Initialize_62 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 62, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 62, AMF.Internals.Tables.Utp_String_Data_00.MS_0038'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 62, (False, (Unlimited => True))); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 62, (False, AMF.CMOF.Public_Visibility)); end Initialize_62; ------------------- -- Initialize_63 -- ------------------- procedure Initialize_63 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 63, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 63, AMF.Internals.Tables.Utp_String_Data_00.MS_0011'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 63, (False, (Unlimited => True))); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 63, (False, AMF.CMOF.Public_Visibility)); end Initialize_63; ------------------- -- Initialize_64 -- ------------------- procedure Initialize_64 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 64, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 64, AMF.Internals.Tables.Utp_String_Data_00.MS_0046'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 64, (False, AMF.CMOF.Public_Visibility)); end Initialize_64; ------------------- -- Initialize_65 -- ------------------- procedure Initialize_65 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 65, AMF.Internals.Tables.Utp_String_Data_00.MS_0013'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 65, (False, AMF.CMOF.Public_Visibility)); end Initialize_65; ------------------- -- Initialize_66 -- ------------------- procedure Initialize_66 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 66, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 66, AMF.Internals.Tables.Utp_String_Data_00.MS_0038'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 66, (False, (Unlimited => True))); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 66, (False, AMF.CMOF.Public_Visibility)); end Initialize_66; ------------------- -- Initialize_67 -- ------------------- procedure Initialize_67 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 67, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 67, AMF.Internals.Tables.Utp_String_Data_00.MS_0011'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 67, (False, (Unlimited => True))); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 67, (False, AMF.CMOF.Public_Visibility)); end Initialize_67; ------------------- -- Initialize_68 -- ------------------- procedure Initialize_68 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 68, AMF.Internals.Tables.Utp_String_Data_00.MS_002C'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 68, (False, AMF.CMOF.Public_Visibility)); end Initialize_68; ------------------- -- Initialize_69 -- ------------------- procedure Initialize_69 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 69, AMF.Internals.Tables.Utp_String_Data_00.MS_0013'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 69, (False, AMF.CMOF.Public_Visibility)); end Initialize_69; ------------------- -- Initialize_70 -- ------------------- procedure Initialize_70 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 70, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 70, AMF.Internals.Tables.Utp_String_Data_00.MS_0038'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 70, (False, (Unlimited => True))); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 70, (False, AMF.CMOF.Public_Visibility)); end Initialize_70; ------------------- -- Initialize_71 -- ------------------- procedure Initialize_71 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 71, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 71, AMF.Internals.Tables.Utp_String_Data_00.MS_0011'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 71, (False, (Unlimited => True))); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 71, (False, AMF.CMOF.Public_Visibility)); end Initialize_71; ------------------- -- Initialize_72 -- ------------------- procedure Initialize_72 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 72, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 72, AMF.Internals.Tables.Utp_String_Data_00.MS_0037'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 72, (False, AMF.CMOF.Public_Visibility)); end Initialize_72; ------------------- -- Initialize_73 -- ------------------- procedure Initialize_73 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 73, AMF.Internals.Tables.Utp_String_Data_00.MS_005B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 73, (False, AMF.CMOF.Public_Visibility)); end Initialize_73; ------------------- -- Initialize_74 -- ------------------- procedure Initialize_74 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 74, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 74, AMF.Internals.Tables.Utp_String_Data_00.MS_0014'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 74, (False, AMF.CMOF.Public_Visibility)); end Initialize_74; ------------------- -- Initialize_75 -- ------------------- procedure Initialize_75 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 75, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 75, AMF.Internals.Tables.Utp_String_Data_00.MS_0042'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 75, (False, AMF.CMOF.Public_Visibility)); end Initialize_75; ------------------- -- Initialize_76 -- ------------------- procedure Initialize_76 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 76, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 76, AMF.Internals.Tables.Utp_String_Data_00.MS_005D'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 76, (False, AMF.CMOF.Public_Visibility)); end Initialize_76; ------------------- -- Initialize_77 -- ------------------- procedure Initialize_77 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 77, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 77, AMF.Internals.Tables.Utp_String_Data_00.MS_0003'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Upper (Base + 77, (False, (Unlimited => True))); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 77, (False, AMF.CMOF.Public_Visibility)); end Initialize_77; ------------------- -- Initialize_78 -- ------------------- procedure Initialize_78 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 78, AMF.Internals.Tables.Utp_String_Data_00.MS_0044'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 78, (False, AMF.CMOF.Public_Visibility)); end Initialize_78; ------------------- -- Initialize_79 -- ------------------- procedure Initialize_79 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 79, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 79, AMF.Internals.Tables.Utp_String_Data_00.MS_004B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 79, (False, AMF.CMOF.Public_Visibility)); end Initialize_79; ------------------- -- Initialize_80 -- ------------------- procedure Initialize_80 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 80, AMF.Internals.Tables.Utp_String_Data_00.MS_006A'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 80, (False, AMF.CMOF.Public_Visibility)); end Initialize_80; ------------------- -- Initialize_81 -- ------------------- procedure Initialize_81 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 81, AMF.Internals.Tables.Utp_String_Data_00.MS_006A'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 81, (False, AMF.CMOF.Public_Visibility)); end Initialize_81; ------------------- -- Initialize_82 -- ------------------- procedure Initialize_82 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 82, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 82, AMF.Internals.Tables.Utp_String_Data_00.MS_0046'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 82, (False, AMF.CMOF.Public_Visibility)); end Initialize_82; ------------------- -- Initialize_83 -- ------------------- procedure Initialize_83 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 83, AMF.Internals.Tables.Utp_String_Data_00.MS_005B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 83, (False, AMF.CMOF.Public_Visibility)); end Initialize_83; ------------------- -- Initialize_84 -- ------------------- procedure Initialize_84 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 84, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 84, AMF.Internals.Tables.Utp_String_Data_00.MS_0046'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 84, (False, AMF.CMOF.Public_Visibility)); end Initialize_84; ------------------- -- Initialize_85 -- ------------------- procedure Initialize_85 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 85, AMF.Internals.Tables.Utp_String_Data_00.MS_0033'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 85, (False, AMF.CMOF.Public_Visibility)); end Initialize_85; ------------------- -- Initialize_86 -- ------------------- procedure Initialize_86 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 86, AMF.Internals.Tables.Utp_String_Data_00.MS_0009'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 86, (False, AMF.CMOF.Public_Visibility)); end Initialize_86; ------------------- -- Initialize_87 -- ------------------- procedure Initialize_87 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 87, AMF.Internals.Tables.Utp_String_Data_00.MS_005E'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 87, (False, AMF.CMOF.Public_Visibility)); end Initialize_87; ------------------- -- Initialize_88 -- ------------------- procedure Initialize_88 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 88, AMF.Internals.Tables.Utp_String_Data_00.MS_003B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 88, (False, AMF.CMOF.Public_Visibility)); end Initialize_88; ------------------- -- Initialize_89 -- ------------------- procedure Initialize_89 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 89, AMF.Internals.Tables.Utp_String_Data_00.MS_0018'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 89, (False, AMF.CMOF.Public_Visibility)); end Initialize_89; ------------------- -- Initialize_90 -- ------------------- procedure Initialize_90 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 90, (False, AMF.CMOF.Public_Visibility)); end Initialize_90; ------------------- -- Initialize_91 -- ------------------- procedure Initialize_91 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 91, (False, AMF.CMOF.Public_Visibility)); end Initialize_91; ------------------- -- Initialize_92 -- ------------------- procedure Initialize_92 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 92, (False, AMF.CMOF.Public_Visibility)); end Initialize_92; ------------------- -- Initialize_93 -- ------------------- procedure Initialize_93 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 93, (False, AMF.CMOF.Public_Visibility)); end Initialize_93; ------------------- -- Initialize_94 -- ------------------- procedure Initialize_94 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 94, (False, AMF.CMOF.Public_Visibility)); end Initialize_94; ------------------- -- Initialize_95 -- ------------------- procedure Initialize_95 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 95, (False, AMF.CMOF.Public_Visibility)); end Initialize_95; ------------------- -- Initialize_96 -- ------------------- procedure Initialize_96 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 96, (False, AMF.CMOF.Public_Visibility)); end Initialize_96; ------------------- -- Initialize_97 -- ------------------- procedure Initialize_97 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 97, (False, AMF.CMOF.Public_Visibility)); end Initialize_97; ------------------- -- Initialize_98 -- ------------------- procedure Initialize_98 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 98, (False, AMF.CMOF.Public_Visibility)); end Initialize_98; ------------------- -- Initialize_99 -- ------------------- procedure Initialize_99 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 99, (False, AMF.CMOF.Public_Visibility)); end Initialize_99; -------------------- -- Initialize_100 -- -------------------- procedure Initialize_100 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 100, (False, AMF.CMOF.Public_Visibility)); end Initialize_100; -------------------- -- Initialize_101 -- -------------------- procedure Initialize_101 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 101, (False, AMF.CMOF.Public_Visibility)); end Initialize_101; -------------------- -- Initialize_102 -- -------------------- procedure Initialize_102 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 102, (False, AMF.CMOF.Public_Visibility)); end Initialize_102; -------------------- -- Initialize_103 -- -------------------- procedure Initialize_103 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 103, (False, AMF.CMOF.Public_Visibility)); end Initialize_103; -------------------- -- Initialize_104 -- -------------------- procedure Initialize_104 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 104, (False, AMF.CMOF.Public_Visibility)); end Initialize_104; -------------------- -- Initialize_105 -- -------------------- procedure Initialize_105 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 105, (False, AMF.CMOF.Public_Visibility)); end Initialize_105; -------------------- -- Initialize_106 -- -------------------- procedure Initialize_106 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 106, (False, AMF.CMOF.Public_Visibility)); end Initialize_106; -------------------- -- Initialize_107 -- -------------------- procedure Initialize_107 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 107, (False, AMF.CMOF.Public_Visibility)); end Initialize_107; -------------------- -- Initialize_108 -- -------------------- procedure Initialize_108 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 108, (False, AMF.CMOF.Public_Visibility)); end Initialize_108; -------------------- -- Initialize_109 -- -------------------- procedure Initialize_109 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 109, (False, AMF.CMOF.Public_Visibility)); end Initialize_109; -------------------- -- Initialize_110 -- -------------------- procedure Initialize_110 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 110, (False, AMF.CMOF.Public_Visibility)); end Initialize_110; -------------------- -- Initialize_111 -- -------------------- procedure Initialize_111 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 111, (False, AMF.CMOF.Public_Visibility)); end Initialize_111; -------------------- -- Initialize_112 -- -------------------- procedure Initialize_112 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 112, (False, AMF.CMOF.Public_Visibility)); end Initialize_112; -------------------- -- Initialize_113 -- -------------------- procedure Initialize_113 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 113, (False, AMF.CMOF.Public_Visibility)); end Initialize_113; -------------------- -- Initialize_114 -- -------------------- procedure Initialize_114 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 114, (False, AMF.CMOF.Public_Visibility)); end Initialize_114; -------------------- -- Initialize_115 -- -------------------- procedure Initialize_115 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 115, (False, AMF.CMOF.Public_Visibility)); end Initialize_115; -------------------- -- Initialize_116 -- -------------------- procedure Initialize_116 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 116, (False, AMF.CMOF.Public_Visibility)); end Initialize_116; -------------------- -- Initialize_117 -- -------------------- procedure Initialize_117 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 117, (False, AMF.CMOF.Public_Visibility)); end Initialize_117; -------------------- -- Initialize_118 -- -------------------- procedure Initialize_118 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 118, (False, AMF.CMOF.Public_Visibility)); end Initialize_118; -------------------- -- Initialize_119 -- -------------------- procedure Initialize_119 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 119, (False, AMF.CMOF.Public_Visibility)); end Initialize_119; -------------------- -- Initialize_120 -- -------------------- procedure Initialize_120 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 120, (False, AMF.CMOF.Public_Visibility)); end Initialize_120; -------------------- -- Initialize_121 -- -------------------- procedure Initialize_121 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 121, (False, AMF.CMOF.Public_Visibility)); end Initialize_121; -------------------- -- Initialize_122 -- -------------------- procedure Initialize_122 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 122, (False, AMF.CMOF.Public_Visibility)); end Initialize_122; -------------------- -- Initialize_123 -- -------------------- procedure Initialize_123 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 123, (False, AMF.CMOF.Public_Visibility)); end Initialize_123; -------------------- -- Initialize_124 -- -------------------- procedure Initialize_124 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 124, (False, AMF.CMOF.Public_Visibility)); end Initialize_124; -------------------- -- Initialize_125 -- -------------------- procedure Initialize_125 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 125, (False, AMF.CMOF.Public_Visibility)); end Initialize_125; -------------------- -- Initialize_126 -- -------------------- procedure Initialize_126 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 126, AMF.Internals.Tables.Utp_String_Data_00.MS_006B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Uri (Base + 126, AMF.Internals.Tables.Utp_String_Data_00.MS_0027'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 126, (False, AMF.CMOF.Public_Visibility)); end Initialize_126; -------------------- -- Initialize_127 -- -------------------- procedure Initialize_127 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 127, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 127, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 127, AMF.Internals.Tables.Utp_String_Data_00.MS_0051'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 127, (False, AMF.CMOF.Public_Visibility)); end Initialize_127; -------------------- -- Initialize_128 -- -------------------- procedure Initialize_128 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 128, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 128, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 128, AMF.Internals.Tables.Utp_String_Data_00.MS_000F'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 128, (False, AMF.CMOF.Public_Visibility)); end Initialize_128; -------------------- -- Initialize_129 -- -------------------- procedure Initialize_129 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 129, AMF.Internals.Tables.Utp_String_Data_00.MS_0034'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 129, (False, AMF.CMOF.Public_Visibility)); end Initialize_129; -------------------- -- Initialize_130 -- -------------------- procedure Initialize_130 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 130, AMF.Internals.Tables.Utp_String_Data_00.MS_006D'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 130, (False, AMF.CMOF.Public_Visibility)); end Initialize_130; -------------------- -- Initialize_131 -- -------------------- procedure Initialize_131 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 131, AMF.Internals.Tables.Utp_String_Data_00.MS_0029'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 131, (False, AMF.CMOF.Public_Visibility)); end Initialize_131; -------------------- -- Initialize_132 -- -------------------- procedure Initialize_132 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 132, AMF.Internals.Tables.Utp_String_Data_00.MS_0006'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 132, (False, AMF.CMOF.Public_Visibility)); end Initialize_132; -------------------- -- Initialize_133 -- -------------------- procedure Initialize_133 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 133, AMF.Internals.Tables.Utp_String_Data_00.MS_0063'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 133, (False, AMF.CMOF.Public_Visibility)); end Initialize_133; -------------------- -- Initialize_134 -- -------------------- procedure Initialize_134 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 134, AMF.Internals.Tables.Utp_String_Data_00.MS_000E'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 134, (False, AMF.CMOF.Public_Visibility)); end Initialize_134; -------------------- -- Initialize_135 -- -------------------- procedure Initialize_135 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 135, AMF.Internals.Tables.Utp_String_Data_00.MS_0053'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 135, (False, AMF.CMOF.Public_Visibility)); end Initialize_135; -------------------- -- Initialize_136 -- -------------------- procedure Initialize_136 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 136, AMF.Internals.Tables.Utp_String_Data_00.MS_000C'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 136, (False, AMF.CMOF.Public_Visibility)); end Initialize_136; -------------------- -- Initialize_137 -- -------------------- procedure Initialize_137 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 137, AMF.Internals.Tables.Utp_String_Data_00.MS_0052'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 137, (False, AMF.CMOF.Public_Visibility)); end Initialize_137; -------------------- -- Initialize_138 -- -------------------- procedure Initialize_138 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 138, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 138, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 138, AMF.Internals.Tables.Utp_String_Data_00.MS_0041'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 138, (False, AMF.CMOF.Public_Visibility)); end Initialize_138; -------------------- -- Initialize_139 -- -------------------- procedure Initialize_139 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 139, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 139, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 139, AMF.Internals.Tables.Utp_String_Data_00.MS_0041'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 139, (False, AMF.CMOF.Public_Visibility)); end Initialize_139; -------------------- -- Initialize_140 -- -------------------- procedure Initialize_140 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 140, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 140, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 140, AMF.Internals.Tables.Utp_String_Data_00.MS_002F'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 140, (False, AMF.CMOF.Public_Visibility)); end Initialize_140; -------------------- -- Initialize_141 -- -------------------- procedure Initialize_141 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 141, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 141, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 141, AMF.Internals.Tables.Utp_String_Data_00.MS_0021'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 141, (False, AMF.CMOF.Public_Visibility)); end Initialize_141; -------------------- -- Initialize_142 -- -------------------- procedure Initialize_142 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 142, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 142, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 142, AMF.Internals.Tables.Utp_String_Data_00.MS_0025'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 142, (False, AMF.CMOF.Public_Visibility)); end Initialize_142; -------------------- -- Initialize_143 -- -------------------- procedure Initialize_143 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 143, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 143, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 143, AMF.Internals.Tables.Utp_String_Data_00.MS_0012'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 143, (False, AMF.CMOF.Public_Visibility)); end Initialize_143; -------------------- -- Initialize_144 -- -------------------- procedure Initialize_144 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 144, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 144, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 144, AMF.Internals.Tables.Utp_String_Data_00.MS_0001'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 144, (False, AMF.CMOF.Public_Visibility)); end Initialize_144; -------------------- -- Initialize_145 -- -------------------- procedure Initialize_145 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 145, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 145, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 145, AMF.Internals.Tables.Utp_String_Data_00.MS_004F'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 145, (False, AMF.CMOF.Public_Visibility)); end Initialize_145; -------------------- -- Initialize_146 -- -------------------- procedure Initialize_146 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 146, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 146, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 146, AMF.Internals.Tables.Utp_String_Data_00.MS_0049'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 146, (False, AMF.CMOF.Public_Visibility)); end Initialize_146; -------------------- -- Initialize_147 -- -------------------- procedure Initialize_147 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 147, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 147, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 147, AMF.Internals.Tables.Utp_String_Data_00.MS_0049'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 147, (False, AMF.CMOF.Public_Visibility)); end Initialize_147; -------------------- -- Initialize_148 -- -------------------- procedure Initialize_148 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 148, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 148, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 148, AMF.Internals.Tables.Utp_String_Data_00.MS_0049'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 148, (False, AMF.CMOF.Public_Visibility)); end Initialize_148; -------------------- -- Initialize_149 -- -------------------- procedure Initialize_149 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 149, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 149, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 149, AMF.Internals.Tables.Utp_String_Data_00.MS_000B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 149, (False, AMF.CMOF.Public_Visibility)); end Initialize_149; -------------------- -- Initialize_150 -- -------------------- procedure Initialize_150 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 150, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 150, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 150, AMF.Internals.Tables.Utp_String_Data_00.MS_0045'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 150, (False, AMF.CMOF.Public_Visibility)); end Initialize_150; -------------------- -- Initialize_151 -- -------------------- procedure Initialize_151 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 151, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 151, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 151, AMF.Internals.Tables.Utp_String_Data_00.MS_005F'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 151, (False, AMF.CMOF.Public_Visibility)); end Initialize_151; -------------------- -- Initialize_152 -- -------------------- procedure Initialize_152 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 152, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 152, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 152, AMF.Internals.Tables.Utp_String_Data_00.MS_005F'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 152, (False, AMF.CMOF.Public_Visibility)); end Initialize_152; -------------------- -- Initialize_153 -- -------------------- procedure Initialize_153 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 153, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 153, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 153, AMF.Internals.Tables.Utp_String_Data_00.MS_004C'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 153, (False, AMF.CMOF.Public_Visibility)); end Initialize_153; -------------------- -- Initialize_154 -- -------------------- procedure Initialize_154 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 154, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 154, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 154, AMF.Internals.Tables.Utp_String_Data_00.MS_0047'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 154, (False, AMF.CMOF.Public_Visibility)); end Initialize_154; -------------------- -- Initialize_155 -- -------------------- procedure Initialize_155 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 155, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 155, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 155, AMF.Internals.Tables.Utp_String_Data_00.MS_002A'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 155, (False, AMF.CMOF.Public_Visibility)); end Initialize_155; -------------------- -- Initialize_156 -- -------------------- procedure Initialize_156 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 156, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 156, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 156, AMF.Internals.Tables.Utp_String_Data_00.MS_0064'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 156, (False, AMF.CMOF.Public_Visibility)); end Initialize_156; -------------------- -- Initialize_157 -- -------------------- procedure Initialize_157 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 157, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 157, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 157, AMF.Internals.Tables.Utp_String_Data_00.MS_0016'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 157, (False, AMF.CMOF.Public_Visibility)); end Initialize_157; -------------------- -- Initialize_158 -- -------------------- procedure Initialize_158 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 158, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 158, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 158, AMF.Internals.Tables.Utp_String_Data_00.MS_001D'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 158, (False, AMF.CMOF.Public_Visibility)); end Initialize_158; -------------------- -- Initialize_159 -- -------------------- procedure Initialize_159 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 159, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 159, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 159, AMF.Internals.Tables.Utp_String_Data_00.MS_0010'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 159, (False, AMF.CMOF.Public_Visibility)); end Initialize_159; -------------------- -- Initialize_160 -- -------------------- procedure Initialize_160 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 160, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 160, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 160, AMF.Internals.Tables.Utp_String_Data_00.MS_0030'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 160, (False, AMF.CMOF.Public_Visibility)); end Initialize_160; -------------------- -- Initialize_161 -- -------------------- procedure Initialize_161 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 161, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 161, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 161, AMF.Internals.Tables.Utp_String_Data_00.MS_0043'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 161, (False, AMF.CMOF.Public_Visibility)); end Initialize_161; -------------------- -- Initialize_162 -- -------------------- procedure Initialize_162 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 162, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 162, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 162, AMF.Internals.Tables.Utp_String_Data_00.MS_002B'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 162, (False, AMF.CMOF.Public_Visibility)); end Initialize_162; -------------------- -- Initialize_163 -- -------------------- procedure Initialize_163 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 163, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 163, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 163, AMF.Internals.Tables.Utp_String_Data_00.MS_003D'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 163, (False, AMF.CMOF.Public_Visibility)); end Initialize_163; -------------------- -- Initialize_164 -- -------------------- procedure Initialize_164 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 164, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 164, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 164, AMF.Internals.Tables.Utp_String_Data_00.MS_0000'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 164, (False, AMF.CMOF.Public_Visibility)); end Initialize_164; -------------------- -- Initialize_165 -- -------------------- procedure Initialize_165 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 165, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 165, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 165, AMF.Internals.Tables.Utp_String_Data_00.MS_0024'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 165, (False, AMF.CMOF.Public_Visibility)); end Initialize_165; -------------------- -- Initialize_166 -- -------------------- procedure Initialize_166 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 166, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 166, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 166, AMF.Internals.Tables.Utp_String_Data_00.MS_0000'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 166, (False, AMF.CMOF.Public_Visibility)); end Initialize_166; -------------------- -- Initialize_167 -- -------------------- procedure Initialize_167 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 167, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 167, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 167, AMF.Internals.Tables.Utp_String_Data_00.MS_002E'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 167, (False, AMF.CMOF.Public_Visibility)); end Initialize_167; -------------------- -- Initialize_168 -- -------------------- procedure Initialize_168 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 168, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 168, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 168, AMF.Internals.Tables.Utp_String_Data_00.MS_0040'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 168, (False, AMF.CMOF.Public_Visibility)); end Initialize_168; -------------------- -- Initialize_169 -- -------------------- procedure Initialize_169 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 169, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 169, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 169, AMF.Internals.Tables.Utp_String_Data_00.MS_000F'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 169, (False, AMF.CMOF.Public_Visibility)); end Initialize_169; -------------------- -- Initialize_170 -- -------------------- procedure Initialize_170 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 170, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 170, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 170, AMF.Internals.Tables.Utp_String_Data_00.MS_0007'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 170, (False, AMF.CMOF.Public_Visibility)); end Initialize_170; -------------------- -- Initialize_171 -- -------------------- procedure Initialize_171 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Is_Composite (Base + 171, True); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Lower (Base + 171, (False, 0)); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 171, AMF.Internals.Tables.Utp_String_Data_00.MS_0008'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Visibility (Base + 171, (False, AMF.CMOF.Public_Visibility)); end Initialize_171; -------------------- -- Initialize_172 -- -------------------- procedure Initialize_172 is begin AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Name (Base + 172, AMF.Internals.Tables.Utp_String_Data_00.MS_003F'Access); AMF.Internals.Tables.CMOF_Attributes.Internal_Set_Value (Base + 172, AMF.Internals.Tables.Utp_String_Data_00.MS_006B'Access); end Initialize_172; end AMF.Internals.Tables.Utp_Metamodel.Properties;
reznikmm/matreshka
Ada
4,041
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Draw_Glue_Point_Type_Attributes; package Matreshka.ODF_Draw.Glue_Point_Type_Attributes is type Draw_Glue_Point_Type_Attribute_Node is new Matreshka.ODF_Draw.Abstract_Draw_Attribute_Node and ODF.DOM.Draw_Glue_Point_Type_Attributes.ODF_Draw_Glue_Point_Type_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Draw_Glue_Point_Type_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Draw_Glue_Point_Type_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Draw.Glue_Point_Type_Attributes;
reznikmm/matreshka
Ada
4,932
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.UML.Interfaces.Collections is pragma Preelaborate; package UML_Interface_Collections is new AMF.Generic_Collections (UML_Interface, UML_Interface_Access); type Set_Of_UML_Interface is new UML_Interface_Collections.Set with null record; Empty_Set_Of_UML_Interface : constant Set_Of_UML_Interface; type Ordered_Set_Of_UML_Interface is new UML_Interface_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Interface : constant Ordered_Set_Of_UML_Interface; type Bag_Of_UML_Interface is new UML_Interface_Collections.Bag with null record; Empty_Bag_Of_UML_Interface : constant Bag_Of_UML_Interface; type Sequence_Of_UML_Interface is new UML_Interface_Collections.Sequence with null record; Empty_Sequence_Of_UML_Interface : constant Sequence_Of_UML_Interface; private Empty_Set_Of_UML_Interface : constant Set_Of_UML_Interface := (UML_Interface_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Interface : constant Ordered_Set_Of_UML_Interface := (UML_Interface_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Interface : constant Bag_Of_UML_Interface := (UML_Interface_Collections.Bag with null record); Empty_Sequence_Of_UML_Interface : constant Sequence_Of_UML_Interface := (UML_Interface_Collections.Sequence with null record); end AMF.UML.Interfaces.Collections;
stcarrez/mat
Ada
1,290
adb
----------------------------------------------------------------------- -- mat-targets-gtkmat - Gtk target management -- Copyright (C) 2014, 2022 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- separate (MAT.Targets.Gtkmat) -- Load the glade XML definition. procedure Load_UI (Target : in out Target_Type) is use type Glib.Guint; Result : Glib.Guint; Error : aliased Glib.Error.GError; begin Result := Target.Builder.Add_From_File ("mat.glade", Error'Access); if Result /= 1 then Log.Error ("Cannot load the 'gakt.glade' configuration file"); raise Initialize_Error; end if; end Load_UI;
wildeee/safADA
Ada
1,065
adb
With Ada.Text_IO; Use Ada.Text_IO; Procedure BuscaBinaria is numeros: array(1..15) of Integer; target : Integer; L : Integer; R : Integer; mid : Integer; found: Integer; -- Leitura String function Get_String return String is Line : String (1 .. 1_000); Last : Natural; begin Get_Line (Line, Last); return Line (1 .. Last); end Get_String; -- Leitura Integer function Get_Integer return Integer is S : constant String := Get_String; begin return Integer'Value (S); end Get_Integer; -- Lê 15 elementos do array procedure Faz_Leitura is begin for I in Integer range 1 .. 15 loop numeros(I) := Get_Integer; end loop; end Faz_Leitura; function binSearch return Integer is begin mid := (L + R) / 2; if numeros(mid) < target then L := mid + 1; return binSearch; end if; if numeros(mid) > target then R := mid - 1; return binSearch; end if; return mid; end binSearch; begin Faz_Leitura; target := Get_Integer; L := 1; R := 15; found := binSearch; Put_Line(Integer'Image(found)); end BuscaBinaria;
persan/A-gst
Ada
2,471
adb
pragma Ada_2012; pragma Warnings (Off); with GStreamer.GST_Low_Level.Gstreamer_0_10_Gst_Rtsp_Gstrtspdefs_H; package body GStreamer.Rtsp.url is use GStreamer.GST_Low_Level.Gstreamer_0_10_Gst_Rtsp_Gstrtspurl_H; use GStreamer.GST_Low_Level.gstreamer_0_10_gst_rtsp_gstrtspdefs_h; use GLIB; -------------- -- Get_Type -- -------------- function Get_Type return GLIB.GType is begin return gst_rtsp_url_get_type; end Get_Type; ----------- -- Parse -- ----------- function Parse (Urlstr : String) return GstRTSPUrl is L_Urlstr : constant String := Urlstr & ASCII.NUL; RetCode : GstRTSPResult; begin return Ret : GstRTSPUrl do RetCode := GstRTSPResult(Gst_Rtsp_Url_Parse (Gchar (L_Urlstr (L_Urlstr'First))'Unrestricted_Access, Ret.Data'Address)); RetCode_2_Exception (RetCode); end return; end Parse; --------------------- -- Get_Request_Uri -- --------------------- function Get_Request_Uri (Arg1 : GstRTSPUrl) return String is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Request_Uri unimplemented"); return raise Program_Error with "Unimplemented function Get_Request_Uri"; end Get_Request_Uri; ---------------------------- -- Decode_Path_Components -- ---------------------------- function Decode_Path_Components (Url : GstRTSPUrl) return System.Address is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Decode_Path_Components unimplemented"); return raise Program_Error with "Unimplemented function Decode_Path_Components"; end Decode_Path_Components; -------------- -- Set_Port -- -------------- procedure Set_Port (Url : GstRTSPUrl; Port : GNAT.Sockets.Port_Type) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Port unimplemented"); raise Program_Error with "Unimplemented procedure Set_Port"; end Set_Port; -------------- -- Get_Port -- -------------- function Get_Port (Url : GstRTSPUrl) return GNAT.Sockets.Port_Type is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Get_Port unimplemented"); return raise Program_Error with "Unimplemented function Get_Port"; end Get_Port; end GStreamer.Rtsp.url;
flyx/OpenGLAda
Ada
3,788
adb
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" with Ada.Text_IO; with GL.Buffers; with GL.Files; with GL.Fixed.Matrix; with GL.Immediate; with GL.Objects.Programs; with GL.Objects.Shaders.Lists; with GL.Types.Colors; with GL_Test.Display_Backend; procedure GL_Test.Shaders is use GL.Buffers; use GL.Types; use GL.Fixed.Matrix; use GL.Immediate; Vertex_Shader : GL.Objects.Shaders.Shader (Kind => GL.Objects.Shaders.Vertex_Shader); Fragment_Shader : GL.Objects.Shaders.Shader (Kind => GL.Objects.Shaders.Fragment_Shader); Program : GL.Objects.Programs.Program; begin Display_Backend.Init; Display_Backend.Open_Window (Width => 500, Height => 500); Vertex_Shader.Initialize_Id; Fragment_Shader.Initialize_Id; Program.Initialize_Id; -- load shader sources and compile shaders GL.Files.Load_Shader_Source_From_File (Vertex_Shader, "../src/gl/gl_test-shaders-vertex.glsl"); GL.Files.Load_Shader_Source_From_File (Fragment_Shader, "../src/gl/gl_test-shaders-fragment.glsl"); Vertex_Shader.Compile; Fragment_Shader.Compile; if not Vertex_Shader.Compile_Status then Ada.Text_IO.Put_Line ("Compilation of vertex shader failed. log:"); Ada.Text_IO.Put_Line (Vertex_Shader.Info_Log); end if; if not Fragment_Shader.Compile_Status then Ada.Text_IO.Put_Line ("Compilation of fragment shader failed. log:"); Ada.Text_IO.Put_Line (Fragment_Shader.Info_Log); end if; -- set up program Program.Attach (Vertex_Shader); Program.Attach (Fragment_Shader); Program.Link; if not Program.Link_Status then Ada.Text_IO.Put_Line ("Program linking failed. Log:"); Ada.Text_IO.Put_Line (Program.Info_Log); return; end if; Program.Use_Program; -- test iteration over program shaders Ada.Text_IO.Put_Line ("Listing shaders attached to program..."); declare use type GL.Objects.Shaders.Lists.Cursor; List : constant GL.Objects.Shaders.Lists.List := Program.Attached_Shaders; Cursor : GL.Objects.Shaders.Lists.Cursor := List.First; begin while Cursor /= GL.Objects.Shaders.Lists.No_Element loop declare Shader : constant GL.Objects.Shaders.Shader := GL.Objects.Shaders.Lists.Element (Cursor); begin Ada.Text_IO.Put_Line ("----------------------------"); Ada.Text_IO.Put_Line ("Kind: " & Shader.Kind'Img); Ada.Text_IO.Put_Line ("Status: " & Shader.Compile_Status'Img); end; Cursor := GL.Objects.Shaders.Lists.Next (Cursor); end loop; end; Ada.Text_IO.Put_Line ("-----------[Done.]----------"); -- set up matrices Projection.Load_Identity; Projection.Apply_Orthogonal (-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); Modelview.Load_Identity; while Display_Backend.Window_Opened loop Clear (Buffer_Bits'(Color => True, others => False)); declare Token : Input_Token := Start (Quads); begin Set_Color (Colors.Color'(1.0, 0.0, 0.0, 0.0)); Token.Add_Vertex (Doubles.Vector4'(0.7, 0.7, 0.0, 1.0)); Set_Color (Colors.Color'(0.0, 1.0, 0.0, 0.0)); Token.Add_Vertex (Doubles.Vector4'(0.7, -0.7, 0.0, 1.0)); Set_Color (Colors.Color'(0.0, 0.0, 1.0, 0.0)); Token.Add_Vertex (Doubles.Vector4'(-0.7, -0.7, 0.0, 1.0)); Set_Color (Colors.Color'(1.0, 0.0, 1.0, 0.0)); Token.Add_Vertex (Doubles.Vector4'(-0.7, 0.7, 0.0, 1.0)); end; Modelview.Apply_Rotation (0.8, 0.0, 0.0, 1.0); GL.Flush; Display_Backend.Swap_Buffers; Display_Backend.Poll_Events; end loop; Display_Backend.Shutdown; end GL_Test.Shaders;
persan/AdaYaml
Ada
4,703
adb
-- part of AdaYaml, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "copying.txt" with Ada.Strings.Hash; with System; with Yaml.Dom.Node_Memory; package body Yaml.Dom.Node is use type Text.Reference; use type Ada.Containers.Hash_Type; use type Count_Type; use type System.Address; function "=" (Left, Right : Instance) return Boolean is Memory : Node_Memory.Pair_Instance; function Equal (Left, Right : not null access Instance) return Boolean; function Equal (Left, Right : Sequence_Data.Instance) return Boolean is Cur_Left, Cur_Right : Sequence_Data.Cursor; begin if Left.Length /= Right.Length then return False; end if; Cur_Left := Left.First; Cur_Right := Right.First; while Sequence_Data.Has_Element (Cur_Left) loop if not Equal (Left.Element (Cur_Left).Value.Data, Right.Element (Cur_Right).Value.Data) then return False; end if; Cur_Left := Sequence_Data.Next (Cur_Left); Cur_Right := Sequence_Data.Next (Cur_Right); end loop; return True; end Equal; function Equal (Left, Right : Mapping_Data.Instance) return Boolean is Cur_Left, Cur_Right : Mapping_Data.Cursor; begin if Left.Length /= Right.Length then return False; end if; Cur_Left := Left.First; while Mapping_Data.Has_Element (Cur_Left) loop Cur_Right := Right.Find (Mapping_Data.Key (Cur_Left)); if not Mapping_Data.Has_Element (Cur_Right) or else not Equal (Mapping_Data.Value (Cur_Left).Data, Mapping_Data.Value (Cur_Right).Data) then return False; end if; Cur_Left := Mapping_Data.Next (Cur_Left); end loop; return True; end Equal; function Equal (Left, Right : not null access Instance) return Boolean is Visited : Boolean; begin if Left.all'Address = Right.all'Address then return True; else Memory.Visit (Left, Right, Visited); if Visited then return True; elsif Left.Kind = Right.Kind and then Left.Tag = Right.Tag then case Left.Kind is when Scalar => return Left.Content = Right.Content; when Sequence => return Equal (Left.Items, Right.Items); when Mapping => return Equal (Left.Pairs, Right.Pairs); end case; else return False; end if; end if; end Equal; begin return Equal (Left'Unrestricted_Access, Right'Unrestricted_Access); end "="; function Hash (Object : Instance) return Ada.Containers.Hash_Type is -- for efficiency reasons, the hash of a collection node is not -- calculated recursively. Instead, only the content of the node and the -- types and number of its children (and their content for scalars) is -- taken into account. this suffices as hash function as long as the -- objects used as keys do not get too large. begin if Object.Kind = Scalar then return Object.Content.Hash; else declare Ret : Ada.Containers.Hash_Type := Ada.Strings.Hash (Object.Kind'Img); procedure Visit (Prefix : String; Cur : not null access Node.Instance) is begin case Cur.Kind is when Scalar => Ret := Ret * Cur.Content.Hash; when Sequence => Ret := Ret * Ada.Strings.Hash (Prefix & "Sequence" & Cur.Items.Length'Img); when Mapping => Ret := Ret * Ada.Strings.Hash (Prefix & "Mapping" & Cur.Pairs.Length'Img); end case; end Visit; procedure Visit_Item (Cur : not null access Node.Instance) is begin Visit ("Item:", Cur); end Visit_Item; procedure Visit_Pair (Key, Value : not null access Node.Instance) is begin Visit ("Key:", Key); Visit ("Value:", Value); end Visit_Pair; begin if Object.Kind = Sequence then Object.Items.Iterate (Visit_Item'Access); else Object.Pairs.Iterate (Visit_Pair'Access); end if; return Ret; end; end if; end Hash; end Yaml.Dom.Node;
reznikmm/matreshka
Ada
3,642
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with League.Holders.Generic_Holders; package AMF.DG.Holders.Scales is new League.Holders.Generic_Holders (AMF.DG.DG_Scale); pragma Preelaborate (AMF.DG.Holders.Scales);
tum-ei-rcs/StratoX
Ada
3,864
adb
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- S Y S T E M . I M G _ I N T -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body System.Img_Int is procedure Set_Digits (T : Integer; S : in out String; P : in out Natural); -- Set digits of absolute value of T, which is zero or negative. We work -- with the negative of the value so that the largest negative number is -- not a special case. ------------------- -- Image_Integer -- ------------------- procedure Image_Integer (V : Integer; S : in out String; P : out Natural) is pragma Assert (S'First = 1); begin if V >= 0 then S (1) := ' '; P := 1; else P := 0; end if; Set_Image_Integer (V, S, P); end Image_Integer; ---------------- -- Set_Digits -- ---------------- procedure Set_Digits (T : Integer; S : in out String; P : in out Natural) is begin if T <= -10 then Set_Digits (T / 10, S, P); P := P + 1; S (P) := Character'Val (48 - (T rem 10)); else P := P + 1; S (P) := Character'Val (48 - T); end if; end Set_Digits; ----------------------- -- Set_Image_Integer -- ----------------------- procedure Set_Image_Integer (V : Integer; S : in out String; P : in out Natural) is begin if V >= 0 then Set_Digits (-V, S, P); else P := P + 1; S (P) := '-'; Set_Digits (V, S, P); end if; end Set_Image_Integer; end System.Img_Int;
damaki/Verhoeff
Ada
1,597
ads
------------------------------------------------------------------------------- -- Copyright (c) 2016 Daniel King -- -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to -- deal in the Software without restriction, including without limitation the -- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -- sell copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -- IN THE SOFTWARE. ------------------------------------------------------------------------------- with AUnit.Test_Fixtures; package Verhoeff_Tests is type Test is new AUnit.Test_Fixtures.Test_Fixture with null record; procedure Test_Case_1(T : in out Test); procedure Test_Case_2(T : in out Test); procedure Test_Symmetry(T : in out Test); procedure Test_Empty(T : in out Test); end Verhoeff_Tests;
reznikmm/matreshka
Ada
3,734
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Style_Shrink_To_Fit_Attributes is pragma Preelaborate; type ODF_Style_Shrink_To_Fit_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Style_Shrink_To_Fit_Attribute_Access is access all ODF_Style_Shrink_To_Fit_Attribute'Class with Storage_Size => 0; end ODF.DOM.Style_Shrink_To_Fit_Attributes;
procrastiraptor/euler
Ada
645
adb
with Ada.Integer_Text_IO; with String_Int; procedure Euler25 is Max_Digits: constant Positive := 1000; use type String_Int.Number; A, B: String_Int.Number(1 .. Max_Digits) := (Max_Digits => '1', others => '0'); Term: Positive := 3; begin loop declare Sum: constant String_Int.Number := A + B; First: constant Natural := A'Last - Sum'Length + 1; begin if Sum'Length = Max_Digits then Ada.Integer_Text_IO.Put(Term); return; end if; Term := Term + 1; B := A; A(First .. A'Last) := Sum; end; end loop; end Euler25;
SietsevanderMolen/fly-thing
Ada
3,431
adb
pragma Profile (Ravenscar); with Ada.Text_IO; use Ada.Text_IO; with Ada.Real_Time; use Ada.Real_Time; with Ada.Float_Text_IO; use Ada.Float_Text_IO; with Vector_Math; use Vector_Math; with Quaternions; with PCA9685; with HMC5883L; with MPU6050; with I2C; with AHRS; use AHRS; with PIDs; use PIDs; procedure Ravn is I2C_Bus : aliased I2C.Bus (Adapter_Number => 1); -- /dev/i2c-1 PWM_Driver : PCA9685.Chip (On_Bus => I2C_Bus'Access, Address => 16#40#); -- default address Compass : HMC5883L.Chip (On_Bus => I2C_Bus'Access, Address => 16#1E#); -- default address IMU : MPU6050.Chip (On_Bus => I2C_Bus'Access, Address => 16#68#); -- default address begin PWM_Driver.Reset; PWM_Driver.SetPWMFreq (1000.0); -- Max frequency as per datasheet PWM_Driver.SetPin (61, 0); -- Initialize with all off Compass.Reset; IMU.Reset; if not Compass.Self_Test then Ada.Text_IO.Put_Line ("HMC5883L didn't pass self test"); end if; Compass.Set_Declination (Degrees => 72, Minutes => 44); -- Oslo/NO declare Compass_Output : Vector_Math.Float3; IMU_Output : MPU6050.MPU6050_Output; Algorithm : AHRS.Mahony := AHRS.Make (Sample_Period => 1.0/200.0, Proportional_Gain => 2.0, Integral_Gain => 0.005); Pid : PIDs.PID := PIDs.Make (Kp => 4.0, Ki => 0.02, Kd => 15.0, Output_Min => 0.0, Output_Max => 100.0, Setpoint => 50.0, Sample_Rate => 200); begin declare Next : Ada.Real_Time.Time; begin Next := Clock; loop Compass_Output := Compass.Get_Axes; IMU_Output := IMU.Get_Motion_6; AHRS.Update (M => Algorithm, Gyroscope => IMU_Output.Gyroscope_Output, Accelerometer => IMU_Output.Accelerometer_Output, Magnetometer => Compass_Output); Put ("raw: "); Ada.Float_Text_IO.Put (Item => IMU_Output.Accelerometer_Output.x, Fore => 4, Aft => 0, Exp => 0); Put (", "); Ada.Float_Text_IO.Put (Item => IMU_Output.Accelerometer_Output.y, Fore => 4, Aft => 0, Exp => 0); Put (", "); Ada.Float_Text_IO.Put (Item => IMU_Output.Accelerometer_Output.z, Fore => 4, Aft => 0, Exp => 0); Put (", "); Ada.Float_Text_IO.Put (Item => Compass_Output.x, Fore => 4, Aft => 2, Exp => 0); Ada.Text_IO.Put_Line (". AHRS: " & Float_Quaternion.Image (Algorithm.Output)); delay until Next; Next := Next + Ada.Real_Time.To_Time_Span (1.0/200.0); end loop; end; end; end Ravn;
reznikmm/matreshka
Ada
3,785
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.Constants; package body Matreshka.ODF_Attributes.Style.Font_Size_Asian is -------------------- -- Get_Local_Name -- -------------------- overriding function Get_Local_Name (Self : not null access constant Style_Font_Size_Asian_Node) return League.Strings.Universal_String is begin return ODF.Constants.Font_Size_Asian_Name; end Get_Local_Name; end Matreshka.ODF_Attributes.Style.Font_Size_Asian;
ekoeppen/STM32_Generic_Ada_Drivers
Ada
1,698
ads
generic HSE_Value : HSE_Range := 8_000_000; PLL_Source : PLL_Source_Type := HSI; SYSCLK_Source : SYSCLK_Source_Type := HSI; RTC_Source : RTC_Source_Type := LSI; PLL_Prediv : PLL_Prediv_Range := 1; PLL_Mul : PLL_Mul_Range := 1; AHB_Prescaler : AHB_Prescaler_Type := DIV1; APB_Prescaler : APB_Prescaler_Type := DIV1; LSI_Enabled : Boolean := True; LSE_Enabled : Boolean := False; package STM32GD.Clock.Tree is pragma Preelaborate; PLL_Value : constant Integer := ( case PLL_Source is when HSI => HSI_Value / 2, when HSE => HSE_Value / PLL_Prediv); PLL_Output_Value : constant Integer := (PLL_Value / PLL_Prediv) * PLL_Mul; SYSCLK : constant Integer := ( case SYSCLK_Source is when HSI => HSI_Value, when PLL => PLL_Output_Value, when HSE => HSE_Value); HCLK : constant Integer := ( case AHB_Prescaler is when DIV1 => SYSCLK, when DIV2 => SYSCLK / 2, when DIV4 => SYSCLK / 4, when DIV8 => SYSCLK / 8, when DIV16 => SYSCLK / 16, when DIV64 => SYSCLK / 64, when DIV128 => SYSCLK / 128, when DIV256 => SYSCLK / 256, when DIV512 => SYSCLK / 512); PCLK : constant Integer := ( case APB_Prescaler is when DIV1 => HCLK, when DIV2 => HCLK / 2, when DIV4 => HCLK / 4, when DIV8 => HCLK / 8, when DIV16 => HCLK / 16); RTCCLK : constant Integer := ( case RTC_Source is when LSI => LSI_Value, when LSE => LSE_Value, when HSE => HSE_Value / 128); function Frequency (Clock : Clock_Type) return Integer; procedure Init; end STM32GD.Clock.Tree;
reznikmm/matreshka
Ada
3,729
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Style_Wrap_Contour_Attributes is pragma Preelaborate; type ODF_Style_Wrap_Contour_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Style_Wrap_Contour_Attribute_Access is access all ODF_Style_Wrap_Contour_Attribute'Class with Storage_Size => 0; end ODF.DOM.Style_Wrap_Contour_Attributes;
io7m/coreland-opengl-ada
Ada
570
adb
package body OpenGL.Buffer is procedure Clear (Mask : in Buffer_Mask_t) is begin Thin.Clear (Thin.Bitfield_t (Mask)); end Clear; procedure Clear_Color (Red : in OpenGL.Types.Clamped_Float_t; Green : in OpenGL.Types.Clamped_Float_t; Blue : in OpenGL.Types.Clamped_Float_t; Alpha : in OpenGL.Types.Clamped_Float_t) is begin Thin.Clear_Color (Red => Thin.Float_t (Red), Green => Thin.Float_t (Green), Blue => Thin.Float_t (Blue), Alpha => Thin.Float_t (Alpha)); end Clear_Color; end OpenGL.Buffer;
stcarrez/ada-util
Ada
8,981
ads
----------------------------------------------------------------------- -- util-serialize-io-json -- JSON Serialization Driver -- Copyright (C) 2010, 2011, 2012, 2016, 2017, 2020, 2021, 2022 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Strings.Unbounded; with Ada.Streams; with Util.Streams.Texts; with Util.Stacks; with Util.Properties; with Util.Beans.Objects; package Util.Serialize.IO.JSON is -- ------------------------------ -- JSON Output Stream -- ------------------------------ -- The <b>Output_Stream</b> provides methods for creating a JSON output stream. -- The stream object takes care of the JSON escape rules. type Output_Stream is limited new Util.Serialize.IO.Output_Stream with private; -- Set the target output stream. procedure Initialize (Stream : in out Output_Stream; Output : in Util.Streams.Texts.Print_Stream_Access); -- Flush the buffer (if any) to the sink. overriding procedure Flush (Stream : in out Output_Stream); -- Close the sink. overriding procedure Close (Stream : in out Output_Stream); -- Write the buffer array to the output stream. overriding procedure Write (Stream : in out Output_Stream; Buffer : in Ada.Streams.Stream_Element_Array); -- Write a wide character on the stream doing some conversion if necessary. -- The default implementation translates the wide character to a UTF-8 sequence. procedure Write_Wide (Stream : in out Output_Stream; Item : in Wide_Wide_Character); -- Start a JSON document. This operation writes the initial JSON marker ('{'). overriding procedure Start_Document (Stream : in out Output_Stream); -- Finish a JSON document by writing the final JSON marker ('}'). overriding procedure End_Document (Stream : in out Output_Stream); -- Write the value as a JSON string. Special characters are escaped using the JSON -- escape rules. procedure Write_String (Stream : in out Output_Stream; Value : in String); -- Write the value as a JSON string. Special characters are escaped using the JSON -- escape rules. procedure Write_Wide_String (Stream : in out Output_Stream; Value : in Wide_Wide_String); -- Start a new JSON object. If the name is not empty, write it as a string -- followed by the ':' (colon). The JSON object starts with '{' (curly brace). -- Example: "list": { overriding procedure Start_Entity (Stream : in out Output_Stream; Name : in String); -- Terminates the current JSON object. overriding procedure End_Entity (Stream : in out Output_Stream; Name : in String); -- Write the attribute name/value pair. overriding procedure Write_Attribute (Stream : in out Output_Stream; Name : in String; Value : in String); overriding procedure Write_Wide_Attribute (Stream : in out Output_Stream; Name : in String; Value : in Wide_Wide_String); overriding procedure Write_Attribute (Stream : in out Output_Stream; Name : in String; Value : in Integer); overriding procedure Write_Attribute (Stream : in out Output_Stream; Name : in String; Value : in Boolean); -- Write a JSON name/value pair. The value is written according to its type -- Example: "name": null -- "name": false -- "name": 12 -- "name": "value" overriding procedure Write_Attribute (Stream : in out Output_Stream; Name : in String; Value : in Util.Beans.Objects.Object); -- Write the attribute with a null value. overriding procedure Write_Null_Attribute (Stream : in out Output_Stream; Name : in String); -- Write a JSON name/value pair (see Write_Attribute). overriding procedure Write_Entity (Stream : in out Output_Stream; Name : in String; Value : in Util.Beans.Objects.Object); -- Write a JSON name/value pair (see Write_Attribute). overriding procedure Write_Entity (Stream : in out Output_Stream; Name : in String; Value : in String); overriding procedure Write_Wide_Entity (Stream : in out Output_Stream; Name : in String; Value : in Wide_Wide_String); overriding procedure Write_Entity (Stream : in out Output_Stream; Name : in String; Value : in Boolean); overriding procedure Write_Entity (Stream : in out Output_Stream; Name : in String; Value : in Integer); overriding procedure Write_Entity (Stream : in out Output_Stream; Name : in String; Value : in Ada.Calendar.Time); overriding procedure Write_Long_Entity (Stream : in out Output_Stream; Name : in String; Value : in Long_Long_Integer); overriding procedure Write_Long_Entity (Stream : in out Output_Stream; Name : in String; Value : in Long_Long_Float); overriding procedure Write_Enum_Entity (Stream : in out Output_Stream; Name : in String; Value : in String); -- Write an entity with a null value. overriding procedure Write_Null_Entity (Stream : in out Output_Stream; Name : in String); -- Starts a JSON array. -- Example: "list": [ overriding procedure Start_Array (Stream : in out Output_Stream; Name : in String); -- Terminates a JSON array. overriding procedure End_Array (Stream : in out Output_Stream; Name : in String); type Parser is new Serialize.IO.Parser with private; -- Parse the stream using the JSON parser. overriding procedure Parse (Handler : in out Parser; Stream : in out Util.Streams.Buffered.Input_Buffer_Stream'Class; Sink : in out Reader'Class); -- Get the current location (file and line) to report an error message. overriding function Get_Location (Handler : in Parser) return String; -- Read a JSON file and return an object. function Read (Path : in String) return Util.Beans.Objects.Object; function Read (Content : in String) return Util.Properties.Manager; private type Node_Info is record Is_Array : Boolean := False; Is_Root : Boolean := False; Has_Fields : Boolean := False; end record; type Node_Info_Access is access all Node_Info; package Node_Info_Stack is new Util.Stacks (Element_Type => Node_Info, Element_Type_Access => Node_Info_Access); type Output_Stream is limited new Util.Serialize.IO.Output_Stream with record Stack : Node_Info_Stack.Stack; Stream : Util.Streams.Texts.Print_Stream_Access; end record; procedure Write_Field_Name (Stream : in out Output_Stream; Name : in String); type Token_Type is (T_EOF, T_LEFT_BRACE, T_RIGHT_BRACE, T_LEFT_BRACKET, T_RIGHT_BRACKET, T_COLON, T_COMMA, T_TRUE, T_FALSE, T_STRING, T_FLOAT, T_NUMBER, T_BOOLEAN, T_UNKNOWN, T_NULL); type Parser is new Util.Serialize.IO.Parser with record Token : Ada.Strings.Unbounded.Unbounded_String; Pending_Token : Token_Type := T_EOF; Line_Number : Natural := 1; Has_Pending_Char : Boolean := False; Pending_Char : Character; end record; end Util.Serialize.IO.JSON;
google-code/ada-security
Ada
10,344
adb
----------------------------------------------------------------------- -- security-policies-urls -- URL security policy -- Copyright (C) 2010, 2011, 2012 Stephane Carrez -- Written by Stephane Carrez ([email protected]) -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. ----------------------------------------------------------------------- with Ada.Unchecked_Deallocation; with Util.Beans.Objects; with Util.Beans.Objects.Vectors; with Util.Serialize.Mappers; with Util.Serialize.Mappers.Record_Mapper; with Security.Controllers.URLs; package body Security.Policies.URLs is -- ------------------------------ -- Get the policy name. -- ------------------------------ overriding function Get_Name (From : in URL_Policy) return String is pragma Unreferenced (From); begin return NAME; end Get_Name; -- ------------------------------ -- Returns True if the user has the permission to access the given URI permission. -- ------------------------------ function Has_Permission (Manager : in URL_Policy; Context : in Contexts.Security_Context'Class; Permission : in URL_Permission'Class) return Boolean is Name : constant String_Ref := To_String_Ref (Permission.URL); Ref : constant Rules_Ref.Ref := Manager.Cache.Get; Rules : constant Rules_Access := Ref.Value; Pos : constant Rules_Maps.Cursor := Rules.Map.Find (Name); Rule : Access_Rule_Ref; begin -- If the rule is not in the cache, search for the access rule that -- matches our URI. Update the cache. This cache update is thread-safe -- as the cache map is never modified: a new cache map is installed. if not Rules_Maps.Has_Element (Pos) then declare New_Ref : constant Rules_Ref.Ref := Rules_Ref.Create; begin Rule := Manager.Find_Access_Rule (Permission.URL); New_Ref.Value.all.Map := Rules.Map; New_Ref.Value.all.Map.Insert (Name, Rule); Manager.Cache.Set (New_Ref); end; else Rule := Rules_Maps.Element (Pos); end if; -- Check if the user has one of the required permission. declare P : constant Access_Rule_Access := Rule.Value; begin if P /= null then for I in P.Permissions'Range loop if Context.Has_Permission (P.Permissions (I)) then return True; end if; end loop; end if; end; return False; end Has_Permission; -- Grant the permission to access to the given <b>URI</b> to users having the <b>To</b> -- permissions. procedure Grant_URI_Permission (Manager : in out URL_Policy; URI : in String; To : in String) is begin null; end Grant_URI_Permission; -- ------------------------------ -- Policy Configuration -- ------------------------------ -- ------------------------------ -- Find the access rule of the policy that matches the given URI. -- Returns the No_Rule value (disable access) if no rule is found. -- ------------------------------ function Find_Access_Rule (Manager : in URL_Policy; URI : in String) return Access_Rule_Ref is Matched : Boolean := False; Result : Access_Rule_Ref; procedure Match (P : in Policy); procedure Match (P : in Policy) is begin if GNAT.Regexp.Match (URI, P.Pattern) then Matched := True; Result := P.Rule; end if; end Match; Last : constant Natural := Manager.Policies.Last_Index; begin for I in 1 .. Last loop Manager.Policies.Query_Element (I, Match'Access); if Matched then return Result; end if; end loop; return Result; end Find_Access_Rule; -- ------------------------------ -- Initialize the permission manager. -- ------------------------------ overriding procedure Initialize (Manager : in out URL_Policy) is begin Manager.Cache := new Rules_Ref.Atomic_Ref; Manager.Cache.Set (Rules_Ref.Create); end Initialize; -- ------------------------------ -- Finalize the permission manager. -- ------------------------------ overriding procedure Finalize (Manager : in out URL_Policy) is procedure Free is new Ada.Unchecked_Deallocation (Rules_Ref.Atomic_Ref, Rules_Ref_Access); begin Free (Manager.Cache); -- for I in Manager.Names'Range loop -- exit when Manager.Names (I) = null; -- Ada.Strings.Unbounded.Free (Manager.Names (I)); -- end loop; end Finalize; type Policy_Fields is (FIELD_ID, FIELD_PERMISSION, FIELD_URL_PATTERN, FIELD_POLICY); procedure Set_Member (P : in out URL_Policy'Class; Field : in Policy_Fields; Value : in Util.Beans.Objects.Object); procedure Process (Policy : in out URL_Policy'Class); procedure Set_Member (P : in out URL_Policy'Class; Field : in Policy_Fields; Value : in Util.Beans.Objects.Object) is begin case Field is when FIELD_ID => P.Id := Util.Beans.Objects.To_Integer (Value); when FIELD_PERMISSION => P.Permissions.Append (Value); when FIELD_URL_PATTERN => P.Patterns.Append (Value); when FIELD_POLICY => Process (P); P.Id := 0; P.Permissions.Clear; P.Patterns.Clear; end case; end Set_Member; procedure Process (Policy : in out URL_Policy'Class) is Pol : Security.Policies.URLs.Policy; Count : constant Natural := Natural (Policy.Permissions.Length); Rule : constant Access_Rule_Ref := Access_Rule_Refs.Create (new Access_Rule (Count)); Iter : Util.Beans.Objects.Vectors.Cursor := Policy.Permissions.First; Pos : Positive := 1; begin Pol.Rule := Rule; -- Step 1: Initialize the list of permission index in Access_Rule from the permission names. while Util.Beans.Objects.Vectors.Has_Element (Iter) loop declare Perm : constant Util.Beans.Objects.Object := Util.Beans.Objects.Vectors.Element (Iter); Name : constant String := Util.Beans.Objects.To_String (Perm); begin Rule.Value.all.Permissions (Pos) := Permissions.Get_Permission_Index (Name); Pos := Pos + 1; exception when Invalid_Name => raise Util.Serialize.Mappers.Field_Error with "Invalid permission: " & Name; end; Util.Beans.Objects.Vectors.Next (Iter); end loop; -- Step 2: Create one policy for each URL pattern Iter := Policy.Patterns.First; while Util.Beans.Objects.Vectors.Has_Element (Iter) loop declare Pattern : constant Util.Beans.Objects.Object := Util.Beans.Objects.Vectors.Element (Iter); begin Pol.Id := Policy.Id; Pol.Pattern := GNAT.Regexp.Compile (Util.Beans.Objects.To_String (Pattern)); Policy.Policies.Append (Pol); end; Util.Beans.Objects.Vectors.Next (Iter); end loop; end Process; package Policy_Mapper is new Util.Serialize.Mappers.Record_Mapper (Element_Type => URL_Policy'Class, Element_Type_Access => URL_Policy_Access, Fields => Policy_Fields, Set_Member => Set_Member); Policy_Mapping : aliased Policy_Mapper.Mapper; -- ------------------------------ -- Setup the XML parser to read the <b>policy</b> description. -- ------------------------------ overriding procedure Prepare_Config (Policy : in out URL_Policy; Reader : in out Util.Serialize.IO.XML.Parser) is Perm : constant Security.Controllers.URLs.URL_Controller_Access := new Security.Controllers.URLs.URL_Controller; begin Perm.Manager := Policy'Unchecked_Access; Reader.Add_Mapping ("policy-rules", Policy_Mapping'Access); Reader.Add_Mapping ("module", Policy_Mapping'Access); Policy_Mapper.Set_Context (Reader, Perm.Manager); if not Policy.Manager.Has_Controller (P_URL.Permission) then Policy.Manager.Add_Permission (Name => "url", Permission => Perm.all'Access); end if; end Prepare_Config; -- ------------------------------ -- Get the URL policy associated with the given policy manager. -- Returns the URL policy instance or null if it was not registered in the policy manager. -- ------------------------------ function Get_URL_Policy (Manager : in Security.Policies.Policy_Manager'Class) return URL_Policy_Access is Policy : constant Security.Policies.Policy_Access := Manager.Get_Policy (NAME); begin if Policy = null or else not (Policy.all in URL_Policy'Class) then return null; else return URL_Policy'Class (Policy.all)'Access; end if; end Get_URL_Policy; begin Policy_Mapping.Add_Mapping ("url-policy", FIELD_POLICY); Policy_Mapping.Add_Mapping ("url-policy/@id", FIELD_ID); Policy_Mapping.Add_Mapping ("url-policy/permission", FIELD_PERMISSION); Policy_Mapping.Add_Mapping ("url-policy/url-pattern", FIELD_URL_PATTERN); end Security.Policies.URLs;
sungyeon/drake
Ada
1,623
ads
pragma License (Unrestricted); -- extended unit specialized for Windows with Ada.IO_Exceptions; private with Ada.Finalization; private with C.windef; package System.Program.Dynamic_Linking is -- Loading dynamic-link library. pragma Preelaborate; type Library is limited private; -- subtype Open_Library is Library -- with -- Dynamic_Predicate => Is_Open (Open_Library), -- Predicate_Failure => raise Status_Error; function Is_Open (Lib : Library) return Boolean; pragma Inline (Is_Open); procedure Open (Lib : in out Library; Name : String); function Open (Name : String) return Library; procedure Close (Lib : in out Library); function Import ( Lib : Library; -- Open_Library Symbol : String) return Address; Status_Error : exception renames Ada.IO_Exceptions.Status_Error; Name_Error : exception renames Ada.IO_Exceptions.Name_Error; Use_Error : exception renames Ada.IO_Exceptions.Use_Error; Data_Error : exception renames Ada.IO_Exceptions.Data_Error; private package Controlled is type Library is limited private; function Reference (Lib : Dynamic_Linking.Library) return not null access C.windef.HMODULE; pragma Inline (Reference); private type Library is limited new Ada.Finalization.Limited_Controlled with record Handle : aliased C.windef.HMODULE := null; end record; overriding procedure Finalize (Object : in out Library); end Controlled; type Library is new Controlled.Library; end System.Program.Dynamic_Linking;
AaronC98/PlaneSystem
Ada
4,383
adb
------------------------------------------------------------------------------ -- Ada Web Server -- -- -- -- Copyright (C) 2009-2014, AdaCore -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 3, or (at your option) any -- -- later version. This library is distributed in the hope that it will be -- -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ------------------------------------------------------------------------------ pragma Ada_2012; with AWS.Translator; package body AWS.Utils.Streams is ---------- -- Open -- ---------- procedure Open (Stream : in out Strings'Class; Str : String) is begin Stream.Str := To_Unbounded_String (Str); Stream.Read_Index := 1; end Open; ---------- -- Read -- ---------- overriding procedure Read (Stream : in out Strings; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is Str : constant String := Slice (Stream.Str, Stream.Read_Index, Stream.Read_Index + Item'Length - 1); J : Stream_Element_Offset := Item'First; begin for S in Str'Range loop Item (J) := Stream_Element (Character'Pos (Str (S))); J := J + 1; end loop; Last := Item'First + Str'Length - 1; Stream.Read_Index := Stream.Read_Index + Item'Length; end Read; overriding procedure Read (Stream : in out SHA1; Item : out Stream_Element_Array; Last : out Stream_Element_Offset) is begin Item := Translator.To_Stream_Element_Array (GNAT.SHA1.Digest (Stream.C)); Last := Item'Last; end Read; ----------- -- Value -- ----------- function Value (Stream : not null access Strings'Class) return String is begin return To_String (Stream.Str); end Value; function Value (Stream : not null access SHA1'Class) return GNAT.SHA1.Message_Digest is Result : GNAT.SHA1.Message_Digest; begin GNAT.SHA1.Message_Digest'Read (Stream, Result); return Result; end Value; ----------- -- Write -- ----------- overriding procedure Write (Stream : in out Strings; Item : Stream_Element_Array) is Str : String (1 .. Integer (Item'Length)); S : Integer := Str'First; begin for Elem of Item loop Str (S) := Character'Val (Elem); S := S + 1; end loop; Append (Stream.Str, Str); end Write; overriding procedure Write (Stream : in out SHA1; Item : Stream_Element_Array) is begin GNAT.SHA1.Update (Stream.C, Item); end Write; end AWS.Utils.Streams;
AdaCore/Ada-IntelliJ
Ada
314
ads
package Hello is type Printer is abstract tagged null record; procedure Print_On_Console (P : Printer; V : String) is abstract; type Ada_Printer is new Printer with null record; procedure Print_On_Console (P : Ada_Printer; V : String); procedure Print_Messages (P : Printer'Class); end Hello;