repo_name
stringlengths 9
74
| language
stringclasses 1
value | length_bytes
int64 11
9.34M
| extension
stringclasses 2
values | content
stringlengths 11
9.34M
|
---|---|---|---|---|
charlie5/lace | Ada | 12,678 | adb | with
openGL.Shader,
openGL.Attribute,
openGL.Buffer.general,
openGL.Texture,
openGL.Palette,
openGL.Tasks,
openGL.Errors,
GL.Binding,
GL.lean,
GL.Pointers,
Interfaces.C.Strings,
System.storage_Elements;
package body openGL.Geometry.lit_colored_textured_skinned
is
-- Globals
--
vertex_Shader : aliased Shader.item;
fragment_Shader : aliased Shader.item;
the_Program : aliased openGL.Program.lit.colored_textured_skinned.item;
is_Defined : Boolean := False;
Name_1 : constant String := "Site";
Name_2 : constant String := "Normal";
Name_3 : constant String := "Color";
Name_4 : constant String := "Coords";
Name_5 : constant String := "Shine";
Name_6 : constant String := "bone_Ids";
Name_7 : constant String := "bone_Weights";
use Interfaces;
Attribute_1_Name : aliased C.char_array := C.to_C (Name_1);
Attribute_2_Name : aliased C.char_array := C.to_C (Name_2);
Attribute_3_Name : aliased C.char_array := C.to_C (Name_3);
Attribute_4_Name : aliased C.char_array := C.to_C (Name_4);
Attribute_5_Name : aliased C.char_array := C.to_C (Name_5);
Attribute_6_Name : aliased C.char_array := C.to_C (Name_6);
Attribute_7_Name : aliased C.char_array := C.to_C (Name_7);
Attribute_1_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_1_Name'Access);
Attribute_2_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_2_Name'Access);
Attribute_3_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_3_Name'Access);
Attribute_4_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_4_Name'Access);
Attribute_5_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_5_Name'Access);
Attribute_6_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_6_Name'Access);
Attribute_7_Name_ptr : aliased constant C.strings.chars_ptr := C.strings.to_chars_ptr (Attribute_7_Name'Access);
white_Texture : openGL.Texture.Object;
----------
-- Vertex
--
function is_Transparent (Self : in Vertex_array) return Boolean -- TODO: Replace this with the generic (check that all similar functions use the generic).
is
use type color_Value;
begin
for Each in Self'Range
loop
if Self (Each).Color.Alpha /= opaque_Value
then
return True;
end if;
end loop;
return False;
end is_Transparent;
---------
-- Forge
--
type Geometry_view is access all Geometry.lit_colored_textured_skinned.item'Class;
function new_Geometry return access Geometry.lit_colored_textured_skinned.item'Class
is
Self : constant Geometry_view := new Geometry.lit_colored_textured_skinned.item;
begin
Self.Program_is (the_Program'Access);
return Self;
end new_Geometry;
procedure define_Program
is
use Palette,
Attribute.Forge,
GL.lean,
GL.Pointers,
System.storage_Elements;
Sample : Vertex;
Attribute_1 : openGL.Attribute.view;
Attribute_2 : openGL.Attribute.view;
Attribute_3 : openGL.Attribute.view;
Attribute_4 : openGL.Attribute.view;
Attribute_5 : openGL.Attribute.view;
Attribute_6 : openGL.Attribute.view;
Attribute_7 : openGL.Attribute.view;
white_Image : constant openGL.Image := [1 .. 2 => [1 .. 2 => +White]];
begin
Tasks.check;
if is_Defined
then
raise Error with "The lit_colored_textured_skinned program has already been defined.";
end if;
is_Defined := True;
-- Define the shaders and program.
--
white_Texture := openGL.Texture.Forge.to_Texture (white_Image);
vertex_Shader .define (Shader.Vertex, "assets/opengl/shader/lit_colored_textured_skinned.vert");
fragment_Shader.define (Shader.Fragment, "assets/opengl/shader/lit_colored_textured_skinned.frag");
the_Program.define ( vertex_Shader'Access,
fragment_Shader'Access);
the_Program.enable;
Attribute_1 := new_Attribute (Name => Name_1,
gl_Location => the_Program.attribute_Location (Name_1),
Size => 3,
data_Kind => Attribute.GL_FLOAT,
Stride => lit_colored_textured_skinned.Vertex'Size / 8,
Offset => 0,
Normalized => False);
Attribute_2 := new_Attribute (Name => Name_2,
gl_Location => the_Program.attribute_Location (Name_2),
Size => 3,
data_Kind => Attribute.GL_FLOAT,
Stride => lit_colored_textured_skinned.Vertex'Size / 8,
Offset => Sample.Normal (1)'Address
- Sample.Site (1)'Address,
Normalized => False);
Attribute_3 := new_Attribute (Name => Name_3,
gl_Location => the_Program.attribute_Location (Name_3),
Size => 4,
data_Kind => Attribute.GL_UNSIGNED_BYTE,
Stride => lit_colored_textured_skinned.Vertex'Size / 8,
Offset => Sample.Color.Primary.Red'Address
- Sample.Site (1) 'Address,
Normalized => True);
Attribute_4 := new_Attribute (Name => Name_4,
gl_Location => the_Program.attribute_Location (Name_4),
Size => 2,
data_Kind => Attribute.GL_FLOAT,
Stride => lit_colored_textured_skinned.Vertex'Size / 8,
Offset => Sample.Coords.S'Address
- Sample.Site (1)'Address,
Normalized => False);
Attribute_5 := new_Attribute (Name => Name_5,
gl_Location => the_Program.attribute_Location (Name_5),
Size => 4,
data_Kind => Attribute.GL_FLOAT,
Stride => lit_colored_textured_skinned.Vertex'Size / 8,
Offset => Sample.bone_Ids (1)'Address
- Sample.Site (1)'Address,
Normalized => False);
Attribute_6 := new_Attribute (Name => Name_6,
gl_Location => the_Program.attribute_Location (Name_6),
Size => 4,
data_Kind => Attribute.GL_FLOAT,
Stride => lit_colored_textured_skinned.Vertex'Size / 8,
Offset => Sample.bone_Ids (1)'Address
- Sample.Site (1)'Address,
Normalized => False);
Attribute_7 := new_Attribute (Name => Name_7,
gl_Location => the_Program.attribute_Location (Name_7),
Size => 4,
data_Kind => Attribute.GL_FLOAT,
Stride => lit_colored_textured_skinned.Vertex'Size / 8,
Offset => Sample.bone_Weights (1)'Address
- Sample.Site (1)'Address,
Normalized => False);
the_Program.add (Attribute_1);
the_Program.add (Attribute_2);
the_Program.add (Attribute_3);
the_Program.add (Attribute_4);
the_Program.add (Attribute_5);
the_Program.add (Attribute_6);
the_Program.add (Attribute_7);
glBindAttribLocation (program => the_Program.gl_Program,
index => the_Program.Attribute (named => Name_1).gl_Location,
name => +Attribute_1_Name_ptr);
Errors.log;
glBindAttribLocation (program => the_Program.gl_Program,
index => the_Program.Attribute (named => Name_2).gl_Location,
name => +Attribute_2_Name_ptr);
Errors.log;
glBindAttribLocation (program => the_Program.gl_Program,
index => the_Program.Attribute (named => Name_3).gl_Location,
name => +Attribute_3_Name_ptr);
Errors.log;
glBindAttribLocation (program => the_Program.gl_Program,
index => the_Program.Attribute (named => Name_4).gl_Location,
name => +Attribute_4_Name_ptr);
Errors.log;
glBindAttribLocation (program => the_Program.gl_Program,
index => the_Program.Attribute (named => Name_5).gl_Location,
name => +Attribute_5_Name_ptr);
Errors.log;
glBindAttribLocation (program => the_Program.gl_Program,
index => the_Program.Attribute (named => Name_6).gl_Location,
name => +Attribute_6_Name_ptr);
Errors.log;
glBindAttribLocation (program => the_Program.gl_Program,
index => the_Program.Attribute (named => Name_7).gl_Location,
name => +Attribute_7_Name_ptr);
Errors.log;
end define_Program;
--------------
-- Attributes
--
function Program return openGL.Program.lit.colored_textured_skinned.view
is
begin
return the_Program'Access;
end Program;
overriding
procedure Indices_are (Self : in out Item; Now : in Indices;
for_Facia : in Positive)
is
begin
raise Error with "openGL.Geometry.lit_coloured_textured_skinned - 'Indices_are' ~ TODO";
end Indices_are;
package openGL_Buffer_of_geometry_Vertices is new Buffer.general (base_Object => Buffer.array_Object,
Index => long_Index_t,
Element => Vertex,
Element_Array => Vertex_array);
procedure Vertices_are (Self : in out Item; Now : in Vertex_array)
is
use openGL_Buffer_of_geometry_Vertices.Forge;
begin
Self.Vertices := new openGL_Buffer_of_geometry_Vertices.object' (to_Buffer (Now,
usage => Buffer.static_Draw));
Self.is_Transparent := Self.is_Transparent
or is_Transparent (Now);
-- Set the bounds.
--
declare
function get_Site (Index : in long_Index_t) return Vector_3
is (Now (Index).Site);
function bounding_Box is new get_Bounds (long_Index_t, get_Site);
begin
Self.Bounds_are (bounding_Box (Count => Now'Length));
end;
end Vertices_are;
overriding
procedure enable_Texture (Self : in Item)
is
use GL,
GL.Binding,
openGL.Texture;
begin
Tasks.check;
glActiveTexture (gl.GL_TEXTURE0);
Errors.log;
if Self.Texture = openGL.Texture.null_Object
then
if not white_Texture.is_Defined
then
declare
use Palette;
white_Image : constant openGL.Image := [1 .. 2 => [1 .. 2 => +White]];
begin
white_Texture := openGL.Texture.Forge.to_Texture (white_Image);
end;
end if;
white_Texture.enable;
else
Self.Texture.enable;
end if;
end enable_Texture;
end openGL.Geometry.lit_colored_textured_skinned;
|
charlie5/lace | Ada | 2,090 | adb | with
lace.Dice.d6,
lace.Dice.any,
ada.Text_IO;
procedure test_Dice
is
procedure log (Message : in String) renames ada.Text_IO.put_Line;
test_Error : exception;
begin
log ("Begin Test");
-- d6x1
--
log ("");
log ("d6x1_less5 Roll:" & lace.Dice.d6.d6x1_less5.Roll'Image);
log ("d6x1_less4 Roll:" & lace.Dice.d6.d6x1_less4.Roll'Image);
log ("d6x1_less3 Roll:" & lace.Dice.d6.d6x1_less3.Roll'Image);
log ("d6x1_less2 Roll:" & lace.Dice.d6.d6x1_less2.Roll'Image);
log ("d6x1_less1 Roll:" & lace.Dice.d6.d6x1_less1.Roll'Image);
log ("d6x1 Roll:" & lace.Dice.d6.d6x1 .Roll'Image);
log ("d6x1_plus1 Roll:" & lace.Dice.d6.d6x1_plus1.Roll'Image);
log ("d6x1_plus2 Roll:" & lace.Dice.d6.d6x1_plus2.Roll'Image);
-- d6x2
--
log ("");
log ("d6x2_less1 Roll:" & lace.Dice.d6.d6x2_less1.Roll'Image);
log ("d6x2 Roll:" & lace.Dice.d6.d6x2 .Roll'Image);
log ("d6x2_plus1 Roll:" & lace.Dice.d6.d6x2_plus1.Roll'Image);
log ("d6x2_plus2 Roll:" & lace.Dice.d6.d6x2_plus2.Roll'Image);
-- any
--
declare
use lace.Dice,
lace.Dice.any;
d100 : constant lace.Dice.any.item := to_Dice (Sides => 100,
Rolls => 1,
Modifier => 0);
the_Roll : Natural;
one_Count : Natural := 0;
hundred_Count : Natural := 0;
begin
for i in 1 .. 1_000
loop
the_Roll := d100.Roll;
case the_Roll
is
when 0 => raise test_Error with "Roll was 0.";
when 1 => one_Count := one_Count + 1;
when 100 => hundred_Count := hundred_Count + 1;
when 101 => raise test_Error with "Roll was 101.";
when others => null;
end case;
end loop;
log ("");
log ("1 rolled" & one_Count'Image & " times.");
log ("100 rolled" & hundred_Count'Image & " times.");
end;
log ("");
log ("End Test");
end test_Dice;
|
alexcamposruiz/dds-requestreply | Ada | 76 | ads | package DDS.Request_Reply.treqtrepreplier is
pragma Elaborate_Body;
end;
|
stcarrez/ada-util | Ada | 5,696 | ads | -----------------------------------------------------------------------
-- util-log-loggers -- Utility Log Package
-- Copyright (C) 2006, 2008, 2009, 2011, 2018, 2019, 2021 Free Software Foundation, Inc.
-- 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.Exceptions;
with Ada.Strings.Unbounded;
with Util.Properties;
private with Ada.Finalization;
private with Util.Log.Appenders;
package Util.Log.Loggers is
use Ada.Exceptions;
use Ada.Strings.Unbounded;
-- The logger identifies and configures the log produced
-- by a component that uses it. The logger has a name
-- which can be printed in the log outputs. The logger instance
-- contains a log level which can be used to control the level of
-- logs.
type Logger is tagged limited private;
type Logger_Access is access constant Logger;
-- Create a logger with the given name.
function Create (Name : in String) return Logger;
-- Create a logger with the given name and use the specified level.
function Create (Name : in String;
Level : in Level_Type) return Logger;
-- Change the log level
procedure Set_Level (Log : in out Logger;
Level : in Level_Type);
-- Get the log level.
function Get_Level (Log : in Logger) return Level_Type;
-- Get the log level name.
function Get_Level_Name (Log : in Logger) return String;
procedure Print (Log : in Logger;
Level : in Level_Type;
Message : in String;
Arg1 : in String := "";
Arg2 : in String := "";
Arg3 : in String := "";
Arg4 : in String := "");
procedure Debug (Log : in Logger'Class;
Message : in String;
Arg1 : in String := "";
Arg2 : in String := "";
Arg3 : in String := "");
procedure Debug (Log : in Logger'Class;
Message : in String;
Arg1 : in String;
Arg2 : in String;
Arg3 : in String;
Arg4 : in String);
procedure Debug (Log : in Logger'Class;
Message : in String;
Arg1 : in Unbounded_String;
Arg2 : in String := "";
Arg3 : in String := "");
procedure Debug (Log : in Logger'Class;
Message : in String;
Arg1 : in Unbounded_String;
Arg2 : in Unbounded_String;
Arg3 : in String := "");
procedure Info (Log : in Logger'Class;
Message : in String;
Arg1 : in String := "";
Arg2 : in String := "";
Arg3 : in String := "");
procedure Info (Log : in Logger'Class;
Message : in String;
Arg1 : in String;
Arg2 : in String;
Arg3 : in String;
Arg4 : in String);
procedure Info (Log : in Logger'Class;
Message : in String;
Arg1 : in Unbounded_String;
Arg2 : in String := "";
Arg3 : in String := "");
procedure Warn (Log : in Logger'Class;
Message : in String;
Arg1 : in String := "";
Arg2 : in String := "";
Arg3 : in String := "");
procedure Error (Log : in Logger'Class;
Message : in String;
Arg1 : in String := "";
Arg2 : in String := "";
Arg3 : in String := "");
procedure Error (Log : in Logger'Class;
Message : in String;
E : in Exception_Occurrence;
Trace : in Boolean := False);
-- Initialize the log environment with the property file.
procedure Initialize (Name : in String);
-- Initialize the log environment with the properties.
procedure Initialize (Properties : in Util.Properties.Manager);
-- Return a printable traceback that correspond to the exception.
function Traceback (E : in Exception_Occurrence) return String;
private
type Logger_Info;
type Logger_Info_Access is access all Logger_Info;
type Logger_Info (Len : Positive) is limited record
Next_Logger : Logger_Info_Access;
Prev_Logger : Logger_Info_Access;
Level : Level_Type := INFO_LEVEL;
Appender : Appenders.Appender_Access;
Name : String (1 .. Len);
end record;
type Logger is new Ada.Finalization.Limited_Controlled with record
Instance : Logger_Info_Access;
end record;
-- Finalize the logger and flush the associated appender
overriding
procedure Finalize (Log : in out Logger);
end Util.Log.Loggers;
|
charlie5/cBound | Ada | 1,261 | ads | -- This file is generated by SWIG. Please do not modify by hand.
--
with xcb.xcb_value_error_t;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_drawable_error_t is
-- Item
--
subtype Item is xcb.xcb_value_error_t.Item;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C.size_t range <>) of aliased xcb.xcb_drawable_error_t.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_drawable_error_t.Item,
Element_Array => xcb.xcb_drawable_error_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_drawable_error_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_drawable_error_t.Pointer,
Element_Array => xcb.xcb_drawable_error_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_drawable_error_t;
|
reznikmm/matreshka | Ada | 4,615 | 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_Draw.Start_Angle_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Draw_Start_Angle_Attribute_Node is
begin
return Self : Draw_Start_Angle_Attribute_Node do
Matreshka.ODF_Draw.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Draw_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Draw_Start_Angle_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Start_Angle_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Draw_URI,
Matreshka.ODF_String_Constants.Start_Angle_Attribute,
Draw_Start_Angle_Attribute_Node'Tag);
end Matreshka.ODF_Draw.Start_Angle_Attributes;
|
Martin-Molinero/coinapi-sdk | Ada | 20,295 | ads | -- OEML _ REST API
-- This section will provide necessary information about the `CoinAPI OEML REST API` protocol. This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a>
--
-- The version of the OpenAPI document: v1
-- Contact: [email protected]
--
-- NOTE: This package is auto generated by OpenAPI-Generator 5.1.1.
-- https://openapi-generator.tech
-- Do not edit the class manually.
with Swagger.Streams;
with Ada.Containers.Vectors;
package .Models is
pragma Style_Checks ("-mr");
type Severity_Type is
record
end record;
package Severity_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Severity_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Severity_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Severity_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Severity_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Severity_Type_Vectors.Vector);
-- ------------------------------
-- Message object.
-- ------------------------------
type Message_Type is
record
P_Type : Swagger.Nullable_UString;
Severity : .Models.Severity_Type;
Exchange_Id : Swagger.Nullable_UString;
Message : Swagger.Nullable_UString;
end record;
package Message_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Message_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Message_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Message_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Message_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Message_Type_Vectors.Vector);
-- ------------------------------
-- JSON validation error.
-- ------------------------------
type ValidationError_Type is
record
P_Type : Swagger.Nullable_UString;
Title : Swagger.Nullable_UString;
Status : Swagger.Number;
Trace_Id : Swagger.Nullable_UString;
Errors : Swagger.Nullable_UString;
end record;
package ValidationError_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => ValidationError_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ValidationError_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in ValidationError_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ValidationError_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out ValidationError_Type_Vectors.Vector);
type OrdType_Type is
record
end record;
package OrdType_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => OrdType_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrdType_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrdType_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrdType_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrdType_Type_Vectors.Vector);
type OrdStatus_Type is
record
end record;
package OrdStatus_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => OrdStatus_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrdStatus_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrdStatus_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrdStatus_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrdStatus_Type_Vectors.Vector);
type OrderCancelAllRequest_Type is
record
Exchange_Id : Swagger.UString;
end record;
package OrderCancelAllRequest_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => OrderCancelAllRequest_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrderCancelAllRequest_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrderCancelAllRequest_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrderCancelAllRequest_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrderCancelAllRequest_Type_Vectors.Vector);
type OrderCancelSingleRequest_Type is
record
Exchange_Id : Swagger.UString;
Exchange_Order_Id : Swagger.Nullable_UString;
Client_Order_Id : Swagger.Nullable_UString;
end record;
package OrderCancelSingleRequest_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => OrderCancelSingleRequest_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrderCancelSingleRequest_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrderCancelSingleRequest_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrderCancelSingleRequest_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrderCancelSingleRequest_Type_Vectors.Vector);
type OrdSide_Type is
record
end record;
package OrdSide_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => OrdSide_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrdSide_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrdSide_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrdSide_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrdSide_Type_Vectors.Vector);
type TimeInForce_Type is
record
end record;
package TimeInForce_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => TimeInForce_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TimeInForce_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in TimeInForce_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TimeInForce_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out TimeInForce_Type_Vectors.Vector);
type OrderNewSingleRequest_Type is
record
Exchange_Id : Swagger.UString;
Client_Order_Id : Swagger.UString;
Symbol_Id_Exchange : Swagger.Nullable_UString;
Symbol_Id_Coinapi : Swagger.Nullable_UString;
Amount_Order : Swagger.Number;
Price : Swagger.Number;
Side : .Models.OrdSide_Type;
Order_Type : .Models.OrdType_Type;
Time_In_Force : .Models.TimeInForce_Type;
Expire_Time : Swagger.Nullable_Date;
Exec_Inst : Swagger.UString_Vectors.Vector;
end record;
package OrderNewSingleRequest_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => OrderNewSingleRequest_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrderNewSingleRequest_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrderNewSingleRequest_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrderNewSingleRequest_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrderNewSingleRequest_Type_Vectors.Vector);
-- ------------------------------
-- Relay fill information on working orders.
-- ------------------------------
type Fills_Type is
record
Time : Swagger.Nullable_Date;
Price : Swagger.Number;
Amount : Swagger.Number;
end record;
package Fills_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Fills_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Fills_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Fills_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Fills_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Fills_Type_Vectors.Vector);
type OrderExecutionReport_Type is
record
Exchange_Id : Swagger.UString;
Client_Order_Id : Swagger.UString;
Symbol_Id_Exchange : Swagger.Nullable_UString;
Symbol_Id_Coinapi : Swagger.Nullable_UString;
Amount_Order : Swagger.Number;
Price : Swagger.Number;
Side : .Models.OrdSide_Type;
Order_Type : .Models.OrdType_Type;
Time_In_Force : .Models.TimeInForce_Type;
Expire_Time : Swagger.Nullable_Date;
Exec_Inst : Swagger.UString_Vectors.Vector;
Client_Order_Id_Format_Exchange : Swagger.UString;
Exchange_Order_Id : Swagger.Nullable_UString;
Amount_Open : Swagger.Number;
Amount_Filled : Swagger.Number;
Avg_Px : Swagger.Number;
Status : .Models.OrdStatus_Type;
Status_History : Swagger.UString_Vectors.Vector_Vectors.Vector;
Error_Message : Swagger.Nullable_UString;
Fills : .Models.Fills_Type_Vectors.Vector;
end record;
package OrderExecutionReport_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => OrderExecutionReport_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrderExecutionReport_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrderExecutionReport_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrderExecutionReport_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrderExecutionReport_Type_Vectors.Vector);
type OrderExecutionReportAllOf_Type is
record
Client_Order_Id_Format_Exchange : Swagger.UString;
Exchange_Order_Id : Swagger.Nullable_UString;
Amount_Open : Swagger.Number;
Amount_Filled : Swagger.Number;
Avg_Px : Swagger.Number;
Status : .Models.OrdStatus_Type;
Status_History : Swagger.UString_Vectors.Vector_Vectors.Vector;
Error_Message : Swagger.Nullable_UString;
Fills : .Models.Fills_Type_Vectors.Vector;
end record;
package OrderExecutionReportAllOf_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => OrderExecutionReportAllOf_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrderExecutionReportAllOf_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in OrderExecutionReportAllOf_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrderExecutionReportAllOf_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out OrderExecutionReportAllOf_Type_Vectors.Vector);
type BalanceData_Type is
record
Asset_Id_Exchange : Swagger.Nullable_UString;
Asset_Id_Coinapi : Swagger.Nullable_UString;
Balance : float;
Available : float;
Locked : float;
Last_Updated_By : Swagger.Nullable_UString;
Rate_Usd : float;
Traded : float;
end record;
package BalanceData_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => BalanceData_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BalanceData_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in BalanceData_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BalanceData_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out BalanceData_Type_Vectors.Vector);
type Balance_Type is
record
Exchange_Id : Swagger.Nullable_UString;
Data : .Models.BalanceData_Type_Vectors.Vector;
end record;
package Balance_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Balance_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Balance_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Balance_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Balance_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Balance_Type_Vectors.Vector);
type Position_Type is
record
Exchange_Id : Swagger.Nullable_UString;
Data : .Models.PositionData_Type_Vectors.Vector;
end record;
package Position_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => Position_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Position_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in Position_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Position_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out Position_Type_Vectors.Vector);
type PositionData_Type is
record
Symbol_Id_Exchange : Swagger.Nullable_UString;
Symbol_Id_Coinapi : Swagger.Nullable_UString;
Avg_Entry_Price : Swagger.Number;
Quantity : Swagger.Number;
Side : .Models.OrdSide_Type;
Unrealized_Pnl : Swagger.Number;
Leverage : Swagger.Number;
Cross_Margin : Swagger.Nullable_Boolean;
Liquidation_Price : Swagger.Number;
Raw_Data : Swagger.Object;
end record;
package PositionData_Type_Vectors is
new Ada.Containers.Vectors (Index_Type => Positive,
Element_Type => PositionData_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PositionData_Type);
procedure Serialize (Into : in out Swagger.Streams.Output_Stream'Class;
Name : in String;
Value : in PositionData_Type_Vectors.Vector);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PositionData_Type);
procedure Deserialize (From : in Swagger.Value_Type;
Name : in String;
Value : out PositionData_Type_Vectors.Vector);
end .Models;
|
Fabien-Chouteau/microbit_examples | Ada | 3,951 | adb | pragma Warnings (Off);
pragma Ada_95;
pragma Source_File_Name (ada_main, Spec_File_Name => "b__main.ads");
pragma Source_File_Name (ada_main, Body_File_Name => "b__main.adb");
pragma Suppress (Overflow_Check);
package body ada_main is
E72 : Short_Integer; pragma Import (Ada, E72, "cortex_m__nvic_E");
E66 : Short_Integer; pragma Import (Ada, E66, "nrf__events_E");
E17 : Short_Integer; pragma Import (Ada, E17, "nrf__gpio_E");
E85 : Short_Integer; pragma Import (Ada, E85, "nrf__gpio__tasks_and_events_E");
E68 : Short_Integer; pragma Import (Ada, E68, "nrf__interrupts_E");
E27 : Short_Integer; pragma Import (Ada, E27, "nrf__rtc_E");
E30 : Short_Integer; pragma Import (Ada, E30, "nrf__spi_master_E");
E51 : Short_Integer; pragma Import (Ada, E51, "nrf__tasks_E");
E83 : Short_Integer; pragma Import (Ada, E83, "nrf__adc_E");
E49 : Short_Integer; pragma Import (Ada, E49, "nrf__clock_E");
E87 : Short_Integer; pragma Import (Ada, E87, "nrf__ppi_E");
E34 : Short_Integer; pragma Import (Ada, E34, "nrf__timers_E");
E37 : Short_Integer; pragma Import (Ada, E37, "nrf__twi_E");
E41 : Short_Integer; pragma Import (Ada, E41, "nrf__uart_E");
E05 : Short_Integer; pragma Import (Ada, E05, "nrf__device_E");
E81 : Short_Integer; pragma Import (Ada, E81, "microbit__ios_E");
E47 : Short_Integer; pragma Import (Ada, E47, "microbit__time_E");
E45 : Short_Integer; pragma Import (Ada, E45, "microbit__buttons_E");
E77 : Short_Integer; pragma Import (Ada, E77, "microbit__display_E");
E79 : Short_Integer; pragma Import (Ada, E79, "microbit__display__symbols_E");
Sec_Default_Sized_Stacks : array (1 .. 1) of aliased System.Secondary_Stack.SS_Stack (System.Parameters.Runtime_Default_Sec_Stack_Size);
procedure adainit is
Binder_Sec_Stacks_Count : Natural;
pragma Import (Ada, Binder_Sec_Stacks_Count, "__gnat_binder_ss_count");
Default_Secondary_Stack_Size : System.Parameters.Size_Type;
pragma Import (C, Default_Secondary_Stack_Size, "__gnat_default_ss_size");
Default_Sized_SS_Pool : System.Address;
pragma Import (Ada, Default_Sized_SS_Pool, "__gnat_default_ss_pool");
begin
null;
ada_main'Elab_Body;
Default_Secondary_Stack_Size := System.Parameters.Runtime_Default_Sec_Stack_Size;
Binder_Sec_Stacks_Count := 1;
Default_Sized_SS_Pool := Sec_Default_Sized_Stacks'Address;
E72 := E72 + 1;
E66 := E66 + 1;
E17 := E17 + 1;
E85 := E85 + 1;
Nrf.Interrupts'Elab_Body;
E68 := E68 + 1;
E27 := E27 + 1;
E30 := E30 + 1;
E51 := E51 + 1;
E83 := E83 + 1;
E49 := E49 + 1;
E87 := E87 + 1;
E34 := E34 + 1;
E37 := E37 + 1;
E41 := E41 + 1;
Nrf.Device'Elab_Spec;
E05 := E05 + 1;
Microbit.Ios'Elab_Spec;
Microbit.Ios'Elab_Body;
E81 := E81 + 1;
Microbit.Time'Elab_Body;
E47 := E47 + 1;
Microbit.Buttons'Elab_Body;
E45 := E45 + 1;
Microbit.Display'Elab_Body;
E77 := E77 + 1;
E79 := E79 + 1;
end adainit;
procedure Ada_Main_Program;
pragma Import (Ada, Ada_Main_Program, "_ada_main");
procedure main is
Ensure_Reference : aliased System.Address := Ada_Main_Program_Name'Address;
pragma Volatile (Ensure_Reference);
begin
adainit;
Ada_Main_Program;
end;
-- BEGIN Object file/option list
-- /home/chouteau/src/github/Ada_Drivers_Library/examples/MicroBit/analog_out/obj/main.o
-- -L/home/chouteau/src/github/Ada_Drivers_Library/examples/MicroBit/analog_out/obj/
-- -L/home/chouteau/src/github/Ada_Drivers_Library/examples/MicroBit/analog_out/obj/
-- -L/home/chouteau/src/github/Ada_Drivers_Library/boards/MicroBit/obj/zfp_lib_Debug/
-- -L/home/chouteau/src/GNAT_GPL/2020-arm-elf/arm-eabi/lib/gnat/zfp-cortex-m0/adalib/
-- -static
-- -lgnat
-- END Object file/option list
end ada_main;
|
gspu/synth | Ada | 47,980 | adb | -- This file is covered by the Internet Software Consortium (ISC) License
-- Reference: ../License.txt
with Ada.Calendar.Arithmetic;
with Ada.Calendar.Formatting;
with Ada.Direct_IO;
with Replicant.Platform;
package body PortScan.Buildcycle is
package ACA renames Ada.Calendar.Arithmetic;
package ACF renames Ada.Calendar.Formatting;
package REP renames Replicant;
----------------------
-- initialize_log --
----------------------
function initialize_log (id : builders) return Boolean
is
FA : access TIO.File_Type;
H_ENV : constant String := "Environment";
H_OPT : constant String := "Options";
CFG1 : constant String := "/etc/make.conf";
CFG2 : constant String := "/etc/mk.conf";
UNAME : constant String := JT.USS (uname_mrv);
BENV : constant String := get_environment (id);
COPTS : constant String := get_options_configuration (id);
PTVAR : JT.Text := get_port_variables (id);
begin
trackers (id).dynlink.Clear;
trackers (id).head_time := CAL.Clock;
declare
log_path : constant String := log_name (trackers (id).seq_id);
begin
-- Try to defend malicious symlink: https://en.wikipedia.org/wiki/Symlink_race
if AD.Exists (log_path) then
AD.Delete_File (log_path);
end if;
TIO.Create (File => trackers (id).log_handle,
Mode => TIO.Out_File,
Name => log_path);
FA := trackers (id).log_handle'Access;
exception
when error : others =>
raise cycle_log_error
with "failed to create log " & log_path;
end;
TIO.Put_Line (FA.all, "=> Building " &
get_catport (all_ports (trackers (id).seq_id)));
TIO.Put_Line (FA.all, "Started : " & timestamp (trackers (id).head_time));
TIO.Put (FA.all, "Platform: " & UNAME);
if BENV = discerr then
TIO.Put_Line (FA.all, LAT.LF & "Environment definition failed, " &
"aborting entire build");
return False;
end if;
TIO.Put_Line (FA.all, LAT.LF & log_section (H_ENV, True));
TIO.Put (FA.all, BENV);
TIO.Put_Line (FA.all, log_section (H_ENV, False) & LAT.LF);
TIO.Put_Line (FA.all, log_section (H_OPT, True));
TIO.Put (FA.all, COPTS);
TIO.Put_Line (FA.all, log_section (H_OPT, False) & LAT.LF);
dump_port_variables (id => id, content => PTVAR);
case software_framework is
when ports_collection =>
TIO.Put_Line (FA.all, log_section (CFG1, True));
TIO.Put (FA.all, dump_make_conf (id, CFG1));
TIO.Put_Line (FA.all, log_section (CFG1, False) & LAT.LF);
when pkgsrc =>
TIO.Put_Line (FA.all, log_section (CFG2, True));
TIO.Put (FA.all, dump_make_conf (id, CFG2));
TIO.Put_Line (FA.all, log_section (CFG2, False) & LAT.LF);
end case;
return True;
end initialize_log;
--------------------
-- finalize_log --
--------------------
procedure finalize_log (id : builders) is
begin
TIO.Put_Line (trackers (id).log_handle, log_section ("Termination", True));
trackers (id).tail_time := CAL.Clock;
TIO.Put_Line (trackers (id).log_handle,
"Finished: " & timestamp (trackers (id).tail_time));
TIO.Put_Line (trackers (id).log_handle,
log_duration (start => trackers (id).head_time,
stop => trackers (id).tail_time));
TIO.Close (trackers (id).log_handle);
end finalize_log;
--------------------
-- log_duration --
--------------------
function log_duration (start, stop : CAL.Time) return String
is
raw : JT.Text := JT.SUS ("Duration:");
diff_days : ACA.Day_Count;
diff_secs : Duration;
leap_secs : ACA.Leap_Seconds_Count;
use type ACA.Day_Count;
begin
ACA.Difference (Left => stop,
Right => start,
Days => diff_days,
Seconds => diff_secs,
Leap_Seconds => leap_secs);
if diff_days > 0 then
if diff_days = 1 then
JT.SU.Append (raw, " 1 day and " &
ACF.Image (Elapsed_Time => diff_secs));
else
JT.SU.Append (raw, diff_days'Img & " days and " &
ACF.Image (Elapsed_Time => diff_secs));
end if;
else
JT.SU.Append (raw, " " & ACF.Image (Elapsed_Time => diff_secs));
end if;
return JT.USS (raw);
end log_duration;
------------------------
-- elapsed_HH_MM_SS --
------------------------
function elapsed_HH_MM_SS (start, stop : CAL.Time) return String
is
diff_days : ACA.Day_Count;
diff_secs : Duration;
leap_secs : ACA.Leap_Seconds_Count;
secs_per_hour : constant Integer := 3600;
total_hours : Integer;
total_minutes : Integer;
work_hours : Integer;
work_seconds : Integer;
use type ACA.Day_Count;
begin
ACA.Difference (Left => stop,
Right => start,
Days => diff_days,
Seconds => diff_secs,
Leap_Seconds => leap_secs);
-- Seems the ACF image is shit, so let's roll our own. If more than
-- 100 hours, change format to "HHH:MM.M"
work_seconds := Integer (diff_secs);
total_hours := work_seconds / secs_per_hour;
total_hours := total_hours + Integer (diff_days) * 24;
if total_hours < 24 then
if work_seconds < 0 then
return "--:--:--";
else
work_seconds := work_seconds - (total_hours * secs_per_hour);
total_minutes := work_seconds / 60;
work_seconds := work_seconds - (total_minutes * 60);
return
JT.zeropad (total_hours, 2) & LAT.Colon &
JT.zeropad (total_minutes, 2) & LAT.Colon &
JT.zeropad (work_seconds, 2);
end if;
elsif total_hours < 100 then
if work_seconds < 0 then
return JT.zeropad (total_hours, 2) & ":00:00";
else
work_hours := work_seconds / secs_per_hour;
work_seconds := work_seconds - (work_hours * secs_per_hour);
total_minutes := work_seconds / 60;
work_seconds := work_seconds - (total_minutes * 60);
return
JT.zeropad (total_hours, 2) & LAT.Colon &
JT.zeropad (total_minutes, 2) & LAT.Colon &
JT.zeropad (work_seconds, 2);
end if;
else
if work_seconds < 0 then
return JT.zeropad (total_hours, 3) & ":00.0";
else
work_hours := work_seconds / secs_per_hour;
work_seconds := work_seconds - (work_hours * secs_per_hour);
total_minutes := work_seconds / 60;
work_seconds := (work_seconds - (total_minutes * 60)) * 10 / 60;
return
JT.zeropad (total_hours, 3) & LAT.Colon &
JT.zeropad (total_minutes, 2) & '.' &
JT.int2str (work_seconds);
end if;
end if;
end elapsed_HH_MM_SS;
-------------------
-- elapsed_now --
-------------------
function elapsed_now return String is
begin
return elapsed_HH_MM_SS (start => start_time, stop => CAL.Clock);
end elapsed_now;
-----------------------------
-- generic_system_command --
-----------------------------
function generic_system_command (command : String) return JT.Text
is
content : JT.Text;
status : Integer;
begin
content := Unix.piped_command (command, status);
if status /= 0 then
raise cycle_cmd_error with "cmd: " & command &
" (return code =" & status'Img & ")";
end if;
return content;
end generic_system_command;
---------------------
-- set_uname_mrv --
---------------------
procedure set_uname_mrv
is
-- valid for all platforms
command : constant String := "/usr/bin/uname -mrv";
begin
uname_mrv := generic_system_command (command);
exception
when others =>
uname_mrv := JT.SUS (discerr);
end set_uname_mrv;
----------------
-- get_root --
----------------
function get_root (id : builders) return String
is
id_image : constant String := Integer (id)'Img;
suffix : String := "/SL00";
begin
if id < 10 then
suffix (5) := id_image (2);
else
suffix (4 .. 5) := id_image (2 .. 3);
end if;
return JT.USS (PM.configuration.dir_buildbase) & suffix;
end get_root;
-----------------------
-- get_environment --
-----------------------
function get_environment (id : builders) return String
is
root : constant String := get_root (id);
command : constant String := chroot & root & environment_override;
begin
return JT.USS (generic_system_command (command));
exception
when others =>
return discerr;
end get_environment;
---------------------------------
-- get_options_configuration --
---------------------------------
function get_options_configuration (id : builders) return String
is
root : constant String := get_root (id);
catport : constant String := get_catport (all_ports (trackers (id).seq_id));
command : constant String := chroot & root & environment_override &
chroot_make_program & " -C " & port_specification (catport);
begin
case software_framework is
when ports_collection =>
return JT.USS (generic_system_command (command & " showconfig"));
when pkgsrc =>
return JT.USS (generic_system_command (command & " show-options"));
end case;
exception
when others =>
return discerr;
end get_options_configuration;
------------------------
-- split_collection --
------------------------
function split_collection (line : JT.Text; title : String) return String
is
-- Support spaces in two ways
-- 1) quoted, e.g. TYPING="The Quick Brown Fox"
-- 2) Escaped, e.g. TYPING=The\ Quick\ Brown\ Fox
meat : JT.Text;
waiting : Boolean := True;
escaped : Boolean := False;
quoted : Boolean := False;
keepit : Boolean;
counter : Natural := 0;
meatlen : Natural := 0;
linelen : Natural := JT.SU.Length (line);
onechar : String (1 .. 1);
meatstr : String (1 .. linelen);
begin
loop
counter := counter + 1;
exit when counter > linelen;
keepit := True;
onechar := JT.SU.Slice (Source => line,
Low => counter,
High => counter);
if onechar (1) = LAT.Reverse_Solidus then
-- A) if inside quotes, it's literal
-- B) if it's first RS, don't keep but mark escaped
-- C) If it's second RS, it's literal, remove escaped
-- D) RS can never start a new NV pair
if not quoted then
if not escaped then
keepit := False;
end if;
escaped := not escaped;
end if;
elsif escaped then
-- E) by definition, next character after an escape is literal
-- We know it's not inside quotes. Keep this (could be a space)
waiting := False;
escaped := not escaped;
elsif onechar (1) = LAT.Space then
if waiting then
keepit := False;
else
if not quoted then
-- name-pair ended, reset
waiting := True;
quoted := False;
onechar (1) := LAT.LF;
end if;
end if;
else
waiting := False;
if onechar (1) = LAT.Quotation then
quoted := not quoted;
end if;
end if;
if keepit then
meatlen := meatlen + 1;
meatstr (meatlen) := onechar (1);
end if;
end loop;
return log_section (title, True) & LAT.LF &
meatstr (1 .. meatlen) & LAT.LF &
log_section (title, False) & LAT.LF;
end split_collection;
--------------------------
-- get_port_variables --
--------------------------
function get_port_variables (id : builders) return JT.Text
is
root : constant String := get_root (id);
catport : constant String := get_catport (all_ports (trackers (id).seq_id));
command : constant String := chroot & root & environment_override &
chroot_make_program & " -C " & port_specification (catport);
cmd_fpc : constant String := command &
" -VCONFIGURE_ENV -VCONFIGURE_ARGS -VMAKE_ENV -VMAKE_ARGS" &
" -VPLIST_SUB -VSUB_LIST";
cmd_nps : constant String := command &
" .MAKE.EXPAND_VARIABLES=yes -VCONFIGURE_ENV -VCONFIGURE_ARGS" &
" -VMAKE_ENV -VMAKE_FLAGS -VBUILD_MAKE_FLAGS -VPLIST_SUBST" &
" -VFILES_SUBST";
begin
case software_framework is
when ports_collection =>
return generic_system_command (cmd_fpc);
when pkgsrc =>
return generic_system_command (cmd_nps);
end case;
exception
when others =>
return JT.SUS (discerr);
end get_port_variables;
---------------------------
-- dump_port_variables --
---------------------------
procedure dump_port_variables (id : builders; content : JT.Text)
is
LA : access TIO.File_Type := trackers (id).log_handle'Access;
topline : JT.Text;
concopy : JT.Text := content;
type result_range_fpc is range 1 .. 6;
type result_range_nps is range 1 .. 7;
begin
case software_framework is
when ports_collection =>
for k in result_range_fpc loop
JT.nextline (lineblock => concopy, firstline => topline);
case k is
when 1 => TIO.Put_Line
(LA.all, split_collection (topline, "CONFIGURE_ENV"));
when 2 => TIO.Put_Line
(LA.all, split_collection (topline, "CONFIGURE_ARGS"));
when 3 => TIO.Put_Line
(LA.all, split_collection (topline, "MAKE_ENV"));
when 4 => TIO.Put_Line
(LA.all, split_collection (topline, "MAKE_ARGS"));
when 5 => TIO.Put_Line
(LA.all, split_collection (topline, "PLIST_SUB"));
when 6 => TIO.Put_Line
(LA.all, split_collection (topline, "SUB_LIST"));
end case;
end loop;
when pkgsrc =>
for k in result_range_nps loop
JT.nextline (lineblock => concopy, firstline => topline);
case k is
when 1 => TIO.Put_Line
(LA.all, split_collection (topline, "CONFIGURE_ENV"));
when 2 => TIO.Put_Line
(LA.all, split_collection (topline, "CONFIGURE_ARGS"));
when 3 => TIO.Put_Line
(LA.all, split_collection (topline, "MAKE_ENV"));
when 4 => TIO.Put_Line
(LA.all, split_collection (topline, "MAKE_FLAGS"));
when 5 => TIO.Put_Line
(LA.all, split_collection (topline, "BUILD_MAKE_FLAGS"));
when 6 => TIO.Put_Line
(LA.all, split_collection (topline, "PLIST_SUBST"));
when 7 => TIO.Put_Line
(LA.all, split_collection (topline, "FILES_SUBST"));
end case;
end loop;
end case;
end dump_port_variables;
----------------
-- log_name --
----------------
function log_name (sid : port_id) return String
is
catport : constant String := get_catport (all_ports (sid));
begin
return JT.USS (PM.configuration.dir_logs) & "/" &
JT.part_1 (catport) & "___" & JT.part_2 (catport) & ".log";
end log_name;
-----------------
-- dump_file --
-----------------
function dump_file (filename : String) return String
is
File_Size : Natural := Natural (AD.Size (filename));
subtype File_String is String (1 .. File_Size);
package File_String_IO is new Ada.Direct_IO (File_String);
File : File_String_IO.File_Type;
Contents : File_String;
begin
File_String_IO.Open (File, Mode => File_String_IO.In_File,
Name => filename);
File_String_IO.Read (File, Item => Contents);
File_String_IO.Close (File);
return String (Contents);
end dump_file;
----------------------
-- dump_make_conf --
----------------------
function dump_make_conf (id : builders; conf_file : String) return String
is
root : constant String := get_root (id);
filename : constant String := root & conf_file;
begin
return dump_file (filename);
end dump_make_conf;
------------------
-- initialize --
------------------
procedure initialize (test_mode : Boolean; jail_env : JT.Text) is
begin
set_uname_mrv;
testing := test_mode;
lock_localbase := testing and then Unix.env_variable_defined ("LOCK");
slave_env := jail_env;
declare
logdir : constant String := JT.USS (PM.configuration.dir_logs);
begin
if not AD.Exists (logdir) then
AD.Create_Path (New_Directory => logdir);
end if;
exception
when error : others =>
raise cycle_log_error
with "failed to create " & logdir;
end;
obtain_custom_environment;
end initialize;
-------------------
-- log_section --
-------------------
function log_section (title : String; header : Boolean) return String
is
hyphens : constant String := (1 .. 50 => '-');
begin
if header then
return LAT.LF & hyphens & LAT.LF & "-- " & title & LAT.LF & hyphens;
else
return "";
end if;
end log_section;
---------------------
-- log_phase_end --
---------------------
procedure log_phase_end (id : builders)
is
begin
TIO.Put_Line (trackers (id).log_handle, "" & LAT.LF);
end log_phase_end;
-----------------------
-- log_phase_begin --
-----------------------
procedure log_phase_begin (phase : String; id : builders)
is
hyphens : constant String := (1 .. 80 => '-');
middle : constant String := "-- Phase: " & phase;
begin
TIO.Put_Line (trackers (id).log_handle,
LAT.LF & hyphens & LAT.LF & middle & LAT.LF & hyphens);
end log_phase_begin;
-----------------------
-- generic_execute --
-----------------------
function generic_execute (id : builders; command : String;
dogbite : out Boolean;
time_limit : execution_limit) return Boolean
is
subtype time_cycle is execution_limit range 1 .. time_limit;
subtype one_minute is Positive range 1 .. 230; -- lose 10 in rounding
type dim_watchdog is array (time_cycle) of Natural;
use type Unix.process_exit;
watchdog : dim_watchdog;
squirrel : time_cycle := time_cycle'First;
cycle_done : Boolean := False;
pid : Unix.pid_t;
status : Unix.process_exit;
lock_lines : Natural;
quartersec : one_minute := one_minute'First;
hangmonitor : constant Boolean := True;
synthexec : constant String := host_localbase & "/libexec/synthexec";
truecommand : constant String := synthexec & " " &
log_name (trackers (id).seq_id) & " " & command;
begin
dogbite := False;
watchdog (squirrel) := trackers (id).loglines;
pid := Unix.launch_process (truecommand);
if Unix.fork_failed (pid) then
return False;
end if;
loop
delay 0.25;
if quartersec = one_minute'Last then
quartersec := one_minute'First;
-- increment squirrel
if squirrel = time_cycle'Last then
squirrel := time_cycle'First;
cycle_done := True;
else
squirrel := squirrel + 1;
end if;
if hangmonitor then
lock_lines := trackers (id).loglines;
if cycle_done then
if watchdog (squirrel) = lock_lines then
-- Log hasn't advanced in a full cycle so bail out
dogbite := True;
Unix.kill_process_tree (process_group => pid);
delay 5.0; -- Give some time for error to write to log
return False;
end if;
end if;
watchdog (squirrel) := lock_lines;
end if;
else
quartersec := quartersec + 1;
end if;
status := Unix.process_status (pid);
if status = Unix.exited_normally then
return True;
end if;
if status = Unix.exited_with_error then
return False;
end if;
end loop;
end generic_execute;
------------------------------
-- stack_linked_libraries --
------------------------------
procedure stack_linked_libraries (id : builders; base, filename : String)
is
command : String := chroot & base & " /usr/bin/objdump -p " & filename;
comres : JT.Text;
topline : JT.Text;
crlen1 : Natural;
crlen2 : Natural;
begin
comres := generic_system_command (command);
crlen1 := JT.SU.Length (comres);
loop
JT.nextline (lineblock => comres, firstline => topline);
crlen2 := JT.SU.Length (comres);
exit when crlen1 = crlen2;
crlen1 := crlen2;
if not JT.IsBlank (topline) then
if JT.contains (topline, "NEEDED") then
if not trackers (id).dynlink.Contains (topline) then
trackers (id).dynlink.Append (topline);
end if;
end if;
end if;
end loop;
exception
-- the command result was not zero, so it was an expected format
-- or static file. Just skip it. (Should never happen)
when bad_result : others => null;
end stack_linked_libraries;
----------------------------
-- log_linked_libraries --
----------------------------
procedure log_linked_libraries (id : builders)
is
procedure log_dump (cursor : string_crate.Cursor);
comres : JT.Text;
topline : JT.Text;
crlen1 : Natural;
crlen2 : Natural;
pkgfile : constant String := JT.USS
(all_ports (trackers (id).seq_id).package_name);
pkgname : constant String := pkgfile (1 .. pkgfile'Last - 4);
root : constant String := get_root (id);
command : constant String := chroot & root & environment_override &
REP.root_localbase & "/sbin/pkg-static query %Fp " & pkgname;
procedure log_dump (cursor : string_crate.Cursor) is
begin
TIO.Put_Line (trackers (id).log_handle,
JT.USS (string_crate.Element (Position => cursor)));
end log_dump;
begin
TIO.Put_Line (trackers (id).log_handle,
"=> Checking shared library dependencies");
comres := generic_system_command (command);
crlen1 := JT.SU.Length (comres);
loop
JT.nextline (lineblock => comres, firstline => topline);
crlen2 := JT.SU.Length (comres);
exit when crlen1 = crlen2;
crlen1 := crlen2;
if REP.Platform.dynamically_linked (root, JT.USS (topline)) then
stack_linked_libraries (id, root, JT.USS (topline));
end if;
end loop;
trackers (id).dynlink.Iterate (log_dump'Access);
exception
when others => null;
end log_linked_libraries;
----------------------------
-- environment_override --
----------------------------
function environment_override (enable_tty : Boolean := False) return String
is
function set_terminal (enable_tty : Boolean) return String;
function set_terminal (enable_tty : Boolean) return String is
begin
if enable_tty then
return "TERM=cons25 ";
end if;
return "TERM=dumb ";
end set_terminal;
PATH : constant String := "PATH=/sbin:/bin:/usr/sbin:/usr/bin:"
& REP.root_localbase & "/sbin:" & REP.root_localbase & "/bin ";
TERM : constant String := set_terminal (enable_tty);
USER : constant String := "USER=root ";
HOME : constant String := "HOME=/root ";
LANG : constant String := "LANG=C ";
FTP : constant String := "SSL_NO_VERIFY_PEER=1 ";
PKG8 : constant String := "PORTSDIR=" & dir_ports & " " &
"PKG_DBDIR=/var/db/pkg8 " &
"PKG_CACHEDIR=/var/cache/pkg8 ";
CENV : constant String := JT.USS (customenv);
JENV : constant String := JT.USS (slave_env);
begin
return " /usr/bin/env -i " &
USER & HOME & LANG & PKG8 & TERM & FTP & PATH & JENV & CENV;
end environment_override;
---------------------
-- set_log_lines --
---------------------
procedure set_log_lines (id : builders)
is
log_path : constant String := log_name (trackers (id).seq_id);
command : constant String := "/usr/bin/wc -l " & log_path;
comres : JT.Text;
begin
if not uselog then
trackers (id).loglines := 0;
return;
end if;
comres := JT.trim (generic_system_command (command));
declare
numtext : constant String :=
JT.part_1 (S => JT.USS (comres), separator => " ");
begin
trackers (id).loglines := Natural'Value (numtext);
end;
exception
when others => null; -- just skip this cycle
end set_log_lines;
-----------------------
-- format_loglines --
-----------------------
function format_loglines (numlines : Natural) return String
is
begin
if numlines < 10000000 then -- 10 million
return JT.int2str (numlines);
end if;
declare
kilo : constant Natural := numlines / 1000;
kilotxt : constant String := JT.int2str (kilo);
begin
if numlines < 100000000 then -- 100 million
return kilotxt (1 .. 2) & "." & kilotxt (3 .. 5) & 'M';
elsif numlines < 1000000000 then -- 1 billion
return kilotxt (1 .. 3) & "." & kilotxt (3 .. 4) & 'M';
else
return kilotxt (1 .. 4) & "." & kilotxt (3 .. 3) & 'M';
end if;
end;
end format_loglines;
---------------------
-- elapsed_build --
---------------------
function elapsed_build (id : builders) return String is
begin
return elapsed_HH_MM_SS (start => trackers (id).head_time,
stop => trackers (id).tail_time);
end elapsed_build;
-----------------------------
-- get_packages_per_hour --
-----------------------------
function get_packages_per_hour (packages_done : Natural;
from_when : CAL.Time)
return Natural
is
diff_days : ACA.Day_Count;
diff_secs : Duration;
leap_secs : ACA.Leap_Seconds_Count;
result : Natural;
rightnow : CAL.Time := CAL.Clock;
work_seconds : Integer;
work_days : Integer;
use type ACA.Day_Count;
begin
if packages_done = 0 then
return 0;
end if;
ACA.Difference (Left => rightnow,
Right => from_when,
Days => diff_days,
Seconds => diff_secs,
Leap_Seconds => leap_secs);
work_seconds := Integer (diff_secs);
work_days := Integer (diff_days);
work_seconds := work_seconds + (work_days * 3600 * 24);
if work_seconds < 0 then
-- should be impossible to get here.
return 0;
end if;
result := packages_done * 3600;
result := result / work_seconds;
return result;
exception
when others => return 0;
end get_packages_per_hour;
------------------------
-- mark_file_system --
------------------------
procedure mark_file_system (id : builders; action : String)
is
function attributes (action : String) return String;
function attributes (action : String) return String
is
core : constant String := "uid,gid,mode,md5digest";
begin
if action = "preconfig" then
return core & ",time";
else
return core;
end if;
end attributes;
path_mm : String := JT.USS (PM.configuration.dir_buildbase) & "/Base";
path_sm : String := JT.USS (PM.configuration.dir_buildbase) & "/SL" &
JT.zeropad (Natural (id), 2);
mtfile : constant String := path_mm & "/mtree." & action & ".exclude";
command : constant String := "/usr/sbin/mtree -X " & mtfile &
" -cn -k " & attributes (action) & " -p " & path_sm;
filename : constant String := path_sm & "/tmp/mtree." & action;
result : JT.Text;
resfile : TIO.File_Type;
begin
result := generic_system_command (command);
-- Try to defend malicious symlink: https://en.wikipedia.org/wiki/Symlink_race
if AD.Exists (filename) then
AD.Delete_File (filename);
end if;
TIO.Create (File => resfile, Mode => TIO.Out_File, Name => filename);
TIO.Put (resfile, JT.USS (result));
TIO.Close (resfile);
exception
when others =>
if TIO.Is_Open (resfile) then
TIO.Close (resfile);
end if;
end mark_file_system;
--------------------------------
-- detect_leftovers_and_MIA --
--------------------------------
function detect_leftovers_and_MIA (id : builders; action : String;
description : String) return Boolean
is
package crate is new AC.Vectors (Index_Type => Positive,
Element_Type => JT.Text,
"=" => JT.SU."=");
package sorter is new crate.Generic_Sorting ("<" => JT.SU."<");
function ignore_modifications return Boolean;
procedure print (cursor : crate.Cursor);
procedure close_active_modifications;
path_mm : String := JT.USS (PM.configuration.dir_buildbase) & "/Base";
path_sm : String := JT.USS (PM.configuration.dir_buildbase) & "/SL" &
JT.zeropad (Natural (id), 2);
mtfile : constant String := path_mm & "/mtree." & action & ".exclude";
filename : constant String := path_sm & "/tmp/mtree." & action;
command : constant String := "/usr/sbin/mtree -X " & mtfile & " -f " &
filename & " -p " & path_sm;
status : Integer;
comres : JT.Text;
topline : JT.Text;
crlen1 : Natural;
crlen2 : Natural;
toplen : Natural;
skiprest : Boolean;
passed : Boolean := True;
activemod : Boolean := False;
modport : JT.Text := JT.blank;
reasons : JT.Text := JT.blank;
leftover : crate.Vector;
missing : crate.Vector;
changed : crate.Vector;
function ignore_modifications return Boolean
is
-- Some modifications need to be ignored
-- A) */ls-R
-- #ls-R files from texmf are often regenerated
-- B) share/xml/catalog.ports
-- # xmlcatmgr is constantly updating catalog.ports, ignore
-- C) share/octave/octave_packages
-- # Octave packages database, blank lines can be inserted
-- # between pre-install and post-deinstall
-- D) info/dir | */info/dir
-- E) lib/gio/modules/giomodule.cache
-- # gio modules cache could be modified for any gio modules
-- F) etc/gconf/gconf.xml.defaults/%gconf-tree*.xml
-- # gconftool-2 --makefile-uninstall-rule is unpredictable
-- G) %%PEARDIR%%/.depdb | %%PEARDIR%%/.filemap
-- # The is pear database cache
-- H) "." with timestamp modification
-- # this happens when ./tmp or ./var is used, which is legal
filename : constant String := JT.USS (modport);
fnlen : constant Natural := filename'Length;
begin
if filename = "usr/local/share/xml/catalog.ports" or else
filename = "usr/local/share/octave/octave_packages" or else
filename = "usr/local/info/dir" or else
filename = "usr/local/lib/gio/modules/giomodule.cache" or else
filename = "usr/local/share/pear/.depdb" or else
filename = "usr/local/share/pear/.filemap"
then
return True;
end if;
if filename = "." and then JT.equivalent (reasons, "modification") then
return True;
end if;
if fnlen > 17 and then filename (1 .. 10) = "usr/local/"
then
if filename (fnlen - 4 .. fnlen) = "/ls-R" or else
filename (fnlen - 8 .. fnlen) = "/info/dir"
then
return True;
end if;
end if;
if fnlen > 56 and then filename (1 .. 39) =
"usr/local/etc/gconf/gconf.xml.defaults/" and then
filename (fnlen - 3 .. fnlen) = ".xml"
then
if JT.contains (filename, "/%gconf-tree") then
return True;
end if;
end if;
return False;
end ignore_modifications;
procedure close_active_modifications is
begin
if activemod and then not ignore_modifications then
JT.SU.Append (modport, " [ ");
JT.SU.Append (modport, reasons);
JT.SU.Append (modport, " ]");
if not changed.Contains (modport) then
changed.Append (modport);
end if;
end if;
activemod := False;
reasons := JT.blank;
modport := JT.blank;
end close_active_modifications;
procedure print (cursor : crate.Cursor)
is
dossier : constant String := JT.USS (crate.Element (cursor));
begin
TIO.Put_Line (trackers (id).log_handle, LAT.HT & dossier);
end print;
begin
-- we can't use generic_system_command because exit code /= 0 normally
comres := Unix.piped_command (command, status);
crlen1 := JT.SU.Length (comres);
loop
skiprest := False;
JT.nextline (lineblock => comres, firstline => topline);
crlen2 := JT.SU.Length (comres);
exit when crlen1 = crlen2;
crlen1 := crlen2;
toplen := JT.SU.Length (topline);
if not skiprest and then JT.SU.Length (topline) > 6 then
declare
sx : constant Natural := toplen - 5;
caboose : constant String := JT.SU.Slice (topline, sx, toplen);
filename : JT.Text := JT.SUS (JT.SU.Slice (topline, 1, sx - 1));
begin
if caboose = " extra" then
close_active_modifications;
if not leftover.Contains (filename) then
leftover.Append (filename);
end if;
skiprest := True;
end if;
end;
end if;
if not skiprest and then JT.SU.Length (topline) > 7 then
declare
canopy : constant String := JT.SU.Slice (topline, 1, 7);
filename : JT.Text := JT.SUS (JT.SU.Slice (topline, 8, toplen));
begin
if canopy = "extra: " then
close_active_modifications;
if not leftover.Contains (filename) then
leftover.Append (filename);
end if;
skiprest := True;
end if;
end;
end if;
if not skiprest and then JT.SU.Length (topline) > 10 then
declare
sx : constant Natural := toplen - 7;
caboose : constant String := JT.SU.Slice (topline, sx, toplen);
filename : JT.Text := JT.SUS (JT.SU.Slice (topline, 3, sx - 1));
begin
if caboose = " missing" then
close_active_modifications;
if not missing.Contains (filename) then
missing.Append (filename);
end if;
skiprest := True;
end if;
end;
end if;
if not skiprest then
declare
line : constant String := JT.USS (topline);
blank8 : constant String := " ";
sx : constant Natural := toplen - 7;
begin
if toplen > 5 and then line (1) = LAT.HT then
-- reason, but only valid if modification is active
if activemod then
if JT.IsBlank (reasons) then
reasons := JT.SUS (JT.part_1 (line (2 .. toplen), " "));
else
JT.SU.Append (reasons, " | ");
JT.SU.Append (reasons, JT.part_1
(line (2 .. toplen), " "));
end if;
end if;
skiprest := True;
end if;
if not skiprest and then line (toplen) = LAT.Colon then
close_active_modifications;
activemod := True;
modport := JT.SUS (line (1 .. toplen - 1));
skiprest := True;
end if;
if not skiprest and then
JT.SU.Slice (topline, sx, toplen) = " changed"
then
close_active_modifications;
activemod := True;
modport := JT.SUS (line (1 .. toplen - 8));
skiprest := True;
end if;
end;
end if;
end loop;
close_active_modifications;
sorter.Sort (Container => changed);
sorter.Sort (Container => missing);
sorter.Sort (Container => leftover);
TIO.Put_Line (trackers (id).log_handle, LAT.LF & "=> Checking for " &
"system changes " & description);
if not leftover.Is_Empty then
passed := False;
TIO.Put_Line (trackers (id).log_handle, LAT.LF &
" Left over files/directories:");
leftover.Iterate (Process => print'Access);
end if;
if not missing.Is_Empty then
passed := False;
TIO.Put_Line (trackers (id).log_handle, LAT.LF &
" Missing files/directories:");
missing.Iterate (Process => print'Access);
end if;
if not changed.Is_Empty then
passed := False;
TIO.Put_Line (trackers (id).log_handle, LAT.LF &
" Modified files/directories:");
changed.Iterate (Process => print'Access);
end if;
if passed then
TIO.Put_Line (trackers (id).log_handle, "Everything is fine.");
end if;
return passed;
end detect_leftovers_and_MIA;
-----------------------------
-- interact_with_builder --
-----------------------------
procedure interact_with_builder (id : builders)
is
root : constant String := get_root (id);
command : constant String := chroot & root &
environment_override (enable_tty => True) &
REP.Platform.interactive_shell;
result : Boolean;
begin
TIO.Put_Line ("Entering interactive test mode at the builder root " &
"directory.");
TIO.Put_Line ("Type 'exit' when done exploring.");
result := Unix.external_command (command);
end interact_with_builder;
---------------------------------
-- obtain_custom_environment --
---------------------------------
procedure obtain_custom_environment
is
target_name : constant String := PM.synth_confdir & "/" &
JT.USS (PM.configuration.profile) & "-environment";
fragment : TIO.File_Type;
begin
customenv := JT.blank;
if AD.Exists (target_name) then
TIO.Open (File => fragment, Mode => TIO.In_File, Name => target_name);
while not TIO.End_Of_File (fragment) loop
declare
Line : String := TIO.Get_Line (fragment);
begin
if JT.contains (Line, "=") then
JT.SU.Append (customenv, JT.trim (Line) & " ");
end if;
end;
end loop;
TIO.Close (fragment);
end if;
exception
when others =>
if TIO.Is_Open (fragment) then
TIO.Close (fragment);
end if;
end obtain_custom_environment;
--------------------------------
-- set_localbase_protection --
--------------------------------
procedure set_localbase_protection (id : builders; lock : Boolean)
is
procedure remount (readonly : Boolean);
procedure dismount;
smount : constant String := get_root (id);
slave_local : constant String := smount & "_localbase";
procedure remount (readonly : Boolean)
is
cmd_freebsd : String := "/sbin/mount_nullfs ";
cmd_dragonfly : String := "/sbin/mount_null ";
points : String := slave_local & " " & smount & REP.root_localbase;
options : String := "-o ro ";
cmd : JT.Text;
cmd_output : JT.Text;
begin
if JT.equivalent (PM.configuration.operating_sys, "FreeBSD") then
cmd := JT.SUS (cmd_freebsd);
else
cmd := JT.SUS (cmd_dragonfly);
end if;
if readonly then
JT.SU.Append (cmd, options);
end if;
JT.SU.Append (cmd, points);
if not Unix.piped_mute_command (JT.USS (cmd), cmd_output) then
if uselog then
TIO.Put_Line (trackers (id).log_handle,
"command failed: " & JT.USS (cmd));
if not JT.IsBlank (cmd_output) then
TIO.Put_Line (trackers (id).log_handle, JT.USS (cmd_output));
end if;
end if;
end if;
end remount;
procedure dismount
is
cmd_unmount : constant String := "/sbin/umount " & smount & REP.root_localbase;
cmd_output : JT.Text;
begin
if not Unix.piped_mute_command (cmd_unmount, cmd_output) then
if uselog then
TIO.Put_Line (trackers (id).log_handle,
"command failed: " & cmd_unmount);
if not JT.IsBlank (cmd_output) then
TIO.Put_Line (trackers (id).log_handle, JT.USS (cmd_output));
end if;
end if;
end if;
end dismount;
begin
if lock then
dismount;
remount (readonly => True);
else
dismount;
remount (readonly => False);
end if;
end set_localbase_protection;
------------------------------
-- timeout_multiplier_x10 --
------------------------------
function timeout_multiplier_x10 return Positive
is
begin
declare
average5 : constant Float := REP.Platform.get_5_minute_load;
avefloat : constant Float := average5 / Float (number_cores);
begin
if avefloat <= 1.0 then
return 10;
else
return Integer (avefloat * 10.0);
end if;
end;
exception
when others => return 10;
end timeout_multiplier_x10;
---------------------------
-- valid_test_phase #2 --
---------------------------
function valid_test_phase (afterphase : String) return Boolean is
begin
if afterphase = "extract" or else
afterphase = "patch" or else
afterphase = "configure" or else
afterphase = "build" or else
afterphase = "stage" or else
afterphase = "install" or else
afterphase = "deinstall"
then
return True;
else
return False;
end if;
end valid_test_phase;
---------------------------
-- builder_status_core --
---------------------------
function builder_status_core (id : builders;
shutdown : Boolean := False;
idle : Boolean := False;
phasestr : String)
return Display.builder_rec
is
result : Display.builder_rec;
phaselen : constant Positive := phasestr'Length;
begin
-- 123456789 123456789 123456789 123456789 1234
-- SL elapsed phase lines origin
-- 01 00:00:00 extract-depends 9999999 www/joe
result.id := id;
result.slavid := JT.zeropad (Natural (id), 2);
result.LLines := (others => ' ');
result.phase := (others => ' ');
result.origin := (others => ' ');
result.shutdown := False;
result.idle := False;
if shutdown then
-- Overrides "idle" if both Shutdown and Idle are True
result.Elapsed := "Shutdown";
result.shutdown := True;
return result;
end if;
if idle then
result.Elapsed := "Idle ";
result.idle := True;
return result;
end if;
declare
catport : constant String :=
get_catport (all_ports (trackers (id).seq_id));
numlines : constant String := format_loglines (trackers (id).loglines);
linehead : constant Natural := 8 - numlines'Length;
begin
result.Elapsed := elapsed_HH_MM_SS (start => trackers (id).head_time,
stop => CAL.Clock);
result.LLines (linehead .. 7) := numlines;
if phaselen <= result.phase'Length then
result.phase (1 .. phasestr'Length) := phasestr;
else
-- special handling for long descriptions
if phasestr = "bootstrap-depends" then
result.phase (1 .. 14) := "bootstrap-deps";
else
result.phase := phasestr
(phasestr'First .. phasestr'First + result.phase'Length - 1);
end if;
end if;
if catport'Length > 37 then
result.origin (1 .. 36) := catport (1 .. 36);
result.origin (37) := LAT.Asterisk;
else
result.origin (1 .. catport'Length) := catport;
end if;
end;
return result;
end builder_status_core;
------------------------
-- port_specification --
------------------------
function port_specification (catport : String) return String is
begin
if JT.contains (catport, "@") then
return dir_ports & "/" & JT.part_1 (catport, "@") &
" FLAVOR=" & JT.part_2 (catport, "@");
else
return dir_ports & "/" & catport;
end if;
end port_specification;
end PortScan.Buildcycle;
|
zhmu/ananas | Ada | 380 | adb | -- { dg-do compile }
-- { dg-options "-O2 -fdump-tree-optimized" }
function Volatile7 return Integer is
type Vol is new Integer;
pragma Volatile (Vol);
type R is record
X : Vol := 0;
end record;
V : R;
begin
for J in 1 .. 10 loop
V.X := V.X + 1;
end loop;
return Integer (V.X);
end;
-- { dg-final { scan-tree-dump "goto" "optimized" } }
|
jam3st/edk2 | Ada | 15,545 | ads | --
-- Copyright (C) 2015-2018 secunet Security Networks AG
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
private package HW.GFX.GMA.Config
with
Initializes => (Valid_Port_GPU, Raw_Clock)
is
CPU : constant CPU_Type := Haswell;
CPU_Var : constant CPU_Variant := Normal;
Internal_Display : constant Internal_Type := DP;
Analog_I2C_Port : constant PCH_Port := PCH_DAC;
EDP_Low_Voltage_Swing : constant Boolean := False;
DDI_HDMI_Buffer_Translation : constant Integer := -1;
Default_MMIO_Base : constant := 0 ;
LVDS_Dual_Threshold : constant := 95_000_000;
----------------------------------------------------------------------------
Default_MMIO_Base_Set : constant Boolean := Default_MMIO_Base /= 0;
Has_Internal_Display : constant Boolean := Internal_Display /= None;
Internal_Is_EDP : constant Boolean := Internal_Display = DP;
Have_DVI_I : constant Boolean := Analog_I2C_Port /= PCH_DAC;
Has_Presence_Straps : constant Boolean := CPU /= Broxton;
----- CPU pipe: --------
Disable_Trickle_Feed : constant Boolean := not
(CPU in Haswell .. Broadwell);
Pipe_Enabled_Workaround : constant Boolean := CPU = Broadwell;
Has_EDP_Transcoder : constant Boolean := CPU >= Haswell;
Use_PDW_For_EDP_Scaling : constant Boolean := CPU = Haswell;
Has_Pipe_DDI_Func : constant Boolean := CPU >= Haswell;
Has_Trans_Clk_Sel : constant Boolean := CPU >= Haswell;
Has_Pipe_MSA_Misc : constant Boolean := CPU >= Haswell;
Has_Pipeconf_Misc : constant Boolean := CPU >= Broadwell;
Has_Pipeconf_BPC : constant Boolean := CPU /= Haswell;
Has_Plane_Control : constant Boolean := CPU >= Broxton;
Has_DSP_Linoff : constant Boolean := CPU <= Ivybridge;
Has_PF_Pipe_Select : constant Boolean := CPU in Ivybridge .. Haswell;
Has_Cursor_FBC_Control : constant Boolean := CPU >= Ivybridge;
VGA_Plane_Workaround : constant Boolean := CPU = Ivybridge;
Has_GMCH_DP_Transcoder : constant Boolean := CPU = G45;
Has_GMCH_VGACNTRL : constant Boolean := CPU = G45;
Has_GMCH_PFIT_CONTROL : constant Boolean := CPU = G45;
----- Panel power: -----
Has_PP_Write_Protection : constant Boolean := CPU <= Ivybridge;
Has_PP_Port_Select : constant Boolean := CPU <= Ivybridge;
Use_PP_VDD_Override : constant Boolean := CPU <= Ivybridge;
Has_PCH_Panel_Power : constant Boolean := CPU >= Ironlake;
----- PCH/FDI: ---------
Has_PCH : constant Boolean := CPU /= Broxton and CPU /= G45;
Has_PCH_DAC : constant Boolean := CPU in Ironlake .. Ivybridge or
(CPU in Broadwell .. Haswell
and CPU_Var = Normal);
Has_PCH_Aux_Channels : constant Boolean := CPU in Ironlake .. Broadwell;
VGA_Has_Sync_Disable : constant Boolean := CPU <= Ivybridge;
Has_Trans_Timing_Ovrrde : constant Boolean := CPU >= Sandybridge;
Has_DPLL_SEL : constant Boolean := CPU in Ironlake .. Ivybridge;
Has_FDI_BPC : constant Boolean := CPU in Ironlake .. Ivybridge;
Has_FDI_Composite_Sel : constant Boolean := CPU = Ivybridge;
Has_Trans_DP_Ctl : constant Boolean := CPU in
Sandybridge .. Ivybridge;
Has_FDI_C : constant Boolean := CPU = Ivybridge;
Has_FDI_RX_Power_Down : constant Boolean := CPU in Haswell .. Broadwell;
Has_GMCH_RawClk : constant Boolean := CPU = G45;
----- DDI: -------------
End_EDP_Training_Late : constant Boolean := CPU in Haswell .. Broadwell;
Has_Per_DDI_Clock_Sel : constant Boolean := CPU in Haswell .. Broadwell;
Has_HOTPLUG_CTL : constant Boolean := CPU in Haswell .. Broadwell;
Has_SHOTPLUG_CTL_A : constant Boolean := (CPU in Haswell .. Broadwell
and CPU_Var = ULT) or
CPU >= Skylake;
Has_DDI_PHYs : constant Boolean := CPU = Broxton;
Has_DDI_D : constant Boolean := CPU >= Haswell and
CPU_Var = Normal and
not Has_DDI_PHYs;
Has_DDI_E : constant Boolean := -- might be disabled by x4 eDP
Has_DDI_D;
Has_DDI_Buffer_Trans : constant Boolean := CPU >= Haswell and
CPU /= Broxton;
Has_Low_Voltage_Swing : constant Boolean := CPU >= Broxton;
Has_Iboost_Config : constant Boolean := CPU >= Skylake;
Need_DP_Aux_Mutex : constant Boolean := False; -- Skylake & (PSR | GTC)
----- GMBUS: -----------
Ungate_GMBUS_Unit_Level : constant Boolean := CPU >= Skylake;
GMBUS_Alternative_Pins : constant Boolean := CPU = Broxton;
Has_PCH_GMBUS : constant Boolean := CPU >= Ironlake;
----- Power: -----------
Has_IPS : constant Boolean := (CPU = Haswell and
CPU_Var = ULT) or
CPU = Broadwell;
Has_IPS_CTL_Mailbox : constant Boolean := CPU = Broadwell;
Has_Per_Pipe_SRD : constant Boolean := CPU >= Broadwell;
----- GTT: -------------
Fold_39Bit_GTT_PTE : constant Boolean := CPU <= Haswell;
----------------------------------------------------------------------------
Max_Pipe : constant Pipe_Index :=
(if CPU <= Sandybridge
then Secondary
else Tertiary);
type Supported_Pipe_Array is array (Pipe_Index) of Boolean;
Supported_Pipe : constant Supported_Pipe_Array :=
(Primary => Primary <= Max_Pipe,
Secondary => Secondary <= Max_Pipe,
Tertiary => Tertiary <= Max_Pipe);
type Valid_Per_Port is array (Port_Type) of Boolean;
type Valid_Per_GPU is array (CPU_Type) of Valid_Per_Port;
Valid_Port_GPU : Valid_Per_GPU :=
(G45 =>
(Disabled => False,
Internal => Config.Internal_Display = LVDS,
HDMI3 => False,
others => True),
Ironlake =>
(Disabled => False,
Internal => Config.Internal_Display = LVDS,
others => True),
Sandybridge =>
(Disabled => False,
Internal => Config.Internal_Display = LVDS,
others => True),
Ivybridge =>
(Disabled => False,
Internal => Config.Internal_Display /= None,
others => True),
Haswell =>
(Disabled => False,
Internal => Config.Internal_Display = DP,
HDMI3 => CPU_Var = Normal,
DP3 => CPU_Var = Normal,
Analog => CPU_Var = Normal,
others => True),
Broadwell =>
(Disabled => False,
Internal => Config.Internal_Display = DP,
HDMI3 => CPU_Var = Normal,
DP3 => CPU_Var = Normal,
Analog => CPU_Var = Normal,
others => True),
Broxton =>
(Internal => Config.Internal_Display = DP,
DP1 => True,
DP2 => True,
HDMI1 => True,
HDMI2 => True,
others => False),
Skylake =>
(Disabled => False,
Internal => Config.Internal_Display = DP,
Analog => False,
others => True))
with
Part_Of => GMA.Config_State;
Valid_Port : Valid_Per_Port renames Valid_Port_GPU (CPU);
Last_Digital_Port : constant Digital_Port :=
(if Has_DDI_E then DIGI_E else DIGI_C);
----------------------------------------------------------------------------
type FDI_Per_Port is array (Port_Type) of Boolean;
Is_FDI_Port : constant FDI_Per_Port :=
(case CPU is
when Ironlake .. Ivybridge => FDI_Per_Port'
(Internal => Internal_Display = LVDS,
others => True),
when Haswell .. Broadwell => FDI_Per_Port'
(Analog => Has_PCH_DAC,
others => False),
when others => FDI_Per_Port'
(others => False));
type FDI_Lanes_Per_Port is array (GPU_Port) of DP_Lane_Count;
FDI_Lane_Count : constant FDI_Lanes_Per_Port :=
(DIGI_D => DP_Lane_Count_2,
others =>
(if CPU in Ironlake .. Ivybridge then
DP_Lane_Count_4
else
DP_Lane_Count_2));
FDI_Training : constant FDI_Training_Type :=
(case CPU is
when Ironlake => Simple_Training,
when Sandybridge => Full_Training,
when others => Auto_Training);
----------------------------------------------------------------------------
Default_DDI_HDMI_Buffer_Translation : constant DDI_HDMI_Buf_Trans_Range :=
(case CPU is
when Haswell => 6,
when Broadwell => 7,
when Broxton => 8,
when Skylake => 8,
when others => 0);
----------------------------------------------------------------------------
Default_CDClk_Freq : constant Frequency_Type :=
(case CPU is
when G45 => 320_000_000, -- unused
when Ironlake |
Haswell |
Broadwell => 450_000_000,
when Sandybridge |
Ivybridge => 400_000_000,
when Broxton => 288_000_000,
when Skylake => 337_500_000);
Default_RawClk_Freq : constant Frequency_Type :=
(case CPU is
when G45 => 100_000_000, -- unused, depends on FSB
when Ironlake |
Sandybridge |
Ivybridge => 125_000_000,
when Haswell |
Broadwell => (if CPU_Var = Normal then
125_000_000
else
24_000_000),
when Broxton => Frequency_Type'First, -- none needed
when Skylake => 24_000_000);
Raw_Clock : Frequency_Type := Default_RawClk_Freq
with Part_Of => GMA.Config_State;
----------------------------------------------------------------------------
-- Maximum source width with enabled scaler. This only accounts
-- for simple 1:1 pipe:scaler mappings.
type Width_Per_Pipe is array (Pipe_Index) of Pos16;
Maximum_Scalable_Width : constant Width_Per_Pipe :=
(case CPU is
when G45 => -- TODO: Is this true?
(Primary => 4096,
Secondary => 2048,
Tertiary => Pos16'First),
when Ironlake..Haswell =>
(Primary => 4096,
Secondary => 2048,
Tertiary => 2048),
when Broadwell..Skylake =>
(Primary => 4096,
Secondary => 4096,
Tertiary => 4096));
-- Maximum X position of hardware cursors
Maximum_Cursor_X : constant := (case CPU is
when G45 .. Ivybridge => 4095,
when Haswell .. Skylake => 8191);
Maximum_Cursor_Y : constant := 4095;
----------------------------------------------------------------------------
-- FIXME: Unknown for Broxton, Linux' i915 contains a fixme too :-D
HDMI_Max_Clock_24bpp : constant Frequency_Type :=
(if CPU >= Haswell then 300_000_000 else 225_000_000);
----------------------------------------------------------------------------
GTT_Offset : constant := (case CPU is
when G45 .. Haswell => 16#0020_0000#,
when Broadwell .. Skylake => 16#0080_0000#);
GTT_Size : constant := (case CPU is
when G45 .. Haswell => 16#0020_0000#,
-- Limit Broadwell to 4MiB to have a stable
-- interface (i.e. same number of entries):
when Broadwell .. Skylake => 16#0040_0000#);
GTT_PTE_Size : constant := (case CPU is
when G45 .. Haswell => 4,
when Broadwell .. Skylake => 8);
Fence_Base : constant := (case CPU is
when G45 .. Ironlake => 16#0000_3000#,
when Sandybridge .. Skylake => 16#0010_0000#);
Fence_Count : constant := (case CPU is
when G45 .. Sandybridge => 16,
when Ivybridge .. Skylake => 32);
----------------------------------------------------------------------------
use type HW.Word16;
function Is_Broadwell_H (Device_Id : Word16) return Boolean is
(Device_Id = 16#1612# or Device_Id = 16#1622# or Device_Id = 16#162a#);
function Is_Skylake_U (Device_Id : Word16) return Boolean is
(Device_Id = 16#1906# or Device_Id = 16#1916# or Device_Id = 16#1923# or
Device_Id = 16#1926# or Device_Id = 16#1927#);
-- Rather catch too much here than too little,
-- it's only used to distinguish generations.
function Is_GPU (Device_Id : Word16; CPU : CPU_Type; CPU_Var : CPU_Variant)
return Boolean is
(case CPU is
when G45 => (Device_Id and 16#ff02#) = 16#2e02# or
(Device_Id and 16#fffe#) = 16#2a42#,
when Ironlake => (Device_Id and 16#fff3#) = 16#0042#,
when Sandybridge => (Device_Id and 16#ffc2#) = 16#0102#,
when Ivybridge => (Device_Id and 16#ffc3#) = 16#0142#,
when Haswell =>
(case CPU_Var is
when Normal => (Device_Id and 16#ffc3#) = 16#0402# or
(Device_Id and 16#ffc3#) = 16#0d02#,
when ULT => (Device_Id and 16#ffc3#) = 16#0a02#),
when Broadwell => ((Device_Id and 16#ffc3#) = 16#1602# or
(Device_Id and 16#ffcf#) = 16#160b# or
(Device_Id and 16#ffcf#) = 16#160d#) and
(case CPU_Var is
when Normal => Is_Broadwell_H (Device_Id),
when ULT => not Is_Broadwell_H (Device_Id)),
when Broxton => (Device_Id and 16#fffe#) = 16#5a84#,
when Skylake => ((Device_Id and 16#ffc3#) = 16#1902# or
(Device_Id and 16#ffcf#) = 16#190b# or
(Device_Id and 16#ffcf#) = 16#190d# or
(Device_Id and 16#fff9#) = 16#1921#) and
(case CPU_Var is
when Normal => not Is_Skylake_U (Device_Id),
when ULT => Is_Skylake_U (Device_Id)));
function Compatible_GPU (Device_Id : Word16) return Boolean is
(Is_GPU (Device_Id, CPU, CPU_Var));
end HW.GFX.GMA.Config;
|
ekoeppen/STM32_Generic_Ada_Drivers | Ada | 3,527 | ads | pragma Style_Checks (Off);
-- This spec has been automatically generated from STM32L0x1.svd
pragma Restrictions (No_Elaboration_Code);
with System;
package STM32_SVD.WWDG is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CR_T_Field is STM32_SVD.UInt7;
subtype CR_WDGA_Field is STM32_SVD.Bit;
-- Control register
type CR_Register is record
-- 7-bit counter (MSB to LSB)
T : CR_T_Field := 16#7F#;
-- Activation bit
WDGA : CR_WDGA_Field := 16#0#;
-- unspecified
Reserved_8_31 : STM32_SVD.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
T at 0 range 0 .. 6;
WDGA at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype CFR_W_Field is STM32_SVD.UInt7;
-- CFR_WDGTB array element
subtype CFR_WDGTB_Element is STM32_SVD.Bit;
-- CFR_WDGTB array
type CFR_WDGTB_Field_Array is array (0 .. 1) of CFR_WDGTB_Element
with Component_Size => 1, Size => 2;
-- Type definition for CFR_WDGTB
type CFR_WDGTB_Field
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- WDGTB as a value
Val : STM32_SVD.UInt2;
when True =>
-- WDGTB as an array
Arr : CFR_WDGTB_Field_Array;
end case;
end record
with Unchecked_Union, Size => 2;
for CFR_WDGTB_Field use record
Val at 0 range 0 .. 1;
Arr at 0 range 0 .. 1;
end record;
subtype CFR_EWI_Field is STM32_SVD.Bit;
-- Configuration register
type CFR_Register is record
-- 7-bit window value
W : CFR_W_Field := 16#7F#;
-- WDGTB0
WDGTB : CFR_WDGTB_Field := (As_Array => False, Val => 16#0#);
-- Early wakeup interrupt
EWI : CFR_EWI_Field := 16#0#;
-- unspecified
Reserved_10_31 : STM32_SVD.UInt22 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CFR_Register use record
W at 0 range 0 .. 6;
WDGTB at 0 range 7 .. 8;
EWI at 0 range 9 .. 9;
Reserved_10_31 at 0 range 10 .. 31;
end record;
subtype SR_EWIF_Field is STM32_SVD.Bit;
-- Status register
type SR_Register is record
-- Early wakeup interrupt flag
EWIF : SR_EWIF_Field := 16#0#;
-- unspecified
Reserved_1_31 : STM32_SVD.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
EWIF at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- System window watchdog
type WWDG_Peripheral is record
-- Control register
CR : aliased CR_Register;
-- Configuration register
CFR : aliased CFR_Register;
-- Status register
SR : aliased SR_Register;
end record
with Volatile;
for WWDG_Peripheral use record
CR at 16#0# range 0 .. 31;
CFR at 16#4# range 0 .. 31;
SR at 16#8# range 0 .. 31;
end record;
-- System window watchdog
WWDG_Periph : aliased WWDG_Peripheral
with Import, Address => WWDG_Base;
end STM32_SVD.WWDG;
|
AaronC98/PlaneSystem | Ada | 31,203 | adb | ------------------------------------------------------------------------------
-- Templates Parser --
-- --
-- Copyright (C) 1999-2019, 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 Ada.Text_IO;
separate (Templates_Parser)
package body Data is
-----------
-- Build --
-----------
function Build (Str : String) return Tag_Var is
function Get_Var_Name (Tag : String) return String;
-- Given a Tag name, it returns the variable name only. It removes
-- the tag separator and the filters.
function Get_Filter_Set (Tag : String) return Filter.Set_Access;
-- Given a tag name, it retruns a set of filter to apply to this
-- variable when translated.
function Get_Attribute (Tag : String) return Attribute_Data;
-- Returns attribute for the given tag
function Is_Internal (Name : String) return Internal_Tag;
-- Returns True if Name is an internal tag
function Is_Macro return Boolean with Inline;
-- Returns True if we are parsing a macro
F_Sep : constant Natural :=
Strings.Fixed.Index (Str, ":", Strings.Backward);
-- Last filter separator
A_Sep : Natural :=
Strings.Fixed.Index (Str, "'", Strings.Backward);
-- Attribute separator
MP_Start, MP_End : Natural := 0;
-- Start/End of the macro parameters, 0 if not a macro
-------------------
-- Get_Attribute --
-------------------
function Get_Attribute (Tag : String) return Attribute_Data is
Start, Stop : Natural;
begin
if A_Sep = 0 then
return No_Attribute;
else
Start := A_Sep + 1;
Stop := Tag'Last - Length (End_Tag);
end if;
declare
A_Name : constant String :=
Characters.Handling.To_Lower (Tag (Start .. Stop));
begin
if A_Name = "length" then
return (Length, 0);
elsif A_Name = "line" then
return (Line, 0);
elsif A_Name = "min_column" then
return (Min_Column, 0);
elsif A_Name = "max_column" then
return (Max_Column, 0);
elsif A_Name'Length >= 8
and then A_Name (A_Name'First .. A_Name'First + 7) = "up_level"
then
if A_Name'Length > 8 then
-- We have a parameter
declare
V : constant String :=
Strings.Fixed.Trim
(A_Name (A_Name'First + 8 .. A_Name'Last),
Strings.Both);
N : Integer;
begin
if V (V'First) = '('
and then V (V'Last) = ')'
and then Is_Number (V (V'First + 1 .. V'Last - 1))
then
N := Integer'Value (V (V'First + 1 .. V'Last - 1));
else
raise Template_Error
with "Wrong value for attribute Up_Level";
end if;
return (Up_Level, N);
end;
else
return (Up_Level, 1);
end if;
elsif A_Name = "indent" then
return (Indent, 0);
else
raise Template_Error
with "Unknown attribute name """ & A_Name & '"';
end if;
end;
end Get_Attribute;
--------------------
-- Get_Filter_Set --
--------------------
function Get_Filter_Set (Tag : String) return Filter.Set_Access is
use type Filter.Callback;
Start : Natural;
Stop : Natural := Tag'Last;
FS : Filter.Set (1 .. Strings.Fixed.Count (Tag, ":"));
-- Note that FS can be larger than needed as ':' can be used inside
-- filter parameters for example.
K : Positive := FS'First;
function Name_Parameter
(Filter : String) return Templates_Parser.Filter.Routine;
-- Given a Filter description, returns the filter handle and
-- parameter.
procedure Get_Slice (Slice : String; First, Last : out Integer);
-- Returns the First and Last slice index as parsed into the Slice
-- string. Returns First and Last set to 0 if there is not valid
-- slice definition in Slice.
function Find_Slash (Str : String) return Natural;
-- Returns the first slash index in Str, skip espaced slashes
function Find
(Str : String;
Start : Positive;
C : Character) return Natural;
-- Look backward for character C in Str starting at position Start.
-- This procedure skips quoted strings and parenthesis. Returns 0 if
-- the character if not found otherwize it returns the positon of C
-- in Str.
----------
-- Find --
----------
function Find
(Str : String;
Start : Positive;
C : Character) return Natural
is
Pos : Natural := Start;
Count : Integer := 0;
begin
while Pos > Str'First
and then (Str (Pos) /= C or else Count /= 0)
loop
if Pos > Str'First and then Str (Pos - 1) /= '\' then
-- This is not a quoted character
if Str (Pos) = ')' then
Count := Count - 1;
elsif Str (Pos) = '(' then
Count := Count + 1;
end if;
end if;
Pos := Pos - 1;
end loop;
if Pos = Str'First then
return 0;
else
return Pos;
end if;
end Find;
----------------
-- Find_Slash --
----------------
function Find_Slash (Str : String) return Natural is
Escaped : Boolean := False;
begin
for K in Str'Range loop
if Str (K) = '\' then
Escaped := not Escaped;
elsif Str (K) = '/' and then not Escaped then
return K;
else
Escaped := False;
end if;
end loop;
return 0;
end Find_Slash;
---------------
-- Get_Slice --
---------------
procedure Get_Slice (Slice : String; First, Last : out Integer) is
P1 : constant Natural := Fixed.Index (Slice, "..");
begin
First := 0;
Last := 0;
if P1 = 0 then
raise Template_Error with "slice expected """ & Slice & '"';
else
First := Integer'Value (Slice (Slice'First .. P1 - 1));
Last := Integer'Value (Slice (P1 + 2 .. Slice'Last));
end if;
end Get_Slice;
--------------------
-- Name_Parameter --
--------------------
function Name_Parameter
(Filter : String) return Templates_Parser.Filter.Routine
is
package F renames Templates_Parser.Filter;
use type F.Mode;
function Unescape (Str : String) return String;
-- Unespace characters Str, to be used with regpat replacement
-- pattern.
--------------
-- Unescape --
--------------
function Unescape (Str : String) return String is
S : String (Str'Range);
I : Natural := S'First - 1;
K : Positive := Str'First;
begin
loop
exit when K > Str'Last;
I := I + 1;
if Str (K) = '\'
and then K < Str'Last
and then not (Str (K + 1) in '0' .. '9')
then
-- An escaped character, skip the backslash
K := K + 1;
-- Handle some special escaped characters \n \r \t
case Str (K) is
when 'n' => S (I) := ASCII.LF;
when 'r' => S (I) := ASCII.CR;
when 't' => S (I) := ASCII.HT;
when others => S (I) := Str (K);
end case;
else
S (I) := Str (K);
end if;
K := K + 1;
end loop;
return S (S'First .. I);
end Unescape;
P1 : constant Natural := Fixed.Index (Filter, "(");
P2 : constant Natural := Fixed.Index (Filter, ")", Backward);
begin
if (P1 = 0 and then P2 /= 0) or else (P1 /= 0 and then P2 = 0) then
raise Template_Error
with "unbalanced parenthesis """ & Filter & '"';
elsif P2 /= 0
and then P2 < Filter'Last
and then Filter (P2 + 1) /= ':'
then
raise Template_Error with
"unexpected character after parenthesis """ & Filter & '"';
end if;
if P1 = 0 then
-- No parenthesis, so there is no parameter to parse
if F.Mode_Value (Filter) = F.User_Defined then
return
(F.Handle (Filter),
F.Parameter_Data'(Mode => F.User_Callback,
Handler => F.User_Handle (Filter),
P => Null_Unbounded_String));
else
return (F.Handle (Filter),
Templates_Parser.Filter.No_Parameter);
end if;
else
declare
use GNAT.Regpat;
Name : constant String := Filter (Filter'First .. P1 - 1);
Mode : constant F.Mode := F.Mode_Value (Name);
Parameter : constant String :=
No_Quote (Filter (P1 + 1 .. P2 - 1));
begin
case F.Parameter (Mode) is
when F.Regexp =>
return (F.Handle (Mode),
F.Parameter_Data'
(F.Regexp,
R_Str => To_Unbounded_String (Parameter),
Regexp => new Pattern_Matcher'
(Compile (Parameter))));
when F.Regpat =>
declare
K : constant Natural := Find_Slash (Parameter);
begin
if K = 0 then
-- No replacement, this is equivalent to
-- REPLACE(<regexp>/\1)
return (F.Handle (Mode),
F.Parameter_Data'
(F.Regpat,
P_Str => To_Unbounded_String
(Parameter),
Regpat => new Pattern_Matcher'
(Compile (Parameter)),
Param => To_Unbounded_String ("\1")));
else
return (F.Handle (Mode),
F.Parameter_Data'
(F.Regpat,
P_Str => To_Unbounded_String
(Parameter
(Parameter'First
.. K - 1)),
Regpat => new Pattern_Matcher'
(Compile
(Parameter
(Parameter'First
.. K - 1))),
Param =>
To_Unbounded_String
(Unescape
(Parameter
(K + 1
.. Parameter'Last)))));
end if;
end;
when F.Slice =>
declare
First, Last : Integer;
begin
Get_Slice (Parameter, First, Last);
return (F.Handle (Mode),
F.Parameter_Data'(F.Slice, First, Last));
end;
when F.Str =>
return (F.Handle (Mode),
F.Parameter_Data'
(F.Str,
S => To_Unbounded_String (Parameter)));
when F.User_Callback =>
return (F.Handle (Mode),
F.Parameter_Data'
(F.User_Callback,
F.User_Handle (Name),
P => To_Unbounded_String (Parameter)));
end case;
end;
end if;
end Name_Parameter;
begin
if FS'Length = 0 then
return null;
end if;
loop
Start := Tag'First;
Stop := Find (Str, Stop, ':');
exit when Stop = 0;
Start := Find (Str, Stop - 1, ':');
if Start = 0 then
-- Last filter found
FS (K) := Name_Parameter
(Tag (Tag'First + Length (Begin_Tag) .. Stop - 1));
else
FS (K) := Name_Parameter (Tag (Start + 1 .. Stop - 1));
end if;
-- Specific check for the NO_DYNAMIC filter which must appear
-- first.
if FS (K).Handle = Filter.No_Dynamic'Access
and then K /= FS'First
then
raise Template_Error with "NO_DYNAMIC must be the first filter";
end if;
K := K + 1;
Stop := Stop - 1;
end loop;
return new Filter.Set'(FS (FS'First .. K - 1));
end Get_Filter_Set;
------------------
-- Get_Var_Name --
------------------
function Get_Var_Name (Tag : String) return String is
Start, Stop : Natural;
begin
if A_Sep = 0 then
-- No attribute
Stop := Tag'Last - Length (End_Tag);
-- Check for macro parameters
if Tag (Stop) = ')' then
MP_End := Stop;
-- Go back to matching open parenthesis
loop
Stop := Stop - 1;
-- ??? check for string literal
exit when Tag (Stop + 1) = '(' or else Stop = Tag'First;
end loop;
MP_Start := Stop + 1;
end if;
else
Stop := A_Sep - 1;
end if;
if F_Sep = 0 then
-- No filter
Start := Tag'First + Length (Begin_Tag);
else
Start := F_Sep + 1;
end if;
return Tag (Start .. Stop);
end Get_Var_Name;
-----------------
-- Is_Internal --
-----------------
function Is_Internal (Name : String) return Internal_Tag is
begin
case Name (Name'First) is
when 'D' =>
if Name = "DAY" then
return Day;
elsif Name = "DAY_NAME" then
return Day_Name;
else
return No;
end if;
when 'H' =>
if Name = "HOUR" then
return Hour;
else
return No;
end if;
when 'M' =>
if Name = "MONTH" then
return Month;
elsif Name = "MONTH_NAME" then
return Month_Name;
elsif Name = "MINUTE" then
return Minute;
else
return No;
end if;
when 'N' =>
if Name = "NOW" then
return Now;
elsif Name = "NUMBER_LINE" then
return Number_Line;
else
return No;
end if;
when 'S' =>
if Name = "SECOND" then
return Second;
else
return No;
end if;
when 'T' =>
if Name = "TABLE_LINE" then
return Table_Line;
elsif Name = "TABLE_LEVEL" then
return Table_Level;
else
return No;
end if;
when 'U' =>
if Name = "UP_TABLE_LINE" then
return Up_Table_Line;
else
return No;
end if;
when 'Y' =>
if Name = "YEAR" then
return Year;
else
return No;
end if;
when others =>
return No;
end case;
end Is_Internal;
--------------
-- Is_Macro --
--------------
function Is_Macro return Boolean is
begin
return MP_Start /= 0 and then MP_End /= 0;
end Is_Macro;
Result : Tag_Var;
begin
if A_Sep <= F_Sep then
-- This is not an attribute in fact, but something like:
-- Filter(that's it):VAR
A_Sep := 0;
end if;
Result.Filters := Get_Filter_Set (Str);
Result.Attribute := Get_Attribute (Str);
declare
Name : constant String := Get_Var_Name (Str);
begin
Result.Name := To_Unbounded_String (Name);
Result.Internal := Is_Internal (Name);
-- If there is no attribute, check for a macro
if Result.Attribute = No_Attribute and then Is_Macro then
Result.Is_Macro := True;
declare
P : constant Templates_Parser.Parameter_Set :=
Get_Parameters (Str (MP_Start .. MP_End));
begin
Result.Parameters := To_Data_Parameters (P);
end;
-- Check if this is a known macro
Result.Def := Clone (Macro.Get (Name));
if Result.Def /= null then
Macro.Rewrite (Result.Def, Result.Parameters);
end if;
end if;
if Name (Name'First) = '$'
and then Strings.Fixed.Count
(Name, Strings.Maps.Constants.Decimal_Digit_Set) = Name'Length - 1
then
Result.N := Natural'Value (Name (Name'First + 1 .. Name'Last));
else
Result.N := -1;
end if;
end;
return Result;
end Build;
-----------
-- Clone --
-----------
function Clone (V : Tag_Var) return Tag_Var is
use type Filter.Set_Access;
R : Tag_Var := V;
begin
if R.Filters /= null then
R.Filters := new Filter.Set'(R.Filters.all);
end if;
if R.Is_Macro then
R.Parameters := new Data.Parameter_Set'(R.Parameters.all);
for K in R.Parameters'Range loop
if R.Parameters (K) /= null then
R.Parameters (K) := Data.Clone (R.Parameters (K));
end if;
end loop;
R.Def := Clone (R.Def);
end if;
return R;
end Clone;
function Clone (D : Tree) return Tree is
Root, N : Tree;
begin
if D /= null then
Root := new Node'(D.all);
N := Root;
loop
if N.Kind = Data.Var then
N.Var := Data.Clone (N.Var);
end if;
exit when N.Next = null;
N.Next := new Node'(N.Next.all);
N := N.Next;
end loop;
end if;
return Root;
end Clone;
-----------
-- Image --
-----------
function Image (T : Tag_Var) return String is
use type Filter.Set_Access;
R : Unbounded_String;
Named : Boolean := False;
begin
R := Begin_Tag;
-- Filters
if T.Filters /= null then
for K in reverse T.Filters'Range loop
Append (R, Filter.Name (T.Filters (K).Handle));
Append (R, Filter.Image (T.Filters (K).Parameters));
Append (R, ":");
end loop;
end if;
-- Tag name
Append (R, T.Name);
-- Macro parameters if any
if T.Is_Macro then
Append (R, "(");
for K in T.Parameters'Range loop
if T.Parameters (K) = null then
Named := True;
else
if Named then
Append (R, Natural'Image (K) & " => ");
end if;
case T.Parameters (K).Kind is
when Text => Append (R, T.Parameters (K).Value);
when Var => Append (R, Image (T.Parameters (K).Var));
end case;
if K /= T.Parameters'Last then
Append (R, ",");
end if;
end if;
end loop;
Append (R, ")");
end if;
-- Attributes
case T.Attribute.Attr is
when Nil => null;
when Length => Append (R, "'Length");
when Line => Append (R, "'Line");
when Min_Column => Append (R, "'Min_Column");
when Max_Column => Append (R, "'Max_Column");
when Indent => Append (R, "'Indent");
when Up_Level =>
Append (R, "'Up_Level");
if T.Attribute.Value /= 1 then
Append (R, '(' & Utils.Image (T.Attribute.Value) & ')');
end if;
end case;
Append (R, End_Tag);
return To_String (R);
end Image;
-------------------------
-- Is_Include_Variable --
-------------------------
function Is_Include_Variable (T : Tag_Var) return Boolean is
begin
return T.N /= -1;
end Is_Include_Variable;
-----------
-- Parse --
-----------
function Parse (Line : String) return Tree is
Begin_Tag : constant String := To_String (Templates_Parser.Begin_Tag);
End_Tag : constant String := To_String (Templates_Parser.End_Tag);
function Build (Line : String) return Tree;
-- Recursive function to build the tree
-----------
-- Build --
-----------
function Build (Line : String) return Tree is
Start, Stop, S : Natural;
begin
if Line = "" then
return null;
else
Start := Strings.Fixed.Index (Line, Begin_Tag);
if Start = 0 then
-- No more tag
return new Node'(Text,
Col => Line'First,
Next => null,
Value => To_Unbounded_String (Line));
else
-- Get matching ending separator, a macro can have variables
-- as parameter:
-- @_MACRO(2,@_VAR_@)_@
S := Start + Begin_Tag'Length;
Search_Matching_Tag : loop
Stop := Strings.Fixed.Index (Line, End_Tag, From => S);
S := Strings.Fixed.Index (Line, Begin_Tag, From => S);
exit Search_Matching_Tag when S = 0 or else S > Stop;
S := Stop + End_Tag'Length;
end loop Search_Matching_Tag;
if Stop = 0 then
raise Internal_Error with
"Tag variable not terminated (missing " & End_Tag & ")";
else
Stop := Stop + End_Tag'Length - 1;
if Start = Line'First then
-- The first token in Line is a variable
return new Node'
(Var,
Col => Start,
Next => Build (Line (Stop + 1 .. Line'Last)),
Var => Build (Line (Start .. Stop)));
else
-- We have some text before the tag
return new Node'
(Text,
Col => Line'First,
Next => Build (Line (Start .. Line'Last)),
Value => To_Unbounded_String
(Line (Line'First .. Start - 1)));
end if;
end if;
end if;
end if;
end Build;
begin
return Build (Line);
end Parse;
----------------
-- Print_Tree --
----------------
procedure Print_Tree (D : Tree) is
N : Tree := D;
NL : Boolean := False;
begin
while N /= null loop
case N.Kind is
when Text =>
declare
Value : constant String := To_String (N.Value);
VL : constant Natural := Value'Length;
BL : constant Natural := Utils.BOM_Utf8'Length;
begin
if VL >= BL
and then
Value
(Value'First .. Value'First + BL - 1) = Utils.BOM_Utf8
then
Text_IO.Put ("U+<FEFF>");
else
Text_IO.Put (Value);
end if;
if Value'Length > 0 then
NL := Value (Value'Last) = ASCII.LF;
else
NL := False;
end if;
end;
when Var =>
if N.Var.Is_Macro and then Expand_Macro then
Print_Tree (N.Var.Def);
else
Text_IO.Put (Image (N.Var));
NL := False;
end if;
end case;
N := N.Next;
end loop;
if not NL then
Text_IO.New_Line;
end if;
end Print_Tree;
-------------
-- Release --
-------------
procedure Release (T : in out Tag_Var) is
use type Filter.Set_Access;
procedure Unchecked_Free is
new Ada.Unchecked_Deallocation (Filter.Set, Filter.Set_Access);
begin
if T.Filters /= null then
Filter.Release (T.Filters.all);
Unchecked_Free (T.Filters);
end if;
if T.Parameters /= null then
for K in T.Parameters'Range loop
Data.Release (T.Parameters (K));
end loop;
Data.Unchecked_Free (T.Parameters);
end if;
Release (T.Def, Include => False);
end Release;
procedure Release (D : in out Tree; Single : Boolean := False) is
procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Node, Tree);
P : Tree;
T : Tree := D;
begin
while T /= null loop
P := T;
T := T.Next;
case P.Kind is
when Var => Release (P.Var);
when Text => null;
end case;
Unchecked_Free (P);
exit when Single;
end loop;
D := null;
end Release;
------------------------
-- To_Data_Parameters --
------------------------
function To_Data_Parameters
(Parameters : Templates_Parser.Parameter_Set) return Data.Parameters
is
P : constant Data.Parameters := new Parameter_Set (Parameters'Range);
begin
for K in P'Range loop
P (K) := Data.Parse (To_String (Parameters (K)));
end loop;
return P;
end To_Data_Parameters;
---------------
-- Translate --
---------------
function Translate
(T : Tag_Var;
Value : String;
Context : not null access Filter.Filter_Context) return String
is
use type Filter.Set_Access;
begin
if T.Filters /= null then
declare
R : Unbounded_String := To_Unbounded_String (Value);
begin
for K in T.Filters'Range loop
R := To_Unbounded_String
(T.Filters (K).Handle
(To_String (R), Context, T.Filters (K).Parameters));
end loop;
return To_String (R);
end;
end if;
return Value;
end Translate;
end Data;
|
Fabien-Chouteau/Ada_Drivers_Library | Ada | 3,767 | ads | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2015-2016, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
package HAL.UART is
type UART_Status is
(Ok,
Err_Error,
Err_Timeout,
Busy);
type UART_Data_Size is
(Data_Size_8b,
Data_Size_9b);
type UART_Data_8b is array (Natural range <>) of UInt8;
type UART_Data_9b is array (Natural range <>) of UInt9;
type UART_Port is limited interface;
type Any_UART_Port is access all UART_Port'Class;
function Data_Size (Port : UART_Port) return UART_Data_Size is abstract;
procedure Transmit
(This : in out UART_Port;
Data : UART_Data_8b;
Status : out UART_Status;
Timeout : Natural := 1000) is abstract
with
Pre'Class => Data_Size (This) = Data_Size_8b;
procedure Transmit
(This : in out UART_Port;
Data : UART_Data_9b;
Status : out UART_Status;
Timeout : Natural := 1000) is abstract
with
Pre'Class => Data_Size (This) = Data_Size_9b;
procedure Receive
(This : in out UART_Port;
Data : out UART_Data_8b;
Status : out UART_Status;
Timeout : Natural := 1000) is abstract
with
Pre'Class => Data_Size (This) = Data_Size_8b;
procedure Receive
(This : in out UART_Port;
Data : out UART_Data_9b;
Status : out UART_Status;
Timeout : Natural := 1000) is abstract
with
Pre'Class => Data_Size (This) = Data_Size_9b;
end HAL.UART;
|
onox/sdlada | Ada | 10,551 | 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 Interfaces.C.Strings;
with SDL.Error;
package body SDL.RWops is
use type C.int;
use type C.size_t;
use type C.Strings.chars_ptr;
procedure SDL_Free (Mem : in C.Strings.chars_ptr) with
Import => True,
Convention => C,
External_Name => "SDL_free";
function Base_Path return UTF_Strings.UTF_String is
function SDL_Get_Base_Path return C.Strings.chars_ptr with
Import => True,
Convention => C,
External_Name => "SDL_GetBasePath";
C_Path : constant C.Strings.chars_ptr := SDL_Get_Base_Path;
begin
if C_Path = C.Strings.Null_Ptr then
raise RWops_Error with SDL.Error.Get;
end if;
declare
Ada_Path : constant UTF_Strings.UTF_String := C.Strings.Value (C_Path);
begin
SDL_Free (C_Path);
return Ada_Path;
end;
end Base_Path;
function Preferences_Path (Organisation : in UTF_Strings.UTF_String;
Application : in UTF_Strings.UTF_String) return UTF_Strings.UTF_String
is
function SDL_Get_Pref_Path (Organisation : in C.Strings.chars_ptr;
Application : in C.Strings.chars_ptr) return C.Strings.chars_ptr with
Import => True,
Convention => C,
External_Name => "SDL_GetPrefPath";
C_Organisation : C.Strings.chars_ptr;
C_Application : C.Strings.chars_ptr;
C_Path : C.Strings.chars_ptr;
begin
C_Organisation := C.Strings.New_String (Organisation);
C_Application := C.Strings.New_String (Application);
C_Path := SDL_Get_Pref_Path (Organisation => C_Organisation,
Application => C_Application);
C.Strings.Free (C_Organisation);
C.Strings.Free (C_Application);
if C_Path = C.Strings.Null_Ptr then
raise RWops_Error with SDL.Error.Get;
end if;
declare
Ada_Path : constant UTF_Strings.UTF_String := C.Strings.Value (C_Path);
begin
SDL_Free (C_Path);
return Ada_Path;
end;
end Preferences_Path;
procedure Close (Ops : in RWops) is
Result : C.int := -1;
begin
Result := Ops.Close (RWops_Pointer (Ops));
if Result /= 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Close;
function From_File (File_Name : in UTF_Strings.UTF_String;
Mode : in File_Mode) return RWops
is
function SDL_RW_From_File (File : in C.Strings.chars_ptr;
Mode : in C.Strings.chars_ptr) return RWops_Pointer with
Import => True,
Convention => C,
External_Name => "SDL_RWFromFile";
Mode_String : String (1 .. 3) := " ";
RWop : RWops_Pointer;
C_File_Name : C.Strings.chars_ptr := C.Strings.Null_Ptr;
C_File_Mode : C.Strings.chars_ptr := C.Strings.Null_Ptr;
begin
case Mode is
when Read =>
Mode_String := "r ";
when Create_To_Write =>
Mode_String := "w ";
when Append =>
Mode_String := "a ";
when Read_Write =>
Mode_String := "r+ ";
when Create_To_Read_Write =>
Mode_String := "w+ ";
when Append_And_Read =>
Mode_String := "a+ ";
when Read_Binary =>
Mode_String := "rb ";
when Create_To_Write_Binary =>
Mode_String := "wb ";
when Append_Binary =>
Mode_String := "ab ";
when Read_Write_Binary =>
Mode_String := "r+b";
when Create_To_Read_Write_Binary =>
Mode_String := "w+b";
when Append_And_Read_Binary =>
Mode_String := "a+b";
end case;
C_File_Name := C.Strings.New_String (File_Name);
C_File_Mode := C.Strings.New_String (Mode_String);
RWop := SDL_RW_From_File (File => C_File_Name, Mode => C_File_Mode);
C.Strings.Free (C_File_Name);
C.Strings.Free (C_File_Mode);
if RWop = null then
raise RWops_Error with SDL.Error.Get;
end if;
return RWops (RWop);
end From_File;
procedure From_File (File_Name : in UTF_Strings.UTF_String;
Mode : in File_Mode;
Ops : out RWops) is
begin
Ops := From_File (File_Name, Mode);
end From_File;
function Seek (Context : in RWops;
Offset : in Offsets;
Whence : in Whence_Type) return Offsets
is
Returned_Offset : SDL.RWops.Offsets := SDL.RWops.Error_Offset;
begin
Returned_Offset := Context.Seek (Context => RWops_Pointer (Context),
Offset => Offset,
Whence => Whence);
if Returned_Offset = SDL.RWops.Error_Offset then
raise RWops_Error with SDL.Error.Get;
end if;
return Returned_Offset;
end Seek;
function Size (Context : in RWops) return Offsets is
Returned_Offset : SDL.RWops.Offsets := SDL.RWops.Error_Offset;
begin
Returned_Offset := Context.Size (Context => RWops_Pointer (Context));
if Returned_Offset < Null_Offset then
raise RWops_Error with SDL.Error.Get;
end if;
return Returned_Offset;
end Size;
function Tell (Context : in RWops) return Offsets is
Returned_Offset : SDL.RWops.Offsets := SDL.RWops.Error_Offset;
begin
-- In C SDL_RWtell is a macro doing just this.
Returned_Offset := Context.Seek (Context => RWops_Pointer (Context),
Offset => Null_Offset,
Whence => RW_Seek_Cur);
if Returned_Offset = SDL.RWops.Error_Offset then
raise RWops_Error with SDL.Error.Get;
end if;
return Returned_Offset;
end Tell;
procedure Write_BE_16 (Destination : in RWops; Value : in Uint16) is
function SDL_Write_BE_16 (Destination : in RWops; Value : in Uint16) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteBE16";
Result : C.size_t := 0;
begin
Result := SDL_Write_BE_16 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_BE_16;
procedure Write_BE_32 (Destination : in RWops; Value : in Uint32) is
function SDL_Write_BE_32 (Destination : in RWops; Value : in Uint32) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteBE32";
Result : C.size_t := 0;
begin
Result := SDL_Write_BE_32 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_BE_32;
procedure Write_BE_64 (Destination : in RWops; Value : in Uint64) is
function SDL_Write_BE_64 (Destination : in RWops; Value : in Uint64) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteBE64";
Result : C.size_t := 0;
begin
Result := SDL_Write_BE_64 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_BE_64;
procedure Write_LE_16 (Destination : in RWops; Value : in Uint16) is
function SDL_Write_LE_16 (Destination : in RWops; Value : in Uint16) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteLE16";
Result : C.size_t := 0;
begin
Result := SDL_Write_LE_16 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_LE_16;
procedure Write_LE_32 (Destination : in RWops; Value : in Uint32) is
function SDL_Write_LE_32 (Destination : in RWops; Value : in Uint32) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteLE32";
Result : C.size_t := 0;
begin
Result := SDL_Write_LE_32 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_LE_32;
procedure Write_LE_64 (Destination : in RWops; Value : in Uint64) is
function SDL_Write_LE_64 (Destination : in RWops; Value : in Uint64) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteLE64";
Result : C.size_t := 0;
begin
Result := SDL_Write_LE_64 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_LE_64;
procedure Write_U_8 (Destination : in RWops; Value : in Uint8) is
function SDL_Write_U_8 (Destination : in RWops; Value : in Uint8) return C.size_t with
Import => True,
Convention => C,
External_Name => "SDL_WriteU8";
Result : C.size_t := 0;
begin
Result := SDL_Write_U_8 (Destination, Value);
if Result = 0 then
raise RWops_Error with SDL.Error.Get;
end if;
end Write_U_8;
function Is_Null (Source : in RWops) return Boolean is
begin
return (if Source = null then True else False);
end Is_Null;
end SDL.RWops;
|
MinimSecure/unum-sdk | Ada | 976 | adb | -- Copyright 2013-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/>.
with IO; use IO;
with Callee; use Callee;
package body Caller is
procedure Verbose_Increment (Val : in out Float; Msg : String) is
begin
Put_Line ("DEBUG: " & Msg);
Increment (Val, "Verbose_Increment");
end Verbose_Increment;
end Caller;
|
AdaCore/gpr | Ada | 8,650 | ads | --
-- Copyright (C) 2019-2023, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-Exception
--
with GPR2.Containers;
with GPR2.Project.Attribute_Index;
with GPR2.Project.Attr_Values;
with GPR2.Project.Registry.Attribute;
with GPR2.Source_Reference.Attribute;
with GPR2.Source_Reference.Value;
package GPR2.Project.Attribute is
use all type Registry.Attribute.Value_Kind;
type Object is new Attr_Values.Object with private;
Undefined : constant Object;
-- This constant is equal to any object declared without an explicit
-- initializer.
overriding function Is_Defined (Self : Object) return Boolean;
-- Returns true if Self is defined
function Create
(Name : Source_Reference.Attribute.Object;
Index : Attribute_Index.Object;
Value : Source_Reference.Value.Object;
Default : Boolean := False;
Frozen : Boolean := False) return Object
with Post => Create'Result.Kind = Single
and then Create'Result.Name.Id = Name.Id
and then Create'Result.Count_Values = 1
and then Create'Result.Is_Default = Default
and then Create'Result.Is_Frozen = Frozen;
-- Creates a single-valued attribute.
-- Default: sets the "default" state of the attribute value
-- Frozen: sets the "frozen" state of the attribute value.
-- when an attribute is frozen, any write to its value will raise
-- an error.
function Create
(Name : Source_Reference.Attribute.Object;
Index : Attribute_Index.Object;
Values : Containers.Source_Value_List;
Default : Boolean := False) return Object
with Post => Create'Result.Kind = List
and then Create'Result.Name.Id = Name.Id
and then Create'Result.Count_Values = Values.Length
and then Create'Result.Is_Default = Default;
-- Creates a multi-valued object
overriding function Create
(Name : Source_Reference.Attribute.Object;
Value : Source_Reference.Value.Object) return Object
with Post => Create'Result.Kind = Single
and then Create'Result.Name.Id = Name.Id
and then Create'Result.Count_Values = 1;
-- Creates a single-valued object
function Create
(Name : Source_Reference.Attribute.Object;
Value : Source_Reference.Value.Object;
Default : Boolean;
Frozen : Boolean := False) return Object
with Post => Create'Result.Kind = Single
and then Create'Result.Name.Id = Name.Id
and then Create'Result.Count_Values = 1
and then Create'Result.Is_Default = Default
and then Create'Result.Is_Frozen = Frozen;
-- Creates a single-valued object with default flag
overriding function Create
(Name : Source_Reference.Attribute.Object;
Values : Containers.Source_Value_List) return Object
with Post => Create'Result.Kind = List
and then Create'Result.Name.Id = Name.Id
and then Create'Result.Count_Values = Values.Length;
-- Creates a multi-valued object
function Create
(Name : Source_Reference.Attribute.Object;
Values : Containers.Source_Value_List;
Default : Boolean) return Object
with Post => Create'Result.Kind = List
and then Create'Result.Name.Id = Name.Id
and then Create'Result.Count_Values = Values.Length
and then Create'Result.Is_Default = Default;
-- Creates a multi-valued object with Default flag
function Create
(Name : Q_Attribute_Id;
Index : Attribute_Index.Object;
Source : GPR2.Path_Name.Object;
Default : Value_Type;
As_List : Boolean) return Object
with Post => Create'Result.Is_Default
and then Create'Result.Name.Id = Name;
function Create
(Name : Q_Attribute_Id;
Index : Value_Type;
Index_Case_Sensitive : Boolean;
Source : GPR2.Path_Name.Object;
Default : Value_Type;
As_List : Boolean) return Object
with Post => Create'Result.Is_Default
and then Create'Result.Name.Id = Name;
function Has_Index (Self : Object) return Boolean
with Pre => Self.Is_Defined;
-- Returns True if the attribute has an index
procedure Set_Index
(Self : in out Object;
Index : Attribute_Index.Object);
-- Overwrites the attribute's index value
function Index (Self : Object) return Attribute_Index.Object
with Inline,
Pre => Self.Is_Defined,
Post => Self.Has_Index = Index'Result.Is_Defined;
-- Returns the attribute's index value
procedure Set_Case
(Self : in out Object;
Index_Is_Case_Sensitive : Boolean;
Value_Is_Case_Sensitive : Boolean)
with Pre => Self.Is_Defined;
-- Sets attribute case sensitivity for the index and the value.
-- By default both are case-sensitive.
function Image
(Self : Object; Name_Len : Natural := 0) return String
with Pre => Self.Is_Defined;
-- Returns a string representation. The attribute name is represented with
-- Name_Len characters (right padding with space) except if Name_Len is 0.
procedure Set_Default_Flag
(Self : in out Object;
Is_Default : Boolean)
with Pre => Self.Is_Defined,
Post => Self.Is_Default = Is_Default;
-- Sets the default flag
function Is_Default (Self : Object) return Boolean
with Pre => Self.Is_Defined;
-- Returns whether attribute did not exist in attribute set and was
-- created from default value.
procedure Freeze (Self : in out Object)
with Pre => Self.Is_Defined,
Post => Self.Is_Frozen;
-- Sets the freeze state of the attribute
function Is_Frozen (Self : Object) return Boolean
with Pre => Self.Is_Defined;
-- The freeze state of the attribute value. If an attribute is frozen, then
-- its value shall not be modified.
function Get_Alias
(Self : Object;
New_Name : Q_Attribute_Id) return Object
with Pre => Self.Is_Defined
and then Self.Name.Id.Pack = New_Name.Pack;
-- Indicates that this attribute is another name for an existing attribute
function Is_Alias (Self : Object) return Boolean
with Pre => Self.Is_Defined;
-- Indicates whether this attribute is an alias of another attribute
procedure Set_From_Config
(Self : in out Object;
From_Config : Boolean)
with Pre => Self.Is_Defined;
-- Sets the From_Config flag
function Is_From_Config (Self : Object) return Boolean;
-- Whether the attribute comes from the configuration project
overriding function Rename
(Self : Object;
Name : Source_Reference.Attribute.Object) return Object
with Pre => Self.Is_Defined;
-- Returns object with the new name Name, and the is_default flag set
private
type Value_At_Pos (Length : Natural) is record
Value : Value_Type (1 .. Length);
At_Pos : Unit_Index := No_Index;
end record;
function "<" (Left, Right : Value_At_Pos) return Boolean is
(Left.Value < Right.Value
or else (Left.Value = Right.Value and then Left.At_Pos < Right.At_Pos));
function Create
(Index : Attribute_Index.Object;
Default_At_Pos : Unit_Index := No_Index) return Value_At_Pos;
-- Create the key Value_At_Pos for the given index
type Object is new Attr_Values.Object with record
Index : Attribute_Index.Object;
Default : Boolean := False;
Frozen : Boolean := False;
Is_Alias : Boolean := False;
From_Config : Boolean := False;
end record;
function Case_Aware_Index (Self : Object) return Value_At_Pos is
(Create
(Index => Self.Index,
Default_At_Pos => At_Pos_Or (Self.Index, No_Index)));
-- Returns Index in lower case if index is case insensitive, returns as is
-- otherwise.
Undefined : constant Object := (Attr_Values.Undefined with others => <>);
overriding function Is_Defined (Self : Object) return Boolean is
(Self /= Undefined);
function Is_Default (Self : Object) return Boolean is (Self.Default);
function Is_Frozen (Self : Object) return Boolean is (Self.Frozen);
function Is_Alias (Self : Object) return Boolean is (Self.Is_Alias);
function Is_From_Config
(Self : Object) return Boolean is (Self.From_Config);
end GPR2.Project.Attribute;
|
leonhxx/pok | Ada | 515 | ads | -- POK header
--
-- The following file is a part of the POK project. Any modification should
-- be made according to the POK licence. You CANNOT use this file or a part
-- of a file for your own project.
--
-- For more information on the POK licence, please see our LICENCE FILE
--
-- Please follow the coding guidelines described in doc/CODING_GUIDELINES
--
-- Copyright (c) 2007-2021 POK team
package User is
procedure Hello_Part1;
end User;
|
shintakezou/langkit | Ada | 6,895 | adb | --
-- Copyright (C) 2014-2022, AdaCore
-- SPDX-License-Identifier: Apache-2.0
--
with Ada.Characters.Handling; use Ada.Characters.Handling;
package body Langkit_Support.Names is
-------------------
-- Is_Valid_Name --
-------------------
function Is_Valid_Name
(Name : Text_Type;
Casing : Casing_Convention := Camel_With_Underscores) return Boolean
is
subtype Alphanumerical is Character_Type with Static_Predicate =>
Alphanumerical in '0' .. '9' | 'a' .. 'z' | 'A' .. 'Z';
subtype Lower_Alphanumerical is Alphanumerical with Static_Predicate =>
Lower_Alphanumerical in '0' .. '9' | 'a' .. 'z';
subtype Upper_Alphanumerical is Alphanumerical with Static_Predicate =>
Upper_Alphanumerical in '0' .. '9' | 'A' .. 'Z';
Last_Was_Underscore : Boolean := False;
begin
-- Validate the first and last characters: first for invariants shared
-- by all conventions, then for convention-specific invariants.
if Name'Length = 0 then
return False;
end if;
declare
First : Character_Type renames Name (Name'First);
Last : Character_Type renames Name (Name'Last);
begin
case Casing is
when Camel_With_Underscores | Camel =>
if First not in Upper_Alphanumerical
or else Last not in Alphanumerical
then
return False;
end if;
when Lower =>
if First not in Lower_Alphanumerical
or else Last not in Lower_Alphanumerical
then
return False;
end if;
when Upper =>
if First not in Upper_Alphanumerical
or else Last not in Upper_Alphanumerical
then
return False;
end if;
end case;
end;
-- Validate all other characters
for C of Name (Name'First + 1 .. Name'Last - 1) loop
case C is
when '_' =>
-- Underscores are forbidden in Camel, and consecutive
-- underscores are forbidden in all conventions.
if Casing = Camel or else Last_Was_Underscore then
return False;
end if;
Last_Was_Underscore := True;
when Alphanumerical =>
-- Depending on the convention, characters following
-- underscores either must be lower-case or upper-case.
if Last_Was_Underscore then
case Casing is
when Camel_With_Underscores | Upper =>
if C not in Upper_Alphanumerical then
return False;
end if;
when Lower =>
if C not in Lower_Alphanumerical then
return False;
end if;
when Camel =>
raise Program_Error;
end case;
else
case Casing is
when Lower =>
if C not in Lower_Alphanumerical then
return False;
end if;
when Upper =>
if C not in Upper_Alphanumerical then
return False;
end if;
when others =>
null;
end case;
end if;
Last_Was_Underscore := False;
when others =>
return False;
end case;
end loop;
return True;
end Is_Valid_Name;
-----------------
-- Create_Name --
-----------------
function Create_Name
(Name : Text_Type;
Casing : Casing_Convention := Camel_With_Underscores) return Name_Type
is
begin
if not Is_Valid_Name (Name, Casing) then
raise Invalid_Name_Error;
end if;
-- Past this point, we know than Name contains alphanumericals and
-- underscores only, so Image (Name) is just a conversion to ASCII (no
-- escape sequence).
declare
N : String := Image (Name);
begin
-- Unless the casing is already Camel_With_Underscores, convert N to
-- it.
case Casing is
when Camel_With_Underscores =>
return To_Unbounded_String (N);
when Camel =>
return Result : Name_Type do
-- Treat each uppper-case letter as the start of a new word
for C of N loop
case C is
when 'A' .. 'Z' =>
if Length (Result) > 0 then
Append (Result, '_');
end if;
Append (Result, C);
when '_' =>
null;
when others =>
Append (Result, C);
end case;
end loop;
end return;
when Lower | Upper =>
declare
Start_Word : Boolean := True;
begin
-- Normalize casing: each start of a word (alphanumericals
-- after underscores) must be upper-case, and the rest in lower
-- case.
for C of N loop
if Start_Word then
C := To_Upper (C);
Start_Word := False;
elsif C = '_' then
Start_Word := True;
else
C := To_Lower (C);
end if;
end loop;
end;
return To_Unbounded_String (N);
end case;
end;
end Create_Name;
-----------------
-- Format_Name --
-----------------
function Format_Name
(Name : Name_Type; Casing : Casing_Convention) return Text_Type
is
N : String := To_String (Name);
Last : Natural := N'Last;
begin
if N'Length = 0 then
raise Invalid_Name_Error;
end if;
case Casing is
when Camel_With_Underscores =>
null;
when Camel =>
-- Strip underscores and preserve all other characters
Last := 0;
for C of N loop
if C /= '_' then
Last := Last + 1;
N (Last) := C;
end if;
end loop;
when Lower =>
for C of N loop
C := To_Lower (C);
end loop;
when Upper =>
for C of N loop
C := To_Upper (C);
end loop;
end case;
return To_Text (N (N'First .. Last));
end Format_Name;
end Langkit_Support.Names;
|
francesco-bongiovanni/ewok-kernel | Ada | 3,753 | adb | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
with ewok.tasks; use ewok.tasks;
with ewok.tasks_shared; use ewok.tasks_shared;
with ewok.gpio;
with ewok.exported.gpios;
with ewok.sanitize;
package body ewok.syscalls.cfg.gpio
with spark_mode => off
is
procedure gpio_set
(caller_id : in ewok.tasks_shared.t_task_id;
params : in out t_parameters;
mode : in ewok.tasks_shared.t_task_mode)
is
ref : ewok.exported.gpios.t_gpio_ref
with address => params(1)'address;
val : unsigned_8
with address => params(2)'address;
begin
-- Task initialization is complete ?
if not is_init_done (caller_id) then
goto ret_denied;
end if;
-- Valid t_gpio_ref ?
if not ref.pin'valid or not ref.port'valid then
goto ret_inval;
end if;
-- Does that GPIO really belongs to the caller ?
if not ewok.gpio.belong_to (caller_id, ref) then
goto ret_denied;
end if;
-- Write the pin
if val >= 1 then
ewok.gpio.write_pin (ref, 1);
else
ewok.gpio.write_pin (ref, 0);
end if;
set_return_value (caller_id, mode, SYS_E_DONE);
ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_inval>>
set_return_value (caller_id, mode, SYS_E_INVAL);
ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_denied>>
set_return_value (caller_id, mode, SYS_E_DENIED);
ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
end gpio_set;
procedure gpio_get
(caller_id : in ewok.tasks_shared.t_task_id;
params : in out t_parameters;
mode : in ewok.tasks_shared.t_task_mode)
is
ref : ewok.exported.gpios.t_gpio_ref
with address => params(1)'address;
val : unsigned_8
with address => to_address (params(2));
begin
-- Task initialization is complete ?
if not is_init_done (caller_id) then
goto ret_denied;
end if;
-- Valid t_gpio_ref ?
if not ref.pin'valid or not ref.port'valid then
goto ret_inval;
end if;
-- Does &val is in the caller address space ?
if not ewok.sanitize.is_word_in_data_slot
(to_system_address (val'address), caller_id, mode)
then
goto ret_denied;
end if;
-- Read the pin
val := unsigned_8 (ewok.gpio.read_pin (ref));
set_return_value (caller_id, mode, SYS_E_DONE);
ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_inval>>
set_return_value (caller_id, mode, SYS_E_INVAL);
ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
<<ret_denied>>
set_return_value (caller_id, mode, SYS_E_DENIED);
ewok.tasks.set_state (caller_id, mode, TASK_STATE_RUNNABLE);
return;
end gpio_get;
end ewok.syscalls.cfg.gpio;
|
Fabien-Chouteau/coffee-clock | Ada | 56,365 | ads | -- This file was generated by bmp2ada
with Giza.Image;
with Giza.Image.DMA2D;
use Giza.Image.DMA2D;
package digit_0 is
pragma Style_Checks (Off);
CLUT : aliased constant L4_CLUT_T := (
(R => 0, G => 0, B => 0),
(R => 255, G => 0, B => 0), others => (0, 0, 0));
Data : aliased constant L4_Data_T := (
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0,
0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0,
0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0,
0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0,
0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0,
0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0,
0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0,
0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0,
0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0,
0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0,
0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0,
0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
);
Image : constant Giza.Image.Ref := new Giza.Image.DMA2D.Instance'
(Mode => L4, W => 160, H => 195, Length => 15600, L4_CLUT => CLUT'Access, L4_Data => Data'Access);
pragma Style_Checks (On);
end digit_0;
|
reznikmm/matreshka | Ada | 11,438 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010, 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.Internals.Unicode.Ucd.Core;
package body Matreshka.Internals.Regexps.Engine.Pike is
use Matreshka.Internals.Strings;
use Matreshka.Internals.Unicode;
use Matreshka.Internals.Utf16;
function Element is
new Unicode.Ucd.Generic_Element
(Matreshka.Internals.Unicode.Ucd.Core_Values,
Matreshka.Internals.Unicode.Ucd.Core_Second_Stage,
Matreshka.Internals.Unicode.Ucd.Core_Second_Stage_Access,
Matreshka.Internals.Unicode.Ucd.Core_First_Stage);
-------------
-- Execute --
-------------
function Execute
(Program : Engine.Program;
String : not null Matreshka.Internals.Strings.Shared_String_Access)
return not null Shared_Match_Access
is
type State_Information is record
PC : Integer;
SS : Regexps.Slice_Array (0 .. Program.Captures);
end record;
type State_Array is
array (1 .. Program.Instructions'Length) of State_Information;
type Thread_List is record
State : State_Array;
Last : Natural;
end record;
type Thread_List_Access is access all Thread_List;
List_1 : aliased Thread_List;
List_2 : aliased Thread_List;
Current : Thread_List_Access := List_1'Access;
Next : Thread_List_Access := List_2'Access;
Aux : Thread_List_Access;
Match : constant not null Shared_Match_Access
:= new Shared_Match (Program.Captures);
SP : Utf16_String_Index := 0;
SI : Positive := 1;
Step : Positive := 1;
Steps : array (Program.Instructions'Range) of Integer := (others => 0);
procedure Add
(PC : Integer;
SS : Slice_Array;
Start_Of_Line : Boolean;
End_Of_Line : Boolean);
---------
-- Add --
---------
procedure Add
(PC : Integer;
SS : Slice_Array;
Start_Of_Line : Boolean;
End_Of_Line : Boolean)
is
S : Slice_Array := SS;
begin
if Steps (PC) = Step then
return;
end if;
Steps (PC) := Step;
case Program.Instructions (PC).Kind is
when Any_Code_Point
| Code_Point
| Code_Range
| I_Property
| Engine.Match
=>
Next.Last := Next.Last + 1;
Next.State (Next.Last) := (PC, SS);
when I_Terminate =>
for J in 1 .. Current.Last loop
if Current.State (J).PC = Program.Instructions (PC).Next then
Current.State (J .. Current.Last - 1) :=
Current.State (J + 1 .. Current.Last);
Current.Last := Current.Last - 1;
exit;
end if;
end loop;
when Split =>
Add
(Program.Instructions (PC).Next,
S,
Start_Of_Line,
End_Of_Line);
Add
(Program.Instructions (PC).Another,
S,
Start_Of_Line,
End_Of_Line);
when Save =>
if Program.Instructions (PC).Start then
S (Program.Instructions (PC).Slot) := (SP, SI, 0, 1);
else
S (Program.Instructions (PC).Slot).Next_Position := SP;
S (Program.Instructions (PC).Slot).Next_Index := SI;
end if;
Add
(Program.Instructions (PC).Next,
S,
Start_Of_Line,
End_Of_Line);
when I_Anchor =>
declare
Match : Boolean := True;
begin
if Program.Instructions (PC).Start_Of_Line then
Match := Start_Of_Line;
end if;
if Program.Instructions (PC).End_Of_Line then
Match := Match and End_Of_Line;
end if;
if Match then
Add
(Program.Instructions (PC).Next,
S,
Start_Of_Line,
End_Of_Line);
end if;
end;
when None =>
raise Program_Error;
end case;
end Add;
PC : Positive := 1;
SS : Regexps.Slice_Array (0 .. Program.Captures)
:= (others => (0, 1, 0, 1));
Code : Matreshka.Internals.Unicode.Code_Point;
T : Integer;
SOL : Boolean := True;
EOL : Boolean := String.Unused = 0;
begin
Match.Is_Matched := False;
Match.Number := Program.Captures;
Next.Last := 0;
Current.Last := 0;
Add (PC, SS, SOL, EOL);
SOL := False;
while SP <= String.Unused loop
-- Handling of 'match' instruction requires to do one cycle after
-- last character. Implicit null terminator allows to do last cycle
-- like any other cycles, and simplify code. Even if it match
-- pattern this match never be taken, because it can be handled
-- only on next cycle, which never be happen.
Aux := Current;
Current := Next;
Next := Aux;
Next.Last := 0;
Step := Step + 1;
exit when Current.Last = 0;
Unchecked_Next (String.Value, SP, Code);
SI := SI + 1;
T := 1;
EOL := SP = String.Unused;
loop
exit when T > Current.Last;
PC := Current.State (T).PC;
SS := Current.State (T).SS;
case Program.Instructions (PC).Kind is
when Any_Code_Point =>
Add (Program.Instructions (PC).Next, SS, SOL, EOL);
when Code_Point =>
if Code = Program.Instructions (PC).Code then
Add (Program.Instructions (PC).Next, SS, SOL, EOL);
end if;
when Code_Range =>
if Program.Instructions (PC).Negate
xor (Code
in Program.Instructions (PC).Low
.. Program.Instructions (PC).High)
then
Add (Program.Instructions (PC).Next, SS, SOL, EOL);
end if;
when I_Property =>
declare
R : Boolean;
begin
case Program.Instructions (PC).Value.Kind is
when None =>
raise Program_Error;
when General_Category =>
R :=
Program.Instructions (PC).Value.GC_Flags
(Element
(Matreshka.Internals.Unicode.Ucd.Core.Property,
Code).GC);
when Binary =>
R :=
Element
(Matreshka.Internals.Unicode.Ucd.Core.Property,
Code).B
(Program.Instructions (PC).Value.Property);
end case;
if Program.Instructions (PC).Negative xor R then
Add (Program.Instructions (PC).Next, SS, SOL, EOL);
end if;
end;
when Engine.Match =>
Match.Is_Matched := True;
Match.Slices := SS;
exit;
when others =>
raise Program_Error;
end case;
T := T + 1;
end loop;
end loop;
if Match.Is_Matched then
Reference (String);
Match.Source := String;
end if;
return Match;
end Execute;
end Matreshka.Internals.Regexps.Engine.Pike;
|
reznikmm/matreshka | Ada | 5,787 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- XML Processor --
-- --
-- Testsuite Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2010-2011, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with League.Strings;
with Matreshka.Internals.Strings;
package XML.SAX.Input_Sources is
pragma Preelaborate;
type SAX_Input_Source is limited interface;
type SAX_Input_Source_Access is access all SAX_Input_Source'Class;
-- not overriding procedure Set_String
-- (Self : in out SAX_Input_Source;
-- String : League.Strings.Universal_String) is abstract;
--
-- procedure Set_Stream
-- (Self : in out SAX_Input_Source;
-- Stream : not null access Ada.Streams.Root_Stream_Type'Class);
-- not overriding function Encoding
-- (Self : SAX_Input_Source) return League.Strings.Universal_String;
not overriding function Public_Id
(Self : SAX_Input_Source) return League.Strings.Universal_String
is abstract;
-- Returns public identifier for the input source, or an empty string if
-- non was supplied.
not overriding function System_Id
(Self : SAX_Input_Source) return League.Strings.Universal_String
is abstract;
-- Returns system identifier for the input source, or an empty string if
-- non was supplied.
-- not overriding procedure Set_Encoding
-- (Self : in out SAX_Input_Source;
-- Encoding : League.Strings.Universal_String);
-- not overriding procedure Set_Public_Id
-- (Self : in out SAX_Input_Source;
-- Id : League.Strings.Universal_String) is abstract;
not overriding procedure Set_System_Id
(Self : in out SAX_Input_Source;
Id : League.Strings.Universal_String) is abstract;
-- Sets system identifier of the entity.
not overriding procedure Set_Version
(Self : in out SAX_Input_Source;
Version : League.Strings.Universal_String) is abstract;
-- Sets XML version for the entity.
not overriding procedure Next
(Self : in out SAX_Input_Source;
Buffer : in out
not null Matreshka.Internals.Strings.Shared_String_Access;
End_Of_Data : out Boolean) is abstract;
not overriding procedure Reset
(Self : in out SAX_Input_Source;
Version : League.Strings.Universal_String;
Encoding : League.Strings.Universal_String;
Rescan : out Boolean;
Success : out Boolean) is abstract;
-- Resets used version and encoding to specified. Sets Rescan to True when
-- encoding is changed and scanning must be restarted from the beginning of
-- the entity. Sets Success to False when error is detected.
end XML.SAX.Input_Sources;
|
stcarrez/ada-util | Ada | 1,139 | ads | -----------------------------------------------------------------------
-- util-commands-raw_io -- Output using raw console IO
-- Copyright (C) 2023 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.
-----------------------------------------------------------------------
package Util.Commands.Raw_IO is
new Util.Commands.IO (Count_Type => Positive,
Put => Util.Commands.Put_Raw,
Put_Line => Util.Commands.Put_Raw_Line,
New_Line => Util.Commands.New_Line_Raw);
|
zhmu/ananas | Ada | 8,300 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- A D A . I N T E R R U P T S . N A M E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1991-2022, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- This is a AIX version of this package
-- The following signals are reserved by the run time (native threads):
-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGABRT, SIGTRAP, SIGINT, SIGEMT
-- SIGSTOP, SIGKILL
-- The following signals are reserved by the run time (FSU threads):
-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGABRT, SIGTRAP, SIGINT, SIGALRM,
-- SIGWAITING, SIGSTOP, SIGKILL
-- The pragma Unreserve_All_Interrupts affects the following signal(s):
-- SIGINT: made available for Ada handler
-- This target-dependent package spec contains names of interrupts
-- supported by the local system.
with System.OS_Interface;
package Ada.Interrupts.Names is
-- All identifiers in this unit are implementation defined
pragma Implementation_Defined;
-- Beware that the mapping of names to signals may be many-to-one. There
-- may be aliases. Also, for all signal names that are not supported on
-- the current system the value of the corresponding constant will be zero.
SIGHUP : constant Interrupt_ID :=
System.OS_Interface.SIGHUP; -- hangup
SIGINT : constant Interrupt_ID :=
System.OS_Interface.SIGINT; -- interrupt (rubout)
SIGQUIT : constant Interrupt_ID :=
System.OS_Interface.SIGQUIT; -- quit (ASCD FS)
SIGILL : constant Interrupt_ID :=
System.OS_Interface.SIGILL; -- illegal instruction (not reset)
SIGTRAP : constant Interrupt_ID :=
System.OS_Interface.SIGTRAP; -- trace trap (not reset)
SIGIOT : constant Interrupt_ID :=
System.OS_Interface.SIGIOT; -- IOT instruction
SIGABRT : constant Interrupt_ID := -- used by abort,
System.OS_Interface.SIGABRT; -- replace SIGIOT in the future
SIGEMT : constant Interrupt_ID :=
System.OS_Interface.SIGEMT; -- EMT instruction
SIGFPE : constant Interrupt_ID :=
System.OS_Interface.SIGFPE; -- floating point exception
SIGKILL : constant Interrupt_ID :=
System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored)
SIGBUS : constant Interrupt_ID :=
System.OS_Interface.SIGBUS; -- bus error
SIGSEGV : constant Interrupt_ID :=
System.OS_Interface.SIGSEGV; -- segmentation violation
SIGSYS : constant Interrupt_ID :=
System.OS_Interface.SIGSYS; -- bad argument to system call
SIGPIPE : constant Interrupt_ID := -- write on a pipe with
System.OS_Interface.SIGPIPE; -- no one to read it
SIGALRM : constant Interrupt_ID :=
System.OS_Interface.SIGALRM; -- alarm clock
SIGTERM : constant Interrupt_ID :=
System.OS_Interface.SIGTERM; -- software termination signal from kill
SIGUSR1 : constant Interrupt_ID :=
System.OS_Interface.SIGUSR1; -- user defined signal 1
SIGUSR2 : constant Interrupt_ID :=
System.OS_Interface.SIGUSR2; -- user defined signal 2
SIGCLD : constant Interrupt_ID :=
System.OS_Interface.SIGCLD; -- child status change
SIGCHLD : constant Interrupt_ID :=
System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD
SIGPWR : constant Interrupt_ID :=
System.OS_Interface.SIGPWR; -- power-fail restart
SIGWINCH : constant Interrupt_ID :=
System.OS_Interface.SIGWINCH; -- window size change
SIGURG : constant Interrupt_ID :=
System.OS_Interface.SIGURG; -- urgent condition on IO channel
SIGPOLL : constant Interrupt_ID :=
System.OS_Interface.SIGPOLL; -- pollable event occurred
SIGIO : constant Interrupt_ID := -- input/output possible,
System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris)
SIGSTOP : constant Interrupt_ID :=
System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored)
SIGTSTP : constant Interrupt_ID :=
System.OS_Interface.SIGTSTP; -- user stop requested from tty
SIGCONT : constant Interrupt_ID :=
System.OS_Interface.SIGCONT; -- stopped process has been continued
SIGTTIN : constant Interrupt_ID :=
System.OS_Interface.SIGTTIN; -- background tty read attempted
SIGTTOU : constant Interrupt_ID :=
System.OS_Interface.SIGTTOU; -- background tty write attempted
SIGVTALRM : constant Interrupt_ID :=
System.OS_Interface.SIGVTALRM; -- virtual timer expired
SIGPROF : constant Interrupt_ID :=
System.OS_Interface.SIGPROF; -- profiling timer expired
SIGXCPU : constant Interrupt_ID :=
System.OS_Interface.SIGXCPU; -- CPU time limit exceeded
SIGXFSZ : constant Interrupt_ID :=
System.OS_Interface.SIGXFSZ; -- filesize limit exceeded
SIGMSG : constant Interrupt_ID :=
System.OS_Interface.SIGMSG; -- input data is in the ring buffer
SIGDANGER : constant Interrupt_ID :=
System.OS_Interface.SIGDANGER; -- system crash imminent;
SIGMIGRATE : constant Interrupt_ID :=
System.OS_Interface.SIGMIGRATE; -- migrate process
SIGPRE : constant Interrupt_ID :=
System.OS_Interface.SIGPRE; -- programming exception
SIGVIRT : constant Interrupt_ID :=
System.OS_Interface.SIGVIRT; -- AIX virtual time alarm
SIGALRM1 : constant Interrupt_ID :=
System.OS_Interface.SIGALRM1; -- m:n condition variables
SIGWAITING : constant Interrupt_ID :=
System.OS_Interface.SIGWAITING; -- m:n scheduling
SIGKAP : constant Interrupt_ID :=
System.OS_Interface.SIGKAP; -- keep alive poll from native keyboard
SIGGRANT : constant Interrupt_ID :=
System.OS_Interface.SIGGRANT; -- monitor mode granted
SIGRETRACT : constant Interrupt_ID :=
System.OS_Interface.SIGRETRACT; -- monitor mode should be relinquished
SIGSOUND : constant Interrupt_ID :=
System.OS_Interface.SIGSOUND; -- sound control has completed
SIGSAK : constant Interrupt_ID :=
System.OS_Interface.SIGSAK; -- secure attention key
end Ada.Interrupts.Names;
|
MinimSecure/unum-sdk | Ada | 1,223 | adb | -- Copyright 2005-2016 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure PA is
type Packed_Array is array (4 .. 8) of Boolean;
pragma pack (Packed_Array);
Var : Packed_Array;
-- Unconstrained packed array (bounds are dynamic).
type Unconstrained_Packed_Array is array (Integer range <>) of Boolean;
U_Var : Unconstrained_Packed_Array (1 .. Ident (6));
begin
Var := (True, False, True, False, True);
U_Var := (True, False, False, True, True, False);
Var (8) := False; -- STOP
U_Var (U_Var'Last) := True;
end PA;
|
tum-ei-rcs/StratoX | Ada | 5,659 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . S E C O N D A R Y _ S T A C K --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the HI-E version of this package
with Unchecked_Conversion;
package body System.Secondary_Stack is
use type SSE.Storage_Offset;
type Memory is array (Mark_Id range <>) of SSE.Storage_Element;
type Stack_Id is record
Top : Mark_Id;
Last : Mark_Id;
Mem : Memory (1 .. Mark_Id'Last);
end record;
pragma Suppress_Initialization (Stack_Id);
type Stack_Ptr is access Stack_Id;
function From_Addr is new Unchecked_Conversion (Address, Stack_Ptr);
function Get_Sec_Stack return Stack_Ptr;
pragma Import (C, Get_Sec_Stack, "__gnat_get_secondary_stack");
-- Return the address of the secondary stack.
-- In a multi-threaded environment, Sec_Stack should be a thread-local
-- variable.
--
-- Possible separate implementation of Get_Sec_Stack in a single-threaded
-- environment:
--
-- with System;
-- package Secondary_Stack is
-- function Get_Sec_Stack return System.Address;
-- pragma Export (C, Get_Sec_Stack, "__gnat_get_secondary_stack");
-- end Secondary_Stack;
-- pragma Warnings (Off);
-- with System.Secondary_Stack; use System.Secondary_Stack;
-- pragma Warnings (On);
-- package body Secondary_Stack is
-- Chunk : aliased String (1 .. Default_Secondary_Stack_Size);
-- for Chunk'Alignment use Standard'Maximum_Alignment;
-- Initialized : Boolean := False;
-- function Get_Sec_Stack return System.Address is
-- begin
-- if not Initialized then
-- Initialized := True;
-- SS_Init (Chunk'Address);
-- end if;
-- return Chunk'Address;
-- end Get_Sec_Stack;
-- end Secondary_Stack;
-----------------
-- SS_Allocate --
-----------------
procedure SS_Allocate
(Address : out System.Address;
Storage_Size : SSE.Storage_Count)
is
Max_Align : constant Mark_Id := Mark_Id (Standard'Maximum_Alignment);
Max_Size : constant Mark_Id :=
((Mark_Id (Storage_Size) + Max_Align - 1) / Max_Align)
* Max_Align;
Sec_Stack : constant Stack_Ptr := Get_Sec_Stack;
begin
if Sec_Stack.Top + Max_Size > Sec_Stack.Last then
raise Storage_Error;
end if;
Address := Sec_Stack.Mem (Sec_Stack.Top)'Address;
Sec_Stack.Top := Sec_Stack.Top + Max_Size;
end SS_Allocate;
-------------
-- SS_Init --
-------------
procedure SS_Init
(Stk : System.Address;
Size : Natural := Default_Secondary_Stack_Size)
is
Stack : constant Stack_Ptr := From_Addr (Stk);
begin
pragma Assert (Size >= 2 * Mark_Id'Max_Size_In_Storage_Elements);
pragma Assert
(Stk mod Standard'Maximum_Alignment = SSE.Storage_Offset'(0));
Stack.Top := Stack.Mem'First;
Stack.Last := Mark_Id (Size) - 2 * Mark_Id'Max_Size_In_Storage_Elements;
end SS_Init;
-------------
-- SS_Mark --
-------------
function SS_Mark return Mark_Id is
begin
return Get_Sec_Stack.Top;
end SS_Mark;
----------------
-- SS_Release --
----------------
procedure SS_Release (M : Mark_Id) is
begin
Get_Sec_Stack.Top := M;
end SS_Release;
end System.Secondary_Stack;
|
AdaCore/training_material | Ada | 22 | adb | I : My_Int_T := 1;
|
zertovitch/excel-writer | Ada | 2,425 | adb | with Excel_Out;
with Ada.Strings.Fixed;
procedure EW_Test is
use Excel_Out;
procedure Test_def_col_width (ef : Excel_type) is
xl : Excel_Out_File;
begin
xl.Create ("With def col width [" & Excel_type'Image (ef) & "].xls", ef);
xl.Write_default_column_width (20);
xl.Write_column_width (1, 5);
xl.Write_column_width (5, 10, 4);
xl.Put ("A");
xl.Put ("B");
xl.Close;
--
xl.Create ("Without def col width [" & Excel_type'Image (ef) & "].xls", ef);
xl.Write_column_width (1, 5);
xl.Write_column_width (5, 10, 4);
xl.Put ("A");
xl.Put ("B");
xl.Close;
end Test_def_col_width;
-- Test automatic choice for integer output
--
procedure Test_General (ef : Excel_type) is
use Ada.Strings, Ada.Strings.Fixed;
xl : Excel_Out_File;
begin
xl.Create ("Integer [" & Excel_type'Image (ef) & "].xls", ef);
xl.Freeze_Top_Row;
xl.Put ("x");
xl.Next;
xl.Put ("2.0**x");
xl.Put ("-2.0**x");
xl.Put ("2.0**x - 1");
xl.Next;
xl.Put ("2**x");
xl.Put ("-2**x");
xl.Put ("2**x - 1");
xl.Next;
xl.Put_Line
("Formulas for checking (all results should be 0). " &
" NB: the formulas are written as text." &
" Edit cells to convert them into real formulas.");
for power in 0 .. 66 loop
xl.Put (power);
xl.Next;
xl.Put (2.0 ** power);
xl.Put (-(2.0 ** power));
xl.Put ((2.0 ** power) - 1.0);
xl.Next;
if power <= 30 then
xl.Put (2 ** power);
xl.Put (-(2 ** power));
xl.Put ((2 ** power) - 1);
else
xl.Next (3);
end if;
xl.Next;
declare
row : constant String := Trim (Integer'Image (power + 2), Both);
begin
xl.Put ("= (2^A" & row & ") - C" & row);
xl.Put ("=-(2^A" & row & ") - D" & row);
xl.Put ("= (2^A" & row & ") - 1 - E" & row);
xl.Next;
if power <= 30 then
xl.Put ("= (2^A" & row & ") - G" & row);
xl.Put ("=-(2^A" & row & ") - H" & row);
xl.Put ("= (2^A" & row & ") - 1 - I" & row);
end if;
end;
xl.New_Line;
end loop;
xl.Close;
end Test_General;
begin
for ef in Excel_type loop
Test_def_col_width (ef);
Test_General (ef);
end loop;
end EW_Test;
|
AdaCore/libadalang | Ada | 369 | adb | procedure Test is
type Kind is (A, C);
procedure Process is null;
X : Kind := A;
begin
begin
-- A and C should be resolved even though B's resolution fails
case X is
when A =>
Process;
when B =>
Process;
when C =>
Process;
end case;
end;
pragma Test_Block;
end Test;
|
stcarrez/helios | Ada | 2,913 | adb | -----------------------------------------------------------------------
-- helios-commands-info -- Helios information commands
-- Copyright (C) 2017, 2018, 2019 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.Real_Time;
with Util.Events.Timers;
with Helios.Datas;
with Helios.Monitor.Agent;
with Helios.Reports.Files;
package body Helios.Commands.Info is
use type Ada.Real_Time.Time_Span;
-- Execute a information command to report information about the agent and monitoring.
overriding
procedure Execute (Command : in out Command_Type;
Name : in String;
Args : in Argument_List'Class;
Context : in out Context_Type) is
pragma Unreferenced (Command, Name, Args);
type Info_Report is new Helios.Reports.Files.File_Report_Type with null record;
-- The timer handler executed when the timer deadline has passed.
overriding
procedure Time_Handler (Report : in out Info_Report;
Event : in out Util.Events.Timers.Timer_Ref'Class);
-- The timer handler executed when the timer deadline has passed.
overriding
procedure Time_Handler (Report : in out Info_Report;
Event : in out Util.Events.Timers.Timer_Ref'Class) is
begin
Helios.Reports.Files.File_Report_Type (Report).Time_Handler (Event);
Context.Runtime.Stop := True;
end Time_Handler;
Timer : Util.Events.Timers.Timer_Ref;
Report : aliased Info_Report;
begin
Report.Path := Ada.Strings.Unbounded.To_Unbounded_String ("report.json");
Load (Context);
Monitor.Agent.Configure (Context.Runtime, Context.Config);
Context.Runtime.Timers.Set_Timer (Report'Unchecked_Access, Timer,
Context.Runtime.Report_Period + Ada.Real_Time.Seconds (1));
Monitor.Agent.Run (Context.Runtime);
end Execute;
-- Write the help associated with the command.
overriding
procedure Help (Command : in out Command_Type;
Name : in String;
Context : in out Context_Type) is
begin
null;
end Help;
end Helios.Commands.Info;
|
tum-ei-rcs/StratoX | Ada | 19,133 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . B B . C P U _ P R I M I T I V E S --
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2002 Universidad Politecnica de Madrid --
-- Copyright (C) 2003-2005 The European Space Agency --
-- Copyright (C) 2003-2016, AdaCore --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- 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/>. --
-- --
------------------------------------------------------------------------------
-- This version is for ARM bareboard targets using the ARMv7-M targets,
-- which only use Thumb2 instructions.
with Ada.Unchecked_Conversion; use Ada;
with System.Storage_Elements;
with System.Multiprocessors;
with System.BB.Board_Support;
with System.BB.Threads;
with System.BB.Threads.Queues;
with System.BB.Time;
with System.Machine_Code; use System.Machine_Code;
package body System.BB.CPU_Primitives is
use Parameters;
use Threads;
use Queues;
use Board_Support;
use Time;
use System.Multiprocessors;
package SSE renames System.Storage_Elements;
use type SSE.Integer_Address;
use type SSE.Storage_Offset;
NL : constant String := ASCII.LF & ASCII.HT;
-- New line separator in Asm templates
No_Floating_Point : constant Boolean := not System.BB.Parameters.Has_FPU;
-- Set True iff the FPU should not be used
-----------
-- Traps --
-----------
Reset_Vector : constant Vector_Id := 1;
NMI_Vector : constant Vector_Id := 2;
Hard_Fault_Vector : constant Vector_Id := 3;
-- Mem_Manage_Vector : constant Vector_Id := 4; -- Never referenced
Bus_Fault_Vector : constant Vector_Id := 5;
Usage_Fault_Vector : constant Vector_Id := 6;
SV_Call_Vector : constant Vector_Id := 11;
-- Debug_Mon_Vector : constant Vector_Id := 12; -- Never referenced
Pend_SV_Vector : constant Vector_Id := 14;
Sys_Tick_Vector : constant Vector_Id := 15;
Interrupt_Request_Vector : constant Vector_Id := 16;
pragma Assert (Interrupt_Request_Vector = Vector_Id'Last);
type Trap_Handler_Ptr is access procedure (Id : Vector_Id);
function To_Pointer is new Unchecked_Conversion (Address, Trap_Handler_Ptr);
type Trap_Handler_Table is array (Vector_Id) of Trap_Handler_Ptr;
pragma Suppress_Initialization (Trap_Handler_Table);
Trap_Handlers : Trap_Handler_Table;
pragma Export (C, Trap_Handlers, "__gnat_bb_exception_handlers");
System_Vectors : constant System.Address;
pragma Import (Asm, System_Vectors, "__vectors");
-- As ARMv7M does not directly provide a single-shot alarm timer, and
-- we have to use Sys_Tick for that, we need to have this clock generate
-- interrupts at a relatively high rate. To avoid unnecessary overhead
-- when no alarms are requested, we'll only call the alarm handler if
-- the current time exceeds the Alarm_Time by at most half the modulus
-- of Timer_Interval.
Alarm_Time : Board_Support.Timer_Interval;
pragma Volatile (Alarm_Time);
pragma Import (C, Alarm_Time, "__gnat_alarm_time");
procedure SV_Call_Handler;
pragma Export (Asm, SV_Call_Handler, "__gnat_sv_call_trap");
procedure Pend_SV_Handler;
pragma Machine_Attribute (Pend_SV_Handler, "naked");
pragma Export (Asm, Pend_SV_Handler, "__gnat_pend_sv_trap");
-- This assembly routine needs to save and restore registers without
-- interference. The "naked" machine attribute communicates this to GCC.
procedure Sys_Tick_Handler;
pragma Export (Asm, Sys_Tick_Handler, "__gnat_sys_tick_trap");
procedure Interrupt_Request_Handler;
pragma Export (Asm, Interrupt_Request_Handler, "__gnat_irq_trap");
procedure GNAT_Error_Handler (Trap : Vector_Id);
pragma No_Return (GNAT_Error_Handler);
-----------------------
-- Context Switching --
-----------------------
-- This port uses the ARMv7-M hardware for saving volatile context for
-- interrupts, see the Hardware_Context type below for details. Any
-- non-volatile registers will be preserved by the interrupt handler in
-- the same way as it happens for ordinary procedure calls.
-- The non-volatile registers, as well as the value of the stack pointer
-- (SP_process) are saved in the Context buffer of the Thread_Descriptor.
-- Any non-volatile floating-point registers are saved on the stack.
-- R4 .. R11 are at offset 0 .. 7
SP_process : constant Context_Id := 8;
type Hardware_Context is record
R0, R1, R2, R3 : Word;
R12, LR, PC, PSR : Word;
end record;
ICSR : Word with Volatile, Address => 16#E000_ED04#; -- Int. Control/State
ICSR_Pend_SV_Set : constant Word := 2**28;
VTOR : Address with Volatile, Address => 16#E000_ED08#; -- Vec. Table Offset
AIRCR : Word with Volatile, Address => 16#E000_ED0C#; -- App Int/Reset Ctrl
CCR : Word with Volatile, Address => 16#E000_ED14#; -- Config. Control
SHPR1 : Word with Volatile, Address => 16#E000_ED18#; -- Sys Hand 4- 7 Prio
SHPR2 : Word with Volatile, Address => 16#E000_ED1C#; -- Sys Hand 8-11 Prio
SHPR3 : Word with Volatile, Address => 16#E000_ED20#; -- Sys Hand 12-15 Prio
SHCSR : Word with Volatile, Address => 16#E000_ED24#; -- Sys Hand Ctrl/State
function PRIMASK return Word with Inline, Export, Convention => C;
-- Function returning the contents of the PRIMASK register
-------------
-- PRIMASK --
-------------
function PRIMASK return Word is
R : Word;
begin
Asm ("mrs %0, PRIMASK", Outputs => Word'Asm_Output ("=r", R),
Volatile => True);
return R;
end PRIMASK;
--------------------
-- Initialize_CPU --
--------------------
procedure Initialize_CPU is
Interrupt_Stack_Table : array (System.Multiprocessors.CPU)
of System.Address;
pragma Import (Asm, Interrupt_Stack_Table, "interrupt_stack_table");
-- Table containing a pointer to the top of the stack for each processor
begin
-- Switch the stack pointer to SP_process (PSP)
Asm ("mrs r0, MSP" & NL &
"msr PSP, r0" & NL &
"mrs r0, CONTROL" & NL &
"orr r0,r0,2" & NL &
"msr CONTROL,r0",
Clobber => "r0",
Volatile => True);
-- Initialize SP_main (MSP)
Asm ("msr MSP, %0",
Inputs => Address'Asm_Input ("r", Interrupt_Stack_Table (1)),
Volatile => True);
-- Initialize vector table
VTOR := System_Vectors'Address;
-- Set configuration: stack is 8 byte aligned, trap on divide by 0,
-- no trap on unaligned access, can enter thread mode from any level.
CCR := CCR or 16#211#;
-- Set priorities of system handlers. The Pend_SV handler runs at the
-- lowest priority, so context switching does not block higher priority
-- interrupt handlers. All other system handlers run at the highest
-- priority (0), so they will not be interrupted. This is also true for
-- the SysTick interrupt, as this interrupt must be serviced promptly in
-- order to avoid losing track of time.
SHPR1 := 0;
SHPR2 := 0;
SHPR3 := 16#00_FF_00_00#;
-- Write the required key (16#05FA#) and desired PRIGROUP value. We
-- configure this to 3, to have 16 group priorities
AIRCR := 16#05FA_0300#;
pragma Assert (AIRCR = 16#FA05_0300#); -- Key value is swapped
-- Enable usage, bus and memory management fault
SHCSR := SHCSR or 16#7_0000#;
-- Unmask Fault
Asm ("cpsie f", Volatile => True);
end Initialize_CPU;
--------------------
-- Context_Switch --
--------------------
procedure Context_Switch is
begin
-- Interrupts must be disabled at this point
pragma Assert (PRIMASK = 1);
-- Make deferred supervisor call pending
ICSR := ICSR_Pend_SV_Set;
-- The context switch better be pending, as otherwise it means
-- interrupts were not disabled.
pragma Assert ((ICSR and ICSR_Pend_SV_Set) /= 0);
-- Memory must be clobbered, as task switching causes a task to signal,
-- which means its memory changes must be visible to all other tasks.
Asm ("", Volatile => True, Clobber => "memory");
end Context_Switch;
-----------------
-- Get_Context --
-----------------
function Get_Context
(Context : Context_Buffer;
Index : Context_Id) return Word
is
(Word (Context (Index)));
------------------------
-- GNAT_Error_Handler --
------------------------
procedure GNAT_Error_Handler (Trap : Vector_Id) is
begin
case Trap is
when Reset_Vector =>
raise Program_Error with "unexpected reset";
when NMI_Vector =>
raise Program_Error with "non-maskable interrupt";
when Hard_Fault_Vector =>
raise Program_Error with "hard fault";
when Bus_Fault_Vector =>
raise Program_Error with "bus fault";
when Usage_Fault_Vector =>
raise Constraint_Error with "usage fault";
when others =>
raise Program_Error with "unhandled trap";
end case;
end GNAT_Error_Handler;
----------------------------------
-- Interrupt_Request_Handler -- --
----------------------------------
procedure Interrupt_Request_Handler is
begin
-- Call the handler (System.BB.Interrupts.Interrupt_Wrapper)
Trap_Handlers (Interrupt_Request_Vector)(Interrupt_Request_Vector);
-- The handler has changed the current priority (BASEPRI), although
-- being useless on ARMv7m. We need to revert it.
-- The interrupt handler may have scheduled a new task, so we need to
-- check whether a context switch is needed.
if Context_Switch_Needed then
-- Perform a context switch because the currently executing thread is
-- no longer the one with the highest priority.
-- No need to update execution time. Already done in the wrapper.
-- Note that the following context switch is not immediate, but
-- will only take effect after interrupts are enabled.
Context_Switch;
end if;
-- Restore interrupt masking of interrupted thread
Enable_Interrupts (Running_Thread.Active_Priority);
end Interrupt_Request_Handler;
---------------------
-- Pend_SV_Handler --
---------------------
procedure Pend_SV_Handler is
begin
-- At most one instance of this handler can run at a time, and
-- interrupts will preserve all state, so interrupts can be left
-- enabled. Note the invariant that at all times the active context is
-- in the ("__gnat_running_thread_table"). Only this handler may update
-- that variable.
Asm
(Template =>
"movw r2, #:lower16:__gnat_running_thread_table" & NL &
"movt r2, #:upper16:__gnat_running_thread_table" & NL &
"mrs r12, PSP " & NL & -- Retrieve current PSP
"ldr r3, [r2]" & NL & -- Load address of running context
-- If floating point is enabled, we may have to save the non-volatile
-- floating point registers, and save bit 4 of the LR register, as
-- this will indicate whether the floating point context was saved
-- or not.
(if No_Floating_Point then "" -- No FP context to save
else
"tst lr, #16" & NL & -- if FPCA flag was set,
"itte eq" & NL & -- then
"vstmdbeq r12!,{s16-s31}" & NL & -- save FP context below PSP
"addeq r12, #1" & NL & -- save flag in bit 0 of PSP
"subne lr, #16" & NL) & -- else set FPCA flag in LR
-- Swap R4-R11 and PSP (stored in R12)
"stm r3, {r4-r12}" & NL & -- Save context
"movw r3, #:lower16:first_thread_table" & NL &
"movt r3, #:upper16:first_thread_table" & NL &
"ldr r3, [r3]" & NL & -- Load address of new context
"str r3, [r2]" & NL & -- Update value of Pend_SV_Context
"ldm r3, {r4-r12}" & NL & -- Load context and new PSP
-- If floating point is enabled, check bit 0 of PSP to see if we
-- need to restore the floating point context.
(if No_Floating_Point then "" -- No FP context to restore
else
"tst r12, #1" & NL & -- if FPCA was set,
"itte ne" & NL & -- then
"subne r12, #1" & NL & -- remove flag from PSP
"vldmiane r12!,{s16-s31}" & NL & -- Restore FP context
"addeq lr, #16" & NL) & -- else clear FPCA flag in LR
-- Finally, update PSP and perform the exception return
"msr PSP, r12" & NL & -- Update PSP
"bx lr", -- return to caller
Volatile => True);
end Pend_SV_Handler;
---------------------
-- SV_Call_Handler --
---------------------
procedure SV_Call_Handler is
begin
GNAT_Error_Handler (SV_Call_Vector);
end SV_Call_Handler;
-----------------
-- Set_Context --
-----------------
procedure Set_Context
(Context : in out Context_Buffer;
Index : Context_Id;
Value : Word) is
begin
Context (Index) := Address (Value);
end Set_Context;
----------------------
-- Sys_Tick_Handler --
----------------------
procedure Sys_Tick_Handler is
Max_Alarm_Interval : constant Timer_Interval := Timer_Interval'Last / 2;
Now : constant Timer_Interval := Read_Clock;
begin
-- The following allows max. efficiency for "useless" tick interrupts
if Alarm_Time - Now <= Max_Alarm_Interval then
-- Alarm is still in the future, nothing to do, so return quickly
return;
end if;
Alarm_Time := Now + Max_Alarm_Interval;
-- Call the alarm handler
Trap_Handlers (Sys_Tick_Vector)(Sys_Tick_Vector);
-- The interrupt handler may have scheduled a new task
if Context_Switch_Needed then
Context_Switch;
end if;
Enable_Interrupts (Running_Thread.Active_Priority);
end Sys_Tick_Handler;
------------------------
-- Initialize_Context --
------------------------
procedure Initialize_Context
(Buffer : not null access Context_Buffer;
Program_Counter : System.Address;
Argument : System.Address;
Stack_Pointer : System.Address)
is
HW_Ctx_Bytes : constant System.Address := Hardware_Context'Size / 8;
New_SP : constant System.Address :=
(Stack_Pointer - HW_Ctx_Bytes) and not 4;
HW_Ctx : Hardware_Context with Address => New_SP;
begin
-- No need to initialize the context of the environment task
if Program_Counter = Null_Address then
return;
end if;
HW_Ctx := (R0 => Word (Argument),
PC => Word (Program_Counter),
PSR => 2**24, -- Set thumb bit
others => 0);
Buffer.all := (SP_process => New_SP, others => 0);
end Initialize_Context;
----------------------------
-- Install_Error_Handlers --
----------------------------
procedure Install_Error_Handlers is
EH : constant Address := GNAT_Error_Handler'Address;
begin
Install_Trap_Handler (EH, Reset_Vector);
Install_Trap_Handler (EH, NMI_Vector);
Install_Trap_Handler (EH, Hard_Fault_Vector);
Install_Trap_Handler (EH, Bus_Fault_Vector);
Install_Trap_Handler (EH, Usage_Fault_Vector);
Install_Trap_Handler (EH, Pend_SV_Vector);
Install_Trap_Handler (EH, SV_Call_Vector);
end Install_Error_Handlers;
--------------------------
-- Install_Trap_Handler --
--------------------------
procedure Install_Trap_Handler
(Service_Routine : System.Address;
Vector : Vector_Id;
Synchronous : Boolean := False)
is
pragma Unreferenced (Synchronous);
begin
Trap_Handlers (Vector) := To_Pointer (Service_Routine);
end Install_Trap_Handler;
------------------------
-- Disable_Interrupts --
------------------------
procedure Disable_Interrupts is
begin
Asm ("cpsid i", Volatile => True);
end Disable_Interrupts;
-----------------------
-- Enable_Interrupts --
-----------------------
procedure Enable_Interrupts (Level : Integer) is
begin
-- Set the BASEPRI according to the specified level. PRIMASK is still
-- set, so the change does not take effect until the next Asm.
Set_Current_Priority (Level);
-- The following enables interrupts and will cause any pending
-- interrupts to take effect. The barriers and their placing are
-- essential, otherwise a blocking operation might not cause an
-- immediate context switch, violating mutual exclusion.
Asm ("cpsie i" & NL
& "dsb" & NL
& "isb",
Clobber => "memory", Volatile => True);
end Enable_Interrupts;
end System.BB.CPU_Primitives;
|
msrLi/portingSources | Ada | 1,070 | adb | -- Copyright 2010-2014 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Ada.Text_IO; use Ada.Text_IO;
package body Pack is
procedure Print (I1 : Positive; I2 : Positive) is
type My_String is array (I1 .. I2) of Character;
I : My_String := (others => 'A');
S : String (1 .. I2 + 3) := (others => ' ');
begin
S (I1 .. I2) := String (I); -- BREAK
Put_Line (S);
end Print;
end Pack;
|
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.Chart_Row_Mapping_Attributes is
pragma Preelaborate;
type ODF_Chart_Row_Mapping_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Chart_Row_Mapping_Attribute_Access is
access all ODF_Chart_Row_Mapping_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Chart_Row_Mapping_Attributes;
|
reznikmm/matreshka | Ada | 18,438 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Redefinable_Template_Signatures is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Redefinable_Template_Signature
(AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Redefinable_Template_Signature
(AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Redefinable_Template_Signature
(Visitor,
AMF.UML.Redefinable_Template_Signatures.UML_Redefinable_Template_Signature_Access (Self),
Control);
end if;
end Visit_Element;
--------------------
-- Get_Classifier --
--------------------
overriding function Get_Classifier
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access is
begin
return
AMF.UML.Classifiers.UML_Classifier_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Classifier
(Self.Element)));
end Get_Classifier;
--------------------
-- Set_Classifier --
--------------------
overriding procedure Set_Classifier
(Self : not null access UML_Redefinable_Template_Signature_Proxy;
To : AMF.UML.Classifiers.UML_Classifier_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Classifier
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Classifier;
----------------------------
-- Get_Extended_Signature --
----------------------------
overriding function Get_Extended_Signature
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Redefinable_Template_Signatures.Collections.Set_Of_UML_Redefinable_Template_Signature is
begin
return
AMF.UML.Redefinable_Template_Signatures.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Extended_Signature
(Self.Element)));
end Get_Extended_Signature;
-----------------------------
-- Get_Inherited_Parameter --
-----------------------------
overriding function Get_Inherited_Parameter
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Template_Parameters.Collections.Set_Of_UML_Template_Parameter is
begin
return
AMF.UML.Template_Parameters.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Inherited_Parameter
(Self.Element)));
end Get_Inherited_Parameter;
-----------------
-- Get_Is_Leaf --
-----------------
overriding function Get_Is_Leaf
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Leaf
(Self.Element);
end Get_Is_Leaf;
-----------------
-- Set_Is_Leaf --
-----------------
overriding procedure Set_Is_Leaf
(Self : not null access UML_Redefinable_Template_Signature_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Leaf
(Self.Element, To);
end Set_Is_Leaf;
---------------------------
-- Get_Redefined_Element --
---------------------------
overriding function Get_Redefined_Element
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element is
begin
return
AMF.UML.Redefinable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Element
(Self.Element)));
end Get_Redefined_Element;
------------------------------
-- Get_Redefinition_Context --
------------------------------
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context
(Self.Element)));
end Get_Redefinition_Context;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Redefinable_Template_Signature_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-------------------------
-- Get_Owned_Parameter --
-------------------------
overriding function Get_Owned_Parameter
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Template_Parameters.Collections.Ordered_Set_Of_UML_Template_Parameter is
begin
return
AMF.UML.Template_Parameters.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Parameter
(Self.Element)));
end Get_Owned_Parameter;
-------------------
-- Get_Parameter --
-------------------
overriding function Get_Parameter
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Template_Parameters.Collections.Ordered_Set_Of_UML_Template_Parameter is
begin
return
AMF.UML.Template_Parameters.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Parameter
(Self.Element)));
end Get_Parameter;
------------------
-- Get_Template --
------------------
overriding function Get_Template
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Templateable_Elements.UML_Templateable_Element_Access is
begin
return
AMF.UML.Templateable_Elements.UML_Templateable_Element_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Template
(Self.Element)));
end Get_Template;
------------------
-- Set_Template --
------------------
overriding procedure Set_Template
(Self : not null access UML_Redefinable_Template_Signature_Proxy;
To : AMF.UML.Templateable_Elements.UML_Templateable_Element_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Template
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Template;
-------------------------
-- Inherited_Parameter --
-------------------------
overriding function Inherited_Parameter
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Template_Parameters.Collections.Set_Of_UML_Template_Parameter is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Inherited_Parameter unimplemented");
raise Program_Error with "Unimplemented procedure UML_Redefinable_Template_Signature_Proxy.Inherited_Parameter";
return Inherited_Parameter (Self);
end Inherited_Parameter;
------------------------
-- Is_Consistent_With --
------------------------
overriding function Is_Consistent_With
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Redefinable_Template_Signature_Proxy.Is_Consistent_With";
return Is_Consistent_With (Self, Redefinee);
end Is_Consistent_With;
-----------------------------------
-- Is_Redefinition_Context_Valid --
-----------------------------------
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented");
raise Program_Error with "Unimplemented procedure UML_Redefinable_Template_Signature_Proxy.Is_Redefinition_Context_Valid";
return Is_Redefinition_Context_Valid (Self, Redefined);
end Is_Redefinition_Context_Valid;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Redefinable_Template_Signature_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Redefinable_Template_Signature_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Redefinable_Template_Signature_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Redefinable_Template_Signature_Proxy.Namespace";
return Namespace (Self);
end Namespace;
end AMF.Internals.UML_Redefinable_Template_Signatures;
|
skill-lang/adaCommon | Ada | 7,075 | ads | -- ___ _ ___ _ _ --
-- / __| |/ (_) | | Common SKilL implementation --
-- \__ \ ' <| | | |__ field handling in skill --
-- |___/_|\_\_|_|____| by: Timm Felden --
-- --
pragma Ada_2012;
with Skill.Field_Types;
with Skill.Field_Restrictions;
with Skill.Internal.Parts;
with Skill.Streams.Reader;
with Skill.Streams.Writer;
with Ada.Containers.Doubly_Linked_Lists;
with Skill.Containers.Vectors;
limited with Skill.Types.Pools;
with Skill.Types;
with Ada.Containers.Hashed_Maps;
with Ada.Unchecked_Conversion;
with Ada.Containers.Vectors;
package Skill.Field_Declarations is
-- pragma Preelaborate;
--Data chunk information, as it is required for parsing of field data
type Chunk_Entry_T is record
C : Skill.Internal.Parts.Chunk;
Input : Skill.Streams.Reader.Sub_Stream;
end record;
type Chunk_Entry is access Chunk_Entry_T;
package Chunk_List_P is new Skill.Containers.Vectors (Natural, Chunk_Entry);
type Owner_T is not null access Skill.Types.Pools.Pool_T;
type Field_Declaration_T is abstract tagged record
Data_Chunks : Chunk_List_P.Vector := Chunk_List_P.Empty_Vector;
T : Skill.Field_Types.Field_Type;
Name : Types.String_Access;
Index : Natural;
Owner : Owner_T;
-- runtime restrictions
Restrictions : Field_Restrictions.Vector;
-- used for offset calculation
-- note: ada has no futures, thus we will store the value in the field and
-- synchronize over a barrier
Future_Offset : Types.v64;
end record;
-- can not be not null, because we need to store them in arrays :-/
type Field_Declaration is access all Field_Declaration_T'Class;
function Hash (This : Field_Declaration) return Ada.Containers.Hash_Type;
use type Internal.Parts.Chunk;
package Chunk_Map_P is new Ada.Containers.Hashed_Maps(Key_Type => Field_Declaration,
Element_Type => Internal.Parts.Chunk,
Hash => Hash,
Equivalent_Keys => "=",
"=" => "=");
type Chunk_Map is not null access Chunk_Map_P.Map;
package Field_Vector_P is new Skill.Containers.Vectors
(Positive,
Field_Declaration);
subtype Field_Vector is Field_Vector_P.Vector;
type Lazy_Field_T is new Field_Declaration_T with private;
type Lazy_Field is access Lazy_Field_T'Class;
type Auto_Field_T is abstract new Field_Declaration_T with private;
type Auto_Field is access Auto_Field_T'Class;
procedure Delete_Chunk (This : Chunk_Entry);
function Name
(This : access Field_Declaration_T'Class) return Types.String_Access;
function Owner
(This : access Field_Declaration_T'Class) return Types.Pools.Pool;
-- @return ∀ r ∈ restrictinos, i ∈ owner. r.check(i)
function Check (This : access Field_Declaration_T) return Boolean;
function Check (This : access Lazy_Field_T) return Boolean;
function Check (This : access Auto_Field_T) return Boolean is (True);
procedure Read
(This : access Field_Declaration_T;
CE : Chunk_Entry) is abstract;
procedure Read (This : access Lazy_Field_T; CE : Chunk_Entry);
procedure Read (This : access Auto_Field_T; CE : Chunk_Entry) is null;
-- offset calculation as preparation of writing data belonging to the
-- owners last block
procedure Offset (This : access Field_Declaration_T) is abstract;
procedure Offset (This : access Lazy_Field_T);
procedure Offset (This : access Auto_Field_T) is null;
-- write data into a map at the end of a write/append operation
-- @note this will always write the last chunk, as, in contrast to read, it is impossible to write to fields in
-- parallel
-- @note only called, if there actually is field data to be written
procedure Write
(This : access Field_Declaration_T;
Output : Streams.Writer.Sub_Stream) is abstract;
procedure Write
(This : access Lazy_Field_T;
Output : Streams.Writer.Sub_Stream);
procedure Write
(This : access Auto_Field_T;
Output : Streams.Writer.Sub_Stream) is null;
-- internal use only
function Field_ID (This : access Field_Declaration_T'Class) return Natural;
-- internal use only
procedure Add_Chunk
(This : access Field_Declaration_T'Class;
C : Skill.Internal.Parts.Chunk);
-- internal use only
-- Fix offset and create memory map for field data parsing.
function Add_Offset_To_Last_Chunk
(This : access Field_Declaration_T'Class;
Input : Skill.Streams.Reader.Input_Stream;
File_Offset : Types.v64) return Types.v64;
-- internal use only
function Make_Lazy_Field
(Owner : Owner_T;
ID : Natural;
T : Field_Types.Field_Type;
Name : Skill.Types.String_Access;
Restrictions : Field_Restrictions.Vector) return Lazy_Field;
procedure Ensure_Is_Loaded (This : access Lazy_Field_T);
procedure Free (This : access Field_Declaration_T) is abstract;
procedure Free (This : access Lazy_Field_T);
procedure Free (This : access Auto_Field_T) is null;
private
pragma Warnings (Off);
function Hash is new Ada.Unchecked_Conversion(Internal.Parts.Chunk,
Ada.Containers.Hash_Type);
use type Streams.Reader.Sub_Stream;
package Part_P is new Ada.Containers.Vectors(Natural, Chunk_Entry);
function Hash is new Ada.Unchecked_Conversion(Types.Annotation,
Ada.Containers.Hash_Type);
use type Types.Box;
use type Types.Annotation;
package Data_P is new Ada.Containers.Hashed_Maps(Types.Annotation, Types.Box,
Hash, "=", "=");
type Lazy_Field_T is new Field_Declaration_T with record
-- data held as in storage pools
-- @note see paper notes for O(1) implementation
-- @note in contrast to all other implementations, we deliberately wast
-- time and space, because it is the only implementation that will make it
-- through the compiler without me jumping out of the window trying to
-- find an efficient workaround
Data : Data_P.Map; -- Sparse Array[T]()
-- pending parts that have to be loaded
Parts : Part_P.Vector;
end record;
function Is_Loaded (This : access Lazy_Field_T'Class) return Boolean is
(This.Parts.Is_Empty);
procedure Load (This : access Lazy_Field_T'Class);
type Auto_Field_T is new Field_Declaration_T with record
null;
end record;
type Auto_Field_Array is array (Integer range <>) of Auto_Field;
end Skill.Field_Declarations;
|
charlie5/cBound | Ada | 944 | ads | -- This file is generated by SWIG. Please do *not* modify by hand.
--
with Interfaces.C;
with Interfaces.C;
package gmp_c.a_a_mpf_struct is
-- Item
--
type Item is record
a_mp_prec : aliased Interfaces.C.int;
a_mp_size : aliased Interfaces.C.int;
a_mp_exp : aliased gmp_c.mp_exp_t;
a_mp_d : access gmp_c.mp_limb_t;
end record;
-- Items
--
type Items is
array (Interfaces.C.size_t range <>) of aliased gmp_c.a_a_mpf_struct.Item;
-- Pointer
--
type Pointer is access all gmp_c.a_a_mpf_struct.Item;
-- Pointers
--
type Pointers is
array
(Interfaces.C.size_t range <>) of aliased gmp_c.a_a_mpf_struct.Pointer;
-- Pointer_Pointer
--
type Pointer_Pointer is access all gmp_c.a_a_mpf_struct.Pointer;
function construct return gmp_c.a_a_mpf_struct.Item;
private
pragma Import (C, construct, "Ada_new___mpf_struct");
end gmp_c.a_a_mpf_struct;
|
reznikmm/matreshka | Ada | 3,814 | 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_Legend_Expansion_Aspect_Ratio_Attributes is
pragma Preelaborate;
type ODF_Style_Legend_Expansion_Aspect_Ratio_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Style_Legend_Expansion_Aspect_Ratio_Attribute_Access is
access all ODF_Style_Legend_Expansion_Aspect_Ratio_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Style_Legend_Expansion_Aspect_Ratio_Attributes;
|
reznikmm/matreshka | Ada | 4,614 | 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_Svg.Stroke_Color_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Svg_Stroke_Color_Attribute_Node is
begin
return Self : Svg_Stroke_Color_Attribute_Node do
Matreshka.ODF_Svg.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Svg_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Svg_Stroke_Color_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Stroke_Color_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Svg_URI,
Matreshka.ODF_String_Constants.Stroke_Color_Attribute,
Svg_Stroke_Color_Attribute_Node'Tag);
end Matreshka.ODF_Svg.Stroke_Color_Attributes;
|
Rodeo-McCabe/orka | Ada | 11,805 | adb | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2017 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with Ada.Strings.Unbounded;
with Glfw.Input.Joysticks;
with Orka.Inputs.Joysticks.Default;
with Orka.Inputs.Joysticks.Gamepads;
package body Orka.Inputs.GLFW is
overriding
procedure Set_Cursor_Mode
(Object : in out GLFW_Pointer_Input;
Mode : Pointers.Default.Cursor_Mode)
is
package Mouse renames Standard.Glfw.Input.Mouse;
use all type Pointers.Default.Cursor_Mode;
begin
case Mode is
when Normal =>
Object.Window.Set_Cursor_Mode (Mouse.Normal);
when Hidden =>
Object.Window.Set_Cursor_Mode (Mouse.Hidden);
when Disabled =>
Object.Window.Set_Cursor_Mode (Mouse.Disabled);
end case;
end Set_Cursor_Mode;
procedure Set_Button_State
(Object : in out GLFW_Pointer_Input;
Subject : Standard.Glfw.Input.Mouse.Button;
State : Standard.Glfw.Input.Button_State)
is
use Standard.Glfw.Input;
use all type Inputs.Pointers.Button;
use all type Inputs.Pointers.Button_State;
Pointer_State : constant Pointers.Button_State
:= (case State is
when Pressed => Pressed,
when Released => Released);
begin
case Subject is
when Mouse.Left_Button =>
Object.Set_Button_State (Left, Pointer_State);
when Mouse.Right_Button =>
Object.Set_Button_State (Right, Pointer_State);
when Mouse.Middle_Button =>
Object.Set_Button_State (Middle, Pointer_State);
when others =>
raise Program_Error with "Invalid mouse button";
end case;
end Set_Button_State;
procedure Set_Window
(Object : in out GLFW_Pointer_Input;
Window : Standard.Glfw.Windows.Window_Reference) is
begin
Object.Window := Window;
end Set_Window;
function Create_Pointer_Input return Inputs.Pointers.Pointer_Input_Ptr is
begin
return new GLFW_Pointer_Input'
(Pointers.Default.Abstract_Pointer_Input with others => <>);
end Create_Pointer_Input;
-----------------------------------------------------------------------------
use Inputs.Joysticks;
procedure Copy_Buttons
(From : Standard.Glfw.Input.Joysticks.Joystick_Button_States;
To : out Inputs.Joysticks.Button_States)
is
use all type Standard.Glfw.Input.Joysticks.Joystick_Button_State;
begin
for Index in From'Range loop
To (Index) := (case From (Index) is
when Pressed => Pressed,
when Released => Released);
end loop;
end Copy_Buttons;
procedure Copy_Axes
(From : Standard.Glfw.Input.Joysticks.Axis_Positions;
To : out Inputs.Joysticks.Axis_Positions) is
begin
for Index in From'Range loop
To (Index) := Axis_Position (From (Index));
end loop;
end Copy_Axes;
procedure Copy_Hats
(From : Standard.Glfw.Input.Joysticks.Joystick_Hat_States;
To : out Inputs.Joysticks.Hat_States)
is
use all type Standard.Glfw.Input.Joysticks.Joystick_Hat_State;
begin
for Index in From'Range loop
To (Index) := (case From (Index) is
when Centered => Centered,
when Up => Up,
when Right => Right,
when Right_Up => Right_Up,
when Down => Down,
when Right_Down => Right_Down,
when Left => Left,
when Left_Up => Left_Up,
when Left_Down => Left_Down);
end loop;
end Copy_Hats;
-----------------------------------------------------------------------------
package SU renames Ada.Strings.Unbounded;
type Abstract_GLFW_Joystick_Input is abstract
new Joysticks.Default.Abstract_Joystick_Input with
record
Joystick : Standard.Glfw.Input.Joysticks.Joystick;
Name, GUID : SU.Unbounded_String;
Present : Boolean;
end record;
overriding
function Is_Present (Object : Abstract_GLFW_Joystick_Input) return Boolean is
(Object.Present and then Object.Joystick.Is_Present);
overriding
function Name (Object : Abstract_GLFW_Joystick_Input) return String is
(SU.To_String (Object.Name));
overriding
function GUID (Object : Abstract_GLFW_Joystick_Input) return String is
(SU.To_String (Object.GUID));
-----------------------------------------------------------------------------
type GLFW_Gamepad_Input is new Abstract_GLFW_Joystick_Input with null record;
overriding
function Is_Gamepad (Object : GLFW_Gamepad_Input) return Boolean is (True);
overriding
function State (Object : in out GLFW_Gamepad_Input) return Inputs.Joysticks.Joystick_State is
use type SU.Unbounded_String;
begin
if not Object.Joystick.Is_Present then
Object.Present := False;
raise Disconnected_Error with Object.Joystick.Index'Image & " is not connected";
elsif Object.Joystick.Joystick_GUID = Object.GUID then
Object.Present := True;
end if;
declare
State : constant Standard.Glfw.Input.Joysticks.Joystick_Gamepad_State :=
Object.Joystick.Gamepad_State;
begin
return Result : Joystick_State
(Button_Count => State.Buttons'Length,
Axis_Count => State.Axes'Length,
Hat_Count => 0)
do
Copy_Buttons (State.Buttons, Result.Buttons);
Copy_Axes (State.Axes, Result.Axes);
Inputs.Joysticks.Gamepads.Normalize_Axes (Result.Axes);
end return;
end;
end State;
-----------------------------------------------------------------------------
type GLFW_Joystick_Input is new Abstract_GLFW_Joystick_Input with null record;
overriding
function Is_Gamepad (Object : GLFW_Joystick_Input) return Boolean is (False);
overriding
function State (Object : in out GLFW_Joystick_Input) return Inputs.Joysticks.Joystick_State is
use type SU.Unbounded_String;
begin
if not Object.Joystick.Is_Present then
Object.Present := False;
raise Disconnected_Error with Object.Joystick.Index'Image & " is not connected";
elsif Object.Joystick.Joystick_GUID = Object.GUID then
Object.Present := True;
end if;
declare
Buttons : constant Standard.Glfw.Input.Joysticks.Joystick_Button_States :=
Object.Joystick.Button_States;
Axes : constant Standard.Glfw.Input.Joysticks.Axis_Positions :=
Object.Joystick.Positions;
Hats : constant Standard.Glfw.Input.Joysticks.Joystick_Hat_States :=
Object.Joystick.Hat_States;
begin
return Result : Joystick_State
(Button_Count => Buttons'Length,
Axis_Count => Axes'Length,
Hat_Count => Hats'Length)
do
Copy_Buttons (Buttons, Result.Buttons);
Copy_Axes (Axes, Result.Axes);
Copy_Hats (Hats, Result.Hats);
end return;
end;
end State;
-----------------------------------------------------------------------------
function Create_Joystick_Input
(Index : Standard.Glfw.Input.Joysticks.Joystick_Index)
return Inputs.Joysticks.Joystick_Input_Ptr
is
Joystick : constant Standard.Glfw.Input.Joysticks.Joystick :=
Standard.Glfw.Input.Joysticks.Get_Joystick (Index);
begin
if not Joystick.Is_Present then
raise Disconnected_Error with Index'Image & " is not connected";
end if;
if Joystick.Is_Gamepad then
return new GLFW_Gamepad_Input'
(Joysticks.Default.Abstract_Joystick_Input with Joystick => Joystick,
Present => True,
Name => SU.To_Unbounded_String (Joystick.Gamepad_Name),
GUID => SU.To_Unbounded_String (Joystick.Joystick_GUID));
else
return new GLFW_Joystick_Input'
(Joysticks.Default.Abstract_Joystick_Input with Joystick => Joystick,
Present => True,
Name => SU.To_Unbounded_String (Joystick.Joystick_Name),
GUID => SU.To_Unbounded_String (Joystick.Joystick_GUID));
end if;
end Create_Joystick_Input;
-----------------------------------------------------------------------------
subtype Slot_Index is Standard.Glfw.Input.Joysticks.Joystick_Index range 1 .. 16;
type Boolean_Array is array (Slot_Index) of Boolean;
protected type Joystick_Manager is new Inputs.Joysticks.Joystick_Manager with
procedure Set_Present
(Index : Slot_Index;
Value : Boolean);
procedure Initialize
with Post => Is_Initialized;
function Is_Initialized return Boolean;
overriding
procedure Acquire (Joystick : out Inputs.Joysticks.Joystick_Input_Access);
overriding
procedure Release (Joystick : Inputs.Joysticks.Joystick_Input_Access);
private
Acquired, Present : Boolean_Array := (others => False);
Initialized : Boolean := False;
end Joystick_Manager;
package Joysticks renames Standard.Glfw.Input.Joysticks;
protected body Joystick_Manager is
procedure Set_Present
(Index : Slot_Index;
Value : Boolean) is
begin
Present (Index) := Value;
end Set_Present;
procedure Initialize is
begin
for Index in Present'Range loop
Present (Index) := Joysticks.Get_Joystick (Index).Is_Present;
end loop;
Initialized := True;
end Initialize;
function Is_Initialized return Boolean is (Initialized);
procedure Acquire (Joystick : out Inputs.Joysticks.Joystick_Input_Access) is
begin
for Index in Acquired'Range loop
if not Acquired (Index) and Present (Index) then
Joystick := Create_Joystick_Input (Index);
Acquired (Index) := True;
return;
end if;
end loop;
Joystick := null;
end Acquire;
procedure Release (Joystick : Inputs.Joysticks.Joystick_Input_Access) is
Index : constant Slot_Index :=
Abstract_GLFW_Joystick_Input (Joystick.all).Joystick.Index;
begin
if not Acquired (Index) then
raise Program_Error;
end if;
Acquired (Index) := False;
end Release;
end Joystick_Manager;
Default_Manager : aliased Joystick_Manager;
procedure On_Connected
(Source : Joysticks.Joystick;
State : Joysticks.Connect_State)
is
use type Joysticks.Connect_State;
begin
Default_Manager.Set_Present (Source.Index, State = Joysticks.Connected);
end On_Connected;
function Create_Joystick_Manager return Inputs.Joysticks.Joystick_Manager_Ptr is
begin
if not Default_Manager.Is_Initialized then
Default_Manager.Initialize;
Joysticks.Set_Callback (On_Connected'Access);
end if;
return Default_Manager'Access;
end Create_Joystick_Manager;
end Orka.Inputs.GLFW;
|
zhmu/ananas | Ada | 47,193 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T N A M E --
-- --
-- B o d y --
-- --
-- Copyright (C) 2001-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 Ada.Characters.Handling; use Ada.Characters.Handling;
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Command_Line; use GNAT.Command_Line;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.Dynamic_Tables;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with Make_Util; use Make_Util;
with Namet; use Namet;
with Opt;
with Osint; use Osint;
with Output;
with Switch; use Switch;
with Table;
with Tempdir;
with Types; use Types;
with System.CRTL;
with System.Regexp; use System.Regexp;
procedure Gnatname is
pragma Warnings (Off);
type Matched_Type is (True, False, Excluded);
pragma Warnings (On);
Create_Project : Boolean := False;
Subdirs_Switch : constant String := "--subdirs=";
Usage_Output : Boolean := False;
-- Set to True when usage is output, to avoid multiple output
Usage_Needed : Boolean := False;
-- Set to True by -h switch
Version_Output : Boolean := False;
-- Set to True when version is output, to avoid multiple output
Very_Verbose : Boolean := False;
-- Set to True with -v -v
File_Path : String_Access := new String'("gnat.adc");
-- Path name of the file specified by -c or -P switch
File_Set : Boolean := False;
-- Set to True by -c or -P switch.
-- Used to detect multiple -c/-P switches.
Args : Argument_List_Access;
-- The list of arguments for calls to the compiler to get the unit names
-- and kinds (spec or body) in the Ada sources.
Path_Name : String_Access;
Path_Last : Natural;
Directory_Last : Natural := 0;
function Dup (Fd : File_Descriptor) return File_Descriptor;
procedure Dup2 (Old_Fd, New_Fd : File_Descriptor);
Gcc : constant String := "gcc";
Gcc_Path : String_Access := null;
package Patterns is new GNAT.Dynamic_Tables
(Table_Component_Type => String_Access,
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
Table_Increment => 100);
-- Table to accumulate the patterns
type Argument_Data is record
Directories : Patterns.Instance;
Name_Patterns : Patterns.Instance;
Excluded_Patterns : Patterns.Instance;
Foreign_Patterns : Patterns.Instance;
end record;
package Arguments is new Table.Table
(Table_Component_Type => Argument_Data,
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
Table_Increment => 100,
Table_Name => "Gnatname.Arguments");
-- Table to accumulate directories and patterns
package Preprocessor_Switches is new Table.Table
(Table_Component_Type => String_Access,
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
Table_Increment => 100,
Table_Name => "Gnatname.Preprocessor_Switches");
-- Table to store the preprocessor switches to be used in the call
-- to the compiler.
type Source is record
File_Name : Name_Id;
Unit_Name : Name_Id;
Index : Int := 0;
Spec : Boolean;
end record;
package Processed_Directories is new Table.Table
(Table_Component_Type => String_Access,
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
Table_Increment => 100,
Table_Name => "Prj.Makr.Processed_Directories");
-- The list of already processed directories for each section, to avoid
-- processing several times the same directory in the same section.
package Sources is new Table.Table
(Table_Component_Type => Source,
Table_Index_Type => Natural,
Table_Low_Bound => 0,
Table_Initial => 10,
Table_Increment => 100,
Table_Name => "Gnatname.Sources");
-- The list of Ada sources found, with their unit name and kind, to be put
-- in the pragmas Source_File_Name in the configuration pragmas file.
procedure Output_Version;
-- Print name and version
procedure Usage;
-- Print usage
procedure Scan_Args;
-- Scan the command line arguments
procedure Add_Source_Directory (S : String);
-- Add S in the Source_Directories table
procedure Get_Directories (From_File : String);
-- Read a source directory text file
procedure Write_Eol;
-- Output an empty line
procedure Write_A_String (S : String);
-- Write a String to Output_FD
procedure Initialize
(File_Path : String;
Preproc_Switches : Argument_List);
-- Start the creation of a configuration pragmas file
--
-- File_Path is the name of the configuration pragmas file to create
--
-- Preproc_Switches is a list of switches to be used when invoking the
-- compiler to get the name and kind of unit of a source file.
type Regexp_List is array (Positive range <>) of Regexp;
procedure Process
(Directories : Argument_List;
Name_Patterns : Regexp_List;
Excluded_Patterns : Regexp_List;
Foreign_Patterns : Regexp_List);
-- Look for source files in the specified directories, with the specified
-- patterns.
--
-- Directories is the list of source directories where to look for sources.
--
-- Name_Patterns is a potentially empty list of file name patterns to check
-- for Ada Sources.
--
-- Excluded_Patterns is a potentially empty list of file name patterns that
-- should not be checked for Ada or non Ada sources.
--
-- Foreign_Patterns is a potentially empty list of file name patterns to
-- check for non Ada sources.
--
-- At least one of Name_Patterns and Foreign_Patterns is not empty
procedure Finalize;
-- Write the configuration pragmas file indicated in a call to procedure
-- Initialize, after one or several calls to procedure Process.
--------------------------
-- Add_Source_Directory --
--------------------------
procedure Add_Source_Directory (S : String) is
begin
Patterns.Append
(Arguments.Table (Arguments.Last).Directories, new String'(S));
end Add_Source_Directory;
---------
-- Dup --
---------
function Dup (Fd : File_Descriptor) return File_Descriptor is
begin
return File_Descriptor (System.CRTL.dup (Integer (Fd)));
end Dup;
----------
-- Dup2 --
----------
procedure Dup2 (Old_Fd, New_Fd : File_Descriptor) is
Fd : Integer;
pragma Warnings (Off, Fd);
begin
Fd := System.CRTL.dup2 (Integer (Old_Fd), Integer (New_Fd));
end Dup2;
---------------------
-- Get_Directories --
---------------------
procedure Get_Directories (From_File : String) is
File : Ada.Text_IO.File_Type;
Line : String (1 .. 2_000);
Last : Natural;
begin
Open (File, In_File, From_File);
while not End_Of_File (File) loop
Get_Line (File, Line, Last);
if Last /= 0 then
Add_Source_Directory (Line (1 .. Last));
end if;
end loop;
Close (File);
exception
when Name_Error =>
Fail ("cannot open source directory file """ & From_File & '"');
end Get_Directories;
--------------
-- Finalize --
--------------
procedure Finalize is
Discard : Boolean;
pragma Warnings (Off, Discard);
begin
-- Delete the file if it already exists
Delete_File
(Path_Name (Directory_Last + 1 .. Path_Last),
Success => Discard);
-- Create a new one
if Opt.Verbose_Mode then
Output.Write_Str ("Creating new file """);
Output.Write_Str (Path_Name (Directory_Last + 1 .. Path_Last));
Output.Write_Line ("""");
end if;
Output_FD := Create_New_File
(Path_Name (Directory_Last + 1 .. Path_Last),
Fmode => Text);
-- Fails if file cannot be created
if Output_FD = Invalid_FD then
Fail_Program
("cannot create new """ & Path_Name (1 .. Path_Last) & """");
end if;
-- For each Ada source, write a pragma Source_File_Name to the
-- configuration pragmas file.
for Index in 1 .. Sources.Last loop
if Sources.Table (Index).Unit_Name /= No_Name then
Write_A_String ("pragma Source_File_Name");
Write_Eol;
Write_A_String (" (");
Write_A_String
(Get_Name_String (Sources.Table (Index).Unit_Name));
Write_A_String (",");
Write_Eol;
if Sources.Table (Index).Spec then
Write_A_String (" Spec_File_Name => """);
else
Write_A_String (" Body_File_Name => """);
end if;
Write_A_String
(Get_Name_String (Sources.Table (Index).File_Name));
Write_A_String ("""");
if Sources.Table (Index).Index /= 0 then
Write_A_String (", Index =>");
Write_A_String (Sources.Table (Index).Index'Img);
end if;
Write_A_String (");");
Write_Eol;
end if;
end loop;
Close (Output_FD);
end Finalize;
----------------
-- Initialize --
----------------
procedure Initialize
(File_Path : String;
Preproc_Switches : Argument_List)
is
begin
Sources.Set_Last (0);
-- Initialize the compiler switches
Args := new Argument_List (1 .. Preproc_Switches'Length + 6);
Args (1) := new String'("-c");
Args (2) := new String'("-gnats");
Args (3) := new String'("-gnatu");
Args (4 .. 3 + Preproc_Switches'Length) := Preproc_Switches;
Args (4 + Preproc_Switches'Length) := new String'("-x");
Args (5 + Preproc_Switches'Length) := new String'("ada");
-- Get the path and file names
Path_Name := new
String (1 .. File_Path'Length);
Path_Last := File_Path'Length;
if File_Names_Case_Sensitive then
Path_Name (1 .. Path_Last) := File_Path;
else
Path_Name (1 .. Path_Last) := To_Lower (File_Path);
end if;
-- Get the end of directory information, if any
for Index in reverse 1 .. Path_Last loop
if Path_Name (Index) = Directory_Separator then
Directory_Last := Index;
exit;
end if;
end loop;
-- Change the current directory to the directory of the project file,
-- if any directory information is specified.
if Directory_Last /= 0 then
begin
Change_Dir (Path_Name (1 .. Directory_Last));
exception
when Directory_Error =>
Fail_Program
("unknown directory """
& Path_Name (1 .. Directory_Last)
& """");
end;
end if;
end Initialize;
-------------
-- Process --
-------------
procedure Process
(Directories : Argument_List;
Name_Patterns : Regexp_List;
Excluded_Patterns : Regexp_List;
Foreign_Patterns : Regexp_List)
is
procedure Process_Directory (Dir_Name : String);
-- Look for Ada and foreign sources in a directory, according to the
-- patterns.
-----------------------
-- Process_Directory --
-----------------------
procedure Process_Directory (Dir_Name : String) is
Matched : Matched_Type := False;
Str : String (1 .. 2_000);
Canon : String (1 .. 2_000);
Last : Natural;
Dir : Dir_Type;
Do_Process : Boolean := True;
Temp_File_Name : String_Access := null;
Save_Last_Source_Index : Natural := 0;
File_Name_Id : Name_Id := No_Name;
Current_Source : Source;
begin
-- Avoid processing the same directory more than once
for Index in 1 .. Processed_Directories.Last loop
if Processed_Directories.Table (Index).all = Dir_Name then
Do_Process := False;
exit;
end if;
end loop;
if Do_Process then
if Opt.Verbose_Mode then
Output.Write_Str ("Processing directory """);
Output.Write_Str (Dir_Name);
Output.Write_Line ("""");
end if;
Processed_Directories. Increment_Last;
Processed_Directories.Table (Processed_Directories.Last) :=
new String'(Dir_Name);
-- Get the source file names from the directory. Fails if the
-- directory does not exist.
begin
Open (Dir, Dir_Name);
exception
when Directory_Error =>
Fail_Program ("cannot open directory """ & Dir_Name & """");
end;
-- Process each regular file in the directory
File_Loop : loop
Read (Dir, Str, Last);
exit File_Loop when Last = 0;
-- Copy the file name and put it in canonical case to match
-- against the patterns that have themselves already been put
-- in canonical case.
Canon (1 .. Last) := Str (1 .. Last);
Canonical_Case_File_Name (Canon (1 .. Last));
if Is_Regular_File
(Dir_Name & Directory_Separator & Str (1 .. Last))
then
Matched := True;
Name_Len := Last;
Name_Buffer (1 .. Name_Len) := Str (1 .. Last);
File_Name_Id := Name_Find;
-- First, check if the file name matches at least one of
-- the excluded expressions;
for Index in Excluded_Patterns'Range loop
if
Match (Canon (1 .. Last), Excluded_Patterns (Index))
then
Matched := Excluded;
exit;
end if;
end loop;
-- If it does not match any of the excluded expressions,
-- check if the file name matches at least one of the
-- regular expressions.
if Matched = True then
Matched := False;
for Index in Name_Patterns'Range loop
if
Match
(Canon (1 .. Last), Name_Patterns (Index))
then
Matched := True;
exit;
end if;
end loop;
end if;
if Very_Verbose
or else (Matched = True and then Opt.Verbose_Mode)
then
Output.Write_Str (" Checking """);
Output.Write_Str (Str (1 .. Last));
Output.Write_Line (""": ");
end if;
-- If the file name matches one of the regular expressions,
-- parse it to get its unit name.
if Matched = True then
declare
FD : File_Descriptor;
Success : Boolean;
Saved_Output : File_Descriptor;
Saved_Error : File_Descriptor;
Tmp_File : Path_Name_Type;
begin
-- If we don't have the path of the compiler yet,
-- get it now. The compiler name may have a prefix,
-- so we get the potentially prefixed name.
if Gcc_Path = null then
declare
Prefix_Gcc : String_Access :=
Program_Name (Gcc, "gnatname");
begin
Gcc_Path :=
Locate_Exec_On_Path (Prefix_Gcc.all);
Free (Prefix_Gcc);
end;
if Gcc_Path = null then
Fail_Program ("could not locate " & Gcc);
end if;
end if;
-- Create the temporary file
Tempdir.Create_Temp_File (FD, Tmp_File);
if FD = Invalid_FD then
Fail_Program
("could not create temporary file");
else
Temp_File_Name :=
new String'(Get_Name_String (Tmp_File));
end if;
Args (Args'Last) :=
new String'
(Dir_Name & Directory_Separator & Str (1 .. Last));
-- Save the standard output and error
Saved_Output := Dup (Standout);
Saved_Error := Dup (Standerr);
-- Set standard output and error to the temporary file
Dup2 (FD, Standout);
Dup2 (FD, Standerr);
-- And spawn the compiler
Spawn (Gcc_Path.all, Args.all, Success);
-- Restore the standard output and error
Dup2 (Saved_Output, Standout);
Dup2 (Saved_Error, Standerr);
-- Close the temporary file
Close (FD);
-- And close the saved standard output and error to
-- avoid too many file descriptors.
Close (Saved_Output);
Close (Saved_Error);
-- Now that standard output is restored, check if
-- the compiler ran correctly.
-- Read the lines of the temporary file:
-- they should contain the kind and name of the unit.
declare
File : Ada.Text_IO.File_Type;
Text_Line : String (1 .. 1_000);
Text_Last : Natural;
begin
begin
Open (File, In_File, Temp_File_Name.all);
exception
when others =>
Fail_Program
("could not read temporary file " &
Temp_File_Name.all);
end;
Save_Last_Source_Index := Sources.Last;
if End_Of_File (File) then
if Opt.Verbose_Mode then
if not Success then
Output.Write_Str (" (process died) ");
end if;
end if;
else
Line_Loop : while not End_Of_File (File) loop
Get_Line (File, Text_Line, Text_Last);
-- Find the first closing parenthesis
Char_Loop : for J in 1 .. Text_Last loop
if Text_Line (J) = ')' then
if J >= 13 and then
Text_Line (1 .. 4) = "Unit"
then
-- Add entry to Sources table
Name_Len := J - 12;
Name_Buffer (1 .. Name_Len) :=
Text_Line (6 .. J - 7);
Current_Source :=
(Unit_Name => Name_Find,
File_Name => File_Name_Id,
Index => 0,
Spec => Text_Line (J - 5 .. J) =
"(spec)");
Sources.Append (Current_Source);
end if;
exit Char_Loop;
end if;
end loop Char_Loop;
end loop Line_Loop;
end if;
if Save_Last_Source_Index = Sources.Last then
if Opt.Verbose_Mode then
Output.Write_Line (" not a unit");
end if;
else
if Sources.Last >
Save_Last_Source_Index + 1
then
for Index in Save_Last_Source_Index + 1 ..
Sources.Last
loop
Sources.Table (Index).Index :=
Int (Index - Save_Last_Source_Index);
end loop;
end if;
for Index in Save_Last_Source_Index + 1 ..
Sources.Last
loop
Current_Source := Sources.Table (Index);
pragma Annotate
(CodePeer, Modified, Current_Source);
if Opt.Verbose_Mode then
if Current_Source.Spec then
Output.Write_Str (" spec of ");
else
Output.Write_Str (" body of ");
end if;
Output.Write_Line
(Get_Name_String
(Current_Source.Unit_Name));
end if;
end loop;
end if;
Close (File);
Delete_File (Temp_File_Name.all, Success);
end;
end;
-- File name matches none of the regular expressions
else
-- If file is not excluded, see if this is foreign source
if Matched /= Excluded then
for Index in Foreign_Patterns'Range loop
if Match (Canon (1 .. Last),
Foreign_Patterns (Index))
then
Matched := True;
exit;
end if;
end loop;
end if;
if Very_Verbose then
case Matched is
when False =>
Output.Write_Line ("no match");
when Excluded =>
Output.Write_Line ("excluded");
when True =>
Output.Write_Line ("foreign source");
end case;
end if;
if Matched = True then
-- Add source file name without unit name
Name_Len := 0;
Add_Str_To_Name_Buffer (Canon (1 .. Last));
Sources.Append
((File_Name => Name_Find,
Unit_Name => No_Name,
Index => 0,
Spec => False));
end if;
end if;
end if;
end loop File_Loop;
Close (Dir);
end if;
end Process_Directory;
-- Start of processing for Process
begin
Processed_Directories.Set_Last (0);
-- Process each directory
for Index in Directories'Range loop
Process_Directory (Directories (Index).all);
end loop;
end Process;
--------------------
-- Output_Version --
--------------------
procedure Output_Version is
begin
if not Version_Output then
Version_Output := True;
Output.Write_Eol;
Display_Version ("GNATNAME", "2001");
end if;
end Output_Version;
---------------
-- Scan_Args --
---------------
procedure Scan_Args is
procedure Check_Version_And_Help is new Check_Version_And_Help_G (Usage);
Project_File_Name_Expected : Boolean;
Pragmas_File_Expected : Boolean;
Directory_Expected : Boolean;
Dir_File_Name_Expected : Boolean;
Foreign_Pattern_Expected : Boolean;
Excluded_Pattern_Expected : Boolean;
procedure Check_Regular_Expression (S : String);
-- Compile string S into a Regexp, fail if any error
-----------------------------
-- Check_Regular_Expression--
-----------------------------
procedure Check_Regular_Expression (S : String) is
Dummy : Regexp;
pragma Warnings (Off, Dummy);
begin
Dummy := Compile (S, Glob => True);
exception
when Error_In_Regexp =>
Fail ("invalid regular expression """ & S & """");
end Check_Regular_Expression;
-- Start of processing for Scan_Args
begin
-- First check for --version or --help
Check_Version_And_Help ("GNATNAME", "2001");
-- Now scan the other switches
Project_File_Name_Expected := False;
Pragmas_File_Expected := False;
Directory_Expected := False;
Dir_File_Name_Expected := False;
Foreign_Pattern_Expected := False;
Excluded_Pattern_Expected := False;
for Next_Arg in 1 .. Argument_Count loop
declare
Next_Argv : constant String := Argument (Next_Arg);
Arg : String (1 .. Next_Argv'Length) := Next_Argv;
begin
if Arg'Length > 0 then
-- -P xxx
if Project_File_Name_Expected then
if Arg (1) = '-' then
Fail ("project file name missing");
else
File_Set := True;
File_Path := new String'(Arg);
Project_File_Name_Expected := False;
end if;
-- -c file
elsif Pragmas_File_Expected then
File_Set := True;
File_Path := new String'(Arg);
Pragmas_File_Expected := False;
-- -d xxx
elsif Directory_Expected then
Add_Source_Directory (Arg);
Directory_Expected := False;
-- -D xxx
elsif Dir_File_Name_Expected then
Get_Directories (Arg);
Dir_File_Name_Expected := False;
-- -f xxx
elsif Foreign_Pattern_Expected then
Patterns.Append
(Arguments.Table (Arguments.Last).Foreign_Patterns,
new String'(Arg));
Check_Regular_Expression (Arg);
Foreign_Pattern_Expected := False;
-- -x xxx
elsif Excluded_Pattern_Expected then
Patterns.Append
(Arguments.Table (Arguments.Last).Excluded_Patterns,
new String'(Arg));
Check_Regular_Expression (Arg);
Excluded_Pattern_Expected := False;
-- There must be at least one Ada pattern or one foreign
-- pattern for the previous section.
-- --and
elsif Arg = "--and" then
if Patterns.Last
(Arguments.Table (Arguments.Last).Name_Patterns) = 0
and then
Patterns.Last
(Arguments.Table (Arguments.Last).Foreign_Patterns) = 0
then
Try_Help;
return;
end if;
-- If no directory were specified for the previous section,
-- then the directory is the project directory.
if Patterns.Last
(Arguments.Table (Arguments.Last).Directories) = 0
then
Patterns.Append
(Arguments.Table (Arguments.Last).Directories,
new String'("."));
end if;
-- Add and initialize another component to Arguments table
declare
New_Arguments : Argument_Data;
pragma Warnings (Off, New_Arguments);
-- Declaring this defaulted initialized object ensures
-- that the new allocated component of table Arguments
-- is correctly initialized.
-- This is VERY ugly, Table should never be used with
-- data requiring default initialization. We should
-- find a way to avoid violating this rule ???
begin
Arguments.Append (New_Arguments);
end;
Patterns.Init
(Arguments.Table (Arguments.Last).Directories);
Patterns.Set_Last
(Arguments.Table (Arguments.Last).Directories, 0);
Patterns.Init
(Arguments.Table (Arguments.Last).Name_Patterns);
Patterns.Set_Last
(Arguments.Table (Arguments.Last).Name_Patterns, 0);
Patterns.Init
(Arguments.Table (Arguments.Last).Excluded_Patterns);
Patterns.Set_Last
(Arguments.Table (Arguments.Last).Excluded_Patterns, 0);
Patterns.Init
(Arguments.Table (Arguments.Last).Foreign_Patterns);
Patterns.Set_Last
(Arguments.Table (Arguments.Last).Foreign_Patterns, 0);
-- Subdirectory switch
elsif Arg'Length > Subdirs_Switch'Length
and then Arg (1 .. Subdirs_Switch'Length) = Subdirs_Switch
then
null;
-- Subdirs are only used in gprname
-- --no-backup
elsif Arg = "--no-backup" then
Opt.No_Backup := True;
-- -c
elsif Arg'Length >= 2 and then Arg (1 .. 2) = "-c" then
if File_Set then
Fail ("only one -P or -c switch may be specified");
end if;
if Arg'Length = 2 then
Pragmas_File_Expected := True;
if Next_Arg = Argument_Count then
Fail ("configuration pragmas file name missing");
end if;
else
File_Set := True;
File_Path := new String'(Arg (3 .. Arg'Last));
end if;
-- -d
elsif Arg'Length >= 2 and then Arg (1 .. 2) = "-d" then
if Arg'Length = 2 then
Directory_Expected := True;
if Next_Arg = Argument_Count then
Fail ("directory name missing");
end if;
else
Add_Source_Directory (Arg (3 .. Arg'Last));
end if;
-- -D
elsif Arg'Length >= 2 and then Arg (1 .. 2) = "-D" then
if Arg'Length = 2 then
Dir_File_Name_Expected := True;
if Next_Arg = Argument_Count then
Fail ("directory list file name missing");
end if;
else
Get_Directories (Arg (3 .. Arg'Last));
end if;
-- -eL
elsif Arg = "-eL" then
Opt.Follow_Links_For_Files := True;
Opt.Follow_Links_For_Dirs := True;
-- -f
elsif Arg'Length >= 2 and then Arg (1 .. 2) = "-f" then
if Arg'Length = 2 then
Foreign_Pattern_Expected := True;
if Next_Arg = Argument_Count then
Fail ("foreign pattern missing");
end if;
else
Patterns.Append
(Arguments.Table (Arguments.Last).Foreign_Patterns,
new String'(Arg (3 .. Arg'Last)));
Check_Regular_Expression (Arg (3 .. Arg'Last));
end if;
-- -gnatep or -gnateD
elsif Arg'Length > 7 and then
(Arg (1 .. 7) = "-gnatep" or else Arg (1 .. 7) = "-gnateD")
then
Preprocessor_Switches.Append (new String'(Arg));
-- -h
elsif Arg = "-h" then
Usage_Needed := True;
-- -P
elsif Arg'Length >= 2 and then Arg (1 .. 2) = "-P" then
if File_Set then
Fail ("only one -c or -P switch may be specified");
end if;
if Arg'Length = 2 then
if Next_Arg = Argument_Count then
Fail ("project file name missing");
else
Project_File_Name_Expected := True;
end if;
else
File_Set := True;
File_Path := new String'(Arg (3 .. Arg'Last));
end if;
Create_Project := True;
-- -v
elsif Arg = "-v" then
if Opt.Verbose_Mode then
Very_Verbose := True;
else
Opt.Verbose_Mode := True;
end if;
-- -x
elsif Arg'Length >= 2 and then Arg (1 .. 2) = "-x" then
if Arg'Length = 2 then
Excluded_Pattern_Expected := True;
if Next_Arg = Argument_Count then
Fail ("excluded pattern missing");
end if;
else
Patterns.Append
(Arguments.Table (Arguments.Last).Excluded_Patterns,
new String'(Arg (3 .. Arg'Last)));
Check_Regular_Expression (Arg (3 .. Arg'Last));
end if;
-- Junk switch starting with minus
elsif Arg (1) = '-' then
Fail ("wrong switch: " & Arg);
-- Not a recognized switch, assume file name
else
Canonical_Case_File_Name (Arg);
Patterns.Append
(Arguments.Table (Arguments.Last).Name_Patterns,
new String'(Arg));
Check_Regular_Expression (Arg);
end if;
end if;
end;
end loop;
end Scan_Args;
-----------
-- Usage --
-----------
procedure Usage is
begin
if not Usage_Output then
Usage_Needed := False;
Usage_Output := True;
Output.Write_Str ("Usage: ");
Osint.Write_Program_Name;
Output.Write_Line (" [switches] naming-pattern [naming-patterns]");
Output.Write_Line
(" {--and [switches] naming-pattern [naming-patterns]}");
Output.Write_Eol;
Output.Write_Line ("switches:");
Display_Usage_Version_And_Help;
Output.Write_Line
(" --subdirs=dir real obj/lib/exec dirs are subdirs");
Output.Write_Line
(" --no-backup do not create backup of project file");
Output.Write_Eol;
Output.Write_Line (" --and use different patterns");
Output.Write_Eol;
Output.Write_Line
(" -cfile create configuration pragmas file");
Output.Write_Line (" -ddir use dir as one of the source " &
"directories");
Output.Write_Line (" -Dfile get source directories from file");
Output.Write_Line
(" -eL follow symbolic links when processing " &
"project files");
Output.Write_Line (" -fpat foreign pattern");
Output.Write_Line
(" -gnateDsym=v preprocess with symbol definition");
Output.Write_Line (" -gnatep=data preprocess files with data file");
Output.Write_Line (" -h output this help message");
Output.Write_Line
(" -Pproj update or create project file proj");
Output.Write_Line (" -v verbose output");
Output.Write_Line (" -v -v very verbose output");
Output.Write_Line (" -xpat exclude pattern pat");
end if;
end Usage;
---------------
-- Write_Eol --
---------------
procedure Write_Eol is
begin
Write_A_String ((1 => ASCII.LF));
end Write_Eol;
--------------------
-- Write_A_String --
--------------------
procedure Write_A_String (S : String) is
Str : String (1 .. S'Length);
begin
if S'Length > 0 then
Str := S;
if Write (Output_FD, Str (1)'Address, Str'Length) /= Str'Length then
Fail_Program ("disk full");
end if;
end if;
end Write_A_String;
-- Start of processing for Gnatname
begin
-- Add the directory where gnatname is invoked in front of the
-- path, if gnatname is invoked with directory information.
declare
Command : constant String := Command_Name;
begin
for Index in reverse Command'Range loop
if Command (Index) = Directory_Separator then
declare
Absolute_Dir : constant String :=
Normalize_Pathname
(Command (Command'First .. Index));
PATH : constant String :=
Absolute_Dir &
Path_Separator &
Getenv ("PATH").all;
begin
Setenv ("PATH", PATH);
end;
exit;
end if;
end loop;
end;
-- Initialize tables
Arguments.Set_Last (0);
declare
New_Arguments : Argument_Data;
pragma Warnings (Off, New_Arguments);
-- Declaring this defaulted initialized object ensures that the new
-- allocated component of table Arguments is correctly initialized.
begin
Arguments.Append (New_Arguments);
end;
Patterns.Init (Arguments.Table (1).Directories);
Patterns.Set_Last (Arguments.Table (1).Directories, 0);
Patterns.Init (Arguments.Table (1).Name_Patterns);
Patterns.Set_Last (Arguments.Table (1).Name_Patterns, 0);
Patterns.Init (Arguments.Table (1).Excluded_Patterns);
Patterns.Set_Last (Arguments.Table (1).Excluded_Patterns, 0);
Patterns.Init (Arguments.Table (1).Foreign_Patterns);
Patterns.Set_Last (Arguments.Table (1).Foreign_Patterns, 0);
Preprocessor_Switches.Set_Last (0);
-- Get the arguments
Scan_Args;
if Create_Project then
declare
Gprname_Path : constant String_Access :=
Locate_Exec_On_Path ("gprname");
Arg_Len : Natural := Argument_Count;
Pos : Natural := 0;
Target : String_Access := null;
Success : Boolean := False;
begin
if Gprname_Path = null then
Fail_Program
("project files are no longer supported by gnatname;" &
" use gprname instead");
end if;
Find_Program_Name;
if Name_Len > 9
and then Name_Buffer (Name_Len - 7 .. Name_Len) = "gnatname"
then
Target := new String'(Name_Buffer (1 .. Name_Len - 9));
Arg_Len := Arg_Len + 1;
end if;
declare
Args : Argument_List (1 .. Arg_Len);
begin
if Target /= null then
Args (1) := new String'("--target=" & Target.all);
Pos := 1;
end if;
for J in 1 .. Argument_Count loop
Pos := Pos + 1;
Args (Pos) := new String'(Argument (J));
end loop;
Spawn (Gprname_Path.all, Args, Success);
if Success then
Exit_Program (E_Success);
else
Exit_Program (E_Errors);
end if;
end;
end;
end if;
if Opt.Verbose_Mode then
Output_Version;
end if;
if Usage_Needed then
Usage;
end if;
-- If no Ada or foreign pattern was specified, print the usage and return
if Patterns.Last (Arguments.Table (Arguments.Last).Name_Patterns) = 0
and then
Patterns.Last (Arguments.Table (Arguments.Last).Foreign_Patterns) = 0
then
if Argument_Count = 0 then
Usage;
elsif not Usage_Output then
Try_Help;
end if;
return;
end if;
-- If no source directory was specified, use the current directory as the
-- unique directory. Note that if a file was specified with directory
-- information, the current directory is the directory of the specified
-- file.
if Patterns.Last (Arguments.Table (Arguments.Last).Directories) = 0 then
Patterns.Append
(Arguments.Table (Arguments.Last).Directories, new String'("."));
end if;
-- Initialize
declare
Prep_Switches : Argument_List
(1 .. Integer (Preprocessor_Switches.Last));
begin
for Index in Prep_Switches'Range loop
Prep_Switches (Index) := Preprocessor_Switches.Table (Index);
end loop;
Initialize
(File_Path => File_Path.all,
Preproc_Switches => Prep_Switches);
end;
-- Process each section successively
for J in 1 .. Arguments.Last loop
declare
Directories : Argument_List
(1 .. Integer
(Patterns.Last (Arguments.Table (J).Directories)));
Name_Patterns : Regexp_List
(1 .. Integer
(Patterns.Last (Arguments.Table (J).Name_Patterns)));
Excl_Patterns : Regexp_List
(1 .. Integer
(Patterns.Last (Arguments.Table (J).Excluded_Patterns)));
Frgn_Patterns : Regexp_List
(1 .. Integer
(Patterns.Last (Arguments.Table (J).Foreign_Patterns)));
begin
-- Build the Directories and Patterns arguments
for Index in Directories'Range loop
Directories (Index) :=
Arguments.Table (J).Directories.Table (Index);
end loop;
for Index in Name_Patterns'Range loop
Name_Patterns (Index) :=
Compile
(Arguments.Table (J).Name_Patterns.Table (Index).all,
Glob => True);
end loop;
for Index in Excl_Patterns'Range loop
Excl_Patterns (Index) :=
Compile
(Arguments.Table (J).Excluded_Patterns.Table (Index).all,
Glob => True);
end loop;
for Index in Frgn_Patterns'Range loop
Frgn_Patterns (Index) :=
Compile
(Arguments.Table (J).Foreign_Patterns.Table (Index).all,
Glob => True);
end loop;
-- Call Prj.Makr.Process where the real work is done
Process
(Directories => Directories,
Name_Patterns => Name_Patterns,
Excluded_Patterns => Excl_Patterns,
Foreign_Patterns => Frgn_Patterns);
end;
end loop;
-- Finalize
Finalize;
if Opt.Verbose_Mode then
Output.Write_Eol;
end if;
end Gnatname;
|
zrmyers/VulkanAda | Ada | 10,712 | ads | --------------------------------------------------------------------------------
-- MIT License
--
-- Copyright (c) 2020 Zane Myers
--
-- 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 Vulkan.Math.GenDType;
with Vulkan.Math.Dvec3;
with Vulkan.Math.Dvec2;
use Vulkan.Math.GenDType;
use Vulkan.Math.Dvec3;
use Vulkan.Math.Dvec2;
--------------------------------------------------------------------------------
--< @group Vulkan Math Basic Types
--------------------------------------------------------------------------------
--< @summary
--< This package defines a double precision floating point vector type with 4
--< components.
--------------------------------------------------------------------------------
package Vulkan.Math.Dvec4 is
pragma Preelaborate;
pragma Pure;
--< A 4 component vector of double-precision floating point values.
subtype Vkm_Dvec4 is Vkm_GenDType(Last_Index => 3);
----------------------------------------------------------------------------
-- Ada does not have the concept of constructors in the sense that they exist
-- in C++. For this reason, we will instead define multiple methods for
-- instantiating a Dvec4 here.
----------------------------------------------------------------------------
-- The following are explicit constructors for Dvec4:
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Dvec4 type.
--<
--< @description
--< Produce a default vector with all components set to 0.0.
--<
--< @return
--< A Dvec4 with all components set to 0.0.
----------------------------------------------------------------------------
function Make_Dvec4 return Vkm_Dvec4 is
(GDT.Make_GenType(Last_Index => 3, value => 0.0)) with Inline;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Dvec4 type.
--<
--< @description
--< Produce a vector with all components set to the same value.
--<
--< @param scalar_value
--< The value to set all components to.
--<
--< @return
--< A Dvec4 with all components set to scalar_value.
----------------------------------------------------------------------------
function Make_Dvec4 (scalar_value : in Vkm_Double) return Vkm_Dvec4 is
(GDT.Make_GenType(Last_Index => 3, value => scalar_value)) with Inline;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Dvec4 type.
--<
--< @description
--< Produce a vector by copying components from an existing vector.
--<
--< @param dvec4_value
--< The Dvec4 to copy components from.
--<
--< @return
--< A Dvec4 with all of its components set equal to the corresponding
--< components of dvec4_value.
----------------------------------------------------------------------------
function Make_Dvec4 (dvec4_value : in Vkm_Dvec4) return Vkm_Dvec4 is
(GDT.Make_GenType(dvec4_value.data(0),dvec4_value.data(1),
dvec4_value.data(2),dvec4_value.data(3))) with Inline;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Dvec4 type.
--<
--< @description
--< Produce a vector by specifying the values for each of its components.
--<
--< @param value1
--< Value for component 1.
--<
--< @param value2
--< Value for component 2.
--<
--< @param value3
--< Value for componetn 3.
--<
--< @param value4
--< Value for component 4.
--<
--< @return
--< A Dvec4 with all components set as specified.
----------------------------------------------------------------------------
function Make_Dvec4 (value1, value2, value3, value4 : in Vkm_Double) return Vkm_Dvec4
renames GDT.Make_GenType;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Dvec4 type.
--<
--< @description
--< Produce a vector by concatenating a scalar value with a Dvec3.
--<
--< Dvec4 = [scalar_value, dvec3_value ]
--<
--< @param scalar_value
--< The scalar value to concatenate with the Dvec3.
--<
--< @param dvec3_value
--< The Dvec3 to concatenate to the scalar value.
--<
--< @return
--< The instance of Dvec4.
----------------------------------------------------------------------------
function Make_Dvec4 (scalar_value : in Vkm_Double;
dvec3_value : in Vkm_Dvec3) return Vkm_Dvec3 is
(Make_Dvec4(scalar_value,
dvec3_value.data(0),
dvec3_value.data(1),
dvec3_value.data(2))) with Inline;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Dvec4 type.
--<
--< @description
--< Produce a vector by concatenating a Dvec3 with a scalar value.
--<
--< Dvec4 = [dvec3_value, scalar_value]
--<
--< @param dvec3_value
--< The Dvec3 to concatenate to the scalar value.
--<
--< @param scalar_value
--< The scalar value to concatenate to the Dvec3.
--<
--< @return
--< The instance of Dvec4.
----------------------------------------------------------------------------
function Make_Dvec4 (dvec3_value : in Vkm_Dvec3;
scalar_value : in Vkm_Double) return Vkm_Dvec4 is
(Make_Dvec4(dvec3_value.data(0),
dvec3_value.data(1),
dvec3_value.data(2),
scalar_value )) with Inline;
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Dvec4 type.
--<
--< @description
--< Produce a vector by concatenating a Dvec2 with a Dvec2.
--<
--< Dvec4 = [dvec2_value1, dvec2_value2]
--<
--< @param dvec2_value1
--< The first Dvec2.
--<
--< @param dvec2_value2
--< The second Dvec2.
--<
--< @return
--< The instance of Dvec4.
----------------------------------------------------------------------------
function Make_Dvec4 (dvec2_value1, dvec2_value2 : in Vkm_Dvec2) return Vkm_Dvec4 is
(Make_Dvec4(dvec2_value1.data(0),dvec2_value1.data(1),
dvec2_value2.data(0),dvec2_value2.data(1)));
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Dvec4 type.
--<
--< @description
--< Produce a vector by concatenating two scalar values with a Dvec2.
--<
--< Dvec4 = [scalar1, scalar2, dvec2_value]
--<
--< @param scalar1
--< First scalar value.
--<
--< @param scalar2
--< Second scalar value.
--<
--< @param dvec2_value
--< The Dvec2 value.
--<
--< @return
--< The instance of Dvec4.
----------------------------------------------------------------------------
function Make_Dvec4 (scalar1, scalar2 : in Vkm_Double;
dvec2_value : in Vkm_Dvec2) return Vkm_Dvec4 is
(Make_Dvec4(scalar1, scalar2, dvec2_value.data(0),dvec2_value.data(1)));
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Dvec4 type.
--<
--< @description
--< Produce a vector by concatenating two scalar values with a Dvec2.
--<
--< Dvec4 = [scalar1, dvec2_value, scalar2]
--<
--< @param scalar1
--< First scalar value.
--<
--< @param dvec2_value
--< The Dvec2 value.
--<
--< @param scalar2
--< Second scalar value.
--<
--< @return
--< The instance of Dvec4.
----------------------------------------------------------------------------
function Make_Dvec4 (scalar1 : in Vkm_Double;
dvec2_value : in Vkm_Dvec2 ;
scalar2 : in Vkm_Double) return Vkm_Dvec4 is
(Make_Dvec4(scalar1, dvec2_value.data(0),dvec2_value.data(1), scalar2));
----------------------------------------------------------------------------
--< @summary
--< Constructor for Vkm_Dvec4 type.
--<
--< @description
--< Produce a vector by concatenating two scalar values with a Dvec2.
--<
--< Dvec4 = [dvec2_value, scalar1, scalar2]
--<
--< @param dvec2_value
--< The Dvec2 value.
--<
--< @param scalar1
--< First scalar value.
--<
--< @param scalar2
--< Second scalar value.
--<
--< @return
--< The instance of Dvec4.
---------------------------------------------------------------------------
function Make_Dvec4 (dvec2_value : in Vkm_Dvec2 ;
scalar1 : in Vkm_Double;
scalar2 : in Vkm_Double) return Vkm_Dvec4 is
(Make_Dvec4(dvec2_value.data(0),dvec2_value.data(1), scalar1, scalar2));
end Vulkan.Math.Dvec4;
|
reznikmm/matreshka | Ada | 3,633 | 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.Elements.Generic_Hash;
function AMF.UMLDI.UML_Keyword_Labels.Hash is
new AMF.Elements.Generic_Hash (UMLDI_UML_Keyword_Label, UMLDI_UML_Keyword_Label_Access);
|
charlie5/cBound | Ada | 1,724 | 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_xc_misc_get_version_reply_t is
-- Item
--
type Item is record
response_type : aliased Interfaces.Unsigned_8;
pad0 : aliased Interfaces.Unsigned_8;
sequence : aliased Interfaces.Unsigned_16;
length : aliased Interfaces.Unsigned_32;
server_major_version : aliased Interfaces.Unsigned_16;
server_minor_version : aliased Interfaces.Unsigned_16;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_xc_misc_get_version_reply_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_xc_misc_get_version_reply_t.Item,
Element_Array => xcb.xcb_xc_misc_get_version_reply_t.Item_Array,
Default_Terminator => (others => <>));
subtype Pointer is C_Pointers.Pointer;
-- Pointer_Array
--
type Pointer_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_xc_misc_get_version_reply_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_xc_misc_get_version_reply_t.Pointer,
Element_Array => xcb.xcb_xc_misc_get_version_reply_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_xc_misc_get_version_reply_t;
|
AdaCore/Ada_Drivers_Library | Ada | 3,333 | ads | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2019, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- Driver for the AdaFruit Charlie Wing matrix LED board.
-- See the IS31FL3731 package for API documentation.
with HAL;
with HAL.I2C;
with IS31FL3731;
package AdaFruit.CharlieWing is
subtype X_Coord is IS31FL3731.X_Coord range 0 .. 15;
subtype Y_Coord is IS31FL3731.Y_Coord range 0 .. 6;
type Device
(Port : not null HAL.I2C.Any_I2C_Port;
AD : HAL.UInt2)
is new IS31FL3731.Device
with private;
overriding
function LED_Address (This : Device;
X : IS31FL3731.X_Coord;
Y : IS31FL3731.Y_Coord)
return IS31FL3731.LED_Id
with Pre => X in X_Coord and then Y in Y_Coord;
-- LED address conversion specific to the LED arrangement of the Charlie
-- Wing.
private
type Device
(Port : not null HAL.I2C.Any_I2C_Port;
AD : HAL.UInt2)
is new IS31FL3731.Device (Port, AD)
with null record;
end AdaFruit.CharlieWing;
|
BrickBot/Bound-T-H8-300 | Ada | 2,367 | adb | -- Options.File_Sets (body)
--
-- A component of the Bound-T Worst-Case Execution Time Tool.
--
-------------------------------------------------------------------------------
-- Copyright (c) 1999 .. 2015 Tidorum Ltd
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- 1. Redistributions of source code must retain the above copyright notice, this
-- list of conditions and the following disclaimer.
-- 2. Redistributions in binary form must reproduce the above copyright notice,
-- this list of conditions and the following disclaimer in the documentation
-- and/or other materials provided with the distribution.
--
-- This software is provided by the copyright holders and contributors "as is" and
-- any express or implied warranties, including, but not limited to, the implied
-- warranties of merchantability and fitness for a particular purpose are
-- disclaimed. In no event shall the copyright owner or contributors be liable for
-- any direct, indirect, incidental, special, exemplary, or consequential damages
-- (including, but not limited to, procurement of substitute goods or services;
-- loss of use, data, or profits; or business interruption) however caused and
-- on any theory of liability, whether in contract, strict liability, or tort
-- (including negligence or otherwise) arising in any way out of the use of this
-- software, even if advised of the possibility of such damage.
--
-- Other modules (files) of this software composition should contain their
-- own copyright statements, which may have different copyright and usage
-- conditions. The above conditions apply to this file.
-------------------------------------------------------------------------------
--
-- $Revision: 1.2 $
-- $Date: 2015/10/24 20:05:50 $
--
-- $Log: options-file_sets.adb,v $
-- Revision 1.2 2015/10/24 20:05:50 niklas
-- Moved to free licence.
--
-- Revision 1.1 2011-08-31 04:17:13 niklas
-- Added for BT-CH-0222: Option registry. Option -dump. External help files.
--
package body Options.File_Sets is
overriding
function Type_And_Default (Option : access Option_T)
return String
is
begin
return "Set of file-names, empty by default";
end Type_And_Default;
end Options.File_Sets;
|
charlie5/cBound | Ada | 1,836 | 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_tex_image_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
minor_opcode : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
context_tag : aliased xcb.xcb_glx_context_tag_t;
target : aliased Interfaces.Unsigned_32;
level : aliased Interfaces.Integer_32;
format : aliased Interfaces.Unsigned_32;
the_type : aliased Interfaces.Unsigned_32;
swap_bytes : aliased Interfaces.Unsigned_8;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_get_tex_image_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_tex_image_request_t.Item,
Element_Array => xcb.xcb_glx_get_tex_image_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_tex_image_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_tex_image_request_t.Pointer,
Element_Array => xcb.xcb_glx_get_tex_image_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_glx_get_tex_image_request_t;
|
sungyeon/drake | Ada | 13,841 | adb | with System.Storage_Elements;
package body System.Formatting is
pragma Suppress (All_Checks);
use type Long_Long_Integer_Types.Word_Unsigned;
use type Long_Long_Integer_Types.Long_Long_Unsigned;
subtype Word_Unsigned is Long_Long_Integer_Types.Word_Unsigned;
subtype Long_Long_Unsigned is Long_Long_Integer_Types.Long_Long_Unsigned;
procedure memset (
b : Address;
c : Integer;
n : Storage_Elements.Storage_Count)
with Import,
Convention => Intrinsic, External_Name => "__builtin_memset";
function add_overflow (
a, b : Word_Unsigned;
res : not null access Word_Unsigned)
return Boolean
with Import,
Convention => Intrinsic,
External_Name =>
(if Standard'Word_Size = Integer'Size then
"__builtin_uadd_overflow"
elsif Standard'Word_Size = Long_Integer'Size then
"__builtin_uaddl_overflow"
else "__builtin_uaddll_overflow");
function add_overflow (
a, b : Long_Long_Unsigned;
res : not null access Long_Long_Unsigned)
return Boolean
with Import,
Convention => Intrinsic,
External_Name => "__builtin_uaddll_overflow";
function mul_overflow (
a, b : Word_Unsigned;
res : not null access Word_Unsigned)
return Boolean
with Import,
Convention => Intrinsic,
External_Name =>
(if Standard'Word_Size = Integer'Size then
"__builtin_umul_overflow"
elsif Standard'Word_Size = Long_Integer'Size then
"__builtin_umull_overflow"
else "__builtin_umulll_overflow");
function mul_overflow (
a, b : Long_Long_Unsigned;
res : not null access Long_Long_Unsigned)
return Boolean
with Import,
Convention => Intrinsic,
External_Name => "__builtin_umulll_overflow";
function Width_Digits (Value : Word_Unsigned; Base : Number_Base)
return Positive;
function Width_Digits (Value : Word_Unsigned; Base : Number_Base)
return Positive
is
P : aliased Word_Unsigned := Word_Unsigned (Base);
Result : Positive := 1;
begin
while P <= Value loop
Result := Result + 1;
exit when mul_overflow (P, Word_Unsigned (Base), P'Access);
end loop;
return Result;
end Width_Digits;
function Width_Digits (Value : Long_Long_Unsigned; Base : Number_Base)
return Positive;
function Width_Digits (Value : Long_Long_Unsigned; Base : Number_Base)
return Positive is
begin
if Standard'Word_Size < Long_Long_Unsigned'Size then
-- optimized for 32bit
declare
P : aliased Long_Long_Unsigned := Long_Long_Unsigned (Base);
Result : Positive := 1;
begin
while P <= Value loop
Result := Result + 1;
exit when mul_overflow (P, Long_Long_Unsigned (Base), P'Access);
end loop;
return Result;
end;
else
-- optimized for 64bit
return Width_Digits (Word_Unsigned (Value), Base);
end if;
end Width_Digits;
procedure Fill_Digits (
Value : Word_Unsigned;
Item : out String;
Base : Number_Base;
Set : Type_Set);
procedure Fill_Digits (
Value : Word_Unsigned;
Item : out String;
Base : Number_Base;
Set : Type_Set)
is
V : Word_Unsigned := Value;
begin
for I in reverse Item'Range loop
Image (Digit (V rem Word_Unsigned (Base)), Item (I), Set);
V := V / Word_Unsigned (Base);
end loop;
end Fill_Digits;
procedure Fill_Digits (
Value : Long_Long_Unsigned;
Item : out String;
Base : Number_Base;
Set : Type_Set);
procedure Fill_Digits (
Value : Long_Long_Unsigned;
Item : out String;
Base : Number_Base;
Set : Type_Set) is
begin
if Standard'Word_Size < Long_Long_Unsigned'Size then
-- optimized for 32bit
declare
V : Long_Long_Unsigned := Value;
I : Positive := Item'Last;
begin
while V > Long_Long_Unsigned (Word_Unsigned'Last) loop
Image (Digit (V rem Long_Long_Unsigned (Base)), Item (I), Set);
V := V / Long_Long_Unsigned (Base);
I := I - 1;
end loop;
Fill_Digits (Word_Unsigned (V), Item (Item'First .. I), Base, Set);
end;
else
-- optimized for 64bit
Fill_Digits (Word_Unsigned (Value), Item, Base, Set);
end if;
end Fill_Digits;
procedure Take_Digits (
Item : String;
Last : out Natural;
Result : out Word_Unsigned;
Base : Number_Base;
Skip_Underscore : Boolean;
Overflow : out Boolean);
procedure Take_Digits (
Item : String;
Last : out Natural;
Result : out Word_Unsigned;
Base : Number_Base;
Skip_Underscore : Boolean;
Overflow : out Boolean)
is
R : aliased Word_Unsigned := 0;
begin
Last := Item'First - 1;
Overflow := False;
while Last < Item'Last loop
declare
X : Digit;
Is_Invalid : Boolean;
Next : Positive := Last + 1;
begin
if Item (Next) = '_' then
exit when not Skip_Underscore
or else Next = Item'First
or else Next >= Item'Last;
Next := Next + 1;
end if;
Value (Item (Next), X, Is_Invalid);
exit when Is_Invalid or else X >= Base;
if mul_overflow (R, Word_Unsigned (Base), R'Access)
or else add_overflow (R, Word_Unsigned (X), R'Access)
then
Overflow := True;
exit;
end if;
Last := Next;
end;
end loop;
Result := R;
end Take_Digits;
procedure Take_Digits (
Item : String;
Last : out Natural;
Result : out Long_Long_Unsigned;
Base : Number_Base;
Skip_Underscore : Boolean;
Overflow : out Boolean);
procedure Take_Digits (
Item : String;
Last : out Natural;
Result : out Long_Long_Unsigned;
Base : Number_Base;
Skip_Underscore : Boolean;
Overflow : out Boolean) is
begin
if Standard'Word_Size < Long_Long_Unsigned'Size then
-- optimized for 32bit
declare
R : aliased Long_Long_Unsigned := 0;
begin
Take_Digits (
Item,
Last,
Word_Unsigned (R),
Base,
Skip_Underscore,
Overflow);
if Overflow then
Overflow := False;
while Last < Item'Last loop
declare
X : Digit;
Is_Invalid : Boolean;
Next : Positive := Last + 1;
begin
if Item (Next) = '_' then
exit when not Skip_Underscore
or else Next >= Item'Last;
Next := Next + 1;
end if;
Value (Item (Next), X, Is_Invalid);
exit when Is_Invalid or else X >= Base;
if mul_overflow (R, Long_Long_Unsigned (Base), R'Access)
or else add_overflow (
R,
Long_Long_Unsigned (X),
R'Access)
then
Overflow := True;
exit;
end if;
Last := Next;
end;
end loop;
end if;
Result := R;
end;
else
-- optimized for 64bit
Take_Digits (
Item,
Last,
Word_Unsigned (Result),
Base,
Skip_Underscore,
Overflow);
end if;
end Take_Digits;
-- implementation
function Digits_Width (
Value : Long_Long_Integer_Types.Word_Unsigned;
Base : Number_Base := 10)
return Positive is
begin
return Width_Digits (Value, Base);
end Digits_Width;
function Digits_Width (
Value : Long_Long_Integer_Types.Long_Long_Unsigned;
Base : Number_Base := 10)
return Positive is
begin
if Standard'Word_Size < Long_Long_Unsigned'Size then
-- optimized for 32bit
return Width_Digits (Value, Base);
else
-- optimized for 64bit
return Digits_Width (Word_Unsigned (Value), Base);
end if;
end Digits_Width;
procedure Image (
Value : Digit;
Item : out Character;
Set : Type_Set := Upper_Case) is
begin
case Value is
when 0 .. 9 =>
Item := Character'Val (Character'Pos ('0') + Value);
when 10 .. 15 =>
Item := Character'Val (
Character'Pos ('a')
- 10
- (Character'Pos ('a') - Character'Pos ('A'))
* Type_Set'Pos (Set)
+ Value);
end case;
end Image;
procedure Image (
Value : Long_Long_Integer_Types.Word_Unsigned;
Item : out String;
Last : out Natural;
Base : Number_Base := 10;
Set : Type_Set := Upper_Case;
Width : Positive := 1;
Fill : Character := '0';
Error : out Boolean)
is
W : constant Positive := Formatting.Digits_Width (Value, Base);
Padding_Length : constant Natural := Integer'Max (0, Width - W);
Length : constant Natural := Padding_Length + W;
begin
Error := Item'First + Length - 1 > Item'Last;
if Error then
Last := Item'First - 1;
else
Last := Item'First + Length - 1;
Fill_Padding (
Item (Item'First .. Item'First + Padding_Length - 1),
Fill);
Fill_Digits (
Value,
Item (Item'First + Padding_Length .. Last),
Base,
Set);
end if;
end Image;
procedure Image (
Value : Long_Long_Integer_Types.Long_Long_Unsigned;
Item : out String;
Last : out Natural;
Base : Number_Base := 10;
Set : Type_Set := Upper_Case;
Width : Positive := 1;
Fill : Character := '0';
Error : out Boolean) is
begin
if Standard'Word_Size < Long_Long_Unsigned'Size then
-- optimized for 32bit
declare
W : constant Positive := Formatting.Digits_Width (Value, Base);
Padding_Length : constant Natural := Integer'Max (0, Width - W);
Length : constant Natural := Padding_Length + W;
begin
Error := Item'First + Length - 1 > Item'Last;
if Error then
Last := Item'First - 1;
else
Last := Item'First + Length - 1;
Fill_Padding (
Item (Item'First .. Item'First + Padding_Length - 1),
Fill);
Fill_Digits (
Value,
Item (Item'First + Padding_Length .. Last),
Base,
Set);
end if;
end;
else
-- optimized for 64bit
Image (
Word_Unsigned (Value),
Item,
Last,
Base,
Set,
Width,
Fill,
Error);
end if;
end Image;
procedure Value (
Item : Character;
Result : out Digit;
Error : out Boolean) is
begin
case Item is
when '0' .. '9' =>
Result := Character'Pos (Item) - Character'Pos ('0');
Error := False;
when 'A' .. 'F' =>
Result := Character'Pos (Item) - (Character'Pos ('A') - 10);
Error := False;
when 'a' .. 'f' =>
Result := Character'Pos (Item) - (Character'Pos ('a') - 10);
Error := False;
when others =>
Error := True;
end case;
end Value;
procedure Value (
Item : String;
Last : out Natural;
Result : out Long_Long_Integer_Types.Word_Unsigned;
Base : Number_Base := 10;
Skip_Underscore : Boolean := False;
Error : out Boolean)
is
Overflow : Boolean;
begin
Take_Digits (Item, Last, Result, Base, Skip_Underscore, Overflow);
if Overflow then
Result := 0;
Last := Item'First - 1;
Error := True;
else
Error := Last < Item'First;
end if;
end Value;
procedure Value (
Item : String;
Last : out Natural;
Result : out Long_Long_Integer_Types.Long_Long_Unsigned;
Base : Number_Base := 10;
Skip_Underscore : Boolean := False;
Error : out Boolean) is
begin
if Standard'Word_Size < Long_Long_Unsigned'Size then
-- optimized for 32bit
declare
Overflow : Boolean;
begin
Take_Digits (Item, Last, Result, Base, Skip_Underscore, Overflow);
if Overflow then
Result := 0;
Last := Item'First - 1;
Error := True;
else
Error := Last < Item'First;
end if;
end;
else
-- optimized for 64bit
Value (
Item,
Last,
Word_Unsigned (Result),
Base,
Skip_Underscore,
Error);
end if;
end Value;
procedure Fill_Padding (Item : out String; Pad : Character) is
begin
memset (Item'Address, Character'Pos (Pad), Item'Length);
end Fill_Padding;
end System.Formatting;
|
zhmu/ananas | Ada | 227 | adb | with Inline7_Pkg2;
package body Inline7_Pkg1 is
procedure Test (I : Integer) is
function F is new Inline7_Pkg2.Calc (I);
begin
if I /= F (I) then
raise Program_Error;
end if;
end;
end Inline7_Pkg1;
|
reznikmm/matreshka | Ada | 6,796 | 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.
------------------------------------------------------------------------------
-- An artifact is the specification of a physical piece of information that
-- is used or produced by a software development process, or by deployment
-- and operation of a system. Examples of artifacts include model files,
-- source files, scripts, and binary executable files, a table in a database
-- system, a development deliverable, or a word-processing document, a mail
-- message.
--
-- An artifact is the source of a deployment to a node.
------------------------------------------------------------------------------
limited with AMF.UML.Artifacts.Collections;
with AMF.UML.Classifiers;
with AMF.UML.Deployed_Artifacts;
limited with AMF.UML.Manifestations.Collections;
limited with AMF.UML.Operations.Collections;
limited with AMF.UML.Properties.Collections;
package AMF.UML.Artifacts is
pragma Preelaborate;
type UML_Artifact is limited interface
and AMF.UML.Classifiers.UML_Classifier
and AMF.UML.Deployed_Artifacts.UML_Deployed_Artifact;
type UML_Artifact_Access is
access all UML_Artifact'Class;
for UML_Artifact_Access'Storage_Size use 0;
not overriding function Get_File_Name
(Self : not null access constant UML_Artifact)
return AMF.Optional_String is abstract;
-- Getter of Artifact::fileName.
--
-- A concrete name that is used to refer to the Artifact in a physical
-- context. Example: file system name, universal resource locator.
not overriding procedure Set_File_Name
(Self : not null access UML_Artifact;
To : AMF.Optional_String) is abstract;
-- Setter of Artifact::fileName.
--
-- A concrete name that is used to refer to the Artifact in a physical
-- context. Example: file system name, universal resource locator.
not overriding function Get_Manifestation
(Self : not null access constant UML_Artifact)
return AMF.UML.Manifestations.Collections.Set_Of_UML_Manifestation is abstract;
-- Getter of Artifact::manifestation.
--
-- The set of model elements that are manifested in the Artifact. That is,
-- these model elements are utilized in the construction (or generation)
-- of the artifact.
not overriding function Get_Nested_Artifact
(Self : not null access constant UML_Artifact)
return AMF.UML.Artifacts.Collections.Set_Of_UML_Artifact is abstract;
-- Getter of Artifact::nestedArtifact.
--
-- The Artifacts that are defined (nested) within the Artifact. The
-- association is a specialization of the ownedMember association from
-- Namespace to NamedElement.
not overriding function Get_Owned_Attribute
(Self : not null access constant UML_Artifact)
return AMF.UML.Properties.Collections.Ordered_Set_Of_UML_Property is abstract;
-- Getter of Artifact::ownedAttribute.
--
-- The attributes or association ends defined for the Artifact. The
-- association is a specialization of the ownedMember association.
not overriding function Get_Owned_Operation
(Self : not null access constant UML_Artifact)
return AMF.UML.Operations.Collections.Ordered_Set_Of_UML_Operation is abstract;
-- Getter of Artifact::ownedOperation.
--
-- The Operations defined for the Artifact. The association is a
-- specialization of the ownedMember association.
end AMF.UML.Artifacts;
|
onedigitallife-net/Byron | Ada | 163 | adb | Pragma Ada_2012;
Pragma Assertion_Policy( Check );
Package Body Byron.Internals.SPARK.Pure_Types with SPARK_Mode => On is
End Byron.Internals.SPARK.Pure_Types;
|
reznikmm/matreshka | Ada | 6,880 | 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.Hidden_Text_Elements is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters)
return Text_Hidden_Text_Element_Node is
begin
return Self : Text_Hidden_Text_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_Hidden_Text_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_Hidden_Text
(ODF.DOM.Text_Hidden_Text_Elements.ODF_Text_Hidden_Text_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_Hidden_Text_Element_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Hidden_Text_Element;
end Get_Local_Name;
----------------
-- Leave_Node --
----------------
overriding procedure Leave_Node
(Self : not null access Text_Hidden_Text_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_Hidden_Text
(ODF.DOM.Text_Hidden_Text_Elements.ODF_Text_Hidden_Text_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_Hidden_Text_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_Hidden_Text
(Visitor,
ODF.DOM.Text_Hidden_Text_Elements.ODF_Text_Hidden_Text_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.Hidden_Text_Element,
Text_Hidden_Text_Element_Node'Tag);
end Matreshka.ODF_Text.Hidden_Text_Elements;
|
charlie5/aIDE | Ada | 2,692 | adb | with
AdaM.Factory;
package body AdaM.a_Type.signed_integer_type
is
-- Storage Pool
--
record_Version : constant := 1;
max_Types : constant := 5_000;
package Pool is new AdaM.Factory.Pools (storage_Folder => ".adam-store",
pool_Name => "signed_integer_types",
max_Items => max_Types,
record_Version => record_Version,
Item => signed_integer_type.item,
View => signed_integer_type.view);
-- Forge
--
procedure define (Self : in out Item; Name : in String)
is
begin
Self.Name := +Name;
end define;
overriding
procedure destruct (Self : in out Item)
is
begin
null;
end destruct;
function new_Type (Name : in String := "") return signed_integer_type.View
is
new_View : constant signed_integer_type.view := Pool.new_Item;
begin
define (signed_integer_type.item (new_View.all), Name);
return new_View;
end new_Type;
procedure free (Self : in out signed_integer_type.view)
is
begin
destruct (a_Type.item (Self.all));
Pool.free (Self);
end free;
-- Attributes
--
overriding function Id (Self : access Item) return AdaM.Id
is
begin
return Pool.to_Id (Self);
end Id;
overriding
function to_Source (Self : in Item) return text_Vectors.Vector
is
pragma Unreferenced (Self);
the_Source : text_Vectors.Vector;
begin
raise Program_Error with "TODO";
return the_Source;
end to_Source;
function First (Self : in Item) return Long_Long_Integer
is
begin
return Self.First;
end First;
procedure First_is (Self : in out Item; Now : in Long_Long_Integer)
is
begin
Self.First := Now;
end First_is;
function Last (Self : in Item) return Long_Long_Integer
is
begin
return Self.Last;
end Last;
procedure Last_is (Self : in out Item; Now : in Long_Long_Integer)
is
begin
Self.Last := Now;
end Last_is;
-- Streams
--
procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : in View)
renames Pool.View_write;
procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
Self : out View)
renames Pool.View_read;
end AdaM.a_Type.signed_integer_type;
|
AdaCore/spat | Ada | 2,933 | ads | ------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. ([email protected])
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
------------------------------------------------------------------------------
pragma License (Unrestricted);
------------------------------------------------------------------------------
--
-- SPARK Proof Analysis Tool
--
-- S.P.A.T. - Collection of checks that should succeed before creating
-- objects from the JSON data.
--
------------------------------------------------------------------------------
package SPAT.Preconditions is
type Accepted_Value_Types is array (JSON_Value_Type) of Boolean with
Pack => True;
Number_Kind : constant Accepted_Value_Types;
---------------------------------------------------------------------------
-- Ensure_Field
--
-- Check that the given JSON object contains an object named Field with
-- type of Kind.
-- If the field is not found or the type is different from the expected
-- one, a warning is issued, unless Is_Optional is True.
-- Returns True if so, False otherwise.
---------------------------------------------------------------------------
function Ensure_Field (Object : in JSON_Value;
Field : in UTF8_String;
Kind : in JSON_Value_Type;
Is_Optional : in Boolean := False) return Boolean;
---------------------------------------------------------------------------
-- Ensure_Field
--
-- Check that the given JSON object contains an object named Field with
-- on of the types in Kind.
-- Returns True if so, False otherwise.
---------------------------------------------------------------------------
function Ensure_Field
(Object : in JSON_Value;
Field : in UTF8_String;
Kinds_Allowed : in Accepted_Value_Types) return Boolean;
---------------------------------------------------------------------------
-- Ensure_Rule_Severity
--
-- Checks that the given JSON object contains a rule and a severity object.
-- Returns True if so, False otherwise.
---------------------------------------------------------------------------
function Ensure_Rule_Severity (Object : in JSON_Value) return Boolean;
private
-- Make JSON type enumeration literals directly visible.
use all type JSON_Value_Type;
Number_Kind : constant Accepted_Value_Types :=
Accepted_Value_Types'(JSON_Int_Type |
JSON_Float_Type => True,
others => False);
end SPAT.Preconditions;
|
reznikmm/matreshka | Ada | 3,615 | 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.Elements.Generic_Hash;
function AMF.UML.Connector_Ends.Hash is
new AMF.Elements.Generic_Hash (UML_Connector_End, UML_Connector_End_Access);
|
reznikmm/matreshka | Ada | 4,608 | 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_Table.Algorithm_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Table_Algorithm_Attribute_Node is
begin
return Self : Table_Algorithm_Attribute_Node do
Matreshka.ODF_Table.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Table_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Table_Algorithm_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.Algorithm_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Table_URI,
Matreshka.ODF_String_Constants.Algorithm_Attribute,
Table_Algorithm_Attribute_Node'Tag);
end Matreshka.ODF_Table.Algorithm_Attributes;
|
godunko/adawebui | Ada | 5,033 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2016-2020, 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: 5711 $ $Date: 2017-01-21 21:29:05 +0300 (Сб, 21 янв 2017) $
------------------------------------------------------------------------------
package body Web.Core.Connectables.Slots_0.Slots_1.Slots_2.Generic_Slots is
---------------------
-- Create_Slot_End --
---------------------
overriding function Create_Slot_End
(Self : Slot) return not null Slot_End_Access is
begin
-- return
-- new Slot_End'
-- (Next => null,
-- Previous => null,
-- Object => Self.Object.all'Unchecked_Access);
-- XXX A2JS: invalid code generated
return Result : not null Slot_End_Access
:= new Slot_End (Self.Object.all'Unchecked_Access)
do
Result.Next := null;
Result.Previous := null;
end return;
end Create_Slot_End;
------------
-- Invoke --
------------
overriding procedure Invoke
(Self : in out Slot_End;
Parameter_1 : Parameter_1_Type;
Parameter_2 : Parameter_2_Type) is
begin
Subprogram (Self.Object.all, Parameter_1, Parameter_2);
end Invoke;
-----------
-- Owner --
-----------
overriding function Owner
(Self : Slot_End) return not null Core.Connectables.Object_Access is
begin
return
Core.Connectables.Connectable_Object'Class
(Self.Object.all)'Unchecked_Access;
end Owner;
-------------
-- To_Slot --
-------------
function To_Slot
(Self : in out Abstract_Object'Class) return Slots_2.Slot'Class is
begin
-- return Slot'(Object => Self'Unchecked_Access);
-- XXX A2JS: invalid code generated
return Result : Slot (Self'Unchecked_Access);
end To_Slot;
end Web.Core.Connectables.Slots_0.Slots_1.Slots_2.Generic_Slots;
|
reznikmm/matreshka | Ada | 4,259 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Open Document Toolkit --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2013, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with Matreshka.DOM_Nodes;
with XML.DOM.Attributes.Internals;
package body ODF.DOM.Attributes.FO.Keep_Together.Internals is
------------
-- Create --
------------
function Create
(Node : Matreshka.ODF_Attributes.FO.Keep_Together.FO_Keep_Together_Access)
return ODF.DOM.Attributes.FO.Keep_Together.ODF_FO_Keep_Together is
begin
return
(XML.DOM.Attributes.Internals.Create
(Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record);
end Create;
----------
-- Wrap --
----------
function Wrap
(Node : Matreshka.ODF_Attributes.FO.Keep_Together.FO_Keep_Together_Access)
return ODF.DOM.Attributes.FO.Keep_Together.ODF_FO_Keep_Together is
begin
return
(XML.DOM.Attributes.Internals.Wrap
(Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record);
end Wrap;
end ODF.DOM.Attributes.FO.Keep_Together.Internals;
|
flyx/OpenGLAda | Ada | 2,983 | adb | -- part of OpenGLAda, (c) 2017 Felix Krause
-- released under the terms of the MIT license, see the file "COPYING"
with GL.API;
with GL.Enums.Textures;
package body GL.Objects.Textures.Targets is
function Buffer_Offset (Object : Texture_Buffer_Target;
Level : Mipmap_Level) return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Buffer_Offset, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Buffer_Offset;
function Buffer_Size (Object : Texture_Buffer_Target;
Level : Mipmap_Level) return Size is
Ret : Size;
begin
API.Get_Tex_Level_Parameter_Size (Object.Kind, Level,
Enums.Textures.Buffer_Size, Ret);
Raise_Exception_On_OpenGL_Error;
return Ret;
end Buffer_Size;
function Target_From_Kind (Kind : Low_Level.Enums.Texture_Kind)
return not null access constant Texture_Proxy'Class is
begin
case Kind is
when GL.Low_Level.Enums.Texture_1D => return Texture_1D'Access;
when GL.Low_Level.Enums.Texture_2D => return Texture_2D'Access;
when GL.Low_Level.Enums.Texture_3D => return Texture_3D'Access;
when GL.Low_Level.Enums.Proxy_Texture_1D =>
return Texture_1D_Proxy'Access;
when GL.Low_Level.Enums.Proxy_Texture_2D =>
return Texture_2D_Proxy'Access;
when GL.Low_Level.Enums.Proxy_Texture_3D =>
return Texture_3D_Proxy'Access;
when GL.Low_Level.Enums.Proxy_Texture_Cube_Map =>
return Texture_Cube_Map_Proxy'Access;
when GL.Low_Level.Enums.Texture_Cube_Map =>
return Texture_Cube_Map'Access;
when GL.Low_Level.Enums.Texture_Cube_Map_Positive_X =>
return Texture_Cube_Map_Positive_X'Access;
when GL.Low_Level.Enums.Texture_Cube_Map_Negative_X =>
return Texture_Cube_Map_Negative_X'Access;
when GL.Low_Level.Enums.Texture_Cube_Map_Positive_Y =>
return Texture_Cube_Map_Positive_Y'Access;
when GL.Low_Level.Enums.Texture_Cube_Map_Negative_Y =>
return Texture_Cube_Map_Negative_Y'Access;
when GL.Low_Level.Enums.Texture_Cube_Map_Positive_Z =>
return Texture_Cube_Map_Positive_Z'Access;
when GL.Low_Level.Enums.Texture_Cube_Map_Negative_Z =>
return Texture_Cube_Map_Negative_Z'Access;
when GL.Low_Level.Enums.Texture_1D_Array |
GL.Low_Level.Enums.Texture_2D_Array |
GL.Low_Level.Enums.Proxy_Texture_1D_Array |
GL.Low_Level.Enums.Proxy_Texture_2D_Array =>
raise Not_Implemented_Exception with Kind'Img;
when GL.Low_Level.Enums.Texture_Buffer =>
return Texture_Buffer'Access;
end case;
end Target_From_Kind;
end GL.Objects.Textures.Targets;
|
zhmu/ananas | Ada | 2,544 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S Y S T E M . V A L _ C H A R --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
package System.Val_Char is
pragma Preelaborate;
function Value_Character (Str : String) return Character;
-- Computes Character'Value (Str)
end System.Val_Char;
|
ZinebZaad/ENSEEIHT | Ada | 619 | adb | with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure Score_21 is
De1, De2 : Integer; -- les deux dés
Score: Integer; -- le score obtenu avec les deux dés
begin
-- Demander la valeur des dés
Get (De1);
Get (De2);
-- Déterminer le score
Score := 0;
if (De1 = 1 and De2 = 2) or (De2 = 1 and De1 = 2) then
Score := 21;
elsif De1 = De2 then
Score := 10 + De1;
elsif De1 - De2 = 1 or De1 - De2 = -1 then
Score := De1 + De2;
end if;
-- Afficher le score
Put ("Score : ");
Put (Score, 1);
New_Line;
end Score_21;
|
reznikmm/matreshka | Ada | 15,179 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-2015, 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$
------------------------------------------------------------------------------
pragma Restrictions (No_Elaboration_Code);
-- GNAT: enforce generation of preinitialized data section instead of
-- generation of elaboration code.
package Matreshka.Internals.Unicode.Ucd.Core_001D is
pragma Preelaborate;
Group_001D : aliased constant Core_Second_Stage
:= (16#2C# .. 16#2E# => -- 1D2C .. 1D2E
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#2F# => -- 1D2F
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#30# .. 16#3A# => -- 1D30 .. 1D3A
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#3B# => -- 1D3B
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#3C# .. 16#4D# => -- 1D3C .. 1D4D
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#4E# => -- 1D4E
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#4F# .. 16#61# => -- 1D4F .. 1D61
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#62# => -- 1D62
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Soft_Dotted
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#63# .. 16#6A# => -- 1D63 .. 1D6A
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Diacritic
| Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#78# => -- 1D78
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#79# => -- 1D79
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#7D# => -- 1D7D
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Changes_When_Uppercased
| Changes_When_Titlecased
| Changes_When_Casemapped
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#96# => -- 1D96
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Soft_Dotted
| Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)),
16#9B# .. 16#A3# => -- 1D9B .. 1DA3
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#A4# => -- 1DA4
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Lowercase
| Soft_Dotted
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#A5# .. 16#A7# => -- 1DA5 .. 1DA7
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#A8# => -- 1DA8
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Lowercase
| Soft_Dotted
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#A9# .. 16#BF# => -- 1DA9 .. 1DBF
(Modifier_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Other_Lowercase
| Alphabetic
| Cased
| Case_Ignorable
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start
| Changes_When_NFKC_Casefolded => True,
others => False)),
16#C0# .. 16#C3# => -- 1DC0 .. 1DC3
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#C4# .. 16#CF# => -- 1DC4 .. 1DCF
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#D0# .. 16#E6# => -- 1DD0 .. 1DE6
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#E7# .. 16#F4# => -- 1DE7 .. 1DF4
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Other_Alphabetic
| Alphabetic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#F5# => -- 1DF5
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#F6# .. 16#FB# => -- 1DF6 .. 1DFB
(Unassigned, Neutral,
Other, Other, Other, Unknown,
(others => False)),
16#FC# => -- 1DFC
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
16#FD# .. 16#FF# => -- 1DFD .. 1DFF
(Nonspacing_Mark, Neutral,
Extend, Extend, Extend, Combining_Mark,
(Diacritic
| Case_Ignorable
| Grapheme_Extend
| ID_Continue
| XID_Continue => True,
others => False)),
others =>
(Lowercase_Letter, Neutral,
Other, A_Letter, Lower, Alphabetic,
(Alphabetic
| Cased
| Grapheme_Base
| ID_Continue
| ID_Start
| Lowercase
| XID_Continue
| XID_Start => True,
others => False)));
end Matreshka.Internals.Unicode.Ucd.Core_001D;
|
io7m/coreland-vector-ada | Ada | 392 | ads | generic package vector.negate is
-- negate, in place
procedure f (a : in out vector_f_t);
pragma inline (f);
procedure d (a : in out vector_d_t);
pragma inline (d);
-- negate, external storage
procedure f_ext (a : vector_f_t; x : out vector_f_t);
pragma inline (f_ext);
procedure d_ext (a : vector_d_t; x : out vector_d_t);
pragma inline (d_ext);
end vector.negate;
|
AdaCore/langkit | Ada | 3,894 | ads | --
-- Copyright (C) 2014-2022, AdaCore
-- SPDX-License-Identifier: Apache-2.0
--
-- This package provides the user of bump pointer pools with a Vector like
-- container. Traditional vectors reallocate their whole storage when we
-- outgrow their current capacity, but this is not possible without a very
-- large memory cost with bump pointer pools, since you cannot free individual
-- chunks of memory.
--
-- So in this package, we have a vector that is constituted of exponentially
-- growing chunks of memory. Since the maximum number of chunks is a constant
-- fixed by the memory of the system (32 being the limit on a modern machine
-- with 16gb of ram), random element access is still amortized O(1), with a
-- large constant.
-- Beware though, random access is still on the average of 100x slower than in
-- order iteration, so *never* use Get_At_Index to iterate over the vector!
with Langkit_Support.Bump_Ptr; use Langkit_Support.Bump_Ptr;
generic
type Element_Type is private;
package Langkit_Support.Bump_Ptr_Vectors is
subtype Index_Type is Positive;
type Vector is private
with Iterable => (First => First,
Next => Next,
Has_Element => Has_Element,
Element => Get);
type Cursor is private;
Empty_Cursor : constant Cursor;
type Element_Access is not null access all Element_Type;
function Create (P : Bump_Ptr_Pool) return Vector;
-- Returns a newly created vector using P as it's pool storage
function Length (Self : Vector) return Natural
with Inline;
-- Return the Length of the vector, ie. the number of elements it contains
function First_Index (Self : Vector) return Index_Type
with Inline;
-- Return the index of the first element in Self
function Last_Index (Self : Vector) return Integer
with Inline;
-- Return the index of the last element in Self, or First_Index (Self) - 1
-- if Self is empty.
procedure Append (Self : in out Vector; Element : Element_Type)
with Inline;
-- Appends Element to Self
function Get (Self : Vector; C : Cursor) return Element_Type
with Inline;
-- Get the element at Index
function Get_At_Index (Self : Vector; I : Index_Type) return Element_Type
with Inline,
Pre => I <= Last_Index (Self);
-- Get the element at Index
function Get_Access (Self : Vector; C : Cursor) return Element_Access
with Inline;
-- Get an access to the element at Index. The lifetime of the access is the
-- one of the vector.
function First (Self : Vector) return Cursor
with Inline;
-- Return the first index, only used for the Iterable aspect
function Next (Self : Vector; C : Cursor) return Cursor
with Inline;
-- Given a vector and an index, return the next index. Only used for the
-- iterable aspect.
function Has_Element (Self : Vector; C : Cursor) return Boolean
with Inline;
-- Given a vector and an index, return True if the index is in the vector
-- range. Only used for the iterable aspect.
private
type Elements_Array is array (Positive range <>) of Element_Type;
type Chunk;
type Chunk_Access is access all Chunk;
pragma No_Strict_Aliasing (Chunk_Access);
type Chunk (Capacity : Natural) is record
Elements : Elements_Array (1 .. Capacity);
Next_Chunk : Chunk_Access;
Length : Natural := 0;
end record;
type Vector is record
Pool : Bump_Ptr_Pool;
First_Chunk, Current_Chunk : Chunk_Access := null;
Length : Natural := 0;
end record;
type Cursor is record
Chunk : Chunk_Access;
Index_In_Chunk : Natural;
end record;
Empty_Cursor : constant Cursor := (null, 0);
end Langkit_Support.Bump_Ptr_Vectors;
|
stcarrez/ada-servlet | Ada | 1,252 | ads | -----------------------------------------------------------------------
-- servlet-cookies-tests - Unit tests for Cookies
-- Copyright (C) 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 Servlet.Cookies.Tests is
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite);
type Test is new Util.Tests.Test with null record;
-- Test creation of cookie
procedure Test_Create_Cookie (T : in out Test);
procedure Test_To_Http_Header (T : in out Test);
procedure Test_Parse_Http_Header (T : in out Test);
end Servlet.Cookies.Tests;
|
andreas-kupries/critcl | Ada | 13,183 | adb | ----------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
-- --
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
-- $Id: test.adb 66 2005-08-17 18:20:58Z andreas_kupries $
-- The program has a few aims.
-- 1. Test ZLib.Ada95 thick binding functionality.
-- 2. Show the example of use main functionality of the ZLib.Ada95 binding.
-- 3. Build this program automatically compile all ZLib.Ada95 packages under
-- GNAT Ada95 compiler.
with ZLib.Streams;
with Ada.Streams.Stream_IO;
with Ada.Numerics.Discrete_Random;
with Ada.Text_IO;
with Ada.Calendar;
procedure Test is
use Ada.Streams;
use Stream_IO;
------------------------------------
-- Test configuration parameters --
------------------------------------
File_Size : Count := 100_000;
Continuous : constant Boolean := False;
Header : constant ZLib.Header_Type := ZLib.Default;
-- ZLib.None;
-- ZLib.Auto;
-- ZLib.GZip;
-- Do not use Header other then Default in ZLib versions 1.1.4
-- and older.
Strategy : constant ZLib.Strategy_Type := ZLib.Default_Strategy;
Init_Random : constant := 10;
-- End --
In_File_Name : constant String := "testzlib.in";
-- Name of the input file
Z_File_Name : constant String := "testzlib.zlb";
-- Name of the compressed file.
Out_File_Name : constant String := "testzlib.out";
-- Name of the decompressed file.
File_In : File_Type;
File_Out : File_Type;
File_Back : File_Type;
File_Z : ZLib.Streams.Stream_Type;
Filter : ZLib.Filter_Type;
Time_Stamp : Ada.Calendar.Time;
procedure Generate_File;
-- Generate file of spetsified size with some random data.
-- The random data is repeatable, for the good compression.
procedure Compare_Streams
(Left, Right : in out Root_Stream_Type'Class);
-- The procedure compearing data in 2 streams.
-- It is for compare data before and after compression/decompression.
procedure Compare_Files (Left, Right : String);
-- Compare files. Based on the Compare_Streams.
procedure Copy_Streams
(Source, Target : in out Root_Stream_Type'Class;
Buffer_Size : in Stream_Element_Offset := 1024);
-- Copying data from one stream to another. It is for test stream
-- interface of the library.
procedure Data_In
(Item : out Stream_Element_Array;
Last : out Stream_Element_Offset);
-- this procedure is for generic instantiation of
-- ZLib.Generic_Translate.
-- reading data from the File_In.
procedure Data_Out (Item : in Stream_Element_Array);
-- this procedure is for generic instantiation of
-- ZLib.Generic_Translate.
-- writing data to the File_Out.
procedure Stamp;
-- Store the timestamp to the local variable.
procedure Print_Statistic (Msg : String; Data_Size : ZLib.Count);
-- Print the time statistic with the message.
procedure Translate is new ZLib.Generic_Translate
(Data_In => Data_In,
Data_Out => Data_Out);
-- This procedure is moving data from File_In to File_Out
-- with compression or decompression, depend on initialization of
-- Filter parameter.
-------------------
-- Compare_Files --
-------------------
procedure Compare_Files (Left, Right : String) is
Left_File, Right_File : File_Type;
begin
Open (Left_File, In_File, Left);
Open (Right_File, In_File, Right);
Compare_Streams (Stream (Left_File).all, Stream (Right_File).all);
Close (Left_File);
Close (Right_File);
end Compare_Files;
---------------------
-- Compare_Streams --
---------------------
procedure Compare_Streams
(Left, Right : in out Ada.Streams.Root_Stream_Type'Class)
is
Left_Buffer, Right_Buffer : Stream_Element_Array (0 .. 16#FFF#);
Left_Last, Right_Last : Stream_Element_Offset;
begin
loop
Read (Left, Left_Buffer, Left_Last);
Read (Right, Right_Buffer, Right_Last);
if Left_Last /= Right_Last then
Ada.Text_IO.Put_Line ("Compare error :"
& Stream_Element_Offset'Image (Left_Last)
& " /= "
& Stream_Element_Offset'Image (Right_Last));
raise Constraint_Error;
elsif Left_Buffer (0 .. Left_Last)
/= Right_Buffer (0 .. Right_Last)
then
Ada.Text_IO.Put_Line ("ERROR: IN and OUT files is not equal.");
raise Constraint_Error;
end if;
exit when Left_Last < Left_Buffer'Last;
end loop;
end Compare_Streams;
------------------
-- Copy_Streams --
------------------
procedure Copy_Streams
(Source, Target : in out Ada.Streams.Root_Stream_Type'Class;
Buffer_Size : in Stream_Element_Offset := 1024)
is
Buffer : Stream_Element_Array (1 .. Buffer_Size);
Last : Stream_Element_Offset;
begin
loop
Read (Source, Buffer, Last);
Write (Target, Buffer (1 .. Last));
exit when Last < Buffer'Last;
end loop;
end Copy_Streams;
-------------
-- Data_In --
-------------
procedure Data_In
(Item : out Stream_Element_Array;
Last : out Stream_Element_Offset) is
begin
Read (File_In, Item, Last);
end Data_In;
--------------
-- Data_Out --
--------------
procedure Data_Out (Item : in Stream_Element_Array) is
begin
Write (File_Out, Item);
end Data_Out;
-------------------
-- Generate_File --
-------------------
procedure Generate_File is
subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#;
package Random_Elements is
new Ada.Numerics.Discrete_Random (Visible_Symbols);
Gen : Random_Elements.Generator;
Buffer : Stream_Element_Array := (1 .. 77 => 16#20#) & 10;
Buffer_Count : constant Count := File_Size / Buffer'Length;
-- Number of same buffers in the packet.
Density : constant Count := 30; -- from 0 to Buffer'Length - 2;
procedure Fill_Buffer (J, D : in Count);
-- Change the part of the buffer.
-----------------
-- Fill_Buffer --
-----------------
procedure Fill_Buffer (J, D : in Count) is
begin
for K in 0 .. D loop
Buffer
(Stream_Element_Offset ((J + K) mod (Buffer'Length - 1) + 1))
:= Random_Elements.Random (Gen);
end loop;
end Fill_Buffer;
begin
Random_Elements.Reset (Gen, Init_Random);
Create (File_In, Out_File, In_File_Name);
Fill_Buffer (1, Buffer'Length - 2);
for J in 1 .. Buffer_Count loop
Write (File_In, Buffer);
Fill_Buffer (J, Density);
end loop;
-- fill remain size.
Write
(File_In,
Buffer
(1 .. Stream_Element_Offset
(File_Size - Buffer'Length * Buffer_Count)));
Flush (File_In);
Close (File_In);
end Generate_File;
---------------------
-- Print_Statistic --
---------------------
procedure Print_Statistic (Msg : String; Data_Size : ZLib.Count) is
use Ada.Calendar;
use Ada.Text_IO;
package Count_IO is new Integer_IO (ZLib.Count);
Curr_Dur : Duration := Clock - Time_Stamp;
begin
Put (Msg);
Set_Col (20);
Ada.Text_IO.Put ("size =");
Count_IO.Put
(Data_Size,
Width => Stream_IO.Count'Image (File_Size)'Length);
Put_Line (" duration =" & Duration'Image (Curr_Dur));
end Print_Statistic;
-----------
-- Stamp --
-----------
procedure Stamp is
begin
Time_Stamp := Ada.Calendar.Clock;
end Stamp;
begin
Ada.Text_IO.Put_Line ("ZLib " & ZLib.Version);
loop
Generate_File;
for Level in ZLib.Compression_Level'Range loop
Ada.Text_IO.Put_Line ("Level ="
& ZLib.Compression_Level'Image (Level));
-- Test generic interface.
Open (File_In, In_File, In_File_Name);
Create (File_Out, Out_File, Z_File_Name);
Stamp;
-- Deflate using generic instantiation.
ZLib.Deflate_Init
(Filter => Filter,
Level => Level,
Strategy => Strategy,
Header => Header);
Translate (Filter);
Print_Statistic ("Generic compress", ZLib.Total_Out (Filter));
ZLib.Close (Filter);
Close (File_In);
Close (File_Out);
Open (File_In, In_File, Z_File_Name);
Create (File_Out, Out_File, Out_File_Name);
Stamp;
-- Inflate using generic instantiation.
ZLib.Inflate_Init (Filter, Header => Header);
Translate (Filter);
Print_Statistic ("Generic decompress", ZLib.Total_Out (Filter));
ZLib.Close (Filter);
Close (File_In);
Close (File_Out);
Compare_Files (In_File_Name, Out_File_Name);
-- Test stream interface.
-- Compress to the back stream.
Open (File_In, In_File, In_File_Name);
Create (File_Back, Out_File, Z_File_Name);
Stamp;
ZLib.Streams.Create
(Stream => File_Z,
Mode => ZLib.Streams.Out_Stream,
Back => ZLib.Streams.Stream_Access
(Stream (File_Back)),
Back_Compressed => True,
Level => Level,
Strategy => Strategy,
Header => Header);
Copy_Streams
(Source => Stream (File_In).all,
Target => File_Z);
-- Flushing internal buffers to the back stream.
ZLib.Streams.Flush (File_Z, ZLib.Finish);
Print_Statistic ("Write compress",
ZLib.Streams.Write_Total_Out (File_Z));
ZLib.Streams.Close (File_Z);
Close (File_In);
Close (File_Back);
-- Compare reading from original file and from
-- decompression stream.
Open (File_In, In_File, In_File_Name);
Open (File_Back, In_File, Z_File_Name);
ZLib.Streams.Create
(Stream => File_Z,
Mode => ZLib.Streams.In_Stream,
Back => ZLib.Streams.Stream_Access
(Stream (File_Back)),
Back_Compressed => True,
Header => Header);
Stamp;
Compare_Streams (Stream (File_In).all, File_Z);
Print_Statistic ("Read decompress",
ZLib.Streams.Read_Total_Out (File_Z));
ZLib.Streams.Close (File_Z);
Close (File_In);
Close (File_Back);
-- Compress by reading from compression stream.
Open (File_Back, In_File, In_File_Name);
Create (File_Out, Out_File, Z_File_Name);
ZLib.Streams.Create
(Stream => File_Z,
Mode => ZLib.Streams.In_Stream,
Back => ZLib.Streams.Stream_Access
(Stream (File_Back)),
Back_Compressed => False,
Level => Level,
Strategy => Strategy,
Header => Header);
Stamp;
Copy_Streams
(Source => File_Z,
Target => Stream (File_Out).all);
Print_Statistic ("Read compress",
ZLib.Streams.Read_Total_Out (File_Z));
ZLib.Streams.Close (File_Z);
Close (File_Out);
Close (File_Back);
-- Decompress to decompression stream.
Open (File_In, In_File, Z_File_Name);
Create (File_Back, Out_File, Out_File_Name);
ZLib.Streams.Create
(Stream => File_Z,
Mode => ZLib.Streams.Out_Stream,
Back => ZLib.Streams.Stream_Access
(Stream (File_Back)),
Back_Compressed => False,
Header => Header);
Stamp;
Copy_Streams
(Source => Stream (File_In).all,
Target => File_Z);
Print_Statistic ("Write decompress",
ZLib.Streams.Write_Total_Out (File_Z));
ZLib.Streams.Close (File_Z);
Close (File_In);
Close (File_Back);
Compare_Files (In_File_Name, Out_File_Name);
end loop;
Ada.Text_IO.Put_Line (Count'Image (File_Size) & " Ok.");
exit when not Continuous;
File_Size := File_Size + 1;
end loop;
end Test;
|
zhmu/ananas | Ada | 89 | ads | with Aggr9_Pkg; use Aggr9_Pkg;
package Aggr9 is
procedure Proc (X : R1);
end Aggr9;
|
charlie5/cBound | Ada | 1,568 | 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_delete_window_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;
glxwindow : aliased xcb.xcb_glx_window_t;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_delete_window_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_delete_window_request_t.Item,
Element_Array => xcb.xcb_glx_delete_window_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_delete_window_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_delete_window_request_t.Pointer,
Element_Array => xcb.xcb_glx_delete_window_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_glx_delete_window_request_t;
|
reznikmm/matreshka | Ada | 4,581 | 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_Db.User_Name_Attributes is
------------
-- Create --
------------
overriding function Create
(Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters)
return Db_User_Name_Attribute_Node is
begin
return Self : Db_User_Name_Attribute_Node do
Matreshka.ODF_Db.Constructors.Initialize
(Self'Unchecked_Access,
Parameters.Document,
Matreshka.ODF_String_Constants.Db_Prefix);
end return;
end Create;
--------------------
-- Get_Local_Name --
--------------------
overriding function Get_Local_Name
(Self : not null access constant Db_User_Name_Attribute_Node)
return League.Strings.Universal_String
is
pragma Unreferenced (Self);
begin
return Matreshka.ODF_String_Constants.User_Name_Attribute;
end Get_Local_Name;
begin
Matreshka.DOM_Documents.Register_Attribute
(Matreshka.ODF_String_Constants.Db_URI,
Matreshka.ODF_String_Constants.User_Name_Attribute,
Db_User_Name_Attribute_Node'Tag);
end Matreshka.ODF_Db.User_Name_Attributes;
|
sungyeon/drake | Ada | 9,876 | adb | -- convert UCD/UnicodeData.txt (13, 14)
-- bin/ucd_simplecasemapping $UCD/UnicodeData.txt > ../source/strings/a-uscama.ads
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Containers.Ordered_Maps;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Text_IO; use Ada.Text_IO;
procedure ucd_simplecasemapping is
function Value (S : String) return Wide_Wide_Character is
Img : constant String := "Hex_" & (1 .. 8 - S'Length => '0') & S;
begin
return Wide_Wide_Character'Value (Img);
end Value;
procedure Put_16 (Item : Integer) is
S : String (1 .. 8); -- "16#XXXX#"
begin
Put (S, Item, Base => 16);
S (1) := '1';
S (2) := '6';
S (3) := '#';
for I in reverse 4 .. 6 loop
if S (I) = '#' then
S (4 .. I) := (others => '0');
exit;
end if;
end loop;
Put (S);
end Put_16;
package WWC_Maps is
new Ada.Containers.Ordered_Maps (
Wide_Wide_Character,
Wide_Wide_Character);
use WWC_Maps;
function Compressible (I : WWC_Maps.Cursor) return Boolean is
begin
return Wide_Wide_Character'Pos (Element (I)) - Wide_Wide_Character'Pos (Key (I))
in -128 .. 127;
end Compressible;
Upper_Table, Lower_Table, Shared_Table : WWC_Maps.Map;
Upper_Num, Lower_Num : Natural;
type Bit is (In_16, In_32);
function Get_Bit (C : Wide_Wide_Character) return Bit is
begin
if C > Wide_Wide_Character'Val (16#FFFF#) then
return In_32;
else
return In_16;
end if;
end Get_Bit;
Shared_Num : array (Bit, Boolean) of Natural;
begin
declare
File : Ada.Text_IO.File_Type;
begin
Open (File, In_File, Argument (1));
while not End_Of_File (File) loop
declare
Line : constant String := Get_Line (File);
type Range_Type is record
First : Positive;
Last : Natural;
end record;
Fields : array (1 .. 14) of Range_Type;
P : Positive := Line'First;
N : Natural;
Code : Wide_Wide_Character;
begin
for I in Fields'Range loop
N := P;
while N <= Line'Last and then Line (N) /= ';' loop
N := N + 1;
end loop;
if (N <= Line'Last) /= (I < Field'Last) then
raise Data_Error with Line & " -- A";
end if;
Fields (I).First := P;
Fields (I).Last := N - 1;
P := N + 1; -- skip ';'
end loop;
Code := Value (Line (Fields (1).First .. Fields (1).Last));
if Fields (13).First <= Fields (13).Last then -- uppercase
Insert (
Upper_Table,
Code,
Value (Line (Fields (13).First .. Fields (13).Last)));
end if;
if Fields (14).First <= Fields (14).Last then -- lowercase
Insert (
Lower_Table,
Code,
Value (Line (Fields (14).First .. Fields (14).Last)));
end if;
-- note: last field (15) is titlecase.
end;
end loop;
Close (File);
end;
Upper_Num := Natural (Length (Upper_Table));
Lower_Num := Natural (Length (Lower_Table));
declare
I : WWC_Maps.Cursor := First (Lower_Table);
begin
while Has_Element (I) loop
if Contains (Upper_Table, Element (I))
and then Element (Upper_Table, Element (I)) = Key (I)
then
Insert (Shared_Table, Key (I), Element (I));
end if;
I := Next (I);
end loop;
end;
for B in Bit loop
for Compressed in Boolean loop
Shared_Num (B, Compressed) := 0;
end loop;
end loop;
declare
I : WWC_Maps.Cursor := First (Shared_Table);
begin
while Has_Element (I) loop
declare
B : Bit := Get_Bit (Key (I));
begin
if Compressible (I) then
declare
K : Wide_Wide_Character := Key (I);
E : Wide_Wide_Character := Element (I);
N : WWC_Maps.Cursor := Next (I);
RLE : Positive := 1;
Compressed : Boolean;
begin
while Has_Element (N)
and then RLE < 255
and then Compressible (N)
and then Key (N) = Wide_Wide_Character'Succ (K)
and then Element (N) = Wide_Wide_Character'Succ (E)
loop
K := Key (N);
E := Element (N);
N := Next (N);
RLE := RLE + 1;
end loop;
I := N;
Compressed := RLE > 1;
Shared_Num (B, Compressed) := Shared_Num (B, Compressed) + 1;
end;
else
Shared_Num (B, False) := Shared_Num (B, False) + 1;
I := Next (I);
end if;
end;
end loop;
end;
Put_Line ("pragma License (Unrestricted);");
Put_Line ("-- implementation unit, translated from UnicodeData.txt (13, 14)");
Put_Line ("package Ada.UCD.Simple_Case_Mapping is");
Put_Line (" pragma Pure;");
New_Line;
Put (" L_Total : constant := ");
Put (Lower_Num, Width => 1);
Put (";");
New_Line;
Put (" U_Total : constant := ");
Put (Upper_Num, Width => 1);
Put (";");
New_Line;
New_Line;
Put_Line (" type Run_Length_8 is mod 2 ** 8;");
New_Line;
Put_Line (" type Compressed_Item_Type is record");
Put_Line (" Start : UCS_2;");
Put_Line (" Length : Run_Length_8;");
Put_Line (" Diff : Difference_8;");
Put_Line (" end record;");
Put_Line (" pragma Suppress_Initialization (Compressed_Item_Type);");
Put_Line (" for Compressed_Item_Type'Size use 32; -- 16 + 8 + 8");
Put_Line (" for Compressed_Item_Type use record");
Put_Line (" Start at 0 range 0 .. 15;");
Put_Line (" Length at 0 range 16 .. 23;");
Put_Line (" Diff at 0 range 24 .. 31;");
Put_Line (" end record;");
New_Line;
Put_Line (" type Compressed_Type is array (Positive range <>) of Compressed_Item_Type;");
Put_Line (" pragma Suppress_Initialization (Compressed_Type);");
Put_Line (" for Compressed_Type'Component_Size use 32;");
New_Line;
Put (" subtype SL_Table_XXXX_Type is Map_16x1_Type (1 .. ");
Put (Shared_Num (In_16, False), Width => 1);
Put (");");
New_Line;
Put (" subtype SL_Table_XXXX_Compressed_Type is Compressed_Type (1 .. ");
Put (Shared_Num (In_16, True), Width => 1);
Put (");");
New_Line;
Put (" subtype SL_Table_1XXXX_Compressed_Type is Compressed_Type (1 .. ");
Put (Shared_Num (In_32, True), Width => 1);
Put (");");
New_Line;
if Shared_Num (In_32, False) /= 0 then
raise Data_Error with "num of shared";
end if;
Put (" subtype DL_Table_XXXX_Type is Map_16x1_Type (1 .. ");
Put (Lower_Num - Natural (Length (Shared_Table)), Width => 1);
Put (");");
New_Line;
Put (" subtype DU_Table_XXXX_Type is Map_16x1_Type (1 .. ");
Put (Upper_Num - Natural (Length (Shared_Table)), Width => 1);
Put (");");
New_Line;
New_Line;
for B in Bit loop
for Compressed in Boolean loop
if Shared_Num (B, Compressed) > 0 then
Put (" SL_Table_");
if B = In_32 then
Put ("1");
end if;
Put ("XXXX");
if Compressed then
Put ("_Compressed");
end if;
Put (" : constant SL_Table_");
if B = In_32 then
Put ("1");
end if;
Put ("XXXX");
if Compressed then
Put ("_Compressed");
end if;
Put ("_Type := (");
New_Line;
declare
Offset : Integer := 0;
I : WWC_Maps.Cursor := First (Shared_Table);
Second : Boolean := False;
begin
if B = In_32 then
Offset := 16#10000#;
end if;
while Has_Element (I) loop
declare
Item_B : Bit := Get_Bit (Key (I));
Item_RLE : Positive := 1;
N : WWC_Maps.Cursor := Next (I);
begin
if Compressible (I) then
declare
K : Wide_Wide_Character := Key (I);
E : Wide_Wide_Character := Element (I);
begin
while Has_Element (N)
and then Item_RLE < 255
and then Compressible (N)
and then Key (N) = Wide_Wide_Character'Succ (K)
and then Element (N) = Wide_Wide_Character'Succ (E)
loop
K := Key (N);
E := Element (N);
N := Next (N);
Item_RLE := Item_RLE + 1;
end loop;
end;
end if;
if Item_B = B
and then (Item_RLE > 1) = Compressed
then
if Second then
Put (",");
New_Line;
end if;
Put (" ");
if Shared_Num (B, Compressed) = 1 then
Put ("1 => ");
end if;
Put ("(");
Put_16 (Wide_Wide_Character'Pos (Key (I)) - Offset);
Put (", ");
if Compressed then
Put (Item_RLE, Width => 1);
Put (", ");
Put (
Wide_Wide_Character'Pos (Element (I))
- Wide_Wide_Character'Pos (Key (I)),
Width => 1);
else
Put_16 (
Wide_Wide_Character'Pos (Element (I)) - Offset);
end if;
Put (")");
Second := True;
end if;
I := N;
end;
end loop;
Put (");");
New_Line;
end;
New_Line;
end if;
end loop;
end loop;
Put_Line (" DL_Table_XXXX : constant DL_Table_XXXX_Type := (");
declare
I : WWC_Maps.Cursor := First (Lower_Table);
Second : Boolean := False;
begin
while Has_Element (I) loop
if not (
Contains (Shared_Table, Key (I))
and then Element (Shared_Table, Key (I)) = Element (I))
then
if Second then
Put (",");
New_Line;
end if;
Put (" (");
Put_16 (Wide_Wide_Character'Pos (Key (I)));
Put (", ");
Put_16 (Wide_Wide_Character'Pos (Element (I)));
Put (")");
Second := True;
end if;
I := Next (I);
end loop;
Put (");");
New_Line;
end;
New_Line;
Put_Line (" DU_Table_XXXX : constant DU_Table_XXXX_Type := (");
declare
I : WWC_Maps.Cursor := First (Upper_Table);
Second : Boolean := False;
begin
while Has_Element (I) loop
if not (
Contains (Shared_Table, Element (I))
and then Element (Shared_Table, Element (I)) = Key (I))
then
if Second then
Put (",");
New_Line;
end if;
Put (" (");
Put_16 (Wide_Wide_Character'Pos (Key (I)));
Put (", ");
Put_16 (Wide_Wide_Character'Pos (Element (I)));
Put (")");
Second := True;
end if;
I := Next (I);
end loop;
Put (");");
New_Line;
end;
New_Line;
Put_Line ("end Ada.UCD.Simple_Case_Mapping;");
end ucd_simplecasemapping;
|
zertovitch/excel-writer | Ada | 3,225 | adb | ------------------------------------------------------------------------------
-- File: CSV2HTML.adb
-- Description: Converts CSV (text with Comma Separated Values) input
-- into HTML array output.
-- CSV is "the" ASCII format for Lotus 1-2-3 and MS Excel
-- Created: 11-Nov-2002
-- Syntax (example) csv2html <demo_data.csv >demo_data.html
-- Author: Gautier de Montmollin
------------------------------------------------------------------------------
with Ada.Text_IO, Ada.Strings.Fixed;
with CSV; -- replaces CSV_Parser
procedure CSV2HTML is
function Windows8bit_to_HTML (c : Character) return String is
begin
case c is
when 'à' => return "à";
when 'â' => return "â";
when 'ä' => return "ä";
when 'Ä' => return "Ä";
when 'é' => return "é";
when 'É' => return "É";
when 'è' => return "è";
when 'È' => return "È";
when 'î' => return "î";
when 'ô' => return "ô";
when 'ö' => return "ö";
when 'Ö' => return "Ö";
when 'ß' => return "ß";
when 'û' => return "û";
when 'ü' => return "ü";
when 'Ü' => return "Ü";
when '’' => return "'";
when '´' => return "'";
when ' ' => return " ";
when others =>
return (1 => c);
end case;
end Windows8bit_to_HTML;
function Windows8bit_to_HTML (s : String) return String is
begin
if s = "" then
return "";
else
return
Windows8bit_to_HTML (s (s'First)) &
Windows8bit_to_HTML (s (s'First + 1 .. s'Last));
end if;
end Windows8bit_to_HTML;
line_count : Natural := 0;
special_sport : constant Boolean := False;
separator : constant Character := ',';
-- ';', ',' or ASCII.HT
use Ada.Text_IO, Ada.Strings;
begin
Put_Line ("<!-- Array translated by CSV2HTML !--> ");
Put_Line ("<!-- Check http://excel-writer.sourceforge.net/ , !--> ");
Put_Line ("<!-- in the ./extras directory !--> ");
Put_Line ("<table border=2><tr>");
--
while not End_Of_File loop
line_count := line_count + 1;
declare
csv_line : constant String := Get_Line;
bds : constant CSV.Fields_Bounds := CSV.Get_Bounds (csv_line, separator);
begin
for i in bds'Range loop
Put ("<td>");
-- Trim blanks on both sides (7-Dec-2003)
Put (
Windows8bit_to_HTML (
Ada.Strings.Fixed.Trim (CSV.Extract (csv_line, bds, i), Both)
)
);
Put ("</td>");
end loop;
end;
Put_Line ("</td></tr>");
--
if special_sport then
case line_count is
when 1 => Put ("<tr bgcolor=#fbee33>"); -- Gold
when 2 => Put ("<tr bgcolor=#c3c3c3>"); -- Silver
when 3 => Put ("<tr bgcolor=#c89544>"); -- Bronze
when others => Put ("<tr>");
end case;
else
Put ("<tr>");
end if;
--
end loop;
Put_Line ("</tr></table>");
end CSV2HTML;
|
reznikmm/gela | Ada | 1,489 | ads | ------------------------------------------------------------------------------
-- G E L A G R A M M A R S --
-- Library for dealing with tests for for Gela project, --
-- a portable Ada compiler --
-- http://gela.ada-ru.org/ --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license in gela.ads file --
------------------------------------------------------------------------------
with Gela.Test_Cases;
with Gela.Test_Iterators;
package Gela.Test_Iterators.Append is
type Iterator is new Gela.Test_Iterators.Iterator with private;
function "+"
(Left, Right : Gela.Test_Iterators.Iterator'Class) return Iterator;
-- Concatenate two iterators.
procedure Start (Self : in out Iterator);
function Has_More_Tests (Self : Iterator) return Boolean;
procedure Next
(Self : in out Iterator;
Test : out Gela.Test_Cases.Test_Case_Access);
private
type Iterator_Access is access all Gela.Test_Iterators.Iterator'Class;
type Side_Kind is (Left, Right);
type Iterator_Access_Array is array (Side_Kind) of Iterator_Access;
type Iterator is new Gela.Test_Iterators.Iterator with record
Side : Side_Kind;
List : Iterator_Access_Array;
end record;
end Gela.Test_Iterators.Append;
|
stcarrez/ada-util | Ada | 18,572 | adb | -----------------------------------------------------------------------
-- serialize-io-xml-tests -- Unit tests for XML serialization
-- Copyright (C) 2011, 2012, 2016, 2017, 2018, 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.Stream_IO;
with Util.Test_Caller;
with Util.Log.Loggers;
with Util.Streams.Files;
with Util.Serialize.IO.JSON.Tests;
with Util.Serialize.Mappers.Record_Mapper;
package body Util.Serialize.IO.XML.Tests is
use Util.Log;
use Util.Tests;
use Ada.Strings.Unbounded;
Log : constant Loggers.Logger := Loggers.Create ("Util.Serialize.IO.Tests");
type Map_Test is record
Value : Natural := 0;
Bool : Boolean := False;
Name : Unbounded_String;
Node : Util.Beans.Objects.Object;
end record;
type Map_Test_Access is access all Map_Test;
type Map_Test_Fields is (FIELD_VALUE, FIELD_BOOL, FIELD_NAME, FIELD_NODE);
function Get_Member (P : in Map_Test;
Field : in Map_Test_Fields) return Util.Beans.Objects.Object;
procedure Set_Member (P : in out Map_Test;
Field : in Map_Test_Fields;
Value : in Util.Beans.Objects.Object);
procedure Set_Member (P : in out Map_Test;
Field : in Map_Test_Fields;
Value : in Util.Beans.Objects.Object) is
begin
case Field is
when FIELD_VALUE =>
P.Value := Natural (Util.Beans.Objects.To_Integer (Value));
when FIELD_BOOL =>
P.Bool := Util.Beans.Objects.To_Boolean (Value);
when FIELD_NAME =>
P.Name := Util.Beans.Objects.To_Unbounded_String (Value);
if P.Name = "raise-field-error" then
raise Util.Serialize.Mappers.Field_Error with "Testing Field_Error exception";
end if;
if P.Name = "raise-field-fatal-error" then
raise Util.Serialize.Mappers.Field_Fatal_Error with "Testing Fatal_Error exception";
end if;
when FIELD_NODE =>
P.Node := Value;
end case;
end Set_Member;
function Get_Member (P : in Map_Test;
Field : in Map_Test_Fields) return Util.Beans.Objects.Object is
begin
case Field is
when FIELD_VALUE =>
return Util.Beans.Objects.To_Object (P.Value);
when FIELD_BOOL =>
return Util.Beans.Objects.To_Object (P.Bool);
when FIELD_NAME =>
return Util.Beans.Objects.To_Object (P.Name);
when FIELD_NODE =>
return P.Node;
end case;
end Get_Member;
package Map_Test_Mapper is
new Util.Serialize.Mappers.Record_Mapper (Element_Type => Map_Test,
Element_Type_Access => Map_Test_Access,
Fields => Map_Test_Fields,
Set_Member => Set_Member);
package Caller is new Util.Test_Caller (Test, "Serialize.IO.XML");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test Util.Serialize.IO.XML.Parser",
Test_Parser'Access);
Caller.Add_Test (Suite, "Test Util.Serialize.IO.XML.Parser2",
Test_Parser2'Access);
Caller.Add_Test (Suite, "Test Util.Serialize.IO.XML.Parser Wildcard Mapping",
Test_Parser_Wildcard_Mapping'Access);
Caller.Add_Test (Suite, "Test Util.Serialize.IO.XML.Parser Deep_Wildcard Mapping",
Test_Parser_Deep_Wildcard_Mapping'Access);
Caller.Add_Test (Suite, "Test Util.Serialize.IO.XML.Parser_Error",
Test_Parser_Error'Access);
Caller.Add_Test (Suite, "Test Util.Serialize.IO.XML.Write",
Test_Writer'Access);
Caller.Add_Test (Suite, "Test Util.Serialize.IO.XML.Write",
Test_Output'Access);
end Add_Tests;
-- ------------------------------
-- Test XML de-serialization
-- ------------------------------
procedure Test_Parser (T : in out Test) is
Mapping : aliased Map_Test_Mapper.Mapper;
Result : aliased Map_Test;
Reader : Util.Serialize.IO.XML.Parser;
Mapper : Util.Serialize.Mappers.Processing;
begin
Mapping.Add_Mapping ("name", FIELD_NAME);
Mapping.Add_Mapping ("value", FIELD_VALUE);
Mapping.Add_Mapping ("status", FIELD_BOOL);
Mapping.Add_Mapping ("@bool", FIELD_BOOL);
Mapping.Add_Mapping ("@id", FIELD_VALUE);
Mapper.Add_Mapping ("info/node", Mapping'Unchecked_Access);
Map_Test_Mapper.Set_Context (Mapper, Result'Unchecked_Access);
-- Extract XML and check name, value, status
Reader.Parse_String ("<info><node><name>A</name><value>2</value>"
& "<status>1</status></node></info>", Mapper);
T.Assert (not Reader.Has_Error, "The parser indicates an error");
Assert_Equals (T, "A", Result.Name, "Invalid name");
Assert_Equals (T, 2, Result.Value, "Invalid value");
T.Assert (Result.Bool, "Invalid boolean");
-- Another extraction.
Map_Test_Mapper.Set_Context (Mapper, Result'Unchecked_Access);
Reader.Parse_String ("<info><node><name>B</name><value>20</value>"
& "<status>0</status></node></info>", Mapper);
T.Assert (not Reader.Has_Error, "The parser indicates an error");
Assert_Equals (T, "B", Result.Name, "Invalid name");
Assert_Equals (T, 20, Result.Value, "Invalid value");
T.Assert (not Result.Bool, "Invalid boolean");
-- Another extraction using attribute mappings.
Reader.Parse_String ("<info><node id='23' bool='true'><name>TOTO</name></node></info>",
Mapper);
T.Assert (not Reader.Has_Error, "The parser indicates an error");
Assert_Equals (T, "TOTO", Result.Name, "Invalid name");
Assert_Equals (T, 23, Result.Value, "Invalid value");
T.Assert (Result.Bool, "Invalid boolean");
end Test_Parser;
-- ------------------------------
-- Test XML de-serialization
-- ------------------------------
procedure Test_Parser2 (T : in out Test) is
use type Util.Beans.Objects.Data_Type;
Mapping : aliased Map_Test_Mapper.Mapper;
Result : aliased Map_Test;
Reader : Util.Serialize.IO.XML.Parser;
Mapper : Util.Serialize.Mappers.Processing;
begin
Mapping.Add_Mapping ("node/name", FIELD_NAME);
Mapping.Add_Mapping ("node/value", FIELD_VALUE);
Mapping.Add_Mapping ("node/status", FIELD_BOOL);
Mapping.Add_Mapping ("node/@bool", FIELD_BOOL);
Mapping.Add_Mapping ("node/@id", FIELD_VALUE);
Mapping.Add_Mapping ("node", FIELD_NODE);
Mapper.Add_Mapping ("info", Mapping'Unchecked_Access);
Map_Test_Mapper.Set_Context (Mapper, Result'Unchecked_Access);
Result.Node := Util.Beans.Objects.Null_Object;
-- Extract XML and check name, value, status
Reader.Parse_String ("<info><node><name>A</name><value>2</value>"
& "<status>1</status></node></info>", Mapper);
T.Assert (not Reader.Has_Error, "The parser indicates an error");
Assert_Equals (T, "A", Result.Name, "Invalid name");
Assert_Equals (T, 2, Result.Value, "Invalid value");
T.Assert (Result.Bool, "Invalid boolean");
T.Assert (Util.Beans.Objects.Get_Type (Result.Node) = Util.Beans.Objects.TYPE_STRING,
"Invalid node type");
-- Another extraction.
Reader.Parse_String ("<info><node><name>B</name><value>20</value>"
& "<status>0</status></node></info>", Mapper);
Assert_Equals (T, "B", Result.Name, "Invalid name");
Assert_Equals (T, 20, Result.Value, "Invalid value");
T.Assert (not Result.Bool, "Invalid boolean");
-- Another extraction using attribute mappings.
Reader.Parse_String ("<info><node id='23' bool='true'><name>TOTO</name></node></info>",
Mapper);
Assert_Equals (T, "TOTO", Result.Name, "Invalid name");
Assert_Equals (T, 23, Result.Value, "Invalid value");
T.Assert (Result.Bool, "Invalid boolean");
end Test_Parser2;
-- -----------------------
-- Test wildcard mapping for serialization.
-- -----------------------
procedure Test_Parser_Wildcard_Mapping (T : in out Test) is
use type Util.Beans.Objects.Data_Type;
Mapping : aliased Map_Test_Mapper.Mapper;
Result : aliased Map_Test;
Reader : Util.Serialize.IO.XML.Parser;
Mapper : Util.Serialize.Mappers.Processing;
begin
Mapping.Add_Mapping ("node/*/status", FIELD_BOOL);
Mapping.Add_Mapping ("node/*/name", FIELD_NAME);
Mapping.Add_Mapping ("node/*/value", FIELD_VALUE);
Mapping.Add_Mapping ("node/*/name/@bool", FIELD_BOOL);
Mapping.Add_Mapping ("node/@id", FIELD_VALUE);
Mapping.Add_Mapping ("node", FIELD_NODE);
Mapper.Add_Mapping ("info", Mapping'Unchecked_Access);
Map_Test_Mapper.Set_Context (Mapper, Result'Unchecked_Access);
Result.Node := Util.Beans.Objects.Null_Object;
-- Extract XML and check name, value, status
Reader.Parse_String ("<info><node><inner><name>A</name><value>2</value></inner>"
& "<status>1</status></node></info>", Mapper);
T.Assert (not Reader.Has_Error, "The parser indicates an error");
Assert_Equals (T, "A", Result.Name, "Invalid name");
Assert_Equals (T, 2, Result.Value, "Invalid value");
T.Assert (Result.Bool, "Invalid boolean");
T.Assert (Util.Beans.Objects.Get_Type (Result.Node) = Util.Beans.Objects.TYPE_STRING,
"Invalid node type");
-- Another extraction.
Reader.Parse_String ("<info><node><b><c><d><name>B</name><value>20</value></d></c></b>"
& "<status>0</status></node></info>", Mapper);
Assert_Equals (T, "B", Result.Name, "Invalid name");
Assert_Equals (T, 20, Result.Value, "Invalid value");
T.Assert (not Result.Bool, "Invalid boolean");
-- Another extraction using attribute mappings.
Reader.Parse_String ("<info><node id='23'><name bool='true'>TOTO</name></node></info>",
Mapper);
Assert_Equals (T, "TOTO", Result.Name, "Invalid name");
Assert_Equals (T, 23, Result.Value, "Invalid value");
T.Assert (Result.Bool, "Invalid boolean");
end Test_Parser_Wildcard_Mapping;
-- -----------------------
-- Test (**) wildcard mapping for serialization.
-- -----------------------
procedure Test_Parser_Deep_Wildcard_Mapping (T : in out Test) is
use type Util.Beans.Objects.Data_Type;
Mapping : aliased Map_Test_Mapper.Mapper;
Result : aliased Map_Test;
Reader : Util.Serialize.IO.XML.Parser;
Mapper : Util.Serialize.Mappers.Processing;
begin
Mapping.Add_Mapping ("**/node/@id", FIELD_VALUE);
Mapping.Add_Mapping ("**/node/name", FIELD_NAME);
Mapping.Add_Mapping ("**/node/name/@bool", FIELD_BOOL);
Mapping.Add_Mapping ("**/node", FIELD_NODE);
Mapping.Dump (Log);
Mapper.Add_Mapping ("info", Mapping'Unchecked_Access);
Map_Test_Mapper.Set_Context (Mapper, Result'Unchecked_Access);
Mapper.Dump (Log);
Result.Node := Util.Beans.Objects.Null_Object;
-- Extract XML and check name, value, status
Reader.Parse_String ("<info><node><node id='2'><name bool='1'>A</name>"
& "<value>2</value></node>"
& "<status>1</status></node></info>", Mapper);
T.Assert (not Reader.Has_Error, "The parser indicates an error");
Assert_Equals (T, "A", Result.Name, "Invalid name");
Assert_Equals (T, 2, Result.Value, "Invalid value");
T.Assert (Result.Bool, "Invalid boolean");
T.Assert (Util.Beans.Objects.Get_Type (Result.Node) = Util.Beans.Objects.TYPE_STRING,
"Invalid node type");
Reader.Parse_String ("<info><node><a><b><node id='3'><name bool='0'>B</name>"
& "<d><value>2</value></d></node></b></a>"
& "<status>1</status></node></info>", Mapper);
T.Assert (not Reader.Has_Error, "The parser indicates an error");
Assert_Equals (T, "B", Result.Name, "Invalid name");
Assert_Equals (T, 3, Result.Value, "Invalid value");
T.Assert (not Result.Bool, "Invalid boolean");
T.Assert (Util.Beans.Objects.Get_Type (Result.Node) = Util.Beans.Objects.TYPE_STRING,
"Invalid node type");
end Test_Parser_Deep_Wildcard_Mapping;
-- ------------------------------
-- Test XML de-serialization with some errors.
-- ------------------------------
procedure Test_Parser_Error (T : in out Test) is
procedure Check_Error (Content : in String;
Msg : in String);
procedure Check_Error (Content : in String;
Msg : in String) is
Mapping : aliased Map_Test_Mapper.Mapper;
Result : aliased Map_Test;
Reader : Util.Serialize.IO.XML.Parser;
Mapper : Util.Serialize.Mappers.Processing;
begin
Mapping.Add_Mapping ("node/name", FIELD_NAME);
Mapping.Add_Mapping ("node/value", FIELD_VALUE);
Mapping.Add_Mapping ("node/status", FIELD_BOOL);
Mapping.Add_Mapping ("node/@bool", FIELD_BOOL);
Mapping.Add_Mapping ("node/@id", FIELD_VALUE);
Mapping.Add_Mapping ("node", FIELD_NODE);
Mapper.Add_Mapping ("info", Mapping'Unchecked_Access);
Map_Test_Mapper.Set_Context (Mapper, Result'Unchecked_Access);
Result.Node := Util.Beans.Objects.Null_Object;
-- Extract XML and check name, value, status
Reader.Parse_String (Content, Mapper);
T.Assert (Reader.Has_Error, "No error reported by the parser for an invalid XML: " & Msg);
end Check_Error;
begin
Check_Error ("<info><node><name>A</name><value>2</value>"
& "<status>1</status></node>", "XML element is not closed");
Check_Error ("<info><node><name attr=>A</name><value>2</value>"
& "<status>1</status></node></info>", "XML attribute is not correct");
Check_Error ("<info><node><name attr='x'>A</name><value>&something;</value>"
& "<status>1</status></node></info>", "XML attribute is not correct");
Check_Error ("<info><node><name attr='x'>A</name><value>raise-field-error</value>"
& "<status>1</status></node></info>", "Field_Error exception");
Check_Error ("<info><node><name attr='x'>A</name><value>raise-fatal-error</value>"
& "<status>1</status></node></info>", "Field_Error exception");
Check_Error ("<info><node><name attr='x'>raise-field-error</name><value>3</value>"
& "<status>1</status></node></info>", "Field_Error exception");
Check_Error ("<info><node><name attr='x'>raise-field-fatal-error</name><value>3</value>"
& "<status>1</status></node></info>", "Field_Error exception");
end Test_Parser_Error;
-- ------------------------------
-- Test XML serialization
-- ------------------------------
procedure Test_Writer (T : in out Test) is
function Serialize (Value : in Map_Test) return String;
Mapping : aliased Map_Test_Mapper.Mapper;
Result : aliased Map_Test;
Mapper : Util.Serialize.Mappers.Processing;
function Serialize (Value : in Map_Test) return String is
Buffer : aliased Util.Streams.Texts.Print_Stream;
Output : Util.Serialize.IO.XML.Output_Stream;
begin
Buffer.Initialize (Size => 10000);
Output.Initialize (Output => Buffer'Unchecked_Access);
Mapping.Write (Output, Value);
return Util.Streams.Texts.To_String (Buffer);
end Serialize;
begin
Mapping.Add_Mapping ("name", FIELD_NAME);
Mapping.Add_Mapping ("value", FIELD_VALUE);
Mapping.Add_Mapping ("status", FIELD_BOOL);
-- Mapping.Add_Mapping ("@bool", FIELD_BOOL);
-- Mapping.Add_Mapping ("@id", FIELD_VALUE);
Mapping.Bind (Get_Member'Access);
Mapper.Add_Mapping ("info/node", Mapping'Unchecked_Access);
Result.Name := To_Unbounded_String ("test");
Result.Bool := False;
Result.Value := 23;
declare
XML : constant String := Serialize (Result);
begin
Log.Info ("Serialize XML: {0}", XML);
T.Assert (XML'Length > 0, "Invalid XML serialization");
end;
end Test_Writer;
-- ------------------------------
-- Test the XML output stream generation.
-- ------------------------------
procedure Test_Output (T : in out Test) is
File : aliased Util.Streams.Files.File_Stream;
Buffer : aliased Util.Streams.Texts.Print_Stream;
Stream : Util.Serialize.IO.XML.Output_Stream;
Expect : constant String := Util.Tests.Get_Path ("regtests/expect/test-stream.xml");
Path : constant String := Util.Tests.Get_Test_Path ("test-stream.xml");
begin
File.Create (Mode => Ada.Streams.Stream_IO.Out_File, Name => Path);
Buffer.Initialize (Output => File'Unchecked_Access, Size => 10000);
Stream.Initialize (Output => Buffer'Unchecked_Access);
Util.Serialize.IO.JSON.Tests.Write_Stream (Stream);
Stream.Close;
Util.Tests.Assert_Equal_Files (T => T,
Expect => Expect,
Test => Path,
Message => "XML output serialization");
end Test_Output;
end Util.Serialize.IO.XML.Tests;
|
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.Table_Orientation_Attributes is
pragma Preelaborate;
type ODF_Table_Orientation_Attribute is limited interface
and XML.DOM.Attributes.DOM_Attribute;
type ODF_Table_Orientation_Attribute_Access is
access all ODF_Table_Orientation_Attribute'Class
with Storage_Size => 0;
end ODF.DOM.Table_Orientation_Attributes;
|
msrLi/portingSources | Ada | 976 | ads | -- Copyright 2008-2014 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package Pck is
type Data is record
One : Integer;
Two : Integer;
Three : Integer;
Four : Integer;
Five : Integer;
Six : Integer;
end record;
procedure Call_Me (D : in out Data);
end Pck;
|
sparre/JSA | Ada | 3,144 | adb | ------------------------------------------------------------------------------
--
-- package Debugging (body)
--
------------------------------------------------------------------------------
-- Update information:
--
-- 1996.04.05 (Jacob Sparre Andersen)
-- Written.
--
-- 1996.05.07 (Jacob S. A. and Jesper H. V. L.)
-- Modified formatting.
--
-- 1996.07.26 (Jacob Sparre Andersen)
-- Removed the dependence of Debug on the redirection.
-- Removed the use of unbounded strings in the redirection routine.
--
-- 1996.09.09 (Jacob Sparre Andersen)
-- Added exception reporting to the initialization.
--
-- 1996.12.03 (Jacob Sparre Andersen)
-- Specified the Mode parameter for opening the Error_Log
--
-- 1998.03.14 (Jacob Sparre Andersen)
-- Commented the calls to Ada.Text_IO.Flush out.
--
-- (Insert additional update information above this line.)
------------------------------------------------------------------------------
with Ada.Command_Line;
with Ada.Text_IO;
package body JSA.Debugging is
---------------------------------------------------------------------------
-- procedure Message:
--
-- Writes a message to Current_Error if debugging is activated.
procedure Message (Item : in String) is
use Ada.Text_IO;
begin -- Message
if Debug then
Put (Current_Error, Item);
-- Flush (Current_Error);
end if;
exception
when others =>
Put_Line ("Unexpected exception raised in Debugging.Message");
raise;
end Message;
---------------------------------------------------------------------------
-- procedure Message_Line:
--
-- Writes a message and a new line to Current_Error if debugging is
-- activated.
procedure Message_Line (Item : in String) is
use Ada.Text_IO;
begin -- Message_Line
if Debug then
Put_Line (Current_Error, Item);
-- Flush (Current_Error);
end if;
exception
when others =>
Put_Line ("Unexpected exception raised in Debugging.Message_Line");
raise;
end Message_Line;
---------------------------------------------------------------------------
use Ada.Command_Line;
use Ada.Text_IO;
Error_Log : File_Type;
Log_To_Current_Error : Boolean := True;
Log_File_Argument_Index : Positive;
begin -- Debugging
for Index in 1 .. Argument_Count - 1 loop
if Argument (Index) = "-errorlog" then
Log_To_Current_Error := False;
Log_File_Argument_Index := Index + 1;
exit;
end if;
end loop;
if not Log_To_Current_Error then
if Argument (Log_File_Argument_Index) = "-" then
Set_Error (Standard_Output);
else
Create (File => Error_Log,
Name => Argument (Log_File_Argument_Index),
Mode => Out_File);
Set_Error (Error_Log);
end if;
end if;
exception
when others =>
Put_Line (Current_Error,
"Unexpected exception raised while initializing package " &
"Debugging.");
raise;
end JSA.Debugging;
|
sungyeon/drake | Ada | 448 | ads | pragma License (Unrestricted);
-- Ada 2012
with Ada.Characters.Conversions;
with Ada.Strings.Generic_Hash_Case_Insensitive;
function Ada.Strings.Wide_Wide_Hash_Case_Insensitive is
new Generic_Hash_Case_Insensitive (
Wide_Wide_Character,
Wide_Wide_String,
Characters.Conversions.Get);
-- pragma Pure (Ada.Strings.Wide_Wide_Hash_Case_Insensitive);
pragma Preelaborate (Ada.Strings.Wide_Wide_Hash_Case_Insensitive); -- use maps
|
zhmu/ananas | Ada | 16,210 | adb | -- { dg-do run }
with Ada.Text_IO; use Ada.Text_IO;
with GNAT; use GNAT;
with GNAT.Sets; use GNAT.Sets;
procedure Sets1 is
function Hash (Key : Integer) return Bucket_Range_Type;
package Integer_Sets is new Membership_Sets
(Element_Type => Integer,
"=" => "=",
Hash => Hash);
use Integer_Sets;
procedure Check_Empty
(Caller : String;
S : Membership_Set;
Low_Elem : Integer;
High_Elem : Integer);
-- Ensure that none of the elements in the range Low_Elem .. High_Elem are
-- present in set S, and that the set's length is 0.
procedure Check_Locked_Mutations
(Caller : String;
S : in out Membership_Set);
-- Ensure that all mutation operations of set S are locked
procedure Check_Present
(Caller : String;
S : Membership_Set;
Low_Elem : Integer;
High_Elem : Integer);
-- Ensure that all elements in the range Low_Elem .. High_Elem are present
-- in set S.
procedure Check_Unlocked_Mutations
(Caller : String;
S : in out Membership_Set);
-- Ensure that all mutation operations of set S are unlocked
procedure Populate
(S : Membership_Set;
Low_Elem : Integer;
High_Elem : Integer);
-- Add elements in the range Low_Elem .. High_Elem in set S
procedure Test_Contains
(Low_Elem : Integer;
High_Elem : Integer;
Init_Size : Positive);
-- Verify that Contains properly identifies that elements in the range
-- Low_Elem .. High_Elem are within a set. Init_Size denotes the initial
-- size of the set.
procedure Test_Create;
-- Verify that all set operations fail on a non-created set
procedure Test_Delete
(Low_Elem : Integer;
High_Elem : Integer;
Init_Size : Positive);
-- Verify that Delete properly removes elements in the range Low_Elem ..
-- High_Elem from a set. Init_Size denotes the initial size of the set.
procedure Test_Is_Empty;
-- Verify that Is_Empty properly returns this status of a set
procedure Test_Iterate;
-- Verify that iterators properly manipulate mutation operations
procedure Test_Iterate_Empty;
-- Verify that iterators properly manipulate mutation operations of an
-- empty set.
procedure Test_Iterate_Forced
(Low_Elem : Integer;
High_Elem : Integer;
Init_Size : Positive);
-- Verify that an iterator that is forcefully advanced by Next properly
-- unlocks the mutation operations of a set. Init_Size denotes the initial
-- size of the set.
procedure Test_Size;
-- Verify that Size returns the correct size of a set
-----------------
-- Check_Empty --
-----------------
procedure Check_Empty
(Caller : String;
S : Membership_Set;
Low_Elem : Integer;
High_Elem : Integer)
is
Siz : constant Natural := Size (S);
begin
for Elem in Low_Elem .. High_Elem loop
if Contains (S, Elem) then
Put_Line ("ERROR: " & Caller & ": extra element" & Elem'Img);
end if;
end loop;
if Siz /= 0 then
Put_Line ("ERROR: " & Caller & ": wrong size");
Put_Line ("expected: 0");
Put_Line ("got :" & Siz'Img);
end if;
end Check_Empty;
----------------------------
-- Check_Locked_Mutations --
----------------------------
procedure Check_Locked_Mutations
(Caller : String;
S : in out Membership_Set)
is
begin
begin
Delete (S, 1);
Put_Line ("ERROR: " & Caller & ": Delete: no exception raised");
exception
when Iterated =>
null;
when others =>
Put_Line ("ERROR: " & Caller & ": Delete: unexpected exception");
end;
begin
Destroy (S);
Put_Line ("ERROR: " & Caller & ": Destroy: no exception raised");
exception
when Iterated =>
null;
when others =>
Put_Line ("ERROR: " & Caller & ": Destroy: unexpected exception");
end;
begin
Insert (S, 1);
Put_Line ("ERROR: " & Caller & ": Insert: no exception raised");
exception
when Iterated =>
null;
when others =>
Put_Line ("ERROR: " & Caller & ": Insert: unexpected exception");
end;
end Check_Locked_Mutations;
-------------------
-- Check_Present --
-------------------
procedure Check_Present
(Caller : String;
S : Membership_Set;
Low_Elem : Integer;
High_Elem : Integer)
is
Elem : Integer;
Iter : Iterator;
begin
Iter := Iterate (S);
for Exp_Elem in Low_Elem .. High_Elem loop
Next (Iter, Elem);
if Elem /= Exp_Elem then
Put_Line ("ERROR: " & Caller & ": Check_Present: wrong element");
Put_Line ("expected:" & Exp_Elem'Img);
Put_Line ("got :" & Elem'Img);
end if;
end loop;
-- At this point all elements should have been accounted for. Check for
-- extra elements.
while Has_Next (Iter) loop
Next (Iter, Elem);
Put_Line
("ERROR: " & Caller & ": Check_Present: extra element" & Elem'Img);
end loop;
exception
when Iterator_Exhausted =>
Put_Line
("ERROR: "
& Caller
& "Check_Present: incorrect number of elements");
end Check_Present;
------------------------------
-- Check_Unlocked_Mutations --
------------------------------
procedure Check_Unlocked_Mutations
(Caller : String;
S : in out Membership_Set)
is
begin
Delete (S, 1);
Insert (S, 1);
end Check_Unlocked_Mutations;
----------
-- Hash --
----------
function Hash (Key : Integer) return Bucket_Range_Type is
begin
return Bucket_Range_Type (Key);
end Hash;
--------------
-- Populate --
--------------
procedure Populate
(S : Membership_Set;
Low_Elem : Integer;
High_Elem : Integer)
is
begin
for Elem in Low_Elem .. High_Elem loop
Insert (S, Elem);
end loop;
end Populate;
-------------------
-- Test_Contains --
-------------------
procedure Test_Contains
(Low_Elem : Integer;
High_Elem : Integer;
Init_Size : Positive)
is
Low_Bogus : constant Integer := Low_Elem - 1;
High_Bogus : constant Integer := High_Elem + 1;
S : Membership_Set := Create (Init_Size);
begin
Populate (S, Low_Elem, High_Elem);
-- Ensure that the elements are contained in the set
for Elem in Low_Elem .. High_Elem loop
if not Contains (S, Elem) then
Put_Line
("ERROR: Test_Contains: element" & Elem'Img & " not in set");
end if;
end loop;
-- Ensure that arbitrary elements which were not inserted in the set are
-- not contained in the set.
if Contains (S, Low_Bogus) then
Put_Line
("ERROR: Test_Contains: element" & Low_Bogus'Img & " in set");
end if;
if Contains (S, High_Bogus) then
Put_Line
("ERROR: Test_Contains: element" & High_Bogus'Img & " in set");
end if;
Destroy (S);
end Test_Contains;
-----------------
-- Test_Create --
-----------------
procedure Test_Create is
Count : Natural;
Flag : Boolean;
Iter : Iterator;
S : Membership_Set;
begin
-- Ensure that every routine defined in the API fails on a set which
-- has not been created yet.
begin
Flag := Contains (S, 1);
Put_Line ("ERROR: Test_Create: Contains: no exception raised");
exception
when Not_Created =>
null;
when others =>
Put_Line ("ERROR: Test_Create: Contains: unexpected exception");
end;
begin
Delete (S, 1);
Put_Line ("ERROR: Test_Create: Delete: no exception raised");
exception
when Not_Created =>
null;
when others =>
Put_Line ("ERROR: Test_Create: Delete: unexpected exception");
end;
begin
Insert (S, 1);
Put_Line ("ERROR: Test_Create: Insert: no exception raised");
exception
when Not_Created =>
null;
when others =>
Put_Line ("ERROR: Test_Create: Insert: unexpected exception");
end;
begin
Flag := Is_Empty (S);
Put_Line ("ERROR: Test_Create: Is_Empty: no exception raised");
exception
when Not_Created =>
null;
when others =>
Put_Line ("ERROR: Test_Create: Is_Empty: unexpected exception");
end;
begin
Iter := Iterate (S);
Put_Line ("ERROR: Test_Create: Iterate: no exception raised");
exception
when Not_Created =>
null;
when others =>
Put_Line ("ERROR: Test_Create: Iterate: unexpected exception");
end;
begin
Count := Size (S);
Put_Line ("ERROR: Test_Create: Size: no exception raised");
exception
when Not_Created =>
null;
when others =>
Put_Line ("ERROR: Test_Create: Size: unexpected exception");
end;
end Test_Create;
-----------------
-- Test_Delete --
-----------------
procedure Test_Delete
(Low_Elem : Integer;
High_Elem : Integer;
Init_Size : Positive)
is
Iter : Iterator;
S : Membership_Set := Create (Init_Size);
begin
Populate (S, Low_Elem, High_Elem);
-- Delete all even elements
for Elem in Low_Elem .. High_Elem loop
if Elem mod 2 = 0 then
Delete (S, Elem);
end if;
end loop;
-- Ensure that all remaining odd elements are present in the set
for Elem in Low_Elem .. High_Elem loop
if Elem mod 2 /= 0 and then not Contains (S, Elem) then
Put_Line ("ERROR: Test_Delete: missing element" & Elem'Img);
end if;
end loop;
-- Delete all odd elements
for Elem in Low_Elem .. High_Elem loop
if Elem mod 2 /= 0 then
Delete (S, Elem);
end if;
end loop;
-- At this point the set should be completely empty
Check_Empty
(Caller => "Test_Delete",
S => S,
Low_Elem => Low_Elem,
High_Elem => High_Elem);
Destroy (S);
end Test_Delete;
-------------------
-- Test_Is_Empty --
-------------------
procedure Test_Is_Empty is
S : Membership_Set := Create (8);
begin
if not Is_Empty (S) then
Put_Line ("ERROR: Test_Is_Empty: set is not empty");
end if;
Insert (S, 1);
if Is_Empty (S) then
Put_Line ("ERROR: Test_Is_Empty: set is empty");
end if;
Delete (S, 1);
if not Is_Empty (S) then
Put_Line ("ERROR: Test_Is_Empty: set is not empty");
end if;
Destroy (S);
end Test_Is_Empty;
------------------
-- Test_Iterate --
------------------
procedure Test_Iterate is
Elem : Integer;
Iter_1 : Iterator;
Iter_2 : Iterator;
S : Membership_Set := Create (5);
begin
Populate (S, 1, 5);
-- Obtain an iterator. This action must lock all mutation operations of
-- the set.
Iter_1 := Iterate (S);
-- Ensure that every mutation routine defined in the API fails on a set
-- with at least one outstanding iterator.
Check_Locked_Mutations
(Caller => "Test_Iterate",
S => S);
-- Obtain another iterator
Iter_2 := Iterate (S);
-- Ensure that every mutation is still locked
Check_Locked_Mutations
(Caller => "Test_Iterate",
S => S);
-- Exhaust the first itertor
while Has_Next (Iter_1) loop
Next (Iter_1, Elem);
end loop;
-- Ensure that every mutation is still locked
Check_Locked_Mutations
(Caller => "Test_Iterate",
S => S);
-- Exhaust the second itertor
while Has_Next (Iter_2) loop
Next (Iter_2, Elem);
end loop;
-- Ensure that all mutation operations are once again callable
Check_Unlocked_Mutations
(Caller => "Test_Iterate",
S => S);
Destroy (S);
end Test_Iterate;
------------------------
-- Test_Iterate_Empty --
------------------------
procedure Test_Iterate_Empty is
Elem : Integer;
Iter : Iterator;
S : Membership_Set := Create (5);
begin
-- Obtain an iterator. This action must lock all mutation operations of
-- the set.
Iter := Iterate (S);
-- Ensure that every mutation routine defined in the API fails on a set
-- with at least one outstanding iterator.
Check_Locked_Mutations
(Caller => "Test_Iterate_Empty",
S => S);
-- Attempt to iterate over the elements
while Has_Next (Iter) loop
Next (Iter, Elem);
Put_Line
("ERROR: Test_Iterate_Empty: element" & Elem'Img & " exists");
end loop;
-- Ensure that all mutation operations are once again callable
Check_Unlocked_Mutations
(Caller => "Test_Iterate_Empty",
S => S);
Destroy (S);
end Test_Iterate_Empty;
-------------------------
-- Test_Iterate_Forced --
-------------------------
procedure Test_Iterate_Forced
(Low_Elem : Integer;
High_Elem : Integer;
Init_Size : Positive)
is
Elem : Integer;
Iter : Iterator;
S : Membership_Set := Create (Init_Size);
begin
Populate (S, Low_Elem, High_Elem);
-- Obtain an iterator. This action must lock all mutation operations of
-- the set.
Iter := Iterate (S);
-- Ensure that every mutation routine defined in the API fails on a set
-- with at least one outstanding iterator.
Check_Locked_Mutations
(Caller => "Test_Iterate_Forced",
S => S);
-- Forcibly advance the iterator until it raises an exception
begin
for Guard in Low_Elem .. High_Elem + 1 loop
Next (Iter, Elem);
end loop;
Put_Line
("ERROR: Test_Iterate_Forced: Iterator_Exhausted not raised");
exception
when Iterator_Exhausted =>
null;
when others =>
Put_Line ("ERROR: Test_Iterate_Forced: unexpected exception");
end;
-- Ensure that all mutation operations are once again callable
Check_Unlocked_Mutations
(Caller => "Test_Iterate_Forced",
S => S);
Destroy (S);
end Test_Iterate_Forced;
---------------
-- Test_Size --
---------------
procedure Test_Size is
S : Membership_Set := Create (6);
Siz : Natural;
begin
Siz := Size (S);
if Siz /= 0 then
Put_Line ("ERROR: Test_Size: wrong size");
Put_Line ("expected: 0");
Put_Line ("got :" & Siz'Img);
end if;
Populate (S, 1, 2);
Siz := Size (S);
if Siz /= 2 then
Put_Line ("ERROR: Test_Size: wrong size");
Put_Line ("expected: 2");
Put_Line ("got :" & Siz'Img);
end if;
Populate (S, 3, 6);
Siz := Size (S);
if Siz /= 6 then
Put_Line ("ERROR: Test_Size: wrong size");
Put_Line ("expected: 6");
Put_Line ("got :" & Siz'Img);
end if;
Destroy (S);
end Test_Size;
-- Start of processing for Operations
begin
Test_Contains
(Low_Elem => 1,
High_Elem => 5,
Init_Size => 5);
Test_Create;
Test_Delete
(Low_Elem => 1,
High_Elem => 10,
Init_Size => 10);
Test_Is_Empty;
Test_Iterate;
Test_Iterate_Empty;
Test_Iterate_Forced
(Low_Elem => 1,
High_Elem => 5,
Init_Size => 5);
Test_Size;
end Sets1;
|
AdaDoom3/bare_bones | Ada | 3,572 | adb | -- -*- Mode: Ada -*-
-- Filename : console.adb
-- Description : Implementation of a console for PC using VGA text mode.
-- Author : Luke A. Guest
-- Created On : Thu Jun 14 12:09:31 2012
-- Licence : See LICENCE in the root directory.
-------------------------------------------------------------------------------
package body Console is
procedure Put
(Char : Character;
X : Screen_Width_Range;
Y : Screen_Height_Range;
Foreground : Foreground_Colour := White;
Background : Background_Colour := Black) is
begin
Video_Memory (Y)(X).Char := Char;
Video_Memory (Y)(X).Colour.Foreground := Foreground;
Video_Memory (Y)(X).Colour.Background := Background;
end Put;
procedure Put
(Str : String;
X : Screen_Width_Range;
Y : Screen_Height_Range;
Foreground : Foreground_Colour := White;
Background : Background_Colour := Black) is
begin
for Index in Str'First .. Str'Last loop
Put (Str (Index),
X + Screen_Width_Range (Index) - 1,
Y,
Foreground,
Background);
end loop;
end Put;
-- procedure Put
-- (Data : in Natural;
-- X : in Screen_Width_Range;
-- Y : in Screen_Height_Range;
-- Foreground : in Foreground_Colour := White;
-- Background : in Background_Colour := Black) is
-- type Numbers_Type is array (0 .. 9) of Character;
-- Numbers : constant Numbers_Type :=
-- ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
-- Str : String (1 .. 20);
-- Value : Natural := Data;
-- Length : Natural := 1;
-- Mask : Natural := 16#0000_000F#;
-- procedure PutStringBackwards
-- (Str : in String;
-- Length : in Natural;
-- X : in Screen_Width_Range;
-- Y : in Screen_Height_Range;
-- Foreground : in Foreground_Colour := White;
-- Background : in Background_Colour := Black);
-- procedure PutStringBackwards
-- (Str : in String;
-- Length : in Natural;
-- X : in Screen_Width_Range;
-- Y : in Screen_Height_Range;
-- Foreground : in Foreground_Colour := White;
-- Background : in Background_Colour := Black) is
-- begin
-- for Index in reverse Integer (Str'First) .. Integer (Length) loop
-- Put (Str (Index),
-- X + Screen_Width_Range (Index) - 1,
-- Y,
-- Foreground,
-- Background);
-- end loop;
-- end PutStringBackwards;
-- begin
-- -- Find how many digits we need for this value.
-- while Value /= 0 loop
-- Str (Integer (Length)) := Numbers (Integer (Value and Mask));
-- Value := Value / 10;
-- Length := Length + 1;
-- end loop;
-- PutStringBackwards (Str, Length, X, Y, Foreground, Background);
-- end Put;
procedure Clear (Background : Background_Colour := Black) is
begin
for X in Screen_Width_Range'First .. Screen_Width_Range'Last loop
for Y in Screen_Height_Range'First .. Screen_Height_Range'Last loop
Put (' ', X, Y, Background => Background);
end loop;
end loop;
end Clear;
end Console;
|
muschellij2/FSL6.0.0 | Ada | 4,470 | adb | ----------------------------------------------------------------
-- ZLib for Ada thick binding. --
-- --
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
-- --
-- Open source license information is in the zlib.ads file. --
----------------------------------------------------------------
-- Continuous test for ZLib multithreading. If the test would fail
-- we should provide thread safe allocation routines for the Z_Stream.
--
-- $Id: mtest.adb,v 1.3 2010/07/15 14:24:17 mwebster Exp $
with ZLib;
with Ada.Streams;
with Ada.Numerics.Discrete_Random;
with Ada.Text_IO;
with Ada.Exceptions;
with Ada.Task_Identification;
procedure MTest is
use Ada.Streams;
use ZLib;
Stop : Boolean := False;
pragma Atomic (Stop);
subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#;
package Random_Elements is
new Ada.Numerics.Discrete_Random (Visible_Symbols);
task type Test_Task;
task body Test_Task is
Buffer : Stream_Element_Array (1 .. 100_000);
Gen : Random_Elements.Generator;
Buffer_First : Stream_Element_Offset;
Compare_First : Stream_Element_Offset;
Deflate : Filter_Type;
Inflate : Filter_Type;
procedure Further (Item : in Stream_Element_Array);
procedure Read_Buffer
(Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
-------------
-- Further --
-------------
procedure Further (Item : in Stream_Element_Array) is
procedure Compare (Item : in Stream_Element_Array);
-------------
-- Compare --
-------------
procedure Compare (Item : in Stream_Element_Array) is
Next_First : Stream_Element_Offset := Compare_First + Item'Length;
begin
if Buffer (Compare_First .. Next_First - 1) /= Item then
raise Program_Error;
end if;
Compare_First := Next_First;
end Compare;
procedure Compare_Write is new ZLib.Write (Write => Compare);
begin
Compare_Write (Inflate, Item, No_Flush);
end Further;
-----------------
-- Read_Buffer --
-----------------
procedure Read_Buffer
(Item : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset)
is
Buff_Diff : Stream_Element_Offset := Buffer'Last - Buffer_First;
Next_First : Stream_Element_Offset;
begin
if Item'Length <= Buff_Diff then
Last := Item'Last;
Next_First := Buffer_First + Item'Length;
Item := Buffer (Buffer_First .. Next_First - 1);
Buffer_First := Next_First;
else
Last := Item'First + Buff_Diff;
Item (Item'First .. Last) := Buffer (Buffer_First .. Buffer'Last);
Buffer_First := Buffer'Last + 1;
end if;
end Read_Buffer;
procedure Translate is new Generic_Translate
(Data_In => Read_Buffer,
Data_Out => Further);
begin
Random_Elements.Reset (Gen);
Buffer := (others => 20);
Main : loop
for J in Buffer'Range loop
Buffer (J) := Random_Elements.Random (Gen);
Deflate_Init (Deflate);
Inflate_Init (Inflate);
Buffer_First := Buffer'First;
Compare_First := Buffer'First;
Translate (Deflate);
if Compare_First /= Buffer'Last + 1 then
raise Program_Error;
end if;
Ada.Text_IO.Put_Line
(Ada.Task_Identification.Image
(Ada.Task_Identification.Current_Task)
& Stream_Element_Offset'Image (J)
& ZLib.Count'Image (Total_Out (Deflate)));
Close (Deflate);
Close (Inflate);
exit Main when Stop;
end loop;
end loop Main;
exception
when E : others =>
Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (E));
Stop := True;
end Test_Task;
Test : array (1 .. 4) of Test_Task;
pragma Unreferenced (Test);
Dummy : Character;
begin
Ada.Text_IO.Get_Immediate (Dummy);
Stop := True;
end MTest;
|
reznikmm/matreshka | Ada | 3,570 | ads | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Tools Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
-- Generates public API of the model.
------------------------------------------------------------------------------
package Generator.API is
procedure Generate_Public_API;
procedure Generate_Stubs;
end Generator.API;
|
AdaCore/langkit | Ada | 1,276 | ads | package Liblktlang.Implementation.Extensions is
function Langkit_Root_P_Fetch_Prelude
(Node : Bare_Langkit_Root) return Boolean;
function Decl_Short_Image (Node : Bare_Decl) return Text_Type;
-- Custom version of Short_Image for declarations. Include
-- the names of the entities it declares.
function Ref_Id_Short_Image (Node : Bare_Ref_Id) return Text_Type;
-- Custom version of Short_Image for referencing identifiers. Include
-- the identifier.
function Lkt_Node_P_Env_From_Vals_Internal
(Node : Bare_Lkt_Node;
Vals : Internal_Env_Kv_Array_Access) return Lexical_Env;
function Lkt_Node_P_Internal_Fetch_Referenced_Unit
(Node : Bare_Lkt_Node; Name : String_Type) return Internal_Unit;
-- Return the unit that this name designates. Load it if needed.
function String_Lit_P_Is_Prefixed_String
(Node : Bare_String_Lit) return Boolean;
-- Return whether this string is prefixed or not
function String_Lit_P_Prefix
(Node : Bare_String_Lit) return Character_Type;
-- Return the prefix of this string
function String_Lit_P_Denoted_Value
(Node : Bare_String_Lit) return String_Type;
-- Return the content of the given string literal node
end Liblktlang.Implementation.Extensions;
|
RajaSrinivasan/srctrace | Ada | 476 | ads | package revisions
-- Ada spec generator
-- File: revisions.ads
BUILD_TIME : constant String := "Thu Nov 7 2019 04:10:14" ;
VERSION_MAJOR : constant := 0 ;
VERSION_MINOR : constant := 0 ;
VERSION_BUILD : constant := 999 ;
REPO_URL : constant String := "[email protected]:privatetutor/projectlets/go.git" ;
SHORT_COMMIT_ID : constant String := "26d9420" ;
LONG_COMMIT_ID : constant String := "26d9420a08b510d4f0dcd17437114246b60a09a4" ;
end revisions ;
|
GPUWorks/lumen2 | Ada | 175,982 | ads | -- Lumen.GL -- Lumen's own thin OpenGL bindings
--
-- Chip Richards, NiEstu, Phoenix AZ, Summer 2010
-- This code is covered by the ISC License:
--
-- Copyright © 2010, NiEstu
--
-- 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.
-- Environment
with System;
with Lumen.Binary;
package Lumen.GL is
---------------------------------------------------------------------------
-- New names for old types
subtype Bitfield is Binary.Word;
subtype Bool is Binary.Byte;
subtype Byte is Binary.S_Byte;
subtype ClampD is Long_Float range 0.0 .. 1.0;
subtype ClampF is Float range 0.0 .. 1.0;
subtype Double is Long_Float;
subtype Int is Integer;
subtype Short is Short_Integer;
subtype SizeI is Integer;
subtype UByte is Binary.Byte;
subtype UInt is Binary.Word;
subtype UShort is Binary.Short;
subtype Pointer is System.Address;
-- Try to bring a touch of order to the GLenum mess
subtype Enum is Binary.Word;
-- Types added by Lumen.GL
type Bools is array (Positive range <>) of Bool;
type Bytes is array (Positive range <>) of Byte;
type Bytes_1 is array (1 .. 1) of Byte;
type Bytes_2 is array (1 .. 2) of Byte;
type Bytes_3 is array (1 .. 3) of Byte;
type Bytes_4 is array (1 .. 4) of Byte;
type Shorts is array (Positive range <>) of Short;
type Shorts_1 is array (1 .. 1) of Short;
type Shorts_2 is array (1 .. 2) of Short;
type Shorts_3 is array (1 .. 3) of Short;
type Shorts_4 is array (1 .. 4) of Short;
type Ints is array (Positive range <>) of Int;
type Ints_1 is array (1 .. 1) of Int;
type Ints_2 is array (1 .. 2) of Int;
type Ints_3 is array (1 .. 3) of Int;
type Ints_4 is array (1 .. 4) of Int;
type Floats is array (Positive range <>) of Float;
type Floats_1 is array (1 .. 1) of Float;
type Floats_2 is array (1 .. 2) of Float;
type Floats_3 is array (1 .. 3) of Float;
type Floats_4 is array (1 .. 4) of Float;
type Doubles is array (Positive range <>) of Double;
type Doubles_1 is array (1 .. 1) of Double;
type Doubles_2 is array (1 .. 2) of Double;
type Doubles_3 is array (1 .. 3) of Double;
type Doubles_4 is array (1 .. 4) of Double;
type SizeIs is array (Positive range <>) of SizeI;
type UBytes is array (Positive range <>) of UByte;
type UBytes_1 is array (1 .. 1) of UByte;
type UBytes_2 is array (1 .. 2) of UByte;
type UBytes_3 is array (1 .. 3) of UByte;
type UBytes_4 is array (1 .. 4) of UByte;
type UShorts is array (Positive range <>) of UShort;
type UShorts_1 is array (1 .. 1) of UShort;
type UShorts_2 is array (1 .. 2) of UShort;
type UShorts_3 is array (1 .. 3) of UShort;
type UShorts_4 is array (1 .. 4) of UShort;
type UInts is array (Positive range <>) of UInt;
type UInts_1 is array (1 .. 1) of UInt;
type UInts_2 is array (1 .. 2) of UInt;
type UInts_3 is array (1 .. 3) of UInt;
type UInts_4 is array (1 .. 4) of UInt;
type Float_Matrix is array (1 .. 4, 1 .. 4) of Float;
type Double_Matrix is array (1 .. 4, 1 .. 4) of Double;
type ClampFs is array (Positive range <>) of ClampF;
type ClampDs is array (Positive range <>) of ClampD;
-- Useful value
Null_Pointer : Pointer := System.Null_Address;
---------------------------------------------------------------------------
-- "Enumeration" constants
-- OpenGL 1.0
-- Boolean Values
GL_FALSE : constant Bool := 16#0#;
GL_TRUE : constant Bool := 16#1#;
GL_VERSION_1_1 : constant Enum := 1;
GL_VERSION_1_2 : constant Enum := 1;
GL_VERSION_1_3 : constant Enum := 1;
GL_VERSION_1_4 : constant Enum := 1;
GL_ARB_imaging : constant Enum := 1;
-- Date types
GL_BYTE : constant Enum := 16#1400#;
GL_UNSIGNED_BYTE : constant Enum := 16#1401#;
GL_SHORT : constant Enum := 16#1402#;
GL_UNSIGNED_SHORT : constant Enum := 16#1403#;
GL_INT : constant Enum := 16#1404#;
GL_UNSIGNED_INT : constant Enum := 16#1405#;
GL_FLOAT : constant Enum := 16#1406#;
GL_2_BYTES : constant Enum := 16#1407#;
GL_3_BYTES : constant Enum := 16#1408#;
GL_4_BYTES : constant Enum := 16#1409#;
GL_DOUBLE : constant Enum := 16#140A#;
-- Primitives
GL_POINTS : constant Enum := 16#0#;
GL_LINES : constant Enum := 16#1#;
GL_LINE_LOOP : constant Enum := 16#2#;
GL_LINE_STRIP : constant Enum := 16#3#;
GL_TRIANGLES : constant Enum := 16#4#;
GL_TRIANGLE_STRIP : constant Enum := 16#5#;
GL_TRIANGLE_FAN : constant Enum := 16#6#;
GL_QUADS : constant Enum := 16#7#;
GL_QUAD_STRIP : constant Enum := 16#8#;
GL_POLYGON : constant Enum := 16#9#;
-- Vertex arrays
GL_VERTEX_ARRAY : constant Enum := 16#8074#;
GL_NORMAL_ARRAY : constant Enum := 16#8075#;
GL_COLOR_ARRAY : constant Enum := 16#8076#;
GL_INDEX_ARRAY : constant Enum := 16#8077#;
GL_TEXTURE_COORD_ARRAY : constant Enum := 16#8078#;
GL_EDGE_FLAG_ARRAY : constant Enum := 16#8079#;
GL_VERTEX_ARRAY_SIZE : constant Enum := 16#807A#;
GL_VERTEX_ARRAY_TYPE : constant Enum := 16#807B#;
GL_VERTEX_ARRAY_STRIDE : constant Enum := 16#807C#;
GL_NORMAL_ARRAY_TYPE : constant Enum := 16#807E#;
GL_NORMAL_ARRAY_STRIDE : constant Enum := 16#807F#;
GL_COLOR_ARRAY_SIZE : constant Enum := 16#8081#;
GL_COLOR_ARRAY_TYPE : constant Enum := 16#8082#;
GL_COLOR_ARRAY_STRIDE : constant Enum := 16#8083#;
GL_INDEX_ARRAY_TYPE : constant Enum := 16#8085#;
GL_INDEX_ARRAY_STRIDE : constant Enum := 16#8086#;
GL_TEXTURE_COORD_ARRAY_SIZE : constant Enum := 16#8088#;
GL_TEXTURE_COORD_ARRAY_TYPE : constant Enum := 16#8089#;
GL_TEXTURE_COORD_ARRAY_STRIDE : constant Enum := 16#808A#;
GL_EDGE_FLAG_ARRAY_STRIDE : constant Enum := 16#808C#;
GL_VERTEX_ARRAY_POINTER : constant Enum := 16#808E#;
GL_NORMAL_ARRAY_POINTER : constant Enum := 16#808F#;
GL_COLOR_ARRAY_POINTER : constant Enum := 16#8090#;
GL_INDEX_ARRAY_POINTER : constant Enum := 16#8091#;
GL_TEXTURE_COORD_ARRAY_POINTER : constant Enum := 16#8092#;
GL_EDGE_FLAG_ARRAY_POINTER : constant Enum := 16#8093#;
GL_V2F : constant Enum := 16#2A20#;
GL_V3F : constant Enum := 16#2A21#;
GL_C4UB_V2F : constant Enum := 16#2A22#;
GL_C4UB_V3F : constant Enum := 16#2A23#;
GL_C3F_V3F : constant Enum := 16#2A24#;
GL_N3F_V3F : constant Enum := 16#2A25#;
GL_C4F_N3F_V3F : constant Enum := 16#2A26#;
GL_T2F_V3F : constant Enum := 16#2A27#;
GL_T4F_V4F : constant Enum := 16#2A28#;
GL_T2F_C4UB_V3F : constant Enum := 16#2A29#;
GL_T2F_C3F_V3F : constant Enum := 16#2A2A#;
GL_T2F_N3F_V3F : constant Enum := 16#2A2B#;
GL_T2F_C4F_N3F_V3F : constant Enum := 16#2A2C#;
GL_T4F_C4F_N3F_V4F : constant Enum := 16#2A2D#;
-- Matrix mode
GL_MATRIX_MODE : constant Enum := 16#BA0#;
GL_MODELVIEW : constant Enum := 16#1700#;
GL_PROJECTION : constant Enum := 16#1701#;
GL_TEXTURE : constant Enum := 16#1702#;
-- Points
GL_POINT_SMOOTH : constant Enum := 16#B10#;
GL_POINT_SIZE : constant Enum := 16#B11#;
GL_POINT_SIZE_GRANULARITY : constant Enum := 16#B13#;
GL_POINT_SIZE_RANGE : constant Enum := 16#B12#;
-- Lines
GL_LINE_SMOOTH : constant Enum := 16#B20#;
GL_LINE_STIPPLE : constant Enum := 16#B24#;
GL_LINE_STIPPLE_PATTERN : constant Enum := 16#B25#;
GL_LINE_STIPPLE_REPEAT : constant Enum := 16#B26#;
GL_LINE_WIDTH : constant Enum := 16#B21#;
GL_LINE_WIDTH_GRANULARITY : constant Enum := 16#B23#;
GL_LINE_WIDTH_RANGE : constant Enum := 16#B22#;
-- Polygons
GL_POINT : constant Enum := 16#1B00#;
GL_LINE : constant Enum := 16#1B01#;
GL_FILL : constant Enum := 16#1B02#;
GL_CW : constant Enum := 16#900#;
GL_CCW : constant Enum := 16#901#;
GL_FRONT : constant Enum := 16#404#;
GL_BACK : constant Enum := 16#405#;
GL_POLYGON_MODE : constant Enum := 16#B40#;
GL_POLYGON_SMOOTH : constant Enum := 16#B41#;
GL_POLYGON_STIPPLE : constant Enum := 16#B42#;
GL_EDGE_FLAG : constant Enum := 16#B43#;
GL_CULL_FACE : constant Enum := 16#B44#;
GL_CULL_FACE_MODE : constant Enum := 16#B45#;
GL_FRONT_FACE : constant Enum := 16#B46#;
GL_POLYGON_OFFSET_FACTOR : constant Enum := 16#8038#;
GL_POLYGON_OFFSET_UNITS : constant Enum := 16#2A00#;
GL_POLYGON_OFFSET_POINT : constant Enum := 16#2A01#;
GL_POLYGON_OFFSET_LINE : constant Enum := 16#2A02#;
GL_POLYGON_OFFSET_FILL : constant Enum := 16#8037#;
-- Display lists
GL_COMPILE : constant Enum := 16#1300#;
GL_COMPILE_AND_EXECUTE : constant Enum := 16#1301#;
GL_LIST_BASE : constant Enum := 16#B32#;
GL_LIST_INDEX : constant Enum := 16#B33#;
GL_LIST_MODE : constant Enum := 16#B30#;
-- Depth buffer
GL_NEVER : constant Enum := 16#200#;
GL_LESS : constant Enum := 16#201#;
GL_EQUAL : constant Enum := 16#202#;
GL_LEQUAL : constant Enum := 16#203#;
GL_GREATER : constant Enum := 16#204#;
GL_NOTEQUAL : constant Enum := 16#205#;
GL_GEQUAL : constant Enum := 16#206#;
GL_ALWAYS : constant Enum := 16#207#;
GL_DEPTH_TEST : constant Enum := 16#B71#;
GL_DEPTH_BITS : constant Enum := 16#D56#;
GL_DEPTH_CLEAR_VALUE : constant Enum := 16#B73#;
GL_DEPTH_FUNC : constant Enum := 16#B74#;
GL_DEPTH_RANGE : constant Enum := 16#B70#;
GL_DEPTH_WRITEMASK : constant Enum := 16#B72#;
GL_DEPTH_COMPONENT : constant Enum := 16#1902#;
-- Lighting
GL_LIGHTING : constant Enum := 16#B50#;
GL_LIGHT0 : constant Enum := 16#4000#;
GL_LIGHT1 : constant Enum := 16#4001#;
GL_LIGHT2 : constant Enum := 16#4002#;
GL_LIGHT3 : constant Enum := 16#4003#;
GL_LIGHT4 : constant Enum := 16#4004#;
GL_LIGHT5 : constant Enum := 16#4005#;
GL_LIGHT6 : constant Enum := 16#4006#;
GL_LIGHT7 : constant Enum := 16#4007#;
GL_SPOT_EXPONENT : constant Enum := 16#1205#;
GL_SPOT_CUTOFF : constant Enum := 16#1206#;
GL_CONSTANT_ATTENUATION : constant Enum := 16#1207#;
GL_LINEAR_ATTENUATION : constant Enum := 16#1208#;
GL_QUADRATIC_ATTENUATION : constant Enum := 16#1209#;
GL_AMBIENT : constant Enum := 16#1200#;
GL_DIFFUSE : constant Enum := 16#1201#;
GL_SPECULAR : constant Enum := 16#1202#;
GL_SHININESS : constant Enum := 16#1601#;
GL_EMISSION : constant Enum := 16#1600#;
GL_POSITION : constant Enum := 16#1203#;
GL_SPOT_DIRECTION : constant Enum := 16#1204#;
GL_AMBIENT_AND_DIFFUSE : constant Enum := 16#1602#;
GL_COLOR_INDEXES : constant Enum := 16#1603#;
GL_LIGHT_MODEL_TWO_SIDE : constant Enum := 16#B52#;
GL_LIGHT_MODEL_LOCAL_VIEWER : constant Enum := 16#B51#;
GL_LIGHT_MODEL_AMBIENT : constant Enum := 16#B53#;
GL_FRONT_AND_BACK : constant Enum := 16#408#;
GL_SHADE_MODEL : constant Enum := 16#B54#;
GL_FLAT : constant Enum := 16#1D00#;
GL_SMOOTH : constant Enum := 16#1D01#;
GL_COLOR_MATERIAL : constant Enum := 16#B57#;
GL_COLOR_MATERIAL_FACE : constant Enum := 16#B55#;
GL_COLOR_MATERIAL_PARAMETER : constant Enum := 16#B56#;
GL_NORMALIZE : constant Enum := 16#BA1#;
-- User clipping planes
GL_CLIP_PLANE0 : constant Enum := 16#3000#;
GL_CLIP_PLANE1 : constant Enum := 16#3001#;
GL_CLIP_PLANE2 : constant Enum := 16#3002#;
GL_CLIP_PLANE3 : constant Enum := 16#3003#;
GL_CLIP_PLANE4 : constant Enum := 16#3004#;
GL_CLIP_PLANE5 : constant Enum := 16#3005#;
-- Accumulation buffer
GL_ACCUM_RED_BITS : constant Enum := 16#D58#;
GL_ACCUM_GREEN_BITS : constant Enum := 16#D59#;
GL_ACCUM_BLUE_BITS : constant Enum := 16#D5A#;
GL_ACCUM_ALPHA_BITS : constant Enum := 16#D5B#;
GL_ACCUM_CLEAR_VALUE : constant Enum := 16#B80#;
GL_ACCUM : constant Enum := 16#100#;
GL_ADD : constant Enum := 16#104#;
GL_LOAD : constant Enum := 16#101#;
GL_MULT : constant Enum := 16#103#;
GL_RETURN : constant Enum := 16#102#;
-- Alpha testing
GL_ALPHA_TEST : constant Enum := 16#BC0#;
GL_ALPHA_TEST_REF : constant Enum := 16#BC2#;
GL_ALPHA_TEST_FUNC : constant Enum := 16#BC1#;
-- Blending
GL_BLEND : constant Enum := 16#BE2#;
GL_BLEND_SRC : constant Enum := 16#BE1#;
GL_BLEND_DST : constant Enum := 16#BE0#;
GL_ZERO : constant Enum := 16#0#;
GL_ONE : constant Enum := 16#1#;
GL_SRC_COLOR : constant Enum := 16#300#;
GL_ONE_MINUS_SRC_COLOR : constant Enum := 16#301#;
GL_SRC_ALPHA : constant Enum := 16#302#;
GL_ONE_MINUS_SRC_ALPHA : constant Enum := 16#303#;
GL_DST_ALPHA : constant Enum := 16#304#;
GL_ONE_MINUS_DST_ALPHA : constant Enum := 16#305#;
GL_DST_COLOR : constant Enum := 16#306#;
GL_ONE_MINUS_DST_COLOR : constant Enum := 16#307#;
GL_SRC_ALPHA_SATURATE : constant Enum := 16#308#;
-- Render mode
GL_FEEDBACK : constant Enum := 16#1C01#;
GL_RENDER : constant Enum := 16#1C00#;
GL_SELECT : constant Enum := 16#1C02#;
-- Feedback
GL_2D : constant Enum := 16#600#;
GL_3D : constant Enum := 16#601#;
GL_3D_COLOR : constant Enum := 16#602#;
GL_3D_COLOR_TEXTURE : constant Enum := 16#603#;
GL_4D_COLOR_TEXTURE : constant Enum := 16#604#;
GL_POINT_TOKEN : constant Enum := 16#701#;
GL_LINE_TOKEN : constant Enum := 16#702#;
GL_LINE_RESET_TOKEN : constant Enum := 16#707#;
GL_POLYGON_TOKEN : constant Enum := 16#703#;
GL_BITMAP_TOKEN : constant Enum := 16#704#;
GL_DRAW_PIXEL_TOKEN : constant Enum := 16#705#;
GL_COPY_PIXEL_TOKEN : constant Enum := 16#706#;
GL_PASS_THROUGH_TOKEN : constant Enum := 16#700#;
GL_FEEDBACK_BUFFER_POINTER : constant Enum := 16#DF0#;
GL_FEEDBACK_BUFFER_SIZE : constant Enum := 16#DF1#;
GL_FEEDBACK_BUFFER_TYPE : constant Enum := 16#DF2#;
-- Selection
GL_SELECTION_BUFFER_POINTER : constant Enum := 16#DF3#;
GL_SELECTION_BUFFER_SIZE : constant Enum := 16#DF4#;
-- Fog
GL_FOG : constant Enum := 16#B60#;
GL_FOG_MODE : constant Enum := 16#B65#;
GL_FOG_DENSITY : constant Enum := 16#B62#;
GL_FOG_COLOR : constant Enum := 16#B66#;
GL_FOG_INDEX : constant Enum := 16#B61#;
GL_FOG_START : constant Enum := 16#B63#;
GL_FOG_END : constant Enum := 16#B64#;
GL_LINEAR : constant Enum := 16#2601#;
GL_EXP : constant Enum := 16#800#;
GL_EXP2 : constant Enum := 16#801#;
-- Logic Ops
GL_LOGIC_OP : constant Enum := 16#BF1#;
GL_INDEX_LOGIC_OP : constant Enum := 16#BF1#;
GL_COLOR_LOGIC_OP : constant Enum := 16#BF2#;
GL_LOGIC_OP_MODE : constant Enum := 16#BF0#;
GL_CLEAR : constant Enum := 16#1500#;
GL_SET : constant Enum := 16#150F#;
GL_COPY : constant Enum := 16#1503#;
GL_COPY_INVERTED : constant Enum := 16#150C#;
GL_NOOP : constant Enum := 16#1505#;
GL_INVERT : constant Enum := 16#150A#;
GL_AND : constant Enum := 16#1501#;
GL_NAND : constant Enum := 16#150E#;
GL_OR : constant Enum := 16#1507#;
GL_NOR : constant Enum := 16#1508#;
GL_XOR : constant Enum := 16#1506#;
GL_EQUIV : constant Enum := 16#1509#;
GL_AND_REVERSE : constant Enum := 16#1502#;
GL_AND_INVERTED : constant Enum := 16#1504#;
GL_OR_REVERSE : constant Enum := 16#150B#;
GL_OR_INVERTED : constant Enum := 16#150D#;
-- Stencil
GL_STENCIL_BITS : constant Enum := 16#D57#;
GL_STENCIL_TEST : constant Enum := 16#B90#;
GL_STENCIL_CLEAR_VALUE : constant Enum := 16#B91#;
GL_STENCIL_FUNC : constant Enum := 16#B92#;
GL_STENCIL_VALUE_MASK : constant Enum := 16#B93#;
GL_STENCIL_FAIL : constant Enum := 16#B94#;
GL_STENCIL_PASS_DEPTH_FAIL : constant Enum := 16#B95#;
GL_STENCIL_PASS_DEPTH_PASS : constant Enum := 16#B96#;
GL_STENCIL_REF : constant Enum := 16#B97#;
GL_STENCIL_WRITEMASK : constant Enum := 16#B98#;
GL_STENCIL_INDEX : constant Enum := 16#1901#;
GL_KEEP : constant Enum := 16#1E00#;
GL_REPLACE : constant Enum := 16#1E01#;
GL_INCR : constant Enum := 16#1E02#;
GL_DECR : constant Enum := 16#1E03#;
-- Buffers, Pixel Drawing/Reading
GL_NONE : constant Enum := 16#0#;
GL_LEFT : constant Enum := 16#406#;
GL_RIGHT : constant Enum := 16#407#;
GL_FRONT_LEFT : constant Enum := 16#400#;
GL_FRONT_RIGHT : constant Enum := 16#401#;
GL_BACK_LEFT : constant Enum := 16#402#;
GL_BACK_RIGHT : constant Enum := 16#403#;
GL_AUX0 : constant Enum := 16#409#;
GL_AUX1 : constant Enum := 16#40A#;
GL_AUX2 : constant Enum := 16#40B#;
GL_AUX3 : constant Enum := 16#40C#;
GL_COLOR_INDEX : constant Enum := 16#1900#;
GL_RED : constant Enum := 16#1903#;
GL_GREEN : constant Enum := 16#1904#;
GL_BLUE : constant Enum := 16#1905#;
GL_ALPHA : constant Enum := 16#1906#;
GL_LUMINANCE : constant Enum := 16#1909#;
GL_LUMINANCE_ALPHA : constant Enum := 16#190A#;
GL_ALPHA_BITS : constant Enum := 16#D55#;
GL_RED_BITS : constant Enum := 16#D52#;
GL_GREEN_BITS : constant Enum := 16#D53#;
GL_BLUE_BITS : constant Enum := 16#D54#;
GL_INDEX_BITS : constant Enum := 16#D51#;
GL_SUBPIXEL_BITS : constant Enum := 16#D50#;
GL_AUX_BUFFERS : constant Enum := 16#C00#;
GL_READ_BUFFER : constant Enum := 16#C02#;
GL_DRAW_BUFFER : constant Enum := 16#C01#;
GL_DOUBLEBUFFER : constant Enum := 16#C32#;
GL_STEREO : constant Enum := 16#C33#;
GL_BITMAP : constant Enum := 16#1A00#;
GL_COLOR : constant Enum := 16#1800#;
GL_DEPTH : constant Enum := 16#1801#;
GL_STENCIL : constant Enum := 16#1802#;
GL_DITHER : constant Enum := 16#BD0#;
GL_RGB : constant Enum := 16#1907#;
GL_RGBA : constant Enum := 16#1908#;
-- Implementation limits
GL_MAX_LIST_NESTING : constant Enum := 16#B31#;
GL_MAX_EVAL_ORDER : constant Enum := 16#D30#;
GL_MAX_LIGHTS : constant Enum := 16#D31#;
GL_MAX_CLIP_PLANES : constant Enum := 16#D32#;
GL_MAX_TEXTURE_SIZE : constant Enum := 16#D33#;
GL_MAX_PIXEL_MAP_TABLE : constant Enum := 16#D34#;
GL_MAX_ATTRIB_STACK_DEPTH : constant Enum := 16#D35#;
GL_MAX_MODELVIEW_STACK_DEPTH : constant Enum := 16#D36#;
GL_MAX_NAME_STACK_DEPTH : constant Enum := 16#D37#;
GL_MAX_PROJECTION_STACK_DEPTH : constant Enum := 16#D38#;
GL_MAX_TEXTURE_STACK_DEPTH : constant Enum := 16#D39#;
GL_MAX_VIEWPORT_DIMS : constant Enum := 16#D3A#;
GL_MAX_CLIENT_ATTRIB_STACK_DEPTH : constant Enum := 16#D3B#;
-- Gets
GL_ATTRIB_STACK_DEPTH : constant Enum := 16#BB0#;
GL_CLIENT_ATTRIB_STACK_DEPTH : constant Enum := 16#BB1#;
GL_COLOR_CLEAR_VALUE : constant Enum := 16#C22#;
GL_COLOR_WRITEMASK : constant Enum := 16#C23#;
GL_CURRENT_INDEX : constant Enum := 16#B01#;
GL_CURRENT_COLOR : constant Enum := 16#B00#;
GL_CURRENT_NORMAL : constant Enum := 16#B02#;
GL_CURRENT_RASTER_COLOR : constant Enum := 16#B04#;
GL_CURRENT_RASTER_DISTANCE : constant Enum := 16#B09#;
GL_CURRENT_RASTER_INDEX : constant Enum := 16#B05#;
GL_CURRENT_RASTER_POSITION : constant Enum := 16#B07#;
GL_CURRENT_RASTER_TEXTURE_COORDS : constant Enum := 16#B06#;
GL_CURRENT_RASTER_POSITION_VALID : constant Enum := 16#B08#;
GL_CURRENT_TEXTURE_COORDS : constant Enum := 16#B03#;
GL_INDEX_CLEAR_VALUE : constant Enum := 16#C20#;
GL_INDEX_MODE : constant Enum := 16#C30#;
GL_INDEX_WRITEMASK : constant Enum := 16#C21#;
GL_MODELVIEW_MATRIX : constant Enum := 16#BA6#;
GL_MODELVIEW_STACK_DEPTH : constant Enum := 16#BA3#;
GL_NAME_STACK_DEPTH : constant Enum := 16#D70#;
GL_PROJECTION_MATRIX : constant Enum := 16#BA7#;
GL_PROJECTION_STACK_DEPTH : constant Enum := 16#BA4#;
GL_RENDER_MODE : constant Enum := 16#C40#;
GL_RGBA_MODE : constant Enum := 16#C31#;
GL_TEXTURE_MATRIX : constant Enum := 16#BA8#;
GL_TEXTURE_STACK_DEPTH : constant Enum := 16#BA5#;
GL_VIEWPORT : constant Enum := 16#BA2#;
-- Evaluators
GL_AUTO_NORMAL : constant Enum := 16#D80#;
GL_MAP1_COLOR_4 : constant Enum := 16#D90#;
GL_MAP1_INDEX : constant Enum := 16#D91#;
GL_MAP1_NORMAL : constant Enum := 16#D92#;
GL_MAP1_TEXTURE_COORD_1 : constant Enum := 16#D93#;
GL_MAP1_TEXTURE_COORD_2 : constant Enum := 16#D94#;
GL_MAP1_TEXTURE_COORD_3 : constant Enum := 16#D95#;
GL_MAP1_TEXTURE_COORD_4 : constant Enum := 16#D96#;
GL_MAP1_VERTEX_3 : constant Enum := 16#D97#;
GL_MAP1_VERTEX_4 : constant Enum := 16#D98#;
GL_MAP2_COLOR_4 : constant Enum := 16#DB0#;
GL_MAP2_INDEX : constant Enum := 16#DB1#;
GL_MAP2_NORMAL : constant Enum := 16#DB2#;
GL_MAP2_TEXTURE_COORD_1 : constant Enum := 16#DB3#;
GL_MAP2_TEXTURE_COORD_2 : constant Enum := 16#DB4#;
GL_MAP2_TEXTURE_COORD_3 : constant Enum := 16#DB5#;
GL_MAP2_TEXTURE_COORD_4 : constant Enum := 16#DB6#;
GL_MAP2_VERTEX_3 : constant Enum := 16#DB7#;
GL_MAP2_VERTEX_4 : constant Enum := 16#DB8#;
GL_MAP1_GRID_DOMAIN : constant Enum := 16#DD0#;
GL_MAP1_GRID_SEGMENTS : constant Enum := 16#DD1#;
GL_MAP2_GRID_DOMAIN : constant Enum := 16#DD2#;
GL_MAP2_GRID_SEGMENTS : constant Enum := 16#DD3#;
GL_COEFF : constant Enum := 16#A00#;
GL_ORDER : constant Enum := 16#A01#;
GL_DOMAIN : constant Enum := 16#A02#;
-- Hints
GL_PERSPECTIVE_CORRECTION_HINT : constant Enum := 16#C50#;
GL_POINT_SMOOTH_HINT : constant Enum := 16#C51#;
GL_LINE_SMOOTH_HINT : constant Enum := 16#C52#;
GL_POLYGON_SMOOTH_HINT : constant Enum := 16#C53#;
GL_FOG_HINT : constant Enum := 16#C54#;
GL_DONT_CARE : constant Enum := 16#1100#;
GL_FASTEST : constant Enum := 16#1101#;
GL_NICEST : constant Enum := 16#1102#;
-- Scissor box
GL_SCISSOR_BOX : constant Enum := 16#C10#;
GL_SCISSOR_TEST : constant Enum := 16#C11#;
-- Pixel Mode / Transfer
GL_MAP_COLOR : constant Enum := 16#D10#;
GL_MAP_STENCIL : constant Enum := 16#D11#;
GL_INDEX_SHIFT : constant Enum := 16#D12#;
GL_INDEX_OFFSET : constant Enum := 16#D13#;
GL_RED_SCALE : constant Enum := 16#D14#;
GL_RED_BIAS : constant Enum := 16#D15#;
GL_GREEN_SCALE : constant Enum := 16#D18#;
GL_GREEN_BIAS : constant Enum := 16#D19#;
GL_BLUE_SCALE : constant Enum := 16#D1A#;
GL_BLUE_BIAS : constant Enum := 16#D1B#;
GL_ALPHA_SCALE : constant Enum := 16#D1C#;
GL_ALPHA_BIAS : constant Enum := 16#D1D#;
GL_DEPTH_SCALE : constant Enum := 16#D1E#;
GL_DEPTH_BIAS : constant Enum := 16#D1F#;
GL_PIXEL_MAP_S_TO_S_SIZE : constant Enum := 16#CB1#;
GL_PIXEL_MAP_I_TO_I_SIZE : constant Enum := 16#CB0#;
GL_PIXEL_MAP_I_TO_R_SIZE : constant Enum := 16#CB2#;
GL_PIXEL_MAP_I_TO_G_SIZE : constant Enum := 16#CB3#;
GL_PIXEL_MAP_I_TO_B_SIZE : constant Enum := 16#CB4#;
GL_PIXEL_MAP_I_TO_A_SIZE : constant Enum := 16#CB5#;
GL_PIXEL_MAP_R_TO_R_SIZE : constant Enum := 16#CB6#;
GL_PIXEL_MAP_G_TO_G_SIZE : constant Enum := 16#CB7#;
GL_PIXEL_MAP_B_TO_B_SIZE : constant Enum := 16#CB8#;
GL_PIXEL_MAP_A_TO_A_SIZE : constant Enum := 16#CB9#;
GL_PIXEL_MAP_S_TO_S : constant Enum := 16#C71#;
GL_PIXEL_MAP_I_TO_I : constant Enum := 16#C70#;
GL_PIXEL_MAP_I_TO_R : constant Enum := 16#C72#;
GL_PIXEL_MAP_I_TO_G : constant Enum := 16#C73#;
GL_PIXEL_MAP_I_TO_B : constant Enum := 16#C74#;
GL_PIXEL_MAP_I_TO_A : constant Enum := 16#C75#;
GL_PIXEL_MAP_R_TO_R : constant Enum := 16#C76#;
GL_PIXEL_MAP_G_TO_G : constant Enum := 16#C77#;
GL_PIXEL_MAP_B_TO_B : constant Enum := 16#C78#;
GL_PIXEL_MAP_A_TO_A : constant Enum := 16#C79#;
GL_PACK_ALIGNMENT : constant Enum := 16#D05#;
GL_PACK_LSB_FIRST : constant Enum := 16#D01#;
GL_PACK_ROW_LENGTH : constant Enum := 16#D02#;
GL_PACK_SKIP_PIXELS : constant Enum := 16#D04#;
GL_PACK_SKIP_ROWS : constant Enum := 16#D03#;
GL_PACK_SWAP_BYTES : constant Enum := 16#D00#;
GL_UNPACK_ALIGNMENT : constant Enum := 16#CF5#;
GL_UNPACK_LSB_FIRST : constant Enum := 16#CF1#;
GL_UNPACK_ROW_LENGTH : constant Enum := 16#CF2#;
GL_UNPACK_SKIP_PIXELS : constant Enum := 16#CF4#;
GL_UNPACK_SKIP_ROWS : constant Enum := 16#CF3#;
GL_UNPACK_SWAP_BYTES : constant Enum := 16#CF0#;
GL_ZOOM_X : constant Enum := 16#D16#;
GL_ZOOM_Y : constant Enum := 16#D17#;
-- Texture mapping
GL_TEXTURE_ENV : constant Enum := 16#2300#;
GL_TEXTURE_ENV_MODE : constant Enum := 16#2200#;
GL_TEXTURE_1D : constant Enum := 16#DE0#;
GL_TEXTURE_2D : constant Enum := 16#DE1#;
GL_TEXTURE_WRAP_S : constant Enum := 16#2802#;
GL_TEXTURE_WRAP_T : constant Enum := 16#2803#;
GL_TEXTURE_MAG_FILTER : constant Enum := 16#2800#;
GL_TEXTURE_MIN_FILTER : constant Enum := 16#2801#;
GL_TEXTURE_ENV_COLOR : constant Enum := 16#2201#;
GL_TEXTURE_GEN_S : constant Enum := 16#C60#;
GL_TEXTURE_GEN_T : constant Enum := 16#C61#;
GL_TEXTURE_GEN_R : constant Enum := 16#C62#;
GL_TEXTURE_GEN_Q : constant Enum := 16#C63#;
GL_TEXTURE_GEN_MODE : constant Enum := 16#2500#;
GL_TEXTURE_BORDER_COLOR : constant Enum := 16#1004#;
GL_TEXTURE_WIDTH : constant Enum := 16#1000#;
GL_TEXTURE_HEIGHT : constant Enum := 16#1001#;
GL_TEXTURE_BORDER : constant Enum := 16#1005#;
GL_TEXTURE_COMPONENTS : constant Enum := 16#1003#;
GL_TEXTURE_RED_SIZE : constant Enum := 16#805C#;
GL_TEXTURE_GREEN_SIZE : constant Enum := 16#805D#;
GL_TEXTURE_BLUE_SIZE : constant Enum := 16#805E#;
GL_TEXTURE_ALPHA_SIZE : constant Enum := 16#805F#;
GL_TEXTURE_LUMINANCE_SIZE : constant Enum := 16#8060#;
GL_TEXTURE_INTENSITY_SIZE : constant Enum := 16#8061#;
GL_NEAREST_MIPMAP_NEAREST : constant Enum := 16#2700#;
GL_NEAREST_MIPMAP_LINEAR : constant Enum := 16#2702#;
GL_LINEAR_MIPMAP_NEAREST : constant Enum := 16#2701#;
GL_LINEAR_MIPMAP_LINEAR : constant Enum := 16#2703#;
GL_OBJECT_LINEAR : constant Enum := 16#2401#;
GL_OBJECT_PLANE : constant Enum := 16#2501#;
GL_EYE_LINEAR : constant Enum := 16#2400#;
GL_EYE_PLANE : constant Enum := 16#2502#;
GL_SPHERE_MAP : constant Enum := 16#2402#;
GL_DECAL : constant Enum := 16#2101#;
GL_MODULATE : constant Enum := 16#2100#;
GL_NEAREST : constant Enum := 16#2600#;
GL_REPEAT : constant Enum := 16#2901#;
GL_CLAMP : constant Enum := 16#2900#;
GL_S : constant Enum := 16#2000#;
GL_T : constant Enum := 16#2001#;
GL_R : constant Enum := 16#2002#;
GL_Q : constant Enum := 16#2003#;
-- Utility
GL_VENDOR : constant Enum := 16#1F00#;
GL_RENDERER : constant Enum := 16#1F01#;
GL_VERSION : constant Enum := 16#1F02#;
GL_EXTENSIONS : constant Enum := 16#1F03#;
-- Errors
GL_NO_ERROR : constant Enum := 16#0#;
GL_INVALID_ENUM : constant Enum := 16#500#;
GL_INVALID_VALUE : constant Enum := 16#501#;
GL_INVALID_OPERATION : constant Enum := 16#502#;
GL_STACK_OVERFLOW : constant Enum := 16#503#;
GL_STACK_UNDERFLOW : constant Enum := 16#504#;
GL_OUT_OF_MEMORY : constant Enum := 16#505#;
-- Push/Pop Attrib bits
GL_CURRENT_BIT : constant Bitfield := 16#00001#;
GL_POINT_BIT : constant Bitfield := 16#00002#;
GL_LINE_BIT : constant Bitfield := 16#00004#;
GL_POLYGON_BIT : constant Bitfield := 16#00008#;
GL_POLYGON_STIPPLE_BIT : constant Bitfield := 16#00010#;
GL_PIXEL_MODE_BIT : constant Bitfield := 16#00020#;
GL_LIGHTING_BIT : constant Bitfield := 16#00040#;
GL_FOG_BIT : constant Bitfield := 16#00080#;
GL_DEPTH_BUFFER_BIT : constant Bitfield := 16#00100#;
GL_ACCUM_BUFFER_BIT : constant Bitfield := 16#00200#;
GL_STENCIL_BUFFER_BIT : constant Bitfield := 16#00400#;
GL_VIEWPORT_BIT : constant Bitfield := 16#00800#;
GL_TRANSFORM_BIT : constant Bitfield := 16#01000#;
GL_ENABLE_BIT : constant Bitfield := 16#02000#;
GL_COLOR_BUFFER_BIT : constant Bitfield := 16#04000#;
GL_HINT_BIT : constant Bitfield := 16#08000#;
GL_EVAL_BIT : constant Bitfield := 16#10000#;
GL_LIST_BIT : constant Bitfield := 16#20000#;
GL_TEXTURE_BIT : constant Bitfield := 16#40000#;
GL_SCISSOR_BIT : constant Bitfield := 16#80000#;
GL_ALL_ATTRIB_BITS : constant Bitfield := 16#FFFFF#;
---------------------------------------------------------------------------
-- OpenGL 1.1
GL_PROXY_TEXTURE_1D : constant Enum := 16#8063#;
GL_PROXY_TEXTURE_2D : constant Enum := 16#8064#;
GL_TEXTURE_PRIORITY : constant Enum := 16#8066#;
GL_TEXTURE_RESIDENT : constant Enum := 16#8067#;
GL_TEXTURE_BINDING_1D : constant Enum := 16#8068#;
GL_TEXTURE_BINDING_2D : constant Enum := 16#8069#;
GL_TEXTURE_INTERNAL_FORMAT : constant Enum := 16#1003#;
GL_ALPHA4 : constant Enum := 16#803B#;
GL_ALPHA8 : constant Enum := 16#803C#;
GL_ALPHA12 : constant Enum := 16#803D#;
GL_ALPHA16 : constant Enum := 16#803E#;
GL_LUMINANCE4 : constant Enum := 16#803F#;
GL_LUMINANCE8 : constant Enum := 16#8040#;
GL_LUMINANCE12 : constant Enum := 16#8041#;
GL_LUMINANCE16 : constant Enum := 16#8042#;
GL_LUMINANCE4_ALPHA4 : constant Enum := 16#8043#;
GL_LUMINANCE6_ALPHA2 : constant Enum := 16#8044#;
GL_LUMINANCE8_ALPHA8 : constant Enum := 16#8045#;
GL_LUMINANCE12_ALPHA4 : constant Enum := 16#8046#;
GL_LUMINANCE12_ALPHA12 : constant Enum := 16#8047#;
GL_LUMINANCE16_ALPHA16 : constant Enum := 16#8048#;
GL_INTENSITY : constant Enum := 16#8049#;
GL_INTENSITY4 : constant Enum := 16#804A#;
GL_INTENSITY8 : constant Enum := 16#804B#;
GL_INTENSITY12 : constant Enum := 16#804C#;
GL_INTENSITY16 : constant Enum := 16#804D#;
GL_R3_G3_B2 : constant Enum := 16#2A10#;
GL_RGB4 : constant Enum := 16#804F#;
GL_RGB5 : constant Enum := 16#8050#;
GL_RGB8 : constant Enum := 16#8051#;
GL_RGB10 : constant Enum := 16#8052#;
GL_RGB12 : constant Enum := 16#8053#;
GL_RGB16 : constant Enum := 16#8054#;
GL_RGBA2 : constant Enum := 16#8055#;
GL_RGBA4 : constant Enum := 16#8056#;
GL_RGB5_A1 : constant Enum := 16#8057#;
GL_RGBA8 : constant Enum := 16#8058#;
GL_RGB10_A2 : constant Enum := 16#8059#;
GL_RGBA12 : constant Enum := 16#805A#;
GL_RGBA16 : constant Enum := 16#805B#;
GL_CLIENT_PIXEL_STORE_BIT : constant Enum := 16#1#;
GL_CLIENT_VERTEX_ARRAY_BIT : constant Enum := 16#2#;
GL_ALL_CLIENT_ATTRIB_BITS : constant Enum := 16#FFFFFFFF#;
GL_CLIENT_ALL_ATTRIB_BITS : constant Enum := 16#FFFFFFFF#;
---------------------------------------------------------------------------
-- OpenGL 1.2
GL_RESCALE_NORMAL : constant Enum := 16#803A#;
GL_CLAMP_TO_EDGE : constant Enum := 16#812F#;
GL_MAX_ELEMENTS_VERTICES : constant Enum := 16#80E8#;
GL_MAX_ELEMENTS_INDICES : constant Enum := 16#80E9#;
GL_BGR : constant Enum := 16#80E0#;
GL_BGRA : constant Enum := 16#80E1#;
GL_UNSIGNED_BYTE_3_3_2 : constant Enum := 16#8032#;
GL_UNSIGNED_BYTE_2_3_3_REV : constant Enum := 16#8362#;
GL_UNSIGNED_SHORT_5_6_5 : constant Enum := 16#8363#;
GL_UNSIGNED_SHORT_5_6_5_REV : constant Enum := 16#8364#;
GL_UNSIGNED_SHORT_4_4_4_4 : constant Enum := 16#8033#;
GL_UNSIGNED_SHORT_4_4_4_4_REV : constant Enum := 16#8365#;
GL_UNSIGNED_SHORT_5_5_5_1 : constant Enum := 16#8034#;
GL_UNSIGNED_SHORT_1_5_5_5_REV : constant Enum := 16#8366#;
GL_UNSIGNED_INT_8_8_8_8 : constant Enum := 16#8035#;
GL_UNSIGNED_INT_8_8_8_8_REV : constant Enum := 16#8367#;
GL_UNSIGNED_INT_10_10_10_2 : constant Enum := 16#8036#;
GL_UNSIGNED_INT_2_10_10_10_REV : constant Enum := 16#8368#;
GL_LIGHT_MODEL_COLOR_CONTROL : constant Enum := 16#81F8#;
GL_SINGLE_COLOR : constant Enum := 16#81F9#;
GL_SEPARATE_SPECULAR_COLOR : constant Enum := 16#81FA#;
GL_TEXTURE_MIN_LOD : constant Enum := 16#813A#;
GL_TEXTURE_MAX_LOD : constant Enum := 16#813B#;
GL_TEXTURE_BASE_LEVEL : constant Enum := 16#813C#;
GL_TEXTURE_MAX_LEVEL : constant Enum := 16#813D#;
GL_SMOOTH_POINT_SIZE_RANGE : constant Enum := 16#B12#;
GL_SMOOTH_POINT_SIZE_GRANULARITY : constant Enum := 16#B13#;
GL_SMOOTH_LINE_WIDTH_RANGE : constant Enum := 16#B22#;
GL_SMOOTH_LINE_WIDTH_GRANULARITY : constant Enum := 16#B23#;
GL_ALIASED_POINT_SIZE_RANGE : constant Enum := 16#846D#;
GL_ALIASED_LINE_WIDTH_RANGE : constant Enum := 16#846E#;
GL_PACK_SKIP_IMAGES : constant Enum := 16#806B#;
GL_PACK_IMAGE_HEIGHT : constant Enum := 16#806C#;
GL_UNPACK_SKIP_IMAGES : constant Enum := 16#806D#;
GL_UNPACK_IMAGE_HEIGHT : constant Enum := 16#806E#;
GL_TEXTURE_3D : constant Enum := 16#806F#;
GL_PROXY_TEXTURE_3D : constant Enum := 16#8070#;
GL_TEXTURE_DEPTH : constant Enum := 16#8071#;
GL_TEXTURE_WRAP_R : constant Enum := 16#8072#;
GL_MAX_3D_TEXTURE_SIZE : constant Enum := 16#8073#;
GL_TEXTURE_BINDING_3D : constant Enum := 16#806A#;
---------------------------------------------------------------------------
-- ARB Imaging
GL_COLOR_TABLE : constant Enum := 16#80D0#;
GL_POST_CONVOLUTION_COLOR_TABLE : constant Enum := 16#80D1#;
GL_POST_COLOR_MATRIX_COLOR_TABLE : constant Enum := 16#80D2#;
GL_PROXY_COLOR_TABLE : constant Enum := 16#80D3#;
GL_PROXY_POST_CONVOLUTION_COLOR_TABLE : constant Enum := 16#80D4#;
GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE : constant Enum := 16#80D5#;
GL_COLOR_TABLE_SCALE : constant Enum := 16#80D6#;
GL_COLOR_TABLE_BIAS : constant Enum := 16#80D7#;
GL_COLOR_TABLE_FORMAT : constant Enum := 16#80D8#;
GL_COLOR_TABLE_WIDTH : constant Enum := 16#80D9#;
GL_COLOR_TABLE_RED_SIZE : constant Enum := 16#80DA#;
GL_COLOR_TABLE_GREEN_SIZE : constant Enum := 16#80DB#;
GL_COLOR_TABLE_BLUE_SIZE : constant Enum := 16#80DC#;
GL_COLOR_TABLE_ALPHA_SIZE : constant Enum := 16#80DD#;
GL_COLOR_TABLE_LUMINANCE_SIZE : constant Enum := 16#80DE#;
GL_COLOR_TABLE_INTENSITY_SIZE : constant Enum := 16#80DF#;
GL_CONVOLUTION_1D : constant Enum := 16#8010#;
GL_CONVOLUTION_2D : constant Enum := 16#8011#;
GL_SEPARABLE_2D : constant Enum := 16#8012#;
GL_CONVOLUTION_BORDER_MODE : constant Enum := 16#8013#;
GL_CONVOLUTION_FILTER_SCALE : constant Enum := 16#8014#;
GL_CONVOLUTION_FILTER_BIAS : constant Enum := 16#8015#;
GL_REDUCE : constant Enum := 16#8016#;
GL_CONVOLUTION_FORMAT : constant Enum := 16#8017#;
GL_CONVOLUTION_WIDTH : constant Enum := 16#8018#;
GL_CONVOLUTION_HEIGHT : constant Enum := 16#8019#;
GL_MAX_CONVOLUTION_WIDTH : constant Enum := 16#801A#;
GL_MAX_CONVOLUTION_HEIGHT : constant Enum := 16#801B#;
GL_POST_CONVOLUTION_RED_SCALE : constant Enum := 16#801C#;
GL_POST_CONVOLUTION_GREEN_SCALE : constant Enum := 16#801D#;
GL_POST_CONVOLUTION_BLUE_SCALE : constant Enum := 16#801E#;
GL_POST_CONVOLUTION_ALPHA_SCALE : constant Enum := 16#801F#;
GL_POST_CONVOLUTION_RED_BIAS : constant Enum := 16#8020#;
GL_POST_CONVOLUTION_GREEN_BIAS : constant Enum := 16#8021#;
GL_POST_CONVOLUTION_BLUE_BIAS : constant Enum := 16#8022#;
GL_POST_CONVOLUTION_ALPHA_BIAS : constant Enum := 16#8023#;
GL_CONSTANT_BORDER : constant Enum := 16#8151#;
GL_REPLICATE_BORDER : constant Enum := 16#8153#;
GL_CONVOLUTION_BORDER_COLOR : constant Enum := 16#8154#;
GL_COLOR_MATRIX : constant Enum := 16#80B1#;
GL_COLOR_MATRIX_STACK_DEPTH : constant Enum := 16#80B2#;
GL_MAX_COLOR_MATRIX_STACK_DEPTH : constant Enum := 16#80B3#;
GL_POST_COLOR_MATRIX_RED_SCALE : constant Enum := 16#80B4#;
GL_POST_COLOR_MATRIX_GREEN_SCALE : constant Enum := 16#80B5#;
GL_POST_COLOR_MATRIX_BLUE_SCALE : constant Enum := 16#80B6#;
GL_POST_COLOR_MATRIX_ALPHA_SCALE : constant Enum := 16#80B7#;
GL_POST_COLOR_MATRIX_RED_BIAS : constant Enum := 16#80B8#;
GL_POST_COLOR_MATRIX_GREEN_BIAS : constant Enum := 16#80B9#;
GL_POST_COLOR_MATRIX_BLUE_BIAS : constant Enum := 16#80BA#;
GL_POST_COLOR_MATRIX_ALPHA_BIAS : constant Enum := 16#80BB#;
GL_HISTOGRAM : constant Enum := 16#8024#;
GL_PROXY_HISTOGRAM : constant Enum := 16#8025#;
GL_HISTOGRAM_WIDTH : constant Enum := 16#8026#;
GL_HISTOGRAM_FORMAT : constant Enum := 16#8027#;
GL_HISTOGRAM_RED_SIZE : constant Enum := 16#8028#;
GL_HISTOGRAM_GREEN_SIZE : constant Enum := 16#8029#;
GL_HISTOGRAM_BLUE_SIZE : constant Enum := 16#802A#;
GL_HISTOGRAM_ALPHA_SIZE : constant Enum := 16#802B#;
GL_HISTOGRAM_LUMINANCE_SIZE : constant Enum := 16#802C#;
GL_HISTOGRAM_SINK : constant Enum := 16#802D#;
GL_MINMAX : constant Enum := 16#802E#;
GL_MINMAX_FORMAT : constant Enum := 16#802F#;
GL_MINMAX_SINK : constant Enum := 16#8030#;
GL_TABLE_TOO_LARGE : constant Enum := 16#8031#;
GL_BLEND_EQUATION : constant Enum := 16#8009#;
GL_BLEND_COLOR : constant Enum := 16#8005#;
---------------------------------------------------------------------------
-- OpenGL 1.3
GL_TEXTURE0 : constant Enum := 16#84C0#;
GL_TEXTURE1 : constant Enum := 16#84C1#;
GL_TEXTURE2 : constant Enum := 16#84C2#;
GL_TEXTURE3 : constant Enum := 16#84C3#;
GL_TEXTURE4 : constant Enum := 16#84C4#;
GL_TEXTURE5 : constant Enum := 16#84C5#;
GL_TEXTURE6 : constant Enum := 16#84C6#;
GL_TEXTURE7 : constant Enum := 16#84C7#;
GL_TEXTURE8 : constant Enum := 16#84C8#;
GL_TEXTURE9 : constant Enum := 16#84C9#;
GL_TEXTURE10 : constant Enum := 16#84CA#;
GL_TEXTURE11 : constant Enum := 16#84CB#;
GL_TEXTURE12 : constant Enum := 16#84CC#;
GL_TEXTURE13 : constant Enum := 16#84CD#;
GL_TEXTURE14 : constant Enum := 16#84CE#;
GL_TEXTURE15 : constant Enum := 16#84CF#;
GL_TEXTURE16 : constant Enum := 16#84D0#;
GL_TEXTURE17 : constant Enum := 16#84D1#;
GL_TEXTURE18 : constant Enum := 16#84D2#;
GL_TEXTURE19 : constant Enum := 16#84D3#;
GL_TEXTURE20 : constant Enum := 16#84D4#;
GL_TEXTURE21 : constant Enum := 16#84D5#;
GL_TEXTURE22 : constant Enum := 16#84D6#;
GL_TEXTURE23 : constant Enum := 16#84D7#;
GL_TEXTURE24 : constant Enum := 16#84D8#;
GL_TEXTURE25 : constant Enum := 16#84D9#;
GL_TEXTURE26 : constant Enum := 16#84DA#;
GL_TEXTURE27 : constant Enum := 16#84DB#;
GL_TEXTURE28 : constant Enum := 16#84DC#;
GL_TEXTURE29 : constant Enum := 16#84DD#;
GL_TEXTURE30 : constant Enum := 16#84DE#;
GL_TEXTURE31 : constant Enum := 16#84DF#;
GL_ACTIVE_TEXTURE : constant Enum := 16#84E0#;
GL_CLIENT_ACTIVE_TEXTURE : constant Enum := 16#84E1#;
GL_MAX_TEXTURE_UNITS : constant Enum := 16#84E2#;
-- Texture cube map
GL_NORMAL_MAP : constant Enum := 16#8511#;
GL_REFLECTION_MAP : constant Enum := 16#8512#;
GL_TEXTURE_CUBE_MAP : constant Enum := 16#8513#;
GL_TEXTURE_BINDING_CUBE_MAP : constant Enum := 16#8514#;
GL_TEXTURE_CUBE_MAP_POSITIVE_X : constant Enum := 16#8515#;
GL_TEXTURE_CUBE_MAP_NEGATIVE_X : constant Enum := 16#8516#;
GL_TEXTURE_CUBE_MAP_POSITIVE_Y : constant Enum := 16#8517#;
GL_TEXTURE_CUBE_MAP_NEGATIVE_Y : constant Enum := 16#8518#;
GL_TEXTURE_CUBE_MAP_POSITIVE_Z : constant Enum := 16#8519#;
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z : constant Enum := 16#851A#;
GL_PROXY_TEXTURE_CUBE_MAP : constant Enum := 16#851B#;
GL_MAX_CUBE_MAP_TEXTURE_SIZE : constant Enum := 16#851C#;
-- Texture compression
GL_COMPRESSED_ALPHA : constant Enum := 16#84E9#;
GL_COMPRESSED_LUMINANCE : constant Enum := 16#84EA#;
GL_COMPRESSED_LUMINANCE_ALPHA : constant Enum := 16#84EB#;
GL_COMPRESSED_INTENSITY : constant Enum := 16#84EC#;
GL_COMPRESSED_RGB : constant Enum := 16#84ED#;
GL_COMPRESSED_RGBA : constant Enum := 16#84EE#;
GL_TEXTURE_COMPRESSION_HINT : constant Enum := 16#84EF#;
GL_TEXTURE_COMPRESSED_IMAGE_SIZE : constant Enum := 16#86A0#;
GL_TEXTURE_COMPRESSED : constant Enum := 16#86A1#;
GL_NUM_COMPRESSED_TEXTURE_FORMATS : constant Enum := 16#86A2#;
GL_COMPRESSED_TEXTURE_FORMATS : constant Enum := 16#86A3#;
-- Multisample
GL_MULTISAMPLE : constant Enum := 16#809D#;
GL_SAMPLE_ALPHA_TO_COVERAGE : constant Enum := 16#809E#;
GL_SAMPLE_ALPHA_TO_ONE : constant Enum := 16#809F#;
GL_SAMPLE_COVERAGE : constant Enum := 16#80A0#;
GL_SAMPLE_BUFFERS : constant Enum := 16#80A8#;
GL_SAMPLES : constant Enum := 16#80A9#;
GL_SAMPLE_COVERAGE_VALUE : constant Enum := 16#80AA#;
GL_SAMPLE_COVERAGE_INVERT : constant Enum := 16#80AB#;
GL_MULTISAMPLE_BIT : constant Enum := 16#2000_0000#;
-- Transpose matrix
GL_TRANSPOSE_MODELVIEW_MATRIX : constant Enum := 16#84E3#;
GL_TRANSPOSE_PROJECTION_MATRIX : constant Enum := 16#84E4#;
GL_TRANSPOSE_TEXTURE_MATRIX : constant Enum := 16#84E5#;
GL_TRANSPOSE_COLOR_MATRIX : constant Enum := 16#84E6#;
-- Texture env combine
GL_COMBINE : constant Enum := 16#8570#;
GL_COMBINE_RGB : constant Enum := 16#8571#;
GL_COMBINE_ALPHA : constant Enum := 16#8572#;
GL_SOURCE0_RGB : constant Enum := 16#8580#;
GL_SOURCE1_RGB : constant Enum := 16#8581#;
GL_SOURCE2_RGB : constant Enum := 16#8582#;
GL_SOURCE0_ALPHA : constant Enum := 16#8588#;
GL_SOURCE1_ALPHA : constant Enum := 16#8589#;
GL_SOURCE2_ALPHA : constant Enum := 16#858A#;
GL_OPERAND0_RGB : constant Enum := 16#8590#;
GL_OPERAND1_RGB : constant Enum := 16#8591#;
GL_OPERAND2_RGB : constant Enum := 16#8592#;
GL_OPERAND0_ALPHA : constant Enum := 16#8598#;
GL_OPERAND1_ALPHA : constant Enum := 16#8599#;
GL_OPERAND2_ALPHA : constant Enum := 16#859A#;
GL_RGB_SCALE : constant Enum := 16#8573#;
GL_ADD_SIGNED : constant Enum := 16#8574#;
GL_INTERPOLATE : constant Enum := 16#8575#;
GL_SUBTRACT : constant Enum := 16#84E7#;
GL_CONSTANT : constant Enum := 16#8576#;
GL_PRIMARY_COLOR : constant Enum := 16#8577#;
GL_PREVIOUS : constant Enum := 16#8578#;
-- Texture env dot3
GL_DOT3_RGB : constant Enum := 16#86AE#;
GL_DOT3_RGBA : constant Enum := 16#86AF#;
-- Texture border clamp
GL_CLAMP_TO_BORDER : constant Enum := 16#812D#;
---------------------------------------------------------------------------
-- ARB extension 1 and OpenGL 1.2.1
GL_ARB_multitexture : constant Enum := 1;
GL_TEXTURE0_ARB : constant Enum := 16#84C0#;
GL_TEXTURE1_ARB : constant Enum := 16#84C1#;
GL_TEXTURE2_ARB : constant Enum := 16#84C2#;
GL_TEXTURE3_ARB : constant Enum := 16#84C3#;
GL_TEXTURE4_ARB : constant Enum := 16#84C4#;
GL_TEXTURE5_ARB : constant Enum := 16#84C5#;
GL_TEXTURE6_ARB : constant Enum := 16#84C6#;
GL_TEXTURE7_ARB : constant Enum := 16#84C7#;
GL_TEXTURE8_ARB : constant Enum := 16#84C8#;
GL_TEXTURE9_ARB : constant Enum := 16#84C9#;
GL_TEXTURE10_ARB : constant Enum := 16#84CA#;
GL_TEXTURE11_ARB : constant Enum := 16#84CB#;
GL_TEXTURE12_ARB : constant Enum := 16#84CC#;
GL_TEXTURE13_ARB : constant Enum := 16#84CD#;
GL_TEXTURE14_ARB : constant Enum := 16#84CE#;
GL_TEXTURE15_ARB : constant Enum := 16#84CF#;
GL_TEXTURE16_ARB : constant Enum := 16#84D0#;
GL_TEXTURE17_ARB : constant Enum := 16#84D1#;
GL_TEXTURE18_ARB : constant Enum := 16#84D2#;
GL_TEXTURE19_ARB : constant Enum := 16#84D3#;
GL_TEXTURE20_ARB : constant Enum := 16#84D4#;
GL_TEXTURE21_ARB : constant Enum := 16#84D5#;
GL_TEXTURE22_ARB : constant Enum := 16#84D6#;
GL_TEXTURE23_ARB : constant Enum := 16#84D7#;
GL_TEXTURE24_ARB : constant Enum := 16#84D8#;
GL_TEXTURE25_ARB : constant Enum := 16#84D9#;
GL_TEXTURE26_ARB : constant Enum := 16#84DA#;
GL_TEXTURE27_ARB : constant Enum := 16#84DB#;
GL_TEXTURE28_ARB : constant Enum := 16#84DC#;
GL_TEXTURE29_ARB : constant Enum := 16#84DD#;
GL_TEXTURE30_ARB : constant Enum := 16#84DE#;
GL_TEXTURE31_ARB : constant Enum := 16#84DF#;
GL_ACTIVE_TEXTURE_ARB : constant Enum := 16#84E0#;
GL_CLIENT_ACTIVE_TEXTURE_ARB : constant Enum := 16#84E1#;
GL_MAX_TEXTURE_UNITS_ARB : constant Enum := 16#84E2#;
---------------------------------------------------------------------------
-- OpenGL 1.4
GL_BLEND_DST_RGB : constant Enum := 16#80C8#;
GL_BLEND_SRC_RGB : constant Enum := 16#80C9#;
GL_BLEND_DST_ALPHA : constant Enum := 16#80CA#;
GL_BLEND_SRC_ALPHA : constant Enum := 16#80CB#;
GL_POINT_FADE_THRESHOLD_SIZE : constant Enum := 16#8128#;
GL_DEPTH_COMPONENT16 : constant Enum := 16#81A5#;
GL_DEPTH_COMPONENT24 : constant Enum := 16#81A6#;
GL_DEPTH_COMPONENT32 : constant Enum := 16#81A7#;
GL_MIRRORED_REPEAT : constant Enum := 16#8370#;
GL_MAX_TEXTURE_LOD_BIAS : constant Enum := 16#84FD#;
GL_TEXTURE_LOD_BIAS : constant Enum := 16#8501#;
GL_INCR_WRAP : constant Enum := 16#8507#;
GL_DECR_WRAP : constant Enum := 16#8508#;
GL_TEXTURE_DEPTH_SIZE : constant Enum := 16#884A#;
GL_TEXTURE_COMPARE_MODE : constant Enum := 16#884C#;
GL_TEXTURE_COMPARE_FUNC : constant Enum := 16#884D#;
GL_POINT_SIZE_MIN : constant Enum := 16#8126#;
GL_POINT_SIZE_MAX : constant Enum := 16#8127#;
GL_POINT_DISTANCE_ATTENUATION : constant Enum := 16#8129#;
GL_GENERATE_MIPMAP : constant Enum := 16#8191#;
GL_GENERATE_MIPMAP_HINT : constant Enum := 16#8192#;
GL_FOG_COORDINATE_SOURCE : constant Enum := 16#8450#;
GL_FOG_COORDINATE : constant Enum := 16#8451#;
GL_FOG_COORDINATE_ARRAY_TYPE : constant Enum := 16#8454#;
GL_FOG_COORDINATE_ARRAY_STRIDE : constant Enum := 16#8455#;
GL_FOG_COORDINATE_ARRAY_POINTER : constant Enum := 16#8456#;
GL_FOG_COORDINATE_ARRAY : constant Enum := 16#8457#;
GL_FRAGMENT_DEPTH : constant Enum := 16#8452#;
GL_CURRENT_FOG_COORDINATE : constant Enum := 16#8453#;
GL_COLOR_SUM : constant Enum := 16#8458#;
GL_CURRENT_SECONDARY_COLOR : constant Enum := 16#8459#;
GL_SECONDARY_COLOR_ARRAY_SIZE : constant Enum := 16#845A#;
GL_SECONDARY_COLOR_ARRAY_TYPE : constant Enum := 16#845B#;
GL_SECONDARY_COLOR_ARRAY_STRIDE : constant Enum := 16#845C#;
GL_SECONDARY_COLOR_ARRAY_POINTER : constant Enum := 16#845D#;
GL_SECONDARY_COLOR_ARRAY : constant Enum := 16#845E#;
GL_TEXTURE_FILTER_CONTROL : constant Enum := 16#8500#;
GL_DEPTH_TEXTURE_MODE : constant Enum := 16#884B#;
GL_COMPARE_R_TO_TEXTURE : constant Enum := 16#884E#;
GL_FUNC_ADD : constant Enum := 16#8006#;
GL_FUNC_SUBTRACT : constant Enum := 16#800A#;
GL_FUNC_REVERSE_SUBTRACT : constant Enum := 16#800B#;
GL_CONSTANT_COLOR : constant Enum := 16#8001#;
GL_ONE_MINUS_CONSTANT_COLOR : constant Enum := 16#8002#;
GL_CONSTANT_ALPHA : constant Enum := 16#8003#;
GL_ONE_MINUS_CONSTANT_ALPHA : constant Enum := 16#8004#;
---------------------------------------------------------------------------
-- Others...
GL_TEXTURE_1D_ARRAY_EXT : constant Enum := 16#8C18#;
GL_PROXY_TEXTURE_1D_ARRAY_EXT : constant Enum := 16#8C19#;
GL_TEXTURE_2D_ARRAY_EXT : constant Enum := 16#8C1A#;
GL_PROXY_TEXTURE_2D_ARRAY_EXT : constant Enum := 16#8C1B#;
GL_TEXTURE_BINDING_1D_ARRAY_EXT : constant Enum := 16#8C1C#;
GL_TEXTURE_BINDING_2D_ARRAY_EXT : constant Enum := 16#8C1D#;
GL_POINT_SPRITE : constant Enum := 16#8861#;
GL_COORD_REPLACE : constant Enum := 16#8862#;
GL_MAX_ARRAY_TEXTURE_LAYERS_EXT : constant Enum := 16#88FF#;
GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT : constant Enum := 16#8CD4#;
GL_FRAMEBUFFER : constant Enum := 16#8D40#;
GL_READ_FRAMEBUFFER : constant Enum := 16#8CA8#;
GL_WRITE_FRAMEBUFFER : constant Enum := 16#8CA9#;
GL_RENDERBUFFER : constant Enum := 16#8D41#;
GL_ARRAY_BUFFER : constant Enum := 16#8892#;
GL_ELEMENT_ARRAY_BUFFER : constant Enum := 16#8893#;
GL_STATIC_DRAW : constant Enum := 16#88E4#;
GL_DYNAMIC_DRAW : constant Enum := 16#88E8#;
GL_VERTEX_SHADER : constant Enum := 16#8B31#;
GL_FRAGMENT_SHADER : constant Enum := 16#8B30#;
GL_DELETE_STATUS : constant Enum := 16#8B80#;
GL_COMPILE_STATUS : constant Enum := 16#8B81#;
GL_LINK_STATUS : constant Enum := 16#8B82#;
GL_VALIDATE_STATUS : constant Enum := 16#8B83#;
GL_INFO_LOG_LENGTH : constant Enum := 16#8B84#;
GL_SHADING_LANGUAGE_VERSION : constant Enum := 16#8B8C#;
---------------------------------------------------------------------------
-- OpenGL 1.0 and 1.1 subprograms (in order as defined in gl.h)
-- Miscellanous
procedure Clear_Index (C : in Float)
with Import => True, Convention => StdCall,
External_Name => "glClearIndex";
procedure Clear_Color
(Red : in ClampF;
Green : in ClampF;
Blue : in ClampF;
Alpha : in ClampF
)
with Import => True, Convention => StdCall,
External_Name => "glClearColor";
procedure Clear (Mask : in Bitfield)
with Import => True, Convention => StdCall, External_Name => "glClear";
procedure Index_Mask (Mask : in UInt)
with Import => True, Convention => StdCall, External_Name => "glIndexMask";
procedure Color_Mask
(Red : in Bool;
Green : in Bool;
Blue : in Bool;
Alpha : in Bool
)
with Import => True, Convention => StdCall, External_Name => "glColorMask";
procedure Alpha_Func
(Func : in Enum;
Ref : in ClampF
)
with Import => True, Convention => StdCall, External_Name => "glAlphaFunc";
procedure Blend_Func
(S_Factor : in Enum;
D_Factor : in Enum
)
with Import => True, Convention => StdCall, External_Name => "glBlendFunc";
procedure Blend_Func_Separate (S_Factor_RGB : in Enum;
D_Factor_RGB : in Enum;
S_Factor_Alpha : in Enum;
D_Factro_Alpha : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glBlendFuncSeparate";
procedure Logic_Op (Op_Code : in Enum)
with Import => True, Convention => StdCall, External_Name => "glLogicOp";
procedure Cull_Face (Mode : in Enum)
with Import => True, Convention => StdCall, External_Name => "glCullFace";
procedure Front_Face (Mode : in Enum)
with Import => True, Convention => StdCall, External_Name => "glFrontFace";
procedure Point_Size (Size : in Float)
with Import => True, Convention => StdCall, External_Name => "glPointSize";
procedure Point_Parameter (PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall,
External_Name => "glPointParameterf";
procedure Point_Parameter (PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall,
External_Name => "glPointParameteri";
procedure Point_Parameter (PName : in Enum;
Params : in Floats_1)
with Import => True, Convention => StdCall,
External_Name => "glPointParameterfv";
procedure Point_Parameter (PName : in Enum;
Params : in Floats_3)
with Import => True, Convention => StdCall,
External_Name => "glPointParameterfv";
procedure Point_Parameter (PName : in Enum;
Params : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glPointParameterfv";
procedure Point_Parameter (PName : in Enum;
Params : in Ints_1)
with Import => True, Convention => StdCall,
External_Name => "glPointParameteriv";
procedure Point_Parameter (PName : in Enum;
Params : in Ints_3)
with Import => True, Convention => StdCall,
External_Name => "glPointParameteriv";
procedure Point_Parameter (PName : in Enum;
Params : in Ints)
with Import => True, Convention => StdCall,
External_Name => "glPointParameteriv";
procedure Line_Width (Width : in Float)
with Import => True, Convention => StdCall, External_Name => "glLineWidth";
procedure Line_Stipple
(Factor : in Int;
Pattern : in UShort
)
with Import => True, Convention => StdCall,
External_Name => "glLineStipple";
procedure Polygon_Mode
(Face : in Enum;
Mode : in Enum
)
with Import => True, Convention => StdCall,
External_Name => "glPolygonMode";
procedure Polygon_Offset
(Factor : in Float;
Units : in Float
)
with Import => True, Convention => StdCall,
External_Name => "glPolygonOffset";
procedure Polygon_Stipple (Mask : in Pointer) -- array of UByte
with Import => True, Convention => StdCall,
External_Name => "glPolygonStipple";
procedure Get_Polygon_Stipple (Mask : in Pointer) -- array of UByte
with Import => True, Convention => StdCall,
External_Name => "glGetPolygonStipple";
procedure Edge_Flag (Flag : in Bool)
with Import => True, Convention => StdCall, External_Name => "glEdgeFlag";
procedure Edge_Flag (Flag : in Pointer) -- array of Bool
with Import => True, Convention => StdCall, External_Name => "glEdgeFlagv";
procedure Scissor
(X : Int;
Y : Int;
Width : SizeI;
Height : SizeI
)
with Import => True, Convention => StdCall, External_Name => "glScissor";
procedure Clip_Plane
(Plane : in Enum;
Equation : in Pointer -- array of Double
)
with Import => True, Convention => StdCall, External_Name => "glClipPlane";
procedure Get_Clip_Plane
(Plane : in Enum;
Equation : in Pointer -- array of Double
)
with Import => True, Convention => StdCall,
External_Name => "glGetClipPlane";
procedure Draw_Buffer (Mode : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glDrawBuffer";
procedure Read_Buffer (Mode : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glReadBuffer";
procedure Enable (Cap : in Enum)
with Import => True, Convention => StdCall, External_Name => "glEnable";
procedure Disable (Cap : in Enum)
with Import => True, Convention => StdCall, External_Name => "glDisable";
function Is_Enabled (Cap : in Enum) return Bool
with Import => True, Convention => StdCall, External_Name => "glIsEnabled";
procedure Get_Boolean
(PName : in Enum;
Params : in Pointer -- array of Bool
)
with Import => True, Convention => StdCall,
External_Name => "glGetBooleanv";
procedure Get_Double
(PName : in Enum;
Params : in Pointer -- array of Double
)
with Import => True, Convention => StdCall,
External_Name => "glGetDoublev";
procedure Get_Float
(PName : in Enum;
Params : in Pointer -- array of Float
)
with Import => True, Convention => StdCall, External_Name => "glGetFloatv";
procedure Get_Integer
(PName : in Enum;
Params : in Pointer -- array of Integer
)
with Import => True, Convention => StdCall,
External_Name => "glGetIntegerv";
procedure Push_Attrib (Mask : in Bitfield)
with Import => True, Convention => StdCall,
External_Name => "glPushAttrib";
procedure Pop_Attrib
with Import => True, Convention => StdCall, External_Name => "glPopAttrib";
procedure Render_Mode (Mode : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glRenderMode";
function Get_Error return Enum
with Import => True, Convention => StdCall, External_Name => "glGetError";
function Get_String (Name : Enum) return String
with Inline => True;
procedure Finish
with Import => True, Convention => StdCall, External_Name => "glFinish";
procedure Flush
with Import => True, Convention => StdCall, External_Name => "glFlush";
procedure Hint (Target : Enum; Hint : Enum)
with Import => True, Convention => StdCall, External_Name => "glHint";
procedure Sample_Coverage (Value : in ClampF;
Inver : in Bool)
with Import => True, Convention => StdCall,
External_Name => "glSampleCoverage";
-- Depth buffer
procedure Clear_Depth (Depth : in ClampD)
with Import => True, Convention => StdCall,
External_Name => "glClearDepth";
procedure Depth_Func (Func : in Enum)
with Import => True, Convention => StdCall, External_Name => "glDepthFunc";
procedure Depth_Mask (Flag : in Bool)
with Import => True, Convention => StdCall, External_Name => "glDepthMask";
procedure Depth_Range
(Near_Val : in ClampD;
Far_Val : in ClampD
)
with Import => True, Convention => StdCall,
External_Name => "glDepthRange";
-- Accumulation buffer
procedure Clear_Accum
(Red : in Float;
Green : in Float;
Blue : in Float;
Alpha : in Float
)
with Import => True, Convention => StdCall,
External_Name => "glClearAccum";
procedure Accum
(Op : in Enum;
Value : in Float
)
with Import => True, Convention => StdCall, External_Name => "glAccum";
-- Transformation
procedure Matrix_Mode (Mode : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glMatrixMode";
procedure Ortho
(Left : in Double;
Right : in Double;
Bottom : in Double;
Top : in Double;
Near_Val : in Double;
Far_Val : in Double
)
with Import => True, Convention => StdCall, External_Name => "glOrtho";
procedure Frustum
(Left : in Double;
Right : in Double;
Bottom : in Double;
Top : in Double;
Near_Val : in Double;
Far_Val : in Double
)
with Import => True, Convention => StdCall, External_Name => "glFrustum";
procedure Viewport
(X : in Int;
Y : in Int;
Width : in SizeI;
Height : in SizeI
)
with Import => True, Convention => StdCall, External_Name => "glViewport";
procedure Push_Matrix
with Import => True, Convention => StdCall,
External_Name => "glPushMatrix";
procedure Pop_Matrix
with Import => True, Convention => StdCall, External_Name => "glPopMatrix";
procedure Load_Identity
with Import => True, Convention => StdCall,
External_Name => "glLoadIdentity";
procedure Load_Matrix (M : in Float_Matrix)
with Import => True, Convention => StdCall,
External_Name => "glLoadMatrixf";
procedure Load_Matrix (M : in Double_Matrix)
with Import => True, Convention => StdCall,
External_Name => "glLoadMatrixd";
procedure Mult_Matrix (M : in Float_Matrix)
with Import => True, Convention => StdCall,
External_Name => "glMultMatrixf";
procedure Mult_Matrix (M : in Double_Matrix)
with Import => True, Convention => StdCall,
External_Name => "glMultMatrixd";
procedure Load_Transpose_Matrix (M : in Double_Matrix)
with Import => True, Convention => StdCall,
External_Name => "glLoadTransposeMatrixd";
procedure Load_Transpose_Matrix (M : in Float_Matrix)
with Import => True, Convention => StdCall,
External_Name => "glLoadTransposeMatrixf";
procedure Mult_Transpose_Matrix (M : in Double_Matrix)
with Import => True, Convention => StdCall,
External_Name => "glMultTransposeMatrixd";
procedure Mult_Transpose_Matrix (M : in Float_Matrix)
with Import => True, Convention => StdCall,
External_Name => "glMultTransposeMatrixf";
procedure Rotate
(Angle : in Double;
X : in Double;
Y : in Double;
Z : in Double
)
with Import => True, Convention => StdCall, External_Name => "glRotated";
procedure Rotate
(Angle : in Float;
X : in Float;
Y : in Float;
Z : in Float
)
with Import => True, Convention => StdCall, External_Name => "glRotatef";
procedure Scale
(X : in Double;
Y : in Double;
Z : in Double
)
with Import => True, Convention => StdCall, External_Name => "glScaled";
procedure Scale
(X : in Float;
Y : in Float;
Z : in Float
)
with Import => True, Convention => StdCall, External_Name => "glScalef";
procedure Translate
(X : in Double;
Y : in Double;
Z : in Double
)
with Import => True, Convention => StdCall,
External_Name => "glTranslated";
procedure Translate
(X : in Float;
Y : in Float;
Z : in Float
)
with Import => True, Convention => StdCall,
External_Name => "glTranslatef";
-- Display Lists
function Is_List (List : in UInt) return Bool
with Import => True, Convention => StdCall, External_Name => "glIsList";
procedure Delete_Lists
(List : in UInt;
SRange : in SizeI
)
with Import => True, Convention => StdCall,
External_Name => "glDeleteLists";
function Gen_Lists (SRange : in SizeI) return UInt
with Import => True, Convention => StdCall, External_Name => "glGenLists";
procedure New_List
(List : in UInt;
Mode : in Enum
)
with Import => True, Convention => StdCall, External_Name => "glNewList";
procedure End_List
with Import => True, Convention => StdCall, External_Name => "glEndList";
procedure Call_List (List : in UInt)
with Import => True, Convention => StdCall, External_Name => "glCallList";
procedure Call_Lists
(N : in SizeI;
SType : in Enum;
Lists : in Pointer
)
with Import => True, Convention => StdCall, External_Name => "glCallLists";
procedure List_Base (Base : in UInt)
with Import => True, Convention => StdCall, External_Name => "glListBase";
-- Drawing Functions
procedure Begin_Primitive (Mode : in Enum)
with Import => True, Convention => StdCall, External_Name => "glBegin";
procedure End_Primitive
with Import => True, Convention => StdCall, External_Name => "glEnd";
procedure Vertex
(X : in Double;
Y : in Double
)
with Import => True, Convention => StdCall, External_Name => "glVertex2d";
procedure Vertex
(X : in Float;
Y : in Float
)
with Import => True, Convention => StdCall, External_Name => "glVertex2f";
procedure Vertex
(X : in Int;
Y : in Int
)
with Import => True, Convention => StdCall, External_Name => "glVertex2i";
procedure Vertex
(X : in Short;
Y : in Short
)
with Import => True, Convention => StdCall, External_Name => "glVertex2s";
procedure Vertex
(X : in Double;
Y : in Double;
Z : in Double
)
with Import => True, Convention => StdCall, External_Name => "glVertex3d";
procedure Vertex
(X : in Float;
Y : in Float;
Z : in Float
)
with Import => True, Convention => StdCall, External_Name => "glVertex3f";
procedure Vertex
(X : in Int;
Y : in Int;
Z : in Int
)
with Import => True, Convention => StdCall, External_Name => "glVertex3i";
procedure Vertex
(X : in Short;
Y : in Short;
Z : in Short
)
with Import => True, Convention => StdCall, External_Name => "glVertex3s";
procedure Vertex
(X : in Double;
Y : in Double;
Z : in Double;
W : in Double
)
with Import => True, Convention => StdCall, External_Name => "glVertext4d";
procedure Vertex
(X : in Float;
Y : in Float;
Z : in Float;
W : in Float
)
with Import => True, Convention => StdCall, External_Name => "glVertex4f";
procedure Vertex
(X : in Int;
Y : in Int;
Z : in Int;
W : in Int
)
with Import => True, Convention => StdCall, External_Name => "glVertex4i";
procedure Vertex
(X : in Short;
Y : in Short;
Z : in Short;
W : in Short
)
with Import => True, Convention => StdCall, External_Name => "glVertex4s";
procedure Vertex (V : in Doubles_2)
with Import => True, Convention => StdCall, External_Name => "glVertex2dv";
procedure Vertex (V : in Doubles_3)
with Import => True, Convention => StdCall, External_Name => "glVertex3dv";
procedure Vertex (V : in Doubles_4)
with Import => True, Convention => StdCall, External_Name => "glVertex4dv";
procedure Vertex (V : in Floats_2)
with Import => True, Convention => StdCall, External_Name => "glVertex2fv";
procedure Vertex (V : in Floats_3)
with Import => True, Convention => StdCall, External_Name => "glVertex3fv";
procedure Vertex (V : in Floats_4)
with Import => True, Convention => StdCall, External_Name => "glVertex4fv";
procedure Vertex (V : in Ints_2)
with Import => True, Convention => StdCall, External_Name => "glVertex2iv";
procedure Vertex (V : in Ints_3)
with Import => True, Convention => StdCall, External_Name => "glVertex3iv";
procedure Vertex (V : in Ints_4)
with Import => True, Convention => StdCall, External_Name => "glVertex4iv";
procedure Vertex (V : in Shorts_2)
with Import => True, Convention => StdCall, External_Name => "glVertex2sv";
procedure Vertex (V : in Shorts_3)
with Import => True, Convention => StdCall, External_Name => "glVertex3sv";
procedure Vertex (V : in Shorts_4)
with Import => True, Convention => StdCall, External_Name => "glVertex4sv";
procedure Normal
(X : in Byte;
Y : in Byte;
Z : in Byte
)
with Import => True, Convention => StdCall, External_Name => "glNormal3b";
procedure Normal
(X : in Double;
Y : in Double;
Z : in Double
)
with Import => True, Convention => StdCall, External_Name => "glNormal3d";
procedure Normal
(X : in Float;
Y : in Float;
Z : in Float
)
with Import => True, Convention => StdCall, External_Name => "glNormal3f";
procedure Normal
(X : in Int;
Y : in Int;
Z : in Int
)
with Import => True, Convention => StdCall, External_Name => "glNormal3i";
procedure Normal
(X : in Short;
Y : in Short;
Z : in Short
)
with Import => True, Convention => StdCall, External_Name => "glNormal3s";
procedure Normal (V : in Bytes_3)
with Import => True, Convention => StdCall, External_Name => "glNormal3bv";
procedure Normal (V : in Doubles_3)
with Import => True, Convention => StdCall, External_Name => "glNormal3dv";
procedure Normal (V : in Floats_3)
with Import => True, Convention => StdCall, External_Name => "glNormal3fv";
procedure Normal (V : in Ints_3)
with Import => True, Convention => StdCall, External_Name => "glNormal3iv";
procedure Normal (V : in Shorts_3)
with Import => True, Convention => StdCall, External_Name => "glNormal3sv";
procedure Index (C : in Double)
with Import => True, Convention => StdCall, External_Name => "glIndexd";
procedure Index (C : in Float)
with Import => True, Convention => StdCall, External_Name => "glIndexf";
procedure Index (C : in Int)
with Import => True, Convention => StdCall, External_Name => "glIndexi";
procedure Index (C : in Short)
with Import => True, Convention => StdCall, External_Name => "glIndexs";
procedure Index (C : in Doubles)
with Import => True, Convention => StdCall, External_Name => "glIndexdv";
procedure Index (C : in Floats)
with Import => True, Convention => StdCall, External_Name => "glIndexfv";
procedure Index (C : in Ints)
with Import => True, Convention => StdCall, External_Name => "glIndexiv";
procedure Index (C : in Shorts)
with Import => True, Convention => StdCall, External_Name => "glIndexsv";
---------------------------------------------------------------------------
-- Component color
procedure Color (Red : in Byte;
Green : in Byte;
Blue : in Byte)
with Import => True, Convention => StdCall, External_Name => "glColor3b";
procedure Color (Red : in Short;
Green : in Short;
Blue : in Short)
with Import => True, Convention => StdCall, External_Name => "glColor3s";
procedure Color (Red : in Int;
Green : in Int;
Blue : in Int)
with Import => True, Convention => StdCall, External_Name => "glColor3i";
procedure Color (Red : in Float;
Green : in Float;
Blue : in Float)
with Import => True, Convention => StdCall, External_Name => "glColor3f";
procedure Color (Red : in Double;
Green : in Double;
Blue : in Double)
with Import => True, Convention => StdCall, External_Name => "glColor3d";
procedure Color (Red : in UByte;
Green : in UByte;
Blue : in UByte)
with Import => True, Convention => StdCall, External_Name => "glColor3ub";
procedure Color (Red : in UShort;
Green : in UShort;
Blue : in UShort)
with Import => True, Convention => StdCall, External_Name => "glColor3us";
procedure Color (Red : in UInt;
Green : in UInt;
Blue : in UInt)
with Import => True, Convention => StdCall, External_Name => "glColor3ui";
procedure Color (Red : in Byte;
Green : in Byte;
Blue : in Byte;
Alpha : in Byte)
with Import => True, Convention => StdCall, External_Name => "glColor4b";
procedure Color (Red : in Short;
Green : in Short;
Blue : in Short;
Alpha : in Short)
with Import => True, Convention => StdCall, External_Name => "glColor4s";
procedure Color (Red : in Int;
Green : in Int;
Blue : in Int;
Alpha : in Int)
with Import => True, Convention => StdCall, External_Name => "glColor4i";
procedure Color (Red : in Float;
Green : in Float;
Blue : in Float;
Alpha : in Float)
with Import => True, Convention => StdCall, External_Name => "glColor4f";
procedure Color (Red : in Double;
Green : in Double;
Blue : in Double;
Alpha : in Double)
with Import => True, Convention => StdCall, External_Name => "glColor4d";
procedure Color (Red : in UByte;
Green : in UByte;
Blue : in UByte;
Alpha : in UByte)
with Import => True, Convention => StdCall, External_Name => "glColor4ub";
procedure Color (Red : in UShort;
Green : in UShort;
Blue : in UShort;
Alpha : in UShort)
with Import => True, Convention => StdCall, External_Name => "glColor4us";
procedure Color (Red : in UInt;
Green : in UInt;
Blue : in UInt;
Alpha : in UInt)
with Import => True, Convention => StdCall, External_Name => "glColor4ui";
procedure Color (V : in Bytes_3)
with Import => True, Convention => StdCall, External_Name => "glColor3bv";
procedure Color (V : in Bytes_4)
with Import => True, Convention => StdCall, External_Name => "glColor4bv";
procedure Color (V : in Shorts_3)
with Import => True, Convention => StdCall, External_Name => "glColor3sv";
procedure Color (V : in Shorts_4)
with Import => True, Convention => StdCall, External_Name => "glColor4sv";
procedure Color (V : in Ints_3)
with Import => True, Convention => StdCall, External_Name => "glColor3iv";
procedure Color (V : in Ints_4)
with Import => True, Convention => StdCall, External_Name => "glColor4iv";
procedure Color (V : in Floats_3)
with Import => True, Convention => StdCall, External_Name => "glColor3fv";
procedure Color (V : in Floats_4)
with Import => True, Convention => StdCall, External_Name => "glColor4fv";
procedure Color (V : in Doubles_3)
with Import => True, Convention => StdCall, External_Name => "glColor3dv";
procedure Color (V : in Doubles_4)
with Import => True, Convention => StdCall, External_Name => "glColor4dv";
procedure Color (V : in UBytes_3)
with Import => True, Convention => StdCall, External_Name => "glColor3ubv";
procedure Color (V : in UBytes_4)
with Import => True, Convention => StdCall, External_Name => "glColor4ubv";
procedure Color (V : in UShorts_3)
with Import => True, Convention => StdCall, External_Name => "glColor3usv";
procedure Color (V : in UShorts_4)
with Import => True, Convention => StdCall, External_Name => "glColor4usv";
procedure Color (V : in UInts_3)
with Import => True, Convention => StdCall, External_Name => "glColor3uiv";
procedure Color (V : in UInts_4)
with Import => True, Convention => StdCall, External_Name => "glColor4uiv";
procedure Secondary_Color (Red : in Byte;
Green : in Byte;
Blue : in Byte)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3b";
procedure Secondary_Color (V : in Bytes_3)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3bv";
procedure Secondary_Color (Red : in Double;
Green : in Double;
Blue : in Double)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3d";
procedure Secondary_Color (V : in Doubles_3)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3dv";
procedure Secondary_Color (Red : in Float;
Green : in Float;
Blue : in Float)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3f";
procedure Secondary_Color (V : in Floats_3)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3fv";
procedure Secondary_Color (Red : in Int;
Green : in Int;
Blue : in Int)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3i";
procedure Secondary_Color (V : in Ints_3)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3iv";
procedure Secondary_Color (Red : in Short;
Green : in Short;
Blue : in Short)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3s";
procedure Secondary_Color (V : in Shorts_3)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3sv";
procedure Secondary_Color (Red : in UByte;
Green : in UByte;
Blue : in UByte)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3ub";
procedure Secondary_Color (V : in UBytes_3)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3ubv";
procedure Secondary_Color (Red : in UInt;
Green : in UInt;
Blue : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3ui";
procedure Secondary_Color (V : in UInts_3)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3uiv";
procedure Secondary_Color (Red : in UShort;
Green : in UShort;
Blue : in UShort)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3us";
procedure Secondary_Color (V : in UShorts_3)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryColor3usv";
procedure Secondary_Color_Pointer (Size : in Int;
Type_Of : in Enum;
Stride : in SizeI;
Colors : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glSecondaryPointer";
---------------------------------------------------------------------------
-- Texture coordinates
procedure Tex_Coord (S : in Short)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord1s";
procedure Tex_Coord (S : in Int)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord1i";
procedure Tex_Coord (S : in Float)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord1f";
procedure Tex_Coord (S : in Double)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord1d";
procedure Tex_Coord (S : in Short;
T : in Short)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord2s";
procedure Tex_Coord (S : in Int;
T : in Int)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord2i";
procedure Tex_Coord (S : in Float;
T : in Float)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord2f";
procedure Tex_Coord (S : in Double;
T : in Double)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord2d";
procedure Tex_Coord (S : in Short;
T : in Short;
R : in Short)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord3s";
procedure Tex_Coord (S : in Int;
T : in Int;
R : in Int)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord3i";
procedure Tex_Coord (S : in Float;
T : in Float;
R : in Float)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord3f";
procedure Tex_Coord (S : in Double;
T : in Double;
R : in Double)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord3d";
procedure Tex_Coord (S : in Short;
T : in Short;
R : in Short;
Q : in Short)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord4s";
procedure Tex_Coord (S : in Int;
T : in Int;
R : in Int;
Q : in Int)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord4i";
procedure Tex_Coord (S : in Float;
T : in Float;
R : in Float;
Q : in Float)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord4f";
procedure Tex_Coord (S : in Double;
T : in Double;
R : in Double;
Q : in Double)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord4d";
procedure Tex_Coord (V : in Shorts_1)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord1sv";
procedure Tex_Coord (V : in Shorts_2)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord2sv";
procedure Tex_Coord (V : in Shorts_3)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord3sv";
procedure Tex_Coord (V : in Shorts_4)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord4sv";
procedure Tex_Coord (V : in Ints_1)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord1iv";
procedure Tex_Coord (V : in Ints_2)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord2iv";
procedure Tex_Coord (V : in Ints_3)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord3iv";
procedure Tex_Coord (V : in Ints_4)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord4iv";
procedure Tex_Coord (V : in Floats_1)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord1fv";
procedure Tex_Coord (V : in Floats_2)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord2fv";
procedure Tex_Coord (V : in Floats_3)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord3fv";
procedure Tex_Coord (V : in Floats_4)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord4fv";
procedure Tex_Coord (V : in Doubles_1)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord1dv";
procedure Tex_Coord (V : in Doubles_2)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord2dv";
procedure Tex_Coord (V : in Doubles_3)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord3dv";
procedure Tex_Coord (V : in Doubles_4)
with Import => True, Convention => StdCall,
External_Name => "glTexCoord4dv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Double)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord1d";
procedure Multi_Tex_Coord (Target : in Enum;
V : in Doubles)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord1dv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Float)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord1f";
procedure Multi_Tex_Coord (Target : in Enum;
V : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord1fv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Int)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord1i";
procedure Multi_Tex_Coord (Target : in Enum;
V : in Ints)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord1iv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Short)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord1s";
procedure Multi_Tex_Coord (Target : in Enum;
V : in Shorts)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord1sv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Double;
T : in Double)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord2d";
procedure Multi_Tex_Coord_2 (Target : in Enum;
V : in Double)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord2dv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Float;
T : in Float)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord2f";
procedure Multi_Tex_Coord_2 (Target : in Enum;
V : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord2fv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Int;
T : in Int)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord2i";
procedure Multi_Tex_Coord_2 (Target : in Enum;
S : in Ints)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord2iv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Short;
T : in Short)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord2s";
procedure Multi_Tex_Coord_2 (Target : in Enum;
V : in Shorts)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord2sv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Double;
T : in Double;
R : in Double)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord3d";
procedure Multi_Tex_Coord_3 (Target : in Enum;
V : in Doubles)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord3dv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Float;
T : in Float;
R : in Float)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord3f";
procedure Multi_Tex_Coord_3 (Target : in Enum;
V : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord3fv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Int;
T : in Int;
R : in Int)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord3i";
procedure Multi_Tex_Coord_3 (Target : in Enum;
V : in Ints)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord3iv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Short;
T : in Short;
R : in Short)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord3s";
procedure Multi_Tex_Coord_3 (Target : in Enum;
V : in Shorts)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord3sv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Double;
T : in Double;
R : in Double;
Q : in Double)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord4d";
procedure Multi_Tex_Coord_4 (Target : in Enum;
V : in Doubles)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord4dv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Float;
T : in Float;
R : in Float;
Q : in Float)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord4f";
procedure Multi_Tex_Coord_4 (Target : in Enum;
V : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord4fv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Int;
T : in Int;
R : in Int;
Q : in Int)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord4i";
procedure Multi_Tex_Coord_4 (Target : in Enum;
V : in Ints)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord4iv";
procedure Multi_Tex_Coord (Target : in Enum;
S : in Short;
T : in Short;
R : in Short;
Q : in Short)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord4s";
procedure Multi_Tex_Coord_4 (Target : in Enum;
V : in Shorts)
with Import => True, Convention => StdCall,
External_Name => "glMultiTexCoord4sv";
---------------------------------------------------------------------------
procedure Raster_Pos (X : in Short;
Y : in Short)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos2s";
procedure Raster_Pos (X : in Int;
Y : in Int)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos2i";
procedure Raster_Pos (X : in Float;
Y : in Float)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos2f";
procedure Raster_Pos (X : in Double;
Y : in Double)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos2d";
procedure Raster_Pos (X : in Short;
Y : in Short;
Z : in Short)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos3s";
procedure Raster_Pos (X : in Int;
Y : in Int;
Z : in Int)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos3i";
procedure Raster_Pos (X : in Float;
Y : in Float;
Z : in Float)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos3f";
procedure Raster_Pos (X : in Double;
Y : in Double;
Z : in Double)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos3d";
procedure Raster_Pos (X : in Short;
Y : in Short;
Z : in Short;
W : in Short)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos4s";
procedure Raster_Pos (X : in Int;
Y : in Int;
Z : in Int;
W : in Int)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos4i";
procedure Raster_Pos (X : in Float;
Y : in Float;
Z : in Float;
W : in Float)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos4f";
procedure Raster_Pos (X : in Double;
Y : in Double;
Z : in Double;
W : in Double)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos4d";
procedure Raster_Pos (V : in Shorts_2)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos2sv";
procedure Raster_Pos (V : in Shorts_3)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos3sv";
procedure Raster_Pos (V : in Shorts_4)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos4sv";
procedure Raster_Pos (V : in Ints_2)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos2iv";
procedure Raster_Pos (V : in Ints_3)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos3iv";
procedure Raster_Pos (V : in Ints_4)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos4fv";
procedure Raster_Pos (V : in Floats_2)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos2fv";
procedure Raster_Pos (V : in Floats_3)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos3fv";
procedure Raster_Pos (V : in Floats_4)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos4fv";
procedure Raster_Pos (V : in Doubles_2)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos2dv";
procedure Raster_Pos (V : in Doubles_3)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos3dv";
procedure Raster_Pos (V : in Doubles_4)
with Import => True, Convention => StdCall,
External_Name => "glRasterPos4dv";
procedure Window_Pos (X : in Double;
Y : in Double)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos2d";
procedure Window_Pos (V : in Doubles_2)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos2dv";
procedure Window_Pos (X : in Float;
Y : in Float)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos2f";
procedure Window_Pos (V : in Floats_2)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos2fv";
procedure Window_Pos (X : in Int;
Y : in Int)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos2i";
procedure Window_Pos (V : in Ints_2)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos2iv";
procedure Window_Pos (X : in Short;
Y : in Short)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos2s";
procedure Window_Pos (V : in Shorts_2)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos2sv";
procedure Window_Pos (X : in Double;
Y : in Double;
Z : in Double)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos3d";
procedure Window_Pos (V : in Doubles_3)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos3dv";
procedure Window_Pos (X : in Float;
Y : in Float;
Z : in Float)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos3f";
procedure Window_Pos (V : in Floats_3)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos3fv";
procedure Window_Pos (X : in Int;
Y : in Int;
Z : in Int)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos3i";
procedure Window_Pos (V : in Ints_3)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos3iv";
procedure Window_Pos (X : in Short;
Y : in Short;
Z : in Short)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos3s";
procedure Window_Pos (V : in Shorts_3)
with Import => True, Convention => StdCall,
External_Name => "glWindowPos3sv";
---------------------------------------------------------------------------
procedure Rect (X1 : in Short;
Y1 : in Short;
X2 : in Short;
Y2 : in Short)
with Import => True, Convention => StdCall, External_Name => "glRects";
procedure Rect (X1 : in Int;
Y1 : in Int;
X2 : in Int;
Y2 : in Int)
with Import => True, Convention => StdCall, External_Name => "glRecti";
procedure Rect (X1 : in Float;
Y1 : in Float;
X2 : in Float;
Y2 : in Float)
with Import => True, Convention => StdCall, External_Name => "glRectf";
procedure Rect (X1 : in Double;
Y1 : in Double;
X2 : in Double;
Y2 : in Double)
with Import => True, Convention => StdCall, External_Name => "glRectd";
procedure Rect (V1 : in Shorts_2;
V2 : in Shorts_2)
with Import => True, Convention => StdCall, External_Name => "glRectsv";
procedure Rect (V1 : in Ints_2;
V2 : in Ints_2)
with Import => True, Convention => StdCall, External_Name => "glRectiv";
procedure Rect (V1 : in Floats_2;
V2 : in Floats_2)
with Import => True, Convention => StdCall, External_Name => "glRectfv";
procedure Rect (V1 : in Doubles_2;
V2 : in Doubles_2)
with Import => True, Convention => StdCall, External_Name => "glRectdv";
---------------------------------------------------------------------------
-- OpenGL 1.1 vertex subprograms
procedure Vertex_Pointer (Size : in SizeI;
Type_Of : in Enum;
Stride : in SizeI;
Data_Pointer : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glVertexPointer";
procedure Normal_Pointer (Size : in SizeI;
Stride : in SizeI;
Data_Pointer : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glNormalPointer";
procedure Color_Pointer (Size : in SizeI;
Type_Of : in Enum;
Stride : in SizeI;
Data_Pointer : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glColorPointer";
procedure Index_Pointer (Type_Of : in Enum;
Stride : in SizeI;
Data_Pointer : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glIndexPointer";
procedure Tex_Coord_Pointer (Size : in SizeI;
Type_Of : in Enum;
Stride : in SizeI;
Data_Pointer : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glTexCoordPointer";
procedure Edge_Flag_Pointer (Stride : in SizeI;
Data_Pointer : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glEdgeFlagPointer";
procedure Get_Pointer (PName : in Enum;
Data_Pointer : out Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGetPointerv";
procedure Array_Element (I : in Int)
with Import => True, Convention => StdCall,
External_Name => "glArrayElement";
procedure Draw_Arrays (Mode : in Enum;
First : in Int;
Count : in SizeI)
with Import => True, Convention => StdCall,
External_Name => "glDrawArrays";
procedure Multi_Draw_Arrays (Mode : in Enum;
First : in Ints;
Count : in SizeI;
Draw_Count : in SizeI)
with Import => True, Convention => StdCall,
External_Name => "glMultiDrawArrays";
procedure Draw_Elements (Mode : in Enum;
Count : in SizeI;
Index_Type : in Enum;
Indices : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glDrawElements";
procedure Draw_Range_Elements (Mode : in Enum;
Start : in UInt;
End_Of : in UInt;
Count : in SizeI;
Type_Of : in Enum;
Indices : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glDrawRangeElements";
procedure Multi_Draw_Elements (Mode : in Enum;
Count : in SizeIs;
Type_Of : in Enum;
Indices : in Pointer;
Draw_Count : in SizeI)
with Import => True, Convention => StdCall,
External_Name => "glMultiDrawElements";
procedure Interleaved_Arrays (Format : in Enum;
Stride : in SizeI;
Data_Pointer : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glInterleavedArrays";
---------------------------------------------------------------------------
-- Lighting and materials
procedure Light (Light : in Enum;
PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall, External_Name => "glLightf";
procedure Light (Light : in Enum;
PName : in Enum;
Params : in Floats_1)
with Import => True, Convention => StdCall, External_Name => "glLightfv";
procedure Light (Light : in Enum;
PName : in Enum;
Params : in Floats_3)
with Import => True, Convention => StdCall, External_Name => "glLightfv";
procedure Light (Light : in Enum;
PName : in Enum;
Params : in Floats_4)
with Import => True, Convention => StdCall, External_Name => "glLightfv";
procedure Light (Light : in Enum;
PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall, External_Name => "glLighti";
procedure Light (Light : in Enum;
PName : in Enum;
Params : in Ints_1)
with Import => True, Convention => StdCall, External_Name => "glLightiv";
procedure Light (Light : in Enum;
PName : in Enum;
Params : in Ints_3)
with Import => True, Convention => StdCall, External_Name => "glLightiv";
procedure Light (Light : in Enum;
PName : in Enum;
Params : in Ints_4)
with Import => True, Convention => StdCall, External_Name => "glLightiv";
procedure Get_Light (Light : in Enum;
PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall,
External_Name => "glGetLightiv";
procedure Get_Light (Light : in Enum;
PName : in Enum;
Params : in Ints_1)
with Import => True, Convention => StdCall,
External_Name => "glGetLightiv";
procedure Get_Light (Light : in Enum;
PName : in Enum;
Params : in Ints_3)
with Import => True, Convention => StdCall,
External_Name => "glGetLightiv";
procedure Get_Light (Light : in Enum;
PName : in Enum;
Params : in Ints_4)
with Import => True, Convention => StdCall,
External_Name => "glGetLightiv";
procedure Get_Light (Light : in Enum;
PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall,
External_Name => "glGetLightfv";
procedure Get_Light (Light : in Enum;
PName : in Enum;
Params : in Floats_1)
with Import => True, Convention => StdCall,
External_Name => "glGetLightfv";
procedure Get_Light (Light : in Enum;
PName : in Enum;
Params : in Floats_3)
with Import => True, Convention => StdCall,
External_Name => "glGetLightfv";
procedure Get_Light (Light : in Enum;
PName : in Enum;
Params : in Floats_4)
with Import => True, Convention => StdCall,
External_Name => "glGetLightfv";
procedure Light_Model (PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall,
External_Name => "glLightModeli";
procedure Light_Model (PName : in Enum;
Params : in Ints_1)
with Import => True, Convention => StdCall,
External_Name => "glLightModeliv";
procedure Light_Model (PName : in Enum;
Params : in Ints_4)
with Import => True, Convention => StdCall,
External_Name => "glLightModeliv";
procedure Light_Model (PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall,
External_Name => "glLightModelf";
procedure Light_Model (PName : in Enum;
Params : in Floats_1)
with Import => True, Convention => StdCall,
External_Name => "glLightModelfv";
procedure Light_Model (PName : in Enum;
Params : in Floats_4)
with Import => True, Convention => StdCall,
External_Name => "glLightModelfv";
procedure Material (Face : in Enum;
PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall, External_Name => "glMateriali";
procedure Material (Face : in Enum;
PName : in Enum;
Params : in Ints_1)
with Import => True, Convention => StdCall,
External_Name => "glMaterialiv";
procedure Material (Face : in Enum;
PName : in Enum;
Params : in Ints_3)
with Import => True, Convention => StdCall,
External_Name => "glMaterialiv";
procedure Material (Face : in Enum;
PName : in Enum;
Params : in Ints_4)
with Import => True, Convention => StdCall,
External_Name => "glMaterialiv";
procedure Material (Face : in Enum;
PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall, External_Name => "glMaterialf";
procedure Material (Face : in Enum;
PName : in Enum;
Params : in Floats_1)
with Import => True, Convention => StdCall,
External_Name => "glMaterialfv";
procedure Material (Face : in Enum;
PName : in Enum;
Params : in Floats_3)
with Import => True, Convention => StdCall,
External_Name => "glMaterialfv";
procedure Material (Face : in Enum;
PName : in Enum;
Params : in Floats_4)
with Import => True, Convention => StdCall,
External_Name => "glMaterialfv";
procedure Get_Material (Face : in Enum;
PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall,
External_Name => "glGetMaterialiv";
procedure Get_Material (Face : in Enum;
PName : in Enum;
Params : in Ints_1)
with Import => True, Convention => StdCall,
External_Name => "glGetMaterialiv";
procedure Get_Material (Face : in Enum;
PName : in Enum;
Params : in Ints_3)
with Import => True, Convention => StdCall,
External_Name => "glGetMaterialiv";
procedure Get_Material (Face : in Enum;
PName : in Enum;
Params : in Ints_4)
with Import => True, Convention => StdCall,
External_Name => "glGetMaterialiv";
procedure Get_Material (Face : in Enum;
PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall,
External_Name => "glGetMaterialfv";
procedure Get_Material (Face : in Enum;
PName : in Enum;
Params : in Floats_1)
with Import => True, Convention => StdCall,
External_Name => "glGetMaterialfv";
procedure Get_Material (Face : in Enum;
PName : in Enum;
Params : in Floats_3)
with Import => True, Convention => StdCall,
External_Name => "glGetMaterialfv";
procedure Get_Material (Face : in Enum;
PName : in Enum;
Params : in Floats_4)
with Import => True, Convention => StdCall,
External_Name => "glGetMaterialfv";
procedure Color_Material (Face : in Enum;
Mode : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glColorMaterial";
---------------------------------------------------------------------------
-- Raster functions
procedure Pixel_Zoom (X_Factor : in Float;
Y_Factor : in Float)
with Import => True, Convention => StdCall, External_Name => "glPixelZoom";
procedure Pixel_Store (PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall,
External_Name => "glPixelStorei";
procedure Pixel_Store (PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall,
External_Name => "glPixelStoref";
procedure Pixel_Transfer (PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall,
External_Name => "glPixelTransferi";
procedure Pixel_Transfer (PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall,
External_Name => "glPixelTransferf";
procedure Pixel_Map (Map : in Enum;
Values : in UShorts)
with Import => True, Convention => StdCall,
External_Name => "glPixelMapusv";
procedure Pixel_Map (Map : in Enum;
Values : in UInts)
with Import => True, Convention => StdCall,
External_Name => "glPixelMapuiv";
procedure Pixel_Map (Map : in Enum;
Values : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glPixelMapfv";
procedure Get_Pixel_Map (Map : in Enum;
Values : in UShorts)
with Import => True, Convention => StdCall,
External_Name => "glGetPixelMapusv";
procedure Get_Pixel_Map (Map : in Enum;
Values : in UInts)
with Import => True, Convention => StdCall,
External_Name => "glGetPixelMapuiv";
procedure Get_Pixel_Map (Map : in Enum;
Values : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glGetPixelMapfv";
procedure Bit_Map (Width : in SizeI;
Height : in SizeI;
X_Orig : in Float;
Y_Orig : in Float;
X_Move : in Float;
Y_Move : in Float;
Bitmap : in UBytes)
with Import => True, Convention => StdCall, External_Name => "glBitMap";
procedure Read_Pixels (X : in Int;
Y : in Int;
Width : in SizeI;
Height : in SizeI;
Format : in Enum;
C_Type : in Enum;
Pixels : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glReadPixels";
procedure Draw_Pixels (Width : in SizeI;
Height : in SizeI;
Format : in Enum;
Type_Of : in Enum;
Pixels : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glDrawPixels";
procedure Copy_Pixels (X : in Int;
Y : in Int;
Width : in SizeI;
Height : in SizeI;
Type_Of : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glCopyPixels";
---------------------------------------------------------------------------
-- Stenciling
procedure Stencil_Func (Func : in Enum;
Ref : in Int;
Mask : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glStencilFunc";
procedure Stencil_Mask (Mask : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glStencilMask";
procedure Stencil_Op (Fail : in Enum;
Z_Fail : in Enum;
Z_Pass : in Enum)
with Import => True, Convention => StdCall, External_Name => "glStencilOp";
procedure Clear_Stencil (S : in Int)
with Import => True, Convention => StdCall,
External_Name => "glClearStencil";
---------------------------------------------------------------------------
function Get_String (Name : Enum;
Index : Int) return String;
-- Blending
procedure Blend_Color (Red : in ClampF;
Green : in ClampF;
Blue : in ClampF;
Alpha : in ClampF)
with Import => True, Convention => StdCall,
External_Name => "glBlendColor";
procedure Blend_Equation (Mode : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glBlendEquation";
procedure Shade_Model (Mode : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glShadeModel";
-- Texturing
procedure Active_Texture (Texture : in Enum) -- v1.3
with Import => True, Convention => StdCall,
External_Name => "glActiveTexture";
procedure Client_Active_Texture (Texture : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glClientActiveTexture";
procedure Bind_Texture (Target : in Enum;
Texture : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glBindTexture";
procedure Gen_Textures (N : in SizeI;
Textures : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGenTextures";
procedure Delete_Textures (N : in SizeI;
Textures : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glDeleteTextures";
procedure Tex_Gen (Coord : in Enum;
PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall, External_Name => "glTexGeni";
procedure Tex_Gen (Coord : in Enum;
PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall, External_Name => "glTexGenf";
procedure Tex_Gen (Coord : in Enum;
PName : in Enum;
Param : in Double)
with Import => True, Convention => StdCall, External_Name => "glTexGend";
procedure Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Ints_1)
with Import => True, Convention => StdCall, External_Name => "glTexGeniv";
procedure Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Ints_4)
with Import => True, Convention => StdCall, External_Name => "glTexGeniv";
procedure Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Floats_1)
with Import => True, Convention => StdCall, External_Name => "glTexGenfv";
procedure Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Floats_4)
with Import => True, Convention => StdCall, External_Name => "glTexGenfv";
procedure Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Doubles_1)
with Import => True, Convention => StdCall, External_Name => "glTexGendv";
procedure Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Doubles_4)
with Import => True, Convention => StdCall, External_Name => "glTexGendv";
procedure Get_Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Ints_1)
with Import => True, Convention => StdCall,
External_Name => "glGetTexGeniv";
procedure Get_Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Ints_4)
with Import => True, Convention => StdCall,
External_Name => "glGetTexGeniv";
procedure Get_Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Floats_1)
with Import => True, Convention => StdCall,
External_Name => "glGetTexGenfv";
procedure Get_Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Floats_4)
with Import => True, Convention => StdCall,
External_Name => "glGetTexGenfv";
procedure Get_Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Doubles_1)
with Import => True, Convention => StdCall,
External_Name => "glGetTexGendv";
procedure Get_Tex_Gen (Coord : in Enum;
PName : in Enum;
Params : in Doubles_4)
with Import => True, Convention => StdCall,
External_Name => "glGetTexGen";
procedure Tex_Env (Target : in Enum;
PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall, External_Name => "glTexEnvi";
procedure Tex_Env (Target : in Enum;
PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall, External_Name => "glTexEnvf";
procedure Tex_Env (Target : in Enum;
PName : in Enum;
Params : in Ints_1)
with Import => True, Convention => StdCall, External_Name => "glTexEnviv";
procedure Tex_Env (Target : in Enum;
PName : in Enum;
Params : in Ints_4)
with Import => True, Convention => StdCall, External_Name => "glTexEnviv";
procedure Tex_Env (Target : in Enum;
PName : in Enum;
Params : in Floats_1)
with Import => True, Convention => StdCall, External_Name => "glTexEnvif";
procedure Tex_Env (Target : in Enum;
PName : in Enum;
Params : in Floats_4)
with Import => True, Convention => StdCall, External_Name => "glTexEnvif";
procedure Get_Tex_Env (Target : in Enum;
PName : in Enum;
Params : out Float)
with Import => True, Convention => StdCall,
External_Name => "glGetTexEnvfv";
procedure Get_Tex_Env (Target : in Enum;
PName : in Enum;
Params : out Floats_1)
with Import => True, Convention => StdCall,
External_Name => "glGetTexEnvfv";
procedure Get_Tex_Env (Target : in Enum;
PName : in Enum;
Params : out Floats_4)
with Import => True, Convention => StdCall,
External_Name => "glGetTexEnvfv";
procedure Get_Tex_Env (Target : in Enum;
PName : in Enum;
Params : out Int)
with Import => True, Convention => StdCall,
External_Name => "glGetTexEnviv";
procedure Get_Tex_Env (Target : in Enum;
PName : in Enum;
Params : out Ints_1)
with Import => True, Convention => StdCall,
External_Name => "glGetTexEnviv";
procedure Get_Tex_Env (Target : in Enum;
PName : in Enum;
Params : out Ints_4)
with Import => True, Convention => StdCall,
External_Name => "glGetTexEnviv";
procedure Tex_Parameter (Target : in Enum;
PName : in Enum;
Param : in Int)
with Import => True, Convention => StdCall,
External_Name => "glTexParameteri";
procedure Tex_Parameter (Target : in Enum;
PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall,
External_Name => "glTexParameterf";
procedure Tex_Parameter (Target : in Enum;
PName : in Enum;
Param : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glTexParameterfv";
procedure Tex_Parameter (Target : in Enum;
PName : in Enum;
Param : in Ints)
with Import => True, Convention => StdCall,
External_Name => "glTexParameteriv";
procedure Get_Tex_Parameter (Target : in Enum;
PName : in Enum;
Params : out Float)
with Import => True, Convention => StdCall,
External_Name => "glGetTexParameterfv";
procedure Get_Tex_Parameter (Target : in Enum;
PName : in Enum;
Params : out Floats_1)
with Import => True, Convention => StdCall,
External_Name => "glGetTexParameterfv";
procedure Get_Tex_Parameter (Target : in Enum;
PName : in Enum;
Params : out Floats_4)
with Import => True, Convention => StdCall,
External_Name => "glGetTexParameterfv";
procedure Get_Tex_Parameter (Target : in Enum;
PName : in Enum;
Params : out Int)
with Import => True, Convention => StdCall,
External_Name => "glGetTexParameteriv";
procedure Get_Tex_Parameter (Target : in Enum;
PName : in Enum;
Params : out Ints_1)
with Import => True, Convention => StdCall,
External_Name => "glGetTexParameteriv";
procedure Get_Tex_Parameter (Target : in Enum;
PName : in Enum;
Params : out Ints_4)
with Import => True, Convention => StdCall,
External_Name => "glGetTexParameteriv";
procedure Get_Tex_Level_Parameter (Target : in Enum;
PName : in Enum;
Params : out Floats)
with Import => True, Convention => StdCall,
External_Name => "glGetTexLevelParameterfv";
procedure Get_Tex_Level_Parameter (Target : in Enum;
PName : in Enum;
Params : out Ints)
with Import => True, Convention => StdCall,
External_Name => "glGetTexLevelParameteriv";
-- Texture images
procedure Tex_Image (Target : in Enum;
Level : in Int;
Internal_Format : in Enum;
Width : in SizeI;
Border : in Int;
Format : in Enum;
Pixel_Type : in Enum;
Pixels : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glTexImage1D";
procedure Tex_Image (Target : in Enum;
Level : in Int;
Internal_Format : in Enum;
Width : in SizeI;
Height : in SizeI;
Border : in Int;
Format : in Enum;
Pixel_Type : in Enum;
Pixels : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glTexImage2D";
procedure Get_Tex_Image (Target : in Enum;
Level : in Int;
Format : in Enum;
Type_Of : in Enum;
Pixels : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGetTexImage";
procedure Tex_Image (Target : in Enum;
Level : in Int;
Internal_Format : in Int;
Width : in SizeI;
Height : in SizeI;
Depth : in SizeI;
Border : in Int;
Format : in Enum;
Pixel_Type : in Enum;
Pixels : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glTexImage3D";
procedure Prioritize_Textures (N : in SizeI;
Textures : in UInts;
Priorities : in ClampFs)
with Import => True, Convention => StdCall,
External_Name => "glPrioritizeTextures";
procedure Are_Textures_Resident (N : in SizeI;
Textures : in UInts;
Residences : out Bools)
with Import => True, Convention => StdCall,
External_Name => "glAreTexturesResident";
function Is_Texture (Texture : in UInt) return Bool
with Import => True, Convention => StdCall, External_Name => "glIsTexture";
procedure Tex_Sub_Image (Target : in Enum;
Level : in Int;
X_Offset : in Int;
Width : in SizeI;
Format : in Enum;
Pixel_Type : in Enum;
Pixels : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glTexSubImage1D";
procedure Tex_Sub_Image (Target : in Enum;
Level : in Int;
X_Offset : in Int;
Y_Offset : in Int;
Width : in SizeI;
Height : in SizeI;
Format : in Enum;
Pixel_Type : in Enum;
Pixels : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glTexSubImage2D";
procedure Tex_Sub_Image (Target : in Enum;
Level : in Int;
X_Offset : in Int;
Y_Offset : in Int;
Z_Offset : in Int;
Width : in SizeI;
Height : in SizeI;
Depth : in SizeI;
Format : in Enum;
Pixel_Type : in Enum;
Pixels : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glTexSubImage3D";
procedure Copy_Tex_Image (Target : in Enum;
Level : in Int;
Internal_Format : in Enum;
X : in Int;
Y : in Int;
Width : in SizeI;
Border : in Int)
with Import => True, Convention => StdCall,
External_Name => "glCopyTexImage1D";
procedure Copy_Tex_Image (Target : in Enum;
Level : in Int;
Internal_Format : in Enum;
X : in Int;
Y : in Int;
Width : in SizeI;
Height : in SizeI;
Border : in Int)
with Import => True, Convention => StdCall,
External_Name => "glCopyTexImage2D";
procedure Copy_Tex_Sub_Image (Target : in Enum;
Level : in Int;
X_Offset : in Int;
X : in Int;
Y : in Int;
Width : in SizeI)
with Import => True, Convention => StdCall,
External_Name => "glCopySubTexImage1D";
procedure Copy_Tex_Sub_Image (Target : in Enum;
Level : in Int;
X_Offset : in SizeI;
Y_Offset : in SizeI;
X : in Int;
Y : in Int;
Width : in SizeI;
Height : in SizeI)
with Import => True, Convention => StdCall,
External_Name => "glCopySubTexImage2D";
procedure Copy_Tex_Sub_Image (Target : in Enum;
Level : in Int;
X_Offset : in Int;
Y_Offset : in Int;
Z_Offset : in Int;
X : in Int;
Y : in Int;
Width : in SizeI;
Height : in SizeI)
with Import => True, Convention => StdCall,
External_Name => "glCopyTexSubImage3D";
procedure Compressed_Tex_Image (Target : in Enum;
Level : in Int;
Internal_Format : in Enum;
Width : in SizeI;
Border : in Int;
Image_Size : in SizeI;
Data : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glCompressedTexImage1D";
procedure Compressed_Tex_Image (Target : in Enum;
Level : in Int;
Internal_Format : in Enum;
Width : in SizeI;
Height : in SizeI;
Border : in Int;
Image_Size : in SizeI;
Data : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glCompressedTexImage2D";
procedure Compressed_Tex_Image (Target : in Enum;
Level : in Int;
Internal_Format : in Enum;
Width : in SizeI;
Height : in SizeI;
Depth : in SizeI;
Border : in Int;
Image_Size : in SizeI;
Data : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glCompressedTexImage3D";
procedure Compressed_Tex_Sub_Image (Target : in Enum;
Level : in Int;
X_Offset : in Int;
Width : in SizeI;
Format : in Enum;
Image_Size : in SizeI;
Data : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glCompressedTexSubImage1D";
procedure Compressed_Tex_Sub_Image (Target : in Enum;
Level : in Int;
X_Offset : in Int;
Y_Offset : in Int;
Width : in SizeI;
Height : in SizeI;
Format : in Enum;
Image_Size : in SizeI;
Data : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glCompressedTexSubImage2D";
procedure Compressed_Tex_Sub_Image (Target : in Enum;
Level : in Int;
X_Offset : in Int;
Y_Offset : in Int;
Z_Offset : in Int;
Width : in SizeI;
Height : in SizeI;
Depth : in SizeI;
Format : in Enum;
Image_Size : in SizeI;
Data : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glCompressedTexSubImage3D";
procedure Get_Compressed_Tex_Image (Target : in Enum;
LOD : in Int;
Pixels : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGetCompressedTexImage";
procedure Tex_Coord_Pointer (Size : in SizeI;
Type_Of : in Enum;
Stride : in SizeI;
Offset : in SizeI)
with Import => True, Convention => StdCall,
External_Name => "glTexCoordPointer";
-- Evaluators
procedure Map (Target : in Enum;
U1 : in Float;
U2 : in Float;
Stride : in Int;
Order : in Int;
Points : in Pointer)
with Import => True, Convention => StdCall, External_Name => "glMap1f";
procedure Map (Target : in Enum;
U1 : in Double;
U2 : in Double;
Stride : in Int;
Order : in Int;
Points : in Pointer)
with Import => True, Convention => StdCall, External_Name => "glMap1d";
procedure Map (Target : in Enum;
U1 : in Float;
U2 : in Float;
UStride : in Int;
UOrder : in Int;
V1 : in Float;
V2 : in Float;
VStride : in Int;
VOrder : in Int;
Points : in Pointer)
with Import => True, Convention => StdCall, External_Name => "glMap2f";
procedure Map (Target : in Enum;
U1 : in Double;
U2 : in Double;
UStride : in Int;
UOrder : in Int;
V1 : in Double;
V2 : in Double;
VStride : in Int;
VOrder : in Int;
Points : in Pointer)
with Import => True, Convention => StdCall, External_Name => "glMap2d";
procedure Get_Map (Target : in Enum;
Query : in Enum;
V : out Doubles)
with Import => True, Convention => StdCall, External_Name => "glGetMapdv";
procedure Get_Map (Target : in Enum;
Query : in Enum;
V : out Floats)
with Import => True, Convention => StdCall, External_Name => "glGetMapfv";
procedure Get_Map (Target : in Enum;
Query : in Enum;
V : out Ints)
with Import => True, Convention => StdCall, External_Name => "glGetMapiv";
procedure Eval_Coord (U : in Double)
with Import => True, Convention => StdCall,
External_Name => "glEvalCoord1d";
procedure Eval_Coord (U : in Float)
with Import => True, Convention => StdCall,
External_Name => "glEvalCoord1f";
procedure Eval_Coord (U : in Doubles)
with Import => True, Convention => StdCall,
External_Name => "glEvalCoord1dv";
procedure Eval_Coord (U : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glEvalCoord1fv";
procedure Eval_Coord (U : in Double;
V : in Double)
with Import => True, Convention => StdCall,
External_Name => "glEvalCoord2d";
procedure Eval_Coord (U : in Float;
V : in Float)
with Import => True, Convention => StdCall,
External_Name => "glEvalCoord2f";
procedure Eval_Coord_2 (U : in Doubles)
with Import => True, Convention => StdCall,
External_Name => "glEvalCoord2dv";
procedure Eval_Coord_2 (U : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glEvalCoord2fv";
procedure Map_Grid (Un : in Int;
U1 : in Float;
U2 : in Float)
with Import => True, Convention => StdCall, External_Name => "glMapGrid1f";
procedure Map_Grid (Un : in Int;
U1 : in Double;
U2 : in Double)
with Import => True, Convention => StdCall, External_Name => "glMapGrid1d";
procedure Map_Grid (Un : in Int;
U1 : in Float;
U2 : in Float;
Vn : in Int;
V1 : in Float;
V2 : in Float)
with Import => True, Convention => StdCall, External_Name => "glMapGrid2f";
procedure Map_Grid (Un : in Int;
U1 : in Double;
U2 : in Double;
Vn : in Int;
V1 : in Double;
V2 : in Double)
with Import => True, Convention => StdCall, External_Name => "glMapGrid2d";
procedure Eval_Point (I : in Int)
with Import => True, Convention => StdCall,
External_Name => "glEvalPoint1";
procedure Eval_Point (I : in Int;
J : in Int)
with Import => True, Convention => StdCall,
External_Name => "glEvalPoint2";
procedure Eval_Mesh (Mode : in Enum;
I1 : in Int;
I2 : in Int)
with Import => True, Convention => StdCall, External_Name => "glEvalMesh1";
procedure Eval_Mesh (Mode : in Enum;
I1 : in Int;
I2 : in Int;
J1 : in Int;
J2 : in Int)
with Import => True, Convention => StdCall, External_Name => "glEvalMesh2";
-- Fog
procedure Fog (PName : in Enum;
Param : in Float)
with Import => True, Convention => StdCall, External_Name => "glFogf";
procedure Fog (Pname : in Enum;
Param : in Int)
with Import => True, Convention => StdCall, External_Name => "glFogi";
procedure Fog (PName : in Enum;
Params : in Floats)
with Import => True, Convention => StdCall, External_Name => "glFogfv";
procedure Fog (PName : in Enum;
Params : in Ints)
with Import => True, Convention => StdCall, External_Name => "glFogiv";
procedure Fog_Coord (Coord : in Float)
with Import => True, Convention => StdCall, External_Name => "glFogCoordf";
procedure Fog_Coord (Coord : in Floats)
with Import => True, Convention => StdCall,
External_Name => "glFogCoordfv";
procedure Fog_Coord (Coord : in Int)
with Import => True, Convention => StdCall, External_Name => "glFogCoordi";
procedure Fog_Coord (Coord : in Ints)
with Import => True, Convention => StdCall,
External_Name => "glFogCoordiv";
procedure Fog_Coord_Pointer (Type_Of : in Enum;
Stride : in SizeI;
Coords : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glFogCoordPointer";
-- Selection and Feedback
procedure Feedback_Buffer (Size : in SizeI;
Type_Of : in Enum;
Buffer : out Floats)
with Import => True, Convention => StdCall,
External_Name => "glFeedbackBuffer";
procedure Pass_Through (Token : in Float)
with Import => True, Convention => StdCall,
External_Name => "glPassThrough";
procedure Select_Buffer (Size : in SizeI;
Buffer : out UInts)
with Import => True, Convention => StdCall,
External_Name => "glSelectBuffer";
procedure Init_Name
with Import => True, Convention => StdCall, External_Name => "glInitNames";
procedure Load_Name (Name : in UInt)
with Import => True, Convention => StdCall, External_Name => "glLoadName";
procedure Push_Name (Name : in UInt)
with Import => True, Convention => StdCall, External_Name => "glPushName";
procedure Pop_Name
with Import => True, Convention => StdCall, External_Name => "glPopName";
-- Buffer objects v2.1???
procedure Gen_Framebuffers (N : in SizeI;
FBOs : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGenFramebuffers";
procedure Bind_Framebuffer (Target : in Enum;
FBO : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glBindFramebuffer";
-- Vertex buffer stuff:
procedure Gen_Buffers (N : in SizeI;
VBO : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGenBuffers";
procedure Delete_Buffers (N : in SizeI;
Buffers : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glDeleteBuffers";
procedure Bind_Buffer (Target : in Enum;
VBO : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glBindBuffer";
procedure Buffer_Data (Target : in Enum;
Size : in SizeI;
Data : in Pointer;
Usage : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glBufferData";
procedure Buffer_Sub_Data (Target: in Enum;
Offset: in SizeI;
Size : in SizeI;
Data : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glBufferSubData";
procedure Enable_Client_State (Target : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glEnableClientState";
procedure Disable_Client_State (Target : in Enum)
with Import => True, Convention => StdCall,
External_Name => "glDisableClientState";
procedure Enable_Vertex_Attrib_Array (Index : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glEnableVertexAttribArray";
procedure Disable_Vertex_Attrib_Array (Index : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glDisableVertexAttribArray";
procedure Vertex_Attrib_Pointer (Index : in UInt;
Size : in Int;
Attr_Type : in Enum;
Normalized : in Bool;
Stride : in SizeI;
Data_Pointer : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glVertexAttribPointer";
-- Vertex array objects
procedure Gen_Vertex_Arrays (N : in SizeI;
VAOs : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGenVertexArrays";
procedure Bind_Vertex_Array (VAO : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glBindVertexArray";
-- Shaders
function Create_Shader (Shader_Type : in Enum) return UInt
with Import => True, Convention => StdCall,
External_Name => "glCreateShader";
procedure Delete_Shader (Shader_ID : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glDeleteShader";
procedure Shader_Source (Shader : in UInt;
Count : in SizeI;
Source_String : in Pointer;
Length : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glShaderSource";
procedure Compile_Shader (Shader : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glCompileShader";
procedure Attach_Shader (Program : in UInt;
Shader : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glAttachShader";
procedure Link_Program (Program : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glLinkProgram";
procedure Use_Program (Program : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glUseProgram";
function Create_Program return UInt
with Import => True, Convention => StdCall,
External_Name => "glCreateProgram";
procedure Get_Shader (Shader : in UInt;
PName : in Enum;
Params : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGetShaderiv";
procedure Get_Shader_Info_Log (Shader : in UInt;
MaxLength : in SizeI;
Length : in Pointer;
InfoLog : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGetShaderInfoLog";
procedure Get_Program (Program : in UInt;
PName : in Enum;
Params : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGetProgramiv";
procedure Get_Program_Info_Log (Progarm : in UInt;
MaxLength : in SizeI;
Length : in Pointer;
InfoLog : in Pointer)
with Import => True, Convention => StdCall,
External_Name => "glGetProgramInfoLog";
procedure Validate_Program (Program : in GL.UInt)
with Import => True, Convention => StdCall,
External_Name => "glValidateProgram";
function Get_Uniform_Location (Program : in UInt;
Name : in String) return Int;
procedure Uniform (Location : in Int;
V0 : in Float)
with Import => True, Convention => StdCall, External_Name => "glUniform1f";
procedure Uniform (Location : in Int;
V0 : in Float;
V1 : in Float)
with Import => True, Convention => StdCall, External_Name => "glUniform2f";
procedure Uniform (Location : in Int;
V0 : in Float;
V1 : in Float;
V2 : in Float)
with Import => True, Convention => StdCall, External_Name => "glUniform3f";
procedure Uniform (Location : in Int;
V0 : in Float;
V1 : in Float;
V2 : in Float;
V3 : in Float)
with Import => True, Convention => StdCall, External_Name => "glUniform4f";
procedure Uniform (Location : in Int;
V0 : in Int)
with Import => True, Convention => StdCall, External_Name => "glUniform1i";
procedure Uniform (Location : in Int;
V0 : in Int;
V1 : in Int)
with Import => True, Convention => StdCall, External_Name => "glUniform2i";
procedure Uniform (Location : in Int;
V0 : in Int;
V1 : in Int;
V2 : in Int)
with Import => True, Convention => StdCall, External_Name => "glUniform3i";
procedure Uniform (Location : in Int;
V0 : in Int;
V1 : in Int;
V2 : in Int;
V3 : in Int)
with Import => True, Convention => StdCall, External_Name => "glUniform4i";
procedure Uniform (Location : in Int;
V0 : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glUniform1ui";
procedure Uniform (Location : in Int;
V0 : in UInt;
V1 : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glUniform2ui";
procedure Uniform (Location : in Int;
V0 : in UInt;
V1 : in UInt;
V2 : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glUniform3ui";
procedure Uniform (Location : in Int;
V0 : in UInt;
V1 : in UInt;
V2 : in UInt;
V3 : in UInt)
with Import => True, Convention => StdCall,
External_Name => "glUniform4ui";
procedure Uniform (Location : in Int;
Count : in SizeI;
Transpose : in Bool;
Value : in Float_Matrix)
with Import => True, Convention => StdCall,
External_Name => "glUniformMatrix4fv";
function Get_Attribute_Location (Program : in UInt;
Name : in String)
return Int;
procedure Vertex_Attrib (Index : in UInt;
X : in Float)
with Import => True, Convention => StdCall,
External_Name => "glVertexAttrib1f";
procedure Vertex_Attrib (Index : in UInt;
X : in Float;
Y : in Float)
with Import => True, Convention => StdCall,
External_Name => "glVertexAttrib2f";
procedure Vertex_Attrib (Index : in UInt;
X : in Float;
Y : in Float;
Z : in Float)
with Import => True, Convention => StdCall,
External_Name => "glVertexAttrib3f";
procedure Vertex_Attrib (Index : in UInt;
X : in Float;
Y : in Float;
Z : in Float;
W : in Float)
with Import => True, Convention => StdCall,
External_Name => "glVertexAttrib4f";
procedure Get_Double (Pname : in Enum;
Params : out Double_Matrix)
with Import => True, Convention => StdCall,
External_Name => "glGetDoublev";
---------------------------------------------------------------------------
end Lumen.GL;
|
jhumphry/LALG | Ada | 17,118 | adb | -- LALG
-- An Ada 2012 binding to BLAS and other linear algebra routines
-- Unit tests for Level 3 BLAS routines
-- Copyright (c) 2015-2021, James Humphry - see LICENSE file for details
-- SPDX-License-Identifier: ISC
with AUnit.Assertions; use AUnit.Assertions;
package body BLAS_Real_Level3 is
--------------------
-- Register_Tests --
--------------------
procedure Register_Tests (T : in out Level3_Test) is
use AUnit.Test_Cases.Registration;
begin
for I of Test_Details_List loop
Register_Routine(T, I.T, To_String(I.D));
end loop;
end Register_Tests;
------------
-- Set_Up --
------------
procedure Set_Up (T : in out Level3_Test) is
begin
null;
end Set_Up;
----------------
-- Check_Gemm --
----------------
procedure Check_Gemm (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
A : aliased constant Concrete_Real_Matrix := Make((
(1.0, 2.0),
(3.0, 4.0),
(5.0, 6.0)
));
B : aliased constant Concrete_Real_Matrix := Make((
(1.0, 2.0, 1.0),
(2.0, 1.0, 2.0)
));
C : aliased Concrete_Real_Matrix := Identity(3);
begin
gemm(A => A,
B => B,
C => C,
ALPHA => 1.0,
BETA => 2.0,
TRANA => No_Transpose,
TRANB => No_Transpose);
Assert(A = Real_2D_Array'(
(1.0, 2.0),
(3.0, 4.0),
(5.0, 6.0)
), "A changed by GEMM operation");
Assert(B = Real_2D_Array'(
(1.0, 2.0, 1.0),
(2.0, 1.0, 2.0)), "B changed by GEMM operation");
Assert(C = Real_2D_Array'(
( 7.0, 4.0, 5.0),
(11.0, 12.0, 11.0),
(17.0, 16.0, 19.0)), "C not set correctly by GEMM operation");
Assert(gemm(A, B, 1.0) = Real_2D_Array'(
( 5.0, 4.0, 5.0),
(11.0, 10.0, 11.0),
(17.0, 16.0, 17.0)), "Function version of GEMM not working");
end Check_Gemm;
----------------
-- Check_Symm --
----------------
procedure Check_Symm (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
A : aliased constant Concrete_Real_Matrix := Make((
(1.0, 3.0),
(5.0, 7.0)
));
B : aliased constant Concrete_Real_Matrix := Make((
(11.0, 13.0),
(17.0, 19.0)
));
C : aliased Concrete_Real_Matrix := Identity(2);
begin
-- Left, Upper
symm(A => A,
SIDE => Left,
UPLO => Upper,
B => B,
C => C,
ALPHA => 1.0,
BETA => 2.0);
Assert(A = Real_2D_Array'(
(1.0, 3.0),
(5.0, 7.0)
), "A changed by SYMM operation (Left, Upper)");
Assert(B = Real_2D_Array'(
(11.0, 13.0),
(17.0, 19.0)
), "B changed by SYMM operation (Left, Upper)");
Assert(C = Real_2D_Array'(
( 64.0, 70.0),
(152.0, 174.0)
), "C not set correctly by SYMM operation (Left, Upper)");
-- Right, Upper
C := Identity(2);
symm(A => A,
SIDE => Right,
UPLO => Upper,
B => B,
C => C,
ALPHA => 1.0,
BETA => 2.0);
Assert(C = Real_2D_Array'(
( 52.0, 124.0),
( 74.0, 186.0)
), "C not set correctly by SYMM operation (Right, Upper)");
-- Left, Lower
C := Identity(2);
symm(A => A,
SIDE => Left,
UPLO => Lower,
B => B,
C => C,
ALPHA => 1.0,
BETA => 2.0);
Assert(C = Real_2D_Array'(
( 98.0, 108.0),
(174.0, 200.0)
), "C not set correctly by SYMM operation (Left, Lower)");
-- Right, Lower
C := Identity(2);
symm(A => A,
SIDE => Right,
UPLO => Lower,
B => B,
C => C,
ALPHA => 1.0,
BETA => 2.0);
Assert(C = Real_2D_Array'(
( 78.0, 146.0),
(112.0, 220.0)
), "C not set correctly by SYMM operation (Left, Lower)");
Assert(symm(A => A,
SIDE => Left,
UPLO => Upper,
B => B,
ALPHA => 1.0) =
Real_2D_Array'(
( 62.0, 70.0),
(152.0, 172.0)
), "Function version of SYMM not working");
end Check_Symm;
----------------
-- Check_Syrk --
----------------
procedure Check_Syrk (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
A : aliased constant Concrete_Real_Matrix := Make((
(1.0, 3.0),
(5.0, 7.0)
));
C_Original : constant Concrete_Real_Matrix := Make((
(11.0, 13.0),
(17.0, 19.0)
));
C : aliased Concrete_Real_Matrix := C_Original;
begin
-- No, Upper
syrk(A => A,
TRANS => No_Transpose,
UPLO => Upper,
C => C,
ALPHA => 2.0,
BETA => 1.0);
Assert(A = Real_2D_Array'(
(1.0, 3.0),
(5.0, 7.0)
), "A changed by SYRK operation (No, Upper)");
Assert(C = Real_2D_Array'(
(31.0, 65.0),
(17.0, 167.0)
), "C not set correctly by SYRK operation (No, Upper)");
-- Transpose, Upper
C := C_Original;
syrk(A => A,
TRANS => Transpose,
UPLO => Upper,
C => C,
ALPHA => 2.0,
BETA => 1.0);
Assert(C = Real_2D_Array'(
(63.0, 89.0),
(17.0, 135.0)
), "C not set correctly by SYRK operation (Transpose, Upper)");
-- No, Lower
C := C_Original;
syrk(A => A,
TRANS => No_Transpose,
UPLO => Lower,
C => C,
ALPHA => 2.0,
BETA => 1.0);
Assert(C = Real_2D_Array'(
(31.0, 13.0),
(69.0, 167.0)
), "C not set correctly by SYRK operation (No, Lower)");
-- Transpose, Lower
C := C_Original;
syrk(A => A,
TRANS => Transpose,
UPLO => Lower,
C => C,
ALPHA => 2.0,
BETA => 1.0);
Assert(C = Real_2D_Array'(
(63.0, 13.0),
(93.0, 135.0)
), "C not set correctly by SYRK operation (Transpose, Lower)");
Assert(syrk(A => A,
TRANS => No_Transpose,
UPLO => Upper,
ALPHA => 2.0) =
Real_2D_Array'(
( 20.0, 52.0),
( 0.0, 148.0)
), "Function version of SYRK not working");
end Check_Syrk;
-----------------
-- Check_Syr2k --
-----------------
procedure Check_Syr2k (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
A : aliased constant Concrete_Real_Matrix := Make((
(1.0, 3.0),
(5.0, 7.0)
));
B : aliased constant Concrete_Real_Matrix := Make((
(11.0, 13.0),
(17.0, 19.0)
));
C_Original : constant Concrete_Real_Matrix := Make((
(23.0, 29.0),
(31.0, 37.0)
));
C : aliased Concrete_Real_Matrix := C_Original;
begin
-- No, Upper
syr2k(A => A,
B => B,
TRANS => No_Transpose,
UPLO => Upper,
C => C,
ALPHA => 2.0,
BETA => 1.0);
Assert(A = Real_2D_Array'(
(1.0, 3.0),
(5.0, 7.0)
), "A changed by SYR2K operation (No, Upper)");
Assert(B = Real_2D_Array'(
(11.0, 13.0),
(17.0, 19.0)
), "B changed by SYR2K operation (No, Upper)");
Assert(C = Real_2D_Array'(
(223.0, 469.0),
( 31.0, 909.0)
), "C not set correctly by SYR2K operation (No, Upper)");
-- Transpose, Upper
C := C_Original;
syr2k(A => A,
B => B,
TRANS => Transpose,
UPLO => Upper,
C => C,
ALPHA => 2.0,
BETA => 1.0);
Assert(C = Real_2D_Array'(
(407.0, 549.0),
( 31.0, 725.0)
), "C not set correctly by SYR2K operation (Transpose, Upper)");
-- No, Lower
C := C_Original;
syr2k(A => A,
B => B,
TRANS => No_Transpose,
UPLO => Lower,
C => C,
ALPHA => 2.0,
BETA => 1.0);
Assert(C = Real_2D_Array'(
(223.0, 29.0),
(471.0, 909.0)
), "C not set correctly by SYR2K operation (No, Lower)");
-- Transpose, Lower
C := C_Original;
syr2k(A => A,
B => B,
TRANS => Transpose,
UPLO => Lower,
C => C,
ALPHA => 2.0,
BETA => 1.0);
Assert(C = Real_2D_Array'(
(407.0, 29.0),
(551.0, 725.0)
), "C not set correctly by SYR2K operation (Transpose, Lower)");
Assert(syr2k(A => A,
B => B,
TRANS => No_Transpose,
UPLO => Upper,
ALPHA => 2.0) =
Real_2D_Array'(
(200.0, 440.0),
( 0.0, 872.0)
), "Function version of SYR2K not working");
end Check_Syr2k;
----------------
-- Check_Trmm --
----------------
procedure Check_Trmm (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
A : aliased constant Concrete_Real_Matrix := Make((
(1.0, 3.0),
(5.0, 7.0)
));
B_Original : constant Concrete_Real_Matrix := Make((
(11.0, 13.0),
(17.0, 19.0)
));
B : aliased Concrete_Real_Matrix := B_Original;
begin
-- Left, Upper, No_Transpose, Non_Unit_Diag
trmm(A => A,
SIDE => Left,
UPLO => Upper,
TRANSA => No_Transpose,
DIAG => Non_Unit_Diag,
B => B,
ALPHA => 1.0);
Assert(A = Real_2D_Array'(
(1.0, 3.0),
(5.0, 7.0)
), "A changed by TRMM operation (Left, Upper, No_Transpose, Non_Unit_Diag)");
Assert(B = Real_2D_Array'(
( 62.0, 70.0),
(119.0, 133.0)
), "B not set correctly by TRMM operation (Left, Upper, No_Transpose, Non_Unit_Diag)");
-- Right, Upper, No_Transpose, Non_Unit_Diag
B := B_Original;
trmm(A => A,
SIDE => Right,
UPLO => Upper,
TRANSA => No_Transpose,
DIAG => Non_Unit_Diag,
B => B,
ALPHA => 1.0);
Assert(B = Real_2D_Array'(
( 11.0, 124.0),
( 17.0, 184.0)
), "B not set correctly by TRMM operation (Right, Upper, No_Transpose, Non_Unit_Diag)");
-- Left, Lower, No_Transpose, Non_Unit_Diag
B := B_Original;
trmm(A => A,
SIDE => Left,
UPLO => Lower,
TRANSA => No_Transpose,
DIAG => Non_Unit_Diag,
B => B,
ALPHA => 1.0);
Assert(B = Real_2D_Array'(
( 11.0, 13.0),
(174.0, 198.0)
), "B not set correctly by TRMM operation (Left, Lower, No_Transpose, Non_Unit_Diag)");
-- Left, Upper, Transpose, Non_Unit_Diag
B := B_Original;
trmm(A => A,
SIDE => Left,
UPLO => Upper,
TRANSA => Transpose,
DIAG => Non_Unit_Diag,
B => B,
ALPHA => 1.0);
Assert(B = Real_2D_Array'(
( 11.0, 13.0),
(152.0, 172.0)
), "B not set correctly by TRMM operation (Left, Upper, Transpose, Non_Unit_Diag)");
-- Left, Upper, No_Transpose, Unit_Diag
B := B_Original;
trmm(A => A,
SIDE => Left,
UPLO => Upper,
TRANSA => No_Transpose,
DIAG => Unit_Diag,
B => B,
ALPHA => 1.0);
Assert(B = Real_2D_Array'(
( 62.0, 70.0),
( 17.0, 19.0)
), "B not set correctly by TRMM operation (Left, Upper, No_Transpose, Unit_Diag)");
end Check_Trmm;
----------------
-- Check_Trsm --
----------------
procedure Check_Trsm (T : in out Test_Cases.Test_Case'Class) is
pragma Unreferenced (T);
A : aliased constant Concrete_Real_Matrix := Make((
(1.0, 3.0),
(5.0, 7.0)
));
X : constant Concrete_Real_Matrix := Make((
( 11.0, 13.0),
( 17.0, 19.0)
));
AU_X : aliased Concrete_Real_Matrix := Make((
( 62.0, 70.0),
(119.0,133.0)
));
X_ALUT : aliased Concrete_Real_Matrix := Make((
( 11.0, 68.0),
( 17.0,104.0)
));
X_V : aliased Concrete_Real_Vector := Make(( 7.0, 14.0));
begin
-- Left, Upper, No_Transpose, Non_Unit_Diag
trsm(A => A,
SIDE => Left,
UPLO => Upper,
TRANSA => No_Transpose,
DIAG => Non_Unit_Diag,
B => AU_X,
ALPHA => 1.0);
Assert(A = Real_2D_Array'(
(1.0, 3.0),
(5.0, 7.0)
), "A changed by matrix TRSM operation (Left, Upper, No_Transpose, Non_Unit_Diag)");
Assert(AU_X = X,
"AU_X not set correctly by matrix TRSM operation (Left, Upper, No_Transpose, Non_Unit_Diag)");
-- Right, Lower, Transpose, Unit_Diag
trsm(A => A,
SIDE => Right,
UPLO => Lower,
TRANSA => Transpose,
DIAG => Unit_Diag,
B => X_ALUT,
ALPHA => 1.0);
Assert(A = Real_2D_Array'(
(1.0, 3.0),
(5.0, 7.0)
), "A changed by matrix TRSM operation (Right, Lower, Transpose, Unit_Diag)");
Assert(X_ALUT = X,
"X_ALUT not set correctly by matrix TRSM operation (Right, Lower, Transpose, Unit_Diag)");
-- Left, Upper, No_Transpose, Non_Unit_Diag
trsm(A => A,
SIDE => Left,
UPLO => Upper,
TRANSA => No_Transpose,
DIAG => Non_Unit_Diag,
B => X_V,
ALPHA => 1.0);
Assert(A = Real_2D_Array'(
(1.0, 3.0),
(5.0, 7.0)
), "A changed by vector TRSM operation (Left, Upper, No_Transpose, Non_Unit_Diag)");
Assert(X_V = Real_1D_Array'(1.0, 2.0),
"X_V not set correctly by vector TRSM operation (Left, Upper, No_Transpose, Non_Unit_Diag)");
end Check_Trsm;
end BLAS_Real_Level3;
|
stcarrez/ada-ado | Ada | 6,447 | adb | -----------------------------------------------------------------------
-- ADO.Model -- ADO.Model
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 166
-----------------------------------------------------------------------
-- Copyright (C) 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 ADO.Objects;
package body ADO.Model is
-- ----------------------------------------
-- Data object: Sequence
-- ----------------------------------------
procedure Set_Name (Object : in out Sequence_Ref;
Value : in String) is
begin
Object.Id := Ada.Strings.Unbounded.To_Unbounded_String (Value);
end Set_Name;
procedure Set_Name (Object : in out Sequence_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
begin
Object.Id := Value;
end Set_Name;
function Get_Name (Object : in Sequence_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Name);
end Get_Name;
function Get_Name (Object : in Sequence_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
begin
return Object.Id;
end Get_Name;
function Get_Version (Object : in Sequence_Ref)
return Integer is
begin
return Object.Version;
end Get_Version;
procedure Set_Value (Object : in out Sequence_Ref;
Value : in ADO.Identifier) is
begin
Object.Value := Value;
Object.Need_Save := True;
end Set_Value;
function Get_Value (Object : in Sequence_Ref)
return ADO.Identifier is
begin
return Object.Value;
end Get_Value;
procedure Set_Block_Size (Object : in out Sequence_Ref;
Value : in ADO.Identifier) is
begin
Object.Block_Size := Value;
end Set_Block_Size;
function Get_Block_Size (Object : in Sequence_Ref)
return ADO.Identifier is
begin
return Object.Block_Size;
end Get_Block_Size;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Sequence_Ref;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
pragma Unreferenced (Session);
begin
Object.Id := Stmt.Get_Unbounded_String (0);
Object.Value := Stmt.Get_Identifier (2);
Object.Block_Size := Stmt.Get_Identifier (3);
Object.Version := Stmt.Get_Integer (1);
end Load;
procedure Find (Object : in out Sequence_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (SEQUENCE_TABLE'Access);
begin
Stmt.Set_Parameters (Query);
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
procedure Save (Object : in out Sequence_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (SEQUENCE_TABLE'Access);
begin
-- if Object.Need_Save then
-- Stmt.Save_Field (Name => COL_0_1_NAME, -- name
-- Value => Object.Get_Key);
-- Object.Clear_Modified (1);
-- end if;
if Object.Need_Save then
Stmt.Save_Field (Name => COL_2_1_NAME, -- value
Value => Object.Value);
end if;
-- if Object.Is_Modified (4) then
-- Stmt.Save_Field (Name => COL_3_1_NAME, -- block_size
-- Value => Object.Block_Size);
-- Object.Clear_Modified (4);
-- end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "name = ? and version = ?");
Stmt.Add_Param (Value => Object.Id);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Sequence_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (SEQUENCE_TABLE'Access);
Result : Integer;
begin
Object.Version := 1;
Query.Save_Field (Name => COL_0_1_NAME, -- name
Value => Object.Id);
Query.Save_Field (Name => COL_1_1_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_2_1_NAME, -- value
Value => Object.Value);
Query.Save_Field (Name => COL_3_1_NAME, -- block_size
Value => Object.Block_Size);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
end Create;
end ADO.Model;
|
AdaCore/gpr | Ada | 162,651 | ads |
--
-- Copyright (C) 2019-2023, AdaCore
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
with Ada.Unchecked_Deallocation;
with Gpr_Parser_Support.Generic_API; use Gpr_Parser_Support.Generic_API;
pragma Warnings (Off, "referenced");
with Gpr_Parser_Support.Generic_API.Analysis;
use Gpr_Parser_Support.Generic_API.Analysis;
pragma Warnings (On, "referenced");
with Gpr_Parser_Support.Generic_API.Introspection;
use Gpr_Parser_Support.Generic_API.Introspection;
with Gpr_Parser_Support.Internal.Introspection;
use Gpr_Parser_Support.Internal.Introspection;
with Gpr_Parser_Support.Text; use Gpr_Parser_Support.Text;
with Gpr_Parser.Analysis; use Gpr_Parser.Analysis;
with Gpr_Parser.Common; use Gpr_Parser.Common;
-- This package provides description tables to enable the generic
-- introspection API in Gpr_Parser_Support to work with this Langkit-generated
-- library.
private package Gpr_Parser.Generic_Introspection is
--------------------------
-- Type index constants --
--------------------------
Type_Index_For_Analysis_Unit : constant Type_Index := 1;
Type_Index_For_Big_Int : constant Type_Index := 2;
Type_Index_For_Bool : constant Type_Index := 3;
Type_Index_For_Character : constant Type_Index := 4;
Type_Index_For_Int : constant Type_Index := 5;
Type_Index_For_Source_Location_Range : constant Type_Index := 6;
Type_Index_For_String : constant Type_Index := 7;
Type_Index_For_Token : constant Type_Index := 8;
Type_Index_For_Symbol : constant Type_Index := 9;
Type_Index_For_Analysis_Unit_Kind : constant Type_Index := 10;
Type_Index_For_Lookup_Kind : constant Type_Index := 11;
Type_Index_For_Designated_Env_Kind : constant Type_Index := 12;
Type_Index_For_Grammar_Rule : constant Type_Index := 13;
Type_Index_For_Gpr_Node_Array : constant Type_Index := 14;
Type_Index_For_Gpr_Node : constant Type_Index := 15;
Type_Index_For_All_Qualifier : constant Type_Index := 16;
Type_Index_For_All_Qualifier_Absent : constant Type_Index := 17;
Type_Index_For_All_Qualifier_Present : constant Type_Index := 18;
Type_Index_For_Attribute_Decl : constant Type_Index := 19;
Type_Index_For_Attribute_Reference : constant Type_Index := 20;
Type_Index_For_Base_List : constant Type_Index := 21;
Type_Index_For_Case_Item_List : constant Type_Index := 22;
Type_Index_For_Gpr_Node_List : constant Type_Index := 23;
Type_Index_For_Choices : constant Type_Index := 24;
Type_Index_For_Term_List : constant Type_Index := 25;
Type_Index_For_Identifier_List : constant Type_Index := 26;
Type_Index_For_String_Literal_List : constant Type_Index := 27;
Type_Index_For_Term_List_List : constant Type_Index := 28;
Type_Index_For_With_Decl_List : constant Type_Index := 29;
Type_Index_For_Builtin_Function_Call : constant Type_Index := 30;
Type_Index_For_Case_Construction : constant Type_Index := 31;
Type_Index_For_Case_Item : constant Type_Index := 32;
Type_Index_For_Compilation_Unit : constant Type_Index := 33;
Type_Index_For_Empty_Decl : constant Type_Index := 34;
Type_Index_For_Expr : constant Type_Index := 35;
Type_Index_For_Prefix : constant Type_Index := 36;
Type_Index_For_Single_Tok_Node : constant Type_Index := 37;
Type_Index_For_Identifier : constant Type_Index := 38;
Type_Index_For_Num_Literal : constant Type_Index := 39;
Type_Index_For_String_Literal : constant Type_Index := 40;
Type_Index_For_Limited : constant Type_Index := 41;
Type_Index_For_Limited_Absent : constant Type_Index := 42;
Type_Index_For_Limited_Present : constant Type_Index := 43;
Type_Index_For_Others_Designator : constant Type_Index := 44;
Type_Index_For_Package_Decl : constant Type_Index := 45;
Type_Index_For_Package_Extension : constant Type_Index := 46;
Type_Index_For_Package_Renaming : constant Type_Index := 47;
Type_Index_For_Package_Spec : constant Type_Index := 48;
Type_Index_For_Project : constant Type_Index := 49;
Type_Index_For_Project_Declaration : constant Type_Index := 50;
Type_Index_For_Project_Extension : constant Type_Index := 51;
Type_Index_For_Project_Qualifier : constant Type_Index := 52;
Type_Index_For_Project_Qualifier_Abstract : constant Type_Index := 53;
Type_Index_For_Project_Qualifier_Aggregate : constant Type_Index := 54;
Type_Index_For_Project_Qualifier_Aggregate_Library : constant Type_Index := 55;
Type_Index_For_Project_Qualifier_Configuration : constant Type_Index := 56;
Type_Index_For_Project_Qualifier_Library : constant Type_Index := 57;
Type_Index_For_Project_Qualifier_Standard : constant Type_Index := 58;
Type_Index_For_String_Literal_At : constant Type_Index := 59;
Type_Index_For_Terms : constant Type_Index := 60;
Type_Index_For_Type_Reference : constant Type_Index := 61;
Type_Index_For_Typed_String_Decl : constant Type_Index := 62;
Type_Index_For_Variable_Decl : constant Type_Index := 63;
Type_Index_For_Variable_Reference : constant Type_Index := 64;
Type_Index_For_With_Decl : constant Type_Index := 65;
----------------------------
-- Member index constants --
----------------------------
Member_Index_For_Attribute_Decl_F_Attr_Name : constant Struct_Member_Index := 1;
Member_Index_For_Attribute_Decl_F_Attr_Index : constant Struct_Member_Index := 2;
Member_Index_For_Attribute_Decl_F_Expr : constant Struct_Member_Index := 3;
Member_Index_For_Attribute_Reference_F_Attribute_Name : constant Struct_Member_Index := 4;
Member_Index_For_Attribute_Reference_F_Attribute_Index : constant Struct_Member_Index := 5;
Member_Index_For_Builtin_Function_Call_F_Function_Name : constant Struct_Member_Index := 6;
Member_Index_For_Builtin_Function_Call_F_Parameters : constant Struct_Member_Index := 7;
Member_Index_For_Case_Construction_F_Var_Ref : constant Struct_Member_Index := 8;
Member_Index_For_Case_Construction_F_Items : constant Struct_Member_Index := 9;
Member_Index_For_Case_Item_F_Choice : constant Struct_Member_Index := 10;
Member_Index_For_Case_Item_F_Decls : constant Struct_Member_Index := 11;
Member_Index_For_Compilation_Unit_F_Project : constant Struct_Member_Index := 12;
Member_Index_For_Prefix_F_Prefix : constant Struct_Member_Index := 13;
Member_Index_For_Prefix_F_Suffix : constant Struct_Member_Index := 14;
Member_Index_For_Package_Decl_F_Pkg_Name : constant Struct_Member_Index := 15;
Member_Index_For_Package_Decl_F_Pkg_Spec : constant Struct_Member_Index := 16;
Member_Index_For_Package_Extension_F_Extended_Name : constant Struct_Member_Index := 17;
Member_Index_For_Package_Renaming_F_Renamed_Name : constant Struct_Member_Index := 18;
Member_Index_For_Package_Spec_F_Extension : constant Struct_Member_Index := 19;
Member_Index_For_Package_Spec_F_Decls : constant Struct_Member_Index := 20;
Member_Index_For_Package_Spec_F_End_Name : constant Struct_Member_Index := 21;
Member_Index_For_Project_F_Context_Clauses : constant Struct_Member_Index := 22;
Member_Index_For_Project_F_Project_Decl : constant Struct_Member_Index := 23;
Member_Index_For_Project_Declaration_F_Qualifier : constant Struct_Member_Index := 24;
Member_Index_For_Project_Declaration_F_Project_Name : constant Struct_Member_Index := 25;
Member_Index_For_Project_Declaration_F_Extension : constant Struct_Member_Index := 26;
Member_Index_For_Project_Declaration_F_Decls : constant Struct_Member_Index := 27;
Member_Index_For_Project_Declaration_F_End_Name : constant Struct_Member_Index := 28;
Member_Index_For_Project_Extension_F_Is_All : constant Struct_Member_Index := 29;
Member_Index_For_Project_Extension_F_Path_Name : constant Struct_Member_Index := 30;
Member_Index_For_String_Literal_At_F_Str_Lit : constant Struct_Member_Index := 31;
Member_Index_For_String_Literal_At_F_At_Lit : constant Struct_Member_Index := 32;
Member_Index_For_Terms_F_Terms : constant Struct_Member_Index := 33;
Member_Index_For_Type_Reference_F_Var_Type_Name : constant Struct_Member_Index := 34;
Member_Index_For_Typed_String_Decl_F_Type_Id : constant Struct_Member_Index := 35;
Member_Index_For_Typed_String_Decl_F_String_Literals : constant Struct_Member_Index := 36;
Member_Index_For_Variable_Decl_F_Var_Name : constant Struct_Member_Index := 37;
Member_Index_For_Variable_Decl_F_Var_Type : constant Struct_Member_Index := 38;
Member_Index_For_Variable_Decl_F_Expr : constant Struct_Member_Index := 39;
Member_Index_For_Variable_Reference_F_Variable_Name : constant Struct_Member_Index := 40;
Member_Index_For_Variable_Reference_F_Attribute_Ref : constant Struct_Member_Index := 41;
Member_Index_For_With_Decl_F_Is_Limited : constant Struct_Member_Index := 42;
Member_Index_For_With_Decl_F_Path_Names : constant Struct_Member_Index := 43;
Member_Index_For_Parent : constant Struct_Member_Index := 44;
Member_Index_For_Parents : constant Struct_Member_Index := 45;
Member_Index_For_Children : constant Struct_Member_Index := 46;
Member_Index_For_Token_Start : constant Struct_Member_Index := 47;
Member_Index_For_Token_End : constant Struct_Member_Index := 48;
Member_Index_For_Child_Index : constant Struct_Member_Index := 49;
Member_Index_For_Previous_Sibling : constant Struct_Member_Index := 50;
Member_Index_For_Next_Sibling : constant Struct_Member_Index := 51;
Member_Index_For_Unit : constant Struct_Member_Index := 52;
Member_Index_For_Is_Ghost : constant Struct_Member_Index := 53;
Member_Index_For_Full_Sloc_Image : constant Struct_Member_Index := 54;
Member_Index_For_All_Qualifier_P_As_Bool : constant Struct_Member_Index := 55;
Member_Index_For_Limited_Node_P_As_Bool : constant Struct_Member_Index := 56;
------------------------------
-- Grammar rule descriptors --
------------------------------
Rule_Name_1 : aliased constant Text_Type :=
"Project_Qualifier";
Rule_Doc_1 : aliased constant Text_Type :=
"";
Rule_Desc_1 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_1'Access,
Is_Public => False,
Doc => Rule_Doc_1'Access,
Return_Type => Type_Index_For_Project_Qualifier);
Rule_Name_2 : aliased constant Text_Type :=
"Project_Extension";
Rule_Doc_2 : aliased constant Text_Type :=
"";
Rule_Desc_2 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_2'Access,
Is_Public => False,
Doc => Rule_Doc_2'Access,
Return_Type => Type_Index_For_Project_Extension);
Rule_Name_3 : aliased constant Text_Type :=
"Project_Declaration";
Rule_Doc_3 : aliased constant Text_Type :=
"";
Rule_Desc_3 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_3'Access,
Is_Public => False,
Doc => Rule_Doc_3'Access,
Return_Type => Type_Index_For_Project_Declaration);
Rule_Name_4 : aliased constant Text_Type :=
"Project";
Rule_Doc_4 : aliased constant Text_Type :=
"";
Rule_Desc_4 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_4'Access,
Is_Public => False,
Doc => Rule_Doc_4'Access,
Return_Type => Type_Index_For_Project);
Rule_Name_5 : aliased constant Text_Type :=
"Declarative_Items";
Rule_Doc_5 : aliased constant Text_Type :=
"";
Rule_Desc_5 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_5'Access,
Is_Public => False,
Doc => Rule_Doc_5'Access,
Return_Type => Type_Index_For_Gpr_Node_List);
Rule_Name_6 : aliased constant Text_Type :=
"Declarative_Item";
Rule_Doc_6 : aliased constant Text_Type :=
"";
Rule_Desc_6 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_6'Access,
Is_Public => False,
Doc => Rule_Doc_6'Access,
Return_Type => Type_Index_For_Gpr_Node);
Rule_Name_7 : aliased constant Text_Type :=
"Simple_Declarative_Items";
Rule_Doc_7 : aliased constant Text_Type :=
"";
Rule_Desc_7 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_7'Access,
Is_Public => False,
Doc => Rule_Doc_7'Access,
Return_Type => Type_Index_For_Gpr_Node_List);
Rule_Name_8 : aliased constant Text_Type :=
"Simple_Declarative_Item";
Rule_Doc_8 : aliased constant Text_Type :=
"";
Rule_Desc_8 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_8'Access,
Is_Public => False,
Doc => Rule_Doc_8'Access,
Return_Type => Type_Index_For_Gpr_Node);
Rule_Name_9 : aliased constant Text_Type :=
"Variable_Decl";
Rule_Doc_9 : aliased constant Text_Type :=
"";
Rule_Desc_9 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_9'Access,
Is_Public => False,
Doc => Rule_Doc_9'Access,
Return_Type => Type_Index_For_Variable_Decl);
Rule_Name_10 : aliased constant Text_Type :=
"Attribute_Decl";
Rule_Doc_10 : aliased constant Text_Type :=
"";
Rule_Desc_10 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_10'Access,
Is_Public => False,
Doc => Rule_Doc_10'Access,
Return_Type => Type_Index_For_Attribute_Decl);
Rule_Name_11 : aliased constant Text_Type :=
"Associative_Array_Index";
Rule_Doc_11 : aliased constant Text_Type :=
"";
Rule_Desc_11 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_11'Access,
Is_Public => False,
Doc => Rule_Doc_11'Access,
Return_Type => Type_Index_For_Gpr_Node);
Rule_Name_12 : aliased constant Text_Type :=
"Package_Decl";
Rule_Doc_12 : aliased constant Text_Type :=
"";
Rule_Desc_12 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_12'Access,
Is_Public => False,
Doc => Rule_Doc_12'Access,
Return_Type => Type_Index_For_Package_Decl);
Rule_Name_13 : aliased constant Text_Type :=
"Package_Renaming";
Rule_Doc_13 : aliased constant Text_Type :=
"";
Rule_Desc_13 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_13'Access,
Is_Public => False,
Doc => Rule_Doc_13'Access,
Return_Type => Type_Index_For_Package_Renaming);
Rule_Name_14 : aliased constant Text_Type :=
"Package_Extension";
Rule_Doc_14 : aliased constant Text_Type :=
"";
Rule_Desc_14 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_14'Access,
Is_Public => False,
Doc => Rule_Doc_14'Access,
Return_Type => Type_Index_For_Package_Extension);
Rule_Name_15 : aliased constant Text_Type :=
"Package_Spec";
Rule_Doc_15 : aliased constant Text_Type :=
"";
Rule_Desc_15 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_15'Access,
Is_Public => False,
Doc => Rule_Doc_15'Access,
Return_Type => Type_Index_For_Package_Spec);
Rule_Name_16 : aliased constant Text_Type :=
"Empty_Declaration";
Rule_Doc_16 : aliased constant Text_Type :=
"";
Rule_Desc_16 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_16'Access,
Is_Public => False,
Doc => Rule_Doc_16'Access,
Return_Type => Type_Index_For_Empty_Decl);
Rule_Name_17 : aliased constant Text_Type :=
"Case_Construction";
Rule_Doc_17 : aliased constant Text_Type :=
"";
Rule_Desc_17 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_17'Access,
Is_Public => False,
Doc => Rule_Doc_17'Access,
Return_Type => Type_Index_For_Case_Construction);
Rule_Name_18 : aliased constant Text_Type :=
"Case_Item";
Rule_Doc_18 : aliased constant Text_Type :=
"";
Rule_Desc_18 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_18'Access,
Is_Public => False,
Doc => Rule_Doc_18'Access,
Return_Type => Type_Index_For_Case_Item);
Rule_Name_19 : aliased constant Text_Type :=
"Others_Designator";
Rule_Doc_19 : aliased constant Text_Type :=
"";
Rule_Desc_19 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_19'Access,
Is_Public => False,
Doc => Rule_Doc_19'Access,
Return_Type => Type_Index_For_Others_Designator);
Rule_Name_20 : aliased constant Text_Type :=
"Choice";
Rule_Doc_20 : aliased constant Text_Type :=
"";
Rule_Desc_20 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_20'Access,
Is_Public => False,
Doc => Rule_Doc_20'Access,
Return_Type => Type_Index_For_Gpr_Node);
Rule_Name_21 : aliased constant Text_Type :=
"Discrete_Choice_List";
Rule_Doc_21 : aliased constant Text_Type :=
"";
Rule_Desc_21 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_21'Access,
Is_Public => False,
Doc => Rule_Doc_21'Access,
Return_Type => Type_Index_For_Choices);
Rule_Name_22 : aliased constant Text_Type :=
"With_Decl";
Rule_Doc_22 : aliased constant Text_Type :=
"";
Rule_Desc_22 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_22'Access,
Is_Public => False,
Doc => Rule_Doc_22'Access,
Return_Type => Type_Index_For_With_Decl);
Rule_Name_23 : aliased constant Text_Type :=
"Context_Clauses";
Rule_Doc_23 : aliased constant Text_Type :=
"";
Rule_Desc_23 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_23'Access,
Is_Public => False,
Doc => Rule_Doc_23'Access,
Return_Type => Type_Index_For_With_Decl_List);
Rule_Name_24 : aliased constant Text_Type :=
"Typed_String_Decl";
Rule_Doc_24 : aliased constant Text_Type :=
"";
Rule_Desc_24 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_24'Access,
Is_Public => False,
Doc => Rule_Doc_24'Access,
Return_Type => Type_Index_For_Typed_String_Decl);
Rule_Name_25 : aliased constant Text_Type :=
"Identifier";
Rule_Doc_25 : aliased constant Text_Type :=
"";
Rule_Desc_25 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_25'Access,
Is_Public => False,
Doc => Rule_Doc_25'Access,
Return_Type => Type_Index_For_Identifier);
Rule_Name_26 : aliased constant Text_Type :=
"String_Literal";
Rule_Doc_26 : aliased constant Text_Type :=
"";
Rule_Desc_26 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_26'Access,
Is_Public => False,
Doc => Rule_Doc_26'Access,
Return_Type => Type_Index_For_String_Literal);
Rule_Name_27 : aliased constant Text_Type :=
"Num_Literal";
Rule_Doc_27 : aliased constant Text_Type :=
"";
Rule_Desc_27 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_27'Access,
Is_Public => False,
Doc => Rule_Doc_27'Access,
Return_Type => Type_Index_For_Num_Literal);
Rule_Name_28 : aliased constant Text_Type :=
"Static_Name";
Rule_Doc_28 : aliased constant Text_Type :=
"";
Rule_Desc_28 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_28'Access,
Is_Public => False,
Doc => Rule_Doc_28'Access,
Return_Type => Type_Index_For_Expr);
Rule_Name_29 : aliased constant Text_Type :=
"Attribute_Reference";
Rule_Doc_29 : aliased constant Text_Type :=
"";
Rule_Desc_29 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_29'Access,
Is_Public => False,
Doc => Rule_Doc_29'Access,
Return_Type => Type_Index_For_Attribute_Reference);
Rule_Name_30 : aliased constant Text_Type :=
"Variable_Reference";
Rule_Doc_30 : aliased constant Text_Type :=
"";
Rule_Desc_30 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_30'Access,
Is_Public => False,
Doc => Rule_Doc_30'Access,
Return_Type => Type_Index_For_Variable_Reference);
Rule_Name_31 : aliased constant Text_Type :=
"Type_Reference";
Rule_Doc_31 : aliased constant Text_Type :=
"";
Rule_Desc_31 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_31'Access,
Is_Public => False,
Doc => Rule_Doc_31'Access,
Return_Type => Type_Index_For_Type_Reference);
Rule_Name_32 : aliased constant Text_Type :=
"Builtin_Function_Call";
Rule_Doc_32 : aliased constant Text_Type :=
"";
Rule_Desc_32 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_32'Access,
Is_Public => False,
Doc => Rule_Doc_32'Access,
Return_Type => Type_Index_For_Builtin_Function_Call);
Rule_Name_33 : aliased constant Text_Type :=
"Expression";
Rule_Doc_33 : aliased constant Text_Type :=
"";
Rule_Desc_33 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_33'Access,
Is_Public => False,
Doc => Rule_Doc_33'Access,
Return_Type => Type_Index_For_Term_List);
Rule_Name_34 : aliased constant Text_Type :=
"Expression_List";
Rule_Doc_34 : aliased constant Text_Type :=
"";
Rule_Desc_34 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_34'Access,
Is_Public => False,
Doc => Rule_Doc_34'Access,
Return_Type => Type_Index_For_Terms);
Rule_Name_35 : aliased constant Text_Type :=
"String_Literal_At";
Rule_Doc_35 : aliased constant Text_Type :=
"";
Rule_Desc_35 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_35'Access,
Is_Public => False,
Doc => Rule_Doc_35'Access,
Return_Type => Type_Index_For_String_Literal_At);
Rule_Name_36 : aliased constant Text_Type :=
"Term";
Rule_Doc_36 : aliased constant Text_Type :=
"";
Rule_Desc_36 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_36'Access,
Is_Public => False,
Doc => Rule_Doc_36'Access,
Return_Type => Type_Index_For_Gpr_Node);
Rule_Name_37 : aliased constant Text_Type :=
"Compilation_Unit";
Rule_Doc_37 : aliased constant Text_Type :=
"";
Rule_Desc_37 : aliased constant Grammar_Rule_Descriptor :=
(Name => Rule_Name_37'Access,
Is_Public => True,
Doc => Rule_Doc_37'Access,
Return_Type => Type_Index_For_Compilation_Unit);
Grammar_Rules : aliased constant Grammar_Rule_Descriptor_Array := (
1 => Rule_Desc_1'Access,
2 => Rule_Desc_2'Access,
3 => Rule_Desc_3'Access,
4 => Rule_Desc_4'Access,
5 => Rule_Desc_5'Access,
6 => Rule_Desc_6'Access,
7 => Rule_Desc_7'Access,
8 => Rule_Desc_8'Access,
9 => Rule_Desc_9'Access,
10 => Rule_Desc_10'Access,
11 => Rule_Desc_11'Access,
12 => Rule_Desc_12'Access,
13 => Rule_Desc_13'Access,
14 => Rule_Desc_14'Access,
15 => Rule_Desc_15'Access,
16 => Rule_Desc_16'Access,
17 => Rule_Desc_17'Access,
18 => Rule_Desc_18'Access,
19 => Rule_Desc_19'Access,
20 => Rule_Desc_20'Access,
21 => Rule_Desc_21'Access,
22 => Rule_Desc_22'Access,
23 => Rule_Desc_23'Access,
24 => Rule_Desc_24'Access,
25 => Rule_Desc_25'Access,
26 => Rule_Desc_26'Access,
27 => Rule_Desc_27'Access,
28 => Rule_Desc_28'Access,
29 => Rule_Desc_29'Access,
30 => Rule_Desc_30'Access,
31 => Rule_Desc_31'Access,
32 => Rule_Desc_32'Access,
33 => Rule_Desc_33'Access,
34 => Rule_Desc_34'Access,
35 => Rule_Desc_35'Access,
36 => Rule_Desc_36'Access,
37 => Rule_Desc_37'Access
);
------------------------------------
-- General value type descriptors --
------------------------------------
Debug_Name_For_Internal_Unit : aliased constant String :=
"AnalysisUnit";
Desc_For_Internal_Unit : aliased constant Type_Descriptor :=
(Category => Analysis_Unit_Category,
Debug_Name => Debug_Name_For_Internal_Unit'Access);
Debug_Name_For_Big_Integer_Type : aliased constant String :=
"BigInt";
Desc_For_Big_Integer_Type : aliased constant Type_Descriptor :=
(Category => Big_Int_Category,
Debug_Name => Debug_Name_For_Big_Integer_Type'Access);
Debug_Name_For_Boolean : aliased constant String :=
"Bool";
Desc_For_Boolean : aliased constant Type_Descriptor :=
(Category => Bool_Category,
Debug_Name => Debug_Name_For_Boolean'Access);
Debug_Name_For_Character_Type : aliased constant String :=
"Character";
Desc_For_Character_Type : aliased constant Type_Descriptor :=
(Category => Char_Category,
Debug_Name => Debug_Name_For_Character_Type'Access);
Debug_Name_For_Integer : aliased constant String :=
"Int";
Desc_For_Integer : aliased constant Type_Descriptor :=
(Category => Int_Category,
Debug_Name => Debug_Name_For_Integer'Access);
Debug_Name_For_Source_Location_Range : aliased constant String :=
"SourceLocationRange";
Desc_For_Source_Location_Range : aliased constant Type_Descriptor :=
(Category => Source_Location_Range_Category,
Debug_Name => Debug_Name_For_Source_Location_Range'Access);
Debug_Name_For_String_Type : aliased constant String :=
"String";
Desc_For_String_Type : aliased constant Type_Descriptor :=
(Category => String_Category,
Debug_Name => Debug_Name_For_String_Type'Access);
Debug_Name_For_Token_Reference : aliased constant String :=
"Token";
Desc_For_Token_Reference : aliased constant Type_Descriptor :=
(Category => Token_Category,
Debug_Name => Debug_Name_For_Token_Reference'Access);
Debug_Name_For_Symbol_Type : aliased constant String :=
"Symbol";
Desc_For_Symbol_Type : aliased constant Type_Descriptor :=
(Category => Symbol_Category,
Debug_Name => Debug_Name_For_Symbol_Type'Access);
Debug_Name_For_Analysis_Unit_Kind : aliased constant String :=
"AnalysisUnitKind";
Desc_For_Analysis_Unit_Kind : aliased constant Type_Descriptor :=
(Category => Enum_Category,
Debug_Name => Debug_Name_For_Analysis_Unit_Kind'Access);
Debug_Name_For_Lookup_Kind : aliased constant String :=
"LookupKind";
Desc_For_Lookup_Kind : aliased constant Type_Descriptor :=
(Category => Enum_Category,
Debug_Name => Debug_Name_For_Lookup_Kind'Access);
Debug_Name_For_Designated_Env_Kind : aliased constant String :=
"DesignatedEnvKind";
Desc_For_Designated_Env_Kind : aliased constant Type_Descriptor :=
(Category => Enum_Category,
Debug_Name => Debug_Name_For_Designated_Env_Kind'Access);
Debug_Name_For_Grammar_Rule : aliased constant String :=
"GrammarRule";
Desc_For_Grammar_Rule : aliased constant Type_Descriptor :=
(Category => Enum_Category,
Debug_Name => Debug_Name_For_Grammar_Rule'Access);
Debug_Name_For_Internal_Entity_Array_Access : aliased constant String :=
"GprNode.array";
Desc_For_Internal_Entity_Array_Access : aliased constant Type_Descriptor :=
(Category => Array_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Array_Access'Access);
Debug_Name_For_Internal_Entity : aliased constant String :=
"GprNode";
Desc_For_Internal_Entity : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity'Access);
Debug_Name_For_Internal_Entity_All_Qualifier : aliased constant String :=
"AllQualifier";
Desc_For_Internal_Entity_All_Qualifier : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_All_Qualifier'Access);
Debug_Name_For_Internal_Entity_All_Qualifier_Absent : aliased constant String :=
"AllQualifier.Absent";
Desc_For_Internal_Entity_All_Qualifier_Absent : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_All_Qualifier_Absent'Access);
Debug_Name_For_Internal_Entity_All_Qualifier_Present : aliased constant String :=
"AllQualifier.Present";
Desc_For_Internal_Entity_All_Qualifier_Present : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_All_Qualifier_Present'Access);
Debug_Name_For_Internal_Entity_Attribute_Decl : aliased constant String :=
"AttributeDecl";
Desc_For_Internal_Entity_Attribute_Decl : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Attribute_Decl'Access);
Debug_Name_For_Internal_Entity_Attribute_Reference : aliased constant String :=
"AttributeReference";
Desc_For_Internal_Entity_Attribute_Reference : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Attribute_Reference'Access);
Debug_Name_For_Internal_Entity_Base_List : aliased constant String :=
"BaseList";
Desc_For_Internal_Entity_Base_List : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Base_List'Access);
Debug_Name_For_Internal_Entity_Case_Item_List : aliased constant String :=
"CaseItem.list";
Desc_For_Internal_Entity_Case_Item_List : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Case_Item_List'Access);
Debug_Name_For_Internal_Entity_Gpr_Node_List : aliased constant String :=
"GprNode.list";
Desc_For_Internal_Entity_Gpr_Node_List : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Gpr_Node_List'Access);
Debug_Name_For_Internal_Entity_Choices : aliased constant String :=
"Choices";
Desc_For_Internal_Entity_Choices : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Choices'Access);
Debug_Name_For_Internal_Entity_Term_List : aliased constant String :=
"TermList";
Desc_For_Internal_Entity_Term_List : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Term_List'Access);
Debug_Name_For_Internal_Entity_Identifier_List : aliased constant String :=
"Identifier.list";
Desc_For_Internal_Entity_Identifier_List : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Identifier_List'Access);
Debug_Name_For_Internal_Entity_String_Literal_List : aliased constant String :=
"StringLiteral.list";
Desc_For_Internal_Entity_String_Literal_List : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_String_Literal_List'Access);
Debug_Name_For_Internal_Entity_Term_List_List : aliased constant String :=
"TermList.list";
Desc_For_Internal_Entity_Term_List_List : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Term_List_List'Access);
Debug_Name_For_Internal_Entity_With_Decl_List : aliased constant String :=
"WithDecl.list";
Desc_For_Internal_Entity_With_Decl_List : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_With_Decl_List'Access);
Debug_Name_For_Internal_Entity_Builtin_Function_Call : aliased constant String :=
"BuiltinFunctionCall";
Desc_For_Internal_Entity_Builtin_Function_Call : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Builtin_Function_Call'Access);
Debug_Name_For_Internal_Entity_Case_Construction : aliased constant String :=
"CaseConstruction";
Desc_For_Internal_Entity_Case_Construction : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Case_Construction'Access);
Debug_Name_For_Internal_Entity_Case_Item : aliased constant String :=
"CaseItem";
Desc_For_Internal_Entity_Case_Item : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Case_Item'Access);
Debug_Name_For_Internal_Entity_Compilation_Unit : aliased constant String :=
"CompilationUnit";
Desc_For_Internal_Entity_Compilation_Unit : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Compilation_Unit'Access);
Debug_Name_For_Internal_Entity_Empty_Decl : aliased constant String :=
"EmptyDecl";
Desc_For_Internal_Entity_Empty_Decl : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Empty_Decl'Access);
Debug_Name_For_Internal_Entity_Expr : aliased constant String :=
"Expr";
Desc_For_Internal_Entity_Expr : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Expr'Access);
Debug_Name_For_Internal_Entity_Prefix : aliased constant String :=
"Prefix";
Desc_For_Internal_Entity_Prefix : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Prefix'Access);
Debug_Name_For_Internal_Entity_Single_Tok_Node : aliased constant String :=
"SingleTokNode";
Desc_For_Internal_Entity_Single_Tok_Node : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Single_Tok_Node'Access);
Debug_Name_For_Internal_Entity_Identifier : aliased constant String :=
"Identifier";
Desc_For_Internal_Entity_Identifier : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Identifier'Access);
Debug_Name_For_Internal_Entity_Num_Literal : aliased constant String :=
"NumLiteral";
Desc_For_Internal_Entity_Num_Literal : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Num_Literal'Access);
Debug_Name_For_Internal_Entity_String_Literal : aliased constant String :=
"StringLiteral";
Desc_For_Internal_Entity_String_Literal : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_String_Literal'Access);
Debug_Name_For_Internal_Entity_Limited_Node : aliased constant String :=
"Limited";
Desc_For_Internal_Entity_Limited_Node : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Limited_Node'Access);
Debug_Name_For_Internal_Entity_Limited_Absent : aliased constant String :=
"Limited.Absent";
Desc_For_Internal_Entity_Limited_Absent : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Limited_Absent'Access);
Debug_Name_For_Internal_Entity_Limited_Present : aliased constant String :=
"Limited.Present";
Desc_For_Internal_Entity_Limited_Present : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Limited_Present'Access);
Debug_Name_For_Internal_Entity_Others_Designator : aliased constant String :=
"OthersDesignator";
Desc_For_Internal_Entity_Others_Designator : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Others_Designator'Access);
Debug_Name_For_Internal_Entity_Package_Decl : aliased constant String :=
"PackageDecl";
Desc_For_Internal_Entity_Package_Decl : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Package_Decl'Access);
Debug_Name_For_Internal_Entity_Package_Extension : aliased constant String :=
"PackageExtension";
Desc_For_Internal_Entity_Package_Extension : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Package_Extension'Access);
Debug_Name_For_Internal_Entity_Package_Renaming : aliased constant String :=
"PackageRenaming";
Desc_For_Internal_Entity_Package_Renaming : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Package_Renaming'Access);
Debug_Name_For_Internal_Entity_Package_Spec : aliased constant String :=
"PackageSpec";
Desc_For_Internal_Entity_Package_Spec : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Package_Spec'Access);
Debug_Name_For_Internal_Entity_Project : aliased constant String :=
"Project";
Desc_For_Internal_Entity_Project : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Project'Access);
Debug_Name_For_Internal_Entity_Project_Declaration : aliased constant String :=
"ProjectDeclaration";
Desc_For_Internal_Entity_Project_Declaration : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Project_Declaration'Access);
Debug_Name_For_Internal_Entity_Project_Extension : aliased constant String :=
"ProjectExtension";
Desc_For_Internal_Entity_Project_Extension : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Project_Extension'Access);
Debug_Name_For_Internal_Entity_Project_Qualifier : aliased constant String :=
"ProjectQualifier";
Desc_For_Internal_Entity_Project_Qualifier : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Project_Qualifier'Access);
Debug_Name_For_Internal_Entity_Project_Qualifier_Abstract : aliased constant String :=
"ProjectQualifier.Abstract";
Desc_For_Internal_Entity_Project_Qualifier_Abstract : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Project_Qualifier_Abstract'Access);
Debug_Name_For_Internal_Entity_Project_Qualifier_Aggregate : aliased constant String :=
"ProjectQualifier.Aggregate";
Desc_For_Internal_Entity_Project_Qualifier_Aggregate : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Project_Qualifier_Aggregate'Access);
Debug_Name_For_Internal_Entity_Project_Qualifier_Aggregate_Library : aliased constant String :=
"ProjectQualifier.AggregateLibrary";
Desc_For_Internal_Entity_Project_Qualifier_Aggregate_Library : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Project_Qualifier_Aggregate_Library'Access);
Debug_Name_For_Internal_Entity_Project_Qualifier_Configuration : aliased constant String :=
"ProjectQualifier.Configuration";
Desc_For_Internal_Entity_Project_Qualifier_Configuration : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Project_Qualifier_Configuration'Access);
Debug_Name_For_Internal_Entity_Project_Qualifier_Library : aliased constant String :=
"ProjectQualifier.Library";
Desc_For_Internal_Entity_Project_Qualifier_Library : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Project_Qualifier_Library'Access);
Debug_Name_For_Internal_Entity_Project_Qualifier_Standard : aliased constant String :=
"ProjectQualifier.Standard";
Desc_For_Internal_Entity_Project_Qualifier_Standard : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Project_Qualifier_Standard'Access);
Debug_Name_For_Internal_Entity_String_Literal_At : aliased constant String :=
"StringLiteralAt";
Desc_For_Internal_Entity_String_Literal_At : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_String_Literal_At'Access);
Debug_Name_For_Internal_Entity_Terms : aliased constant String :=
"Terms";
Desc_For_Internal_Entity_Terms : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Terms'Access);
Debug_Name_For_Internal_Entity_Type_Reference : aliased constant String :=
"TypeReference";
Desc_For_Internal_Entity_Type_Reference : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Type_Reference'Access);
Debug_Name_For_Internal_Entity_Typed_String_Decl : aliased constant String :=
"TypedStringDecl";
Desc_For_Internal_Entity_Typed_String_Decl : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Typed_String_Decl'Access);
Debug_Name_For_Internal_Entity_Variable_Decl : aliased constant String :=
"VariableDecl";
Desc_For_Internal_Entity_Variable_Decl : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Variable_Decl'Access);
Debug_Name_For_Internal_Entity_Variable_Reference : aliased constant String :=
"VariableReference";
Desc_For_Internal_Entity_Variable_Reference : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_Variable_Reference'Access);
Debug_Name_For_Internal_Entity_With_Decl : aliased constant String :=
"WithDecl";
Desc_For_Internal_Entity_With_Decl : aliased constant Type_Descriptor :=
(Category => Struct_Category,
Debug_Name => Debug_Name_For_Internal_Entity_With_Decl'Access);
Types : aliased constant Type_Descriptor_Array := (
Desc_For_Internal_Unit'Access,
Desc_For_Big_Integer_Type'Access,
Desc_For_Boolean'Access,
Desc_For_Character_Type'Access,
Desc_For_Integer'Access,
Desc_For_Source_Location_Range'Access,
Desc_For_String_Type'Access,
Desc_For_Token_Reference'Access,
Desc_For_Symbol_Type'Access,
Desc_For_Analysis_Unit_Kind'Access,
Desc_For_Lookup_Kind'Access,
Desc_For_Designated_Env_Kind'Access,
Desc_For_Grammar_Rule'Access,
Desc_For_Internal_Entity_Array_Access'Access,
Desc_For_Internal_Entity'Access,
Desc_For_Internal_Entity_All_Qualifier'Access,
Desc_For_Internal_Entity_All_Qualifier_Absent'Access,
Desc_For_Internal_Entity_All_Qualifier_Present'Access,
Desc_For_Internal_Entity_Attribute_Decl'Access,
Desc_For_Internal_Entity_Attribute_Reference'Access,
Desc_For_Internal_Entity_Base_List'Access,
Desc_For_Internal_Entity_Case_Item_List'Access,
Desc_For_Internal_Entity_Gpr_Node_List'Access,
Desc_For_Internal_Entity_Choices'Access,
Desc_For_Internal_Entity_Term_List'Access,
Desc_For_Internal_Entity_Identifier_List'Access,
Desc_For_Internal_Entity_String_Literal_List'Access,
Desc_For_Internal_Entity_Term_List_List'Access,
Desc_For_Internal_Entity_With_Decl_List'Access,
Desc_For_Internal_Entity_Builtin_Function_Call'Access,
Desc_For_Internal_Entity_Case_Construction'Access,
Desc_For_Internal_Entity_Case_Item'Access,
Desc_For_Internal_Entity_Compilation_Unit'Access,
Desc_For_Internal_Entity_Empty_Decl'Access,
Desc_For_Internal_Entity_Expr'Access,
Desc_For_Internal_Entity_Prefix'Access,
Desc_For_Internal_Entity_Single_Tok_Node'Access,
Desc_For_Internal_Entity_Identifier'Access,
Desc_For_Internal_Entity_Num_Literal'Access,
Desc_For_Internal_Entity_String_Literal'Access,
Desc_For_Internal_Entity_Limited_Node'Access,
Desc_For_Internal_Entity_Limited_Absent'Access,
Desc_For_Internal_Entity_Limited_Present'Access,
Desc_For_Internal_Entity_Others_Designator'Access,
Desc_For_Internal_Entity_Package_Decl'Access,
Desc_For_Internal_Entity_Package_Extension'Access,
Desc_For_Internal_Entity_Package_Renaming'Access,
Desc_For_Internal_Entity_Package_Spec'Access,
Desc_For_Internal_Entity_Project'Access,
Desc_For_Internal_Entity_Project_Declaration'Access,
Desc_For_Internal_Entity_Project_Extension'Access,
Desc_For_Internal_Entity_Project_Qualifier'Access,
Desc_For_Internal_Entity_Project_Qualifier_Abstract'Access,
Desc_For_Internal_Entity_Project_Qualifier_Aggregate'Access,
Desc_For_Internal_Entity_Project_Qualifier_Aggregate_Library'Access,
Desc_For_Internal_Entity_Project_Qualifier_Configuration'Access,
Desc_For_Internal_Entity_Project_Qualifier_Library'Access,
Desc_For_Internal_Entity_Project_Qualifier_Standard'Access,
Desc_For_Internal_Entity_String_Literal_At'Access,
Desc_For_Internal_Entity_Terms'Access,
Desc_For_Internal_Entity_Type_Reference'Access,
Desc_For_Internal_Entity_Typed_String_Decl'Access,
Desc_For_Internal_Entity_Variable_Decl'Access,
Desc_For_Internal_Entity_Variable_Reference'Access,
Desc_For_Internal_Entity_With_Decl'Access
);
---------------------------
-- Enum type descriptors --
---------------------------
Enum_Name_For_Analysis_Unit_Kind_1 : aliased constant Text_Type :=
"Unit_Specification";
Enum_Name_For_Analysis_Unit_Kind_2 : aliased constant Text_Type :=
"Unit_Body";
Enum_Name_For_Analysis_Unit_Kind : aliased constant Text_Type :=
"Analysis_Unit_Kind";
Enum_Desc_For_Analysis_Unit_Kind : aliased constant Enum_Type_Descriptor := (
Last_Value => 2,
Name => Enum_Name_For_Analysis_Unit_Kind'Access,
Default_Value => 0,
Value_Names => (
1 => Enum_Name_For_Analysis_Unit_Kind_1'Access,
2 => Enum_Name_For_Analysis_Unit_Kind_2'Access
)
);
Enum_Name_For_Lookup_Kind_1 : aliased constant Text_Type :=
"Recursive";
Enum_Name_For_Lookup_Kind_2 : aliased constant Text_Type :=
"Flat";
Enum_Name_For_Lookup_Kind_3 : aliased constant Text_Type :=
"Minimal";
Enum_Name_For_Lookup_Kind : aliased constant Text_Type :=
"Lookup_Kind";
Enum_Desc_For_Lookup_Kind : aliased constant Enum_Type_Descriptor := (
Last_Value => 3,
Name => Enum_Name_For_Lookup_Kind'Access,
Default_Value => 0,
Value_Names => (
1 => Enum_Name_For_Lookup_Kind_1'Access,
2 => Enum_Name_For_Lookup_Kind_2'Access,
3 => Enum_Name_For_Lookup_Kind_3'Access
)
);
Enum_Name_For_Designated_Env_Kind_1 : aliased constant Text_Type :=
"None";
Enum_Name_For_Designated_Env_Kind_2 : aliased constant Text_Type :=
"Current_Env";
Enum_Name_For_Designated_Env_Kind_3 : aliased constant Text_Type :=
"Named_Env";
Enum_Name_For_Designated_Env_Kind_4 : aliased constant Text_Type :=
"Direct_Env";
Enum_Name_For_Designated_Env_Kind : aliased constant Text_Type :=
"Designated_Env_Kind";
Enum_Desc_For_Designated_Env_Kind : aliased constant Enum_Type_Descriptor := (
Last_Value => 4,
Name => Enum_Name_For_Designated_Env_Kind'Access,
Default_Value => 1,
Value_Names => (
1 => Enum_Name_For_Designated_Env_Kind_1'Access,
2 => Enum_Name_For_Designated_Env_Kind_2'Access,
3 => Enum_Name_For_Designated_Env_Kind_3'Access,
4 => Enum_Name_For_Designated_Env_Kind_4'Access
)
);
Enum_Name_For_Grammar_Rule_1 : aliased constant Text_Type :=
"Project_Qualifier_Rule";
Enum_Name_For_Grammar_Rule_2 : aliased constant Text_Type :=
"Project_Extension_Rule";
Enum_Name_For_Grammar_Rule_3 : aliased constant Text_Type :=
"Project_Declaration_Rule";
Enum_Name_For_Grammar_Rule_4 : aliased constant Text_Type :=
"Project_Rule";
Enum_Name_For_Grammar_Rule_5 : aliased constant Text_Type :=
"Declarative_Items_Rule";
Enum_Name_For_Grammar_Rule_6 : aliased constant Text_Type :=
"Declarative_Item_Rule";
Enum_Name_For_Grammar_Rule_7 : aliased constant Text_Type :=
"Simple_Declarative_Items_Rule";
Enum_Name_For_Grammar_Rule_8 : aliased constant Text_Type :=
"Simple_Declarative_Item_Rule";
Enum_Name_For_Grammar_Rule_9 : aliased constant Text_Type :=
"Variable_Decl_Rule";
Enum_Name_For_Grammar_Rule_10 : aliased constant Text_Type :=
"Attribute_Decl_Rule";
Enum_Name_For_Grammar_Rule_11 : aliased constant Text_Type :=
"Associative_Array_Index_Rule";
Enum_Name_For_Grammar_Rule_12 : aliased constant Text_Type :=
"Package_Decl_Rule";
Enum_Name_For_Grammar_Rule_13 : aliased constant Text_Type :=
"Package_Renaming_Rule";
Enum_Name_For_Grammar_Rule_14 : aliased constant Text_Type :=
"Package_Extension_Rule";
Enum_Name_For_Grammar_Rule_15 : aliased constant Text_Type :=
"Package_Spec_Rule";
Enum_Name_For_Grammar_Rule_16 : aliased constant Text_Type :=
"Empty_Declaration_Rule";
Enum_Name_For_Grammar_Rule_17 : aliased constant Text_Type :=
"Case_Construction_Rule";
Enum_Name_For_Grammar_Rule_18 : aliased constant Text_Type :=
"Case_Item_Rule";
Enum_Name_For_Grammar_Rule_19 : aliased constant Text_Type :=
"Others_Designator_Rule";
Enum_Name_For_Grammar_Rule_20 : aliased constant Text_Type :=
"Choice_Rule";
Enum_Name_For_Grammar_Rule_21 : aliased constant Text_Type :=
"Discrete_Choice_List_Rule";
Enum_Name_For_Grammar_Rule_22 : aliased constant Text_Type :=
"With_Decl_Rule";
Enum_Name_For_Grammar_Rule_23 : aliased constant Text_Type :=
"Context_Clauses_Rule";
Enum_Name_For_Grammar_Rule_24 : aliased constant Text_Type :=
"Typed_String_Decl_Rule";
Enum_Name_For_Grammar_Rule_25 : aliased constant Text_Type :=
"Identifier_Rule";
Enum_Name_For_Grammar_Rule_26 : aliased constant Text_Type :=
"String_Literal_Rule";
Enum_Name_For_Grammar_Rule_27 : aliased constant Text_Type :=
"Num_Literal_Rule";
Enum_Name_For_Grammar_Rule_28 : aliased constant Text_Type :=
"Static_Name_Rule";
Enum_Name_For_Grammar_Rule_29 : aliased constant Text_Type :=
"Attribute_Reference_Rule";
Enum_Name_For_Grammar_Rule_30 : aliased constant Text_Type :=
"Variable_Reference_Rule";
Enum_Name_For_Grammar_Rule_31 : aliased constant Text_Type :=
"Type_Reference_Rule";
Enum_Name_For_Grammar_Rule_32 : aliased constant Text_Type :=
"Builtin_Function_Call_Rule";
Enum_Name_For_Grammar_Rule_33 : aliased constant Text_Type :=
"Expression_Rule";
Enum_Name_For_Grammar_Rule_34 : aliased constant Text_Type :=
"Expression_List_Rule";
Enum_Name_For_Grammar_Rule_35 : aliased constant Text_Type :=
"String_Literal_At_Rule";
Enum_Name_For_Grammar_Rule_36 : aliased constant Text_Type :=
"Term_Rule";
Enum_Name_For_Grammar_Rule_37 : aliased constant Text_Type :=
"Compilation_Unit_Rule";
Enum_Name_For_Grammar_Rule : aliased constant Text_Type :=
"Grammar_Rule";
Enum_Desc_For_Grammar_Rule : aliased constant Enum_Type_Descriptor := (
Last_Value => 37,
Name => Enum_Name_For_Grammar_Rule'Access,
Default_Value => 0,
Value_Names => (
1 => Enum_Name_For_Grammar_Rule_1'Access,
2 => Enum_Name_For_Grammar_Rule_2'Access,
3 => Enum_Name_For_Grammar_Rule_3'Access,
4 => Enum_Name_For_Grammar_Rule_4'Access,
5 => Enum_Name_For_Grammar_Rule_5'Access,
6 => Enum_Name_For_Grammar_Rule_6'Access,
7 => Enum_Name_For_Grammar_Rule_7'Access,
8 => Enum_Name_For_Grammar_Rule_8'Access,
9 => Enum_Name_For_Grammar_Rule_9'Access,
10 => Enum_Name_For_Grammar_Rule_10'Access,
11 => Enum_Name_For_Grammar_Rule_11'Access,
12 => Enum_Name_For_Grammar_Rule_12'Access,
13 => Enum_Name_For_Grammar_Rule_13'Access,
14 => Enum_Name_For_Grammar_Rule_14'Access,
15 => Enum_Name_For_Grammar_Rule_15'Access,
16 => Enum_Name_For_Grammar_Rule_16'Access,
17 => Enum_Name_For_Grammar_Rule_17'Access,
18 => Enum_Name_For_Grammar_Rule_18'Access,
19 => Enum_Name_For_Grammar_Rule_19'Access,
20 => Enum_Name_For_Grammar_Rule_20'Access,
21 => Enum_Name_For_Grammar_Rule_21'Access,
22 => Enum_Name_For_Grammar_Rule_22'Access,
23 => Enum_Name_For_Grammar_Rule_23'Access,
24 => Enum_Name_For_Grammar_Rule_24'Access,
25 => Enum_Name_For_Grammar_Rule_25'Access,
26 => Enum_Name_For_Grammar_Rule_26'Access,
27 => Enum_Name_For_Grammar_Rule_27'Access,
28 => Enum_Name_For_Grammar_Rule_28'Access,
29 => Enum_Name_For_Grammar_Rule_29'Access,
30 => Enum_Name_For_Grammar_Rule_30'Access,
31 => Enum_Name_For_Grammar_Rule_31'Access,
32 => Enum_Name_For_Grammar_Rule_32'Access,
33 => Enum_Name_For_Grammar_Rule_33'Access,
34 => Enum_Name_For_Grammar_Rule_34'Access,
35 => Enum_Name_For_Grammar_Rule_35'Access,
36 => Enum_Name_For_Grammar_Rule_36'Access,
37 => Enum_Name_For_Grammar_Rule_37'Access
)
);
Enum_Types : aliased constant Enum_Type_Descriptor_Array := (
Type_Index_For_Analysis_Unit_Kind => Enum_Desc_For_Analysis_Unit_Kind'Access,
Type_Index_For_Lookup_Kind => Enum_Desc_For_Lookup_Kind'Access,
Type_Index_For_Designated_Env_Kind => Enum_Desc_For_Designated_Env_Kind'Access,
Type_Index_For_Grammar_Rule => Enum_Desc_For_Grammar_Rule'Access
);
------------------------------------
-- Introspection values for enums --
------------------------------------
type Internal_Rec_Analysis_Unit_Kind is new Base_Internal_Enum_Value with record
Value : Analysis_Unit_Kind;
end record;
type Internal_Acc_Analysis_Unit_Kind is access all Internal_Rec_Analysis_Unit_Kind;
overriding function "=" (Left, Right : Internal_Rec_Analysis_Unit_Kind) return Boolean;
overriding function Type_Of (Value : Internal_Rec_Analysis_Unit_Kind) return Type_Index;
overriding function Image (Value : Internal_Rec_Analysis_Unit_Kind) return String;
overriding function Value_Index (Value : Internal_Rec_Analysis_Unit_Kind) return Enum_Value_Index;
type Internal_Rec_Lookup_Kind is new Base_Internal_Enum_Value with record
Value : Lookup_Kind;
end record;
type Internal_Acc_Lookup_Kind is access all Internal_Rec_Lookup_Kind;
overriding function "=" (Left, Right : Internal_Rec_Lookup_Kind) return Boolean;
overriding function Type_Of (Value : Internal_Rec_Lookup_Kind) return Type_Index;
overriding function Image (Value : Internal_Rec_Lookup_Kind) return String;
overriding function Value_Index (Value : Internal_Rec_Lookup_Kind) return Enum_Value_Index;
type Internal_Rec_Designated_Env_Kind is new Base_Internal_Enum_Value with record
Value : Designated_Env_Kind;
end record;
type Internal_Acc_Designated_Env_Kind is access all Internal_Rec_Designated_Env_Kind;
overriding function "=" (Left, Right : Internal_Rec_Designated_Env_Kind) return Boolean;
overriding function Type_Of (Value : Internal_Rec_Designated_Env_Kind) return Type_Index;
overriding function Image (Value : Internal_Rec_Designated_Env_Kind) return String;
overriding function Value_Index (Value : Internal_Rec_Designated_Env_Kind) return Enum_Value_Index;
type Internal_Rec_Grammar_Rule is new Base_Internal_Enum_Value with record
Value : Grammar_Rule;
end record;
type Internal_Acc_Grammar_Rule is access all Internal_Rec_Grammar_Rule;
overriding function "=" (Left, Right : Internal_Rec_Grammar_Rule) return Boolean;
overriding function Type_Of (Value : Internal_Rec_Grammar_Rule) return Type_Index;
overriding function Image (Value : Internal_Rec_Grammar_Rule) return String;
overriding function Value_Index (Value : Internal_Rec_Grammar_Rule) return Enum_Value_Index;
function Create_Enum
(Enum_Type : Type_Index;
Value_Index : Enum_Value_Index) return Internal_Value_Access;
-- Implementation of the Create_Enum operation in the lanugage descriptor
----------------------------
-- Array type descriptors --
----------------------------
Array_Types : aliased constant Array_Type_Descriptor_Array := (
Type_Index_For_Gpr_Node_Array => (Element_Type => Type_Index_For_Gpr_Node)
);
-------------------------------------
-- Introspection values for arrays --
-------------------------------------
type Internal_Stored_Gpr_Node_Array is access all Gpr_Node_Array;
procedure Free is new Ada.Unchecked_Deallocation (Gpr_Node_Array, Internal_Stored_Gpr_Node_Array);
type Internal_Rec_Gpr_Node_Array is new Base_Internal_Array_Value with record
Value : Internal_Stored_Gpr_Node_Array;
end record;
type Internal_Acc_Gpr_Node_Array is access all Internal_Rec_Gpr_Node_Array;
overriding function "=" (Left, Right : Internal_Rec_Gpr_Node_Array) return Boolean;
overriding procedure Destroy (Value : in out Internal_Rec_Gpr_Node_Array);
overriding function Type_Of (Value : Internal_Rec_Gpr_Node_Array) return Type_Index;
overriding function Array_Length (Value : Internal_Rec_Gpr_Node_Array) return Natural;
overriding function Array_Item
(Value : Internal_Rec_Gpr_Node_Array; Index : Positive) return Internal_Value_Access;
function Create_Array
(Values : Internal_Value_Array) return Internal_Acc_Gpr_Node_Array;
function Create_Array
(Array_Type : Type_Index;
Values : Internal_Value_Array) return Internal_Value_Access;
-- Implementation of the Create_Array operation in the language descriptor
-------------------------------
-- Iterator type descriptors --
-------------------------------
Iterator_Types : aliased constant Iterator_Type_Descriptor_Array := (
1 .. 0 => <>
);
--------------------------------------
-- Introspection values for structs --
--------------------------------------
function Create_Struct
(Struct_Type : Type_Index;
Values : Internal_Value_Array) return Internal_Value_Access;
-- Implementation for the Create_Struct operation in the language
-- descriptor.
-------------------------------
-- Struct member descriptors --
-------------------------------
Indexes_For_Attribute_Decl_F_Attr_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Attribute_Decl => 1);
Member_Name_For_Attribute_Decl_F_Attr_Name : aliased constant Text_Type :=
"F_Attr_Name";
Member_Desc_For_Attribute_Decl_F_Attr_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Attribute_Decl_F_Attr_Name'Access,
Owner => Type_Index_For_Attribute_Decl,
Member_Type => Type_Index_For_Identifier,
Null_For => null,
Indexes => Indexes_For_Attribute_Decl_F_Attr_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Attribute_Decl_F_Attr_Index : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Attribute_Decl => 2);
Member_Name_For_Attribute_Decl_F_Attr_Index : aliased constant Text_Type :=
"F_Attr_Index";
Member_Desc_For_Attribute_Decl_F_Attr_Index : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Attribute_Decl_F_Attr_Index'Access,
Owner => Type_Index_For_Attribute_Decl,
Member_Type => Type_Index_For_Gpr_Node,
Null_For => null,
Indexes => Indexes_For_Attribute_Decl_F_Attr_Index'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Attribute_Decl_F_Expr : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Attribute_Decl => 3);
Member_Name_For_Attribute_Decl_F_Expr : aliased constant Text_Type :=
"F_Expr";
Member_Desc_For_Attribute_Decl_F_Expr : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Attribute_Decl_F_Expr'Access,
Owner => Type_Index_For_Attribute_Decl,
Member_Type => Type_Index_For_Term_List,
Null_For => null,
Indexes => Indexes_For_Attribute_Decl_F_Expr'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Attribute_Reference_F_Attribute_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Attribute_Reference => 1);
Member_Name_For_Attribute_Reference_F_Attribute_Name : aliased constant Text_Type :=
"F_Attribute_Name";
Member_Desc_For_Attribute_Reference_F_Attribute_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Attribute_Reference_F_Attribute_Name'Access,
Owner => Type_Index_For_Attribute_Reference,
Member_Type => Type_Index_For_Identifier,
Null_For => null,
Indexes => Indexes_For_Attribute_Reference_F_Attribute_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Attribute_Reference_F_Attribute_Index : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Attribute_Reference => 2);
Member_Name_For_Attribute_Reference_F_Attribute_Index : aliased constant Text_Type :=
"F_Attribute_Index";
Member_Desc_For_Attribute_Reference_F_Attribute_Index : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Attribute_Reference_F_Attribute_Index'Access,
Owner => Type_Index_For_Attribute_Reference,
Member_Type => Type_Index_For_Gpr_Node,
Null_For => null,
Indexes => Indexes_For_Attribute_Reference_F_Attribute_Index'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Builtin_Function_Call_F_Function_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Builtin_Function_Call => 1);
Member_Name_For_Builtin_Function_Call_F_Function_Name : aliased constant Text_Type :=
"F_Function_Name";
Member_Desc_For_Builtin_Function_Call_F_Function_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Builtin_Function_Call_F_Function_Name'Access,
Owner => Type_Index_For_Builtin_Function_Call,
Member_Type => Type_Index_For_Identifier,
Null_For => null,
Indexes => Indexes_For_Builtin_Function_Call_F_Function_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Builtin_Function_Call_F_Parameters : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Builtin_Function_Call => 2);
Member_Name_For_Builtin_Function_Call_F_Parameters : aliased constant Text_Type :=
"F_Parameters";
Member_Desc_For_Builtin_Function_Call_F_Parameters : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Builtin_Function_Call_F_Parameters'Access,
Owner => Type_Index_For_Builtin_Function_Call,
Member_Type => Type_Index_For_Terms,
Null_For => null,
Indexes => Indexes_For_Builtin_Function_Call_F_Parameters'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Case_Construction_F_Var_Ref : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Case_Construction => 1);
Member_Name_For_Case_Construction_F_Var_Ref : aliased constant Text_Type :=
"F_Var_Ref";
Member_Desc_For_Case_Construction_F_Var_Ref : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Case_Construction_F_Var_Ref'Access,
Owner => Type_Index_For_Case_Construction,
Member_Type => Type_Index_For_Variable_Reference,
Null_For => null,
Indexes => Indexes_For_Case_Construction_F_Var_Ref'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Case_Construction_F_Items : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Case_Construction => 2);
Member_Name_For_Case_Construction_F_Items : aliased constant Text_Type :=
"F_Items";
Member_Desc_For_Case_Construction_F_Items : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Case_Construction_F_Items'Access,
Owner => Type_Index_For_Case_Construction,
Member_Type => Type_Index_For_Case_Item_List,
Null_For => null,
Indexes => Indexes_For_Case_Construction_F_Items'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Case_Item_F_Choice : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Case_Item => 1);
Member_Name_For_Case_Item_F_Choice : aliased constant Text_Type :=
"F_Choice";
Member_Desc_For_Case_Item_F_Choice : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Case_Item_F_Choice'Access,
Owner => Type_Index_For_Case_Item,
Member_Type => Type_Index_For_Choices,
Null_For => null,
Indexes => Indexes_For_Case_Item_F_Choice'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Case_Item_F_Decls : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Case_Item => 2);
Member_Name_For_Case_Item_F_Decls : aliased constant Text_Type :=
"F_Decls";
Member_Desc_For_Case_Item_F_Decls : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Case_Item_F_Decls'Access,
Owner => Type_Index_For_Case_Item,
Member_Type => Type_Index_For_Gpr_Node_List,
Null_For => null,
Indexes => Indexes_For_Case_Item_F_Decls'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Compilation_Unit_F_Project : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Compilation_Unit => 1);
Member_Name_For_Compilation_Unit_F_Project : aliased constant Text_Type :=
"F_Project";
Member_Desc_For_Compilation_Unit_F_Project : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Compilation_Unit_F_Project'Access,
Owner => Type_Index_For_Compilation_Unit,
Member_Type => Type_Index_For_Project,
Null_For => null,
Indexes => Indexes_For_Compilation_Unit_F_Project'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Prefix_F_Prefix : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Prefix => 1);
Member_Name_For_Prefix_F_Prefix : aliased constant Text_Type :=
"F_Prefix";
Member_Desc_For_Prefix_F_Prefix : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Prefix_F_Prefix'Access,
Owner => Type_Index_For_Prefix,
Member_Type => Type_Index_For_Expr,
Null_For => null,
Indexes => Indexes_For_Prefix_F_Prefix'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Prefix_F_Suffix : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Prefix => 2);
Member_Name_For_Prefix_F_Suffix : aliased constant Text_Type :=
"F_Suffix";
Member_Desc_For_Prefix_F_Suffix : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Prefix_F_Suffix'Access,
Owner => Type_Index_For_Prefix,
Member_Type => Type_Index_For_Identifier,
Null_For => null,
Indexes => Indexes_For_Prefix_F_Suffix'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Package_Decl_F_Pkg_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Package_Decl => 1);
Member_Name_For_Package_Decl_F_Pkg_Name : aliased constant Text_Type :=
"F_Pkg_Name";
Member_Desc_For_Package_Decl_F_Pkg_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Package_Decl_F_Pkg_Name'Access,
Owner => Type_Index_For_Package_Decl,
Member_Type => Type_Index_For_Identifier,
Null_For => null,
Indexes => Indexes_For_Package_Decl_F_Pkg_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Package_Decl_F_Pkg_Spec : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Package_Decl => 2);
Member_Name_For_Package_Decl_F_Pkg_Spec : aliased constant Text_Type :=
"F_Pkg_Spec";
Member_Desc_For_Package_Decl_F_Pkg_Spec : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Package_Decl_F_Pkg_Spec'Access,
Owner => Type_Index_For_Package_Decl,
Member_Type => Type_Index_For_Gpr_Node,
Null_For => null,
Indexes => Indexes_For_Package_Decl_F_Pkg_Spec'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Package_Extension_F_Extended_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Package_Extension => 1);
Member_Name_For_Package_Extension_F_Extended_Name : aliased constant Text_Type :=
"F_Extended_Name";
Member_Desc_For_Package_Extension_F_Extended_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Package_Extension_F_Extended_Name'Access,
Owner => Type_Index_For_Package_Extension,
Member_Type => Type_Index_For_Identifier_List,
Null_For => null,
Indexes => Indexes_For_Package_Extension_F_Extended_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Package_Renaming_F_Renamed_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Package_Renaming => 1);
Member_Name_For_Package_Renaming_F_Renamed_Name : aliased constant Text_Type :=
"F_Renamed_Name";
Member_Desc_For_Package_Renaming_F_Renamed_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Package_Renaming_F_Renamed_Name'Access,
Owner => Type_Index_For_Package_Renaming,
Member_Type => Type_Index_For_Identifier_List,
Null_For => null,
Indexes => Indexes_For_Package_Renaming_F_Renamed_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Package_Spec_F_Extension : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Package_Spec => 1);
Member_Name_For_Package_Spec_F_Extension : aliased constant Text_Type :=
"F_Extension";
Member_Desc_For_Package_Spec_F_Extension : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Package_Spec_F_Extension'Access,
Owner => Type_Index_For_Package_Spec,
Member_Type => Type_Index_For_Package_Extension,
Null_For => null,
Indexes => Indexes_For_Package_Spec_F_Extension'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Package_Spec_F_Decls : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Package_Spec => 2);
Member_Name_For_Package_Spec_F_Decls : aliased constant Text_Type :=
"F_Decls";
Member_Desc_For_Package_Spec_F_Decls : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Package_Spec_F_Decls'Access,
Owner => Type_Index_For_Package_Spec,
Member_Type => Type_Index_For_Gpr_Node_List,
Null_For => null,
Indexes => Indexes_For_Package_Spec_F_Decls'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Package_Spec_F_End_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Package_Spec => 3);
Member_Name_For_Package_Spec_F_End_Name : aliased constant Text_Type :=
"F_End_Name";
Member_Desc_For_Package_Spec_F_End_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Package_Spec_F_End_Name'Access,
Owner => Type_Index_For_Package_Spec,
Member_Type => Type_Index_For_Identifier,
Null_For => null,
Indexes => Indexes_For_Package_Spec_F_End_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Project_F_Context_Clauses : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Project => 1);
Member_Name_For_Project_F_Context_Clauses : aliased constant Text_Type :=
"F_Context_Clauses";
Member_Desc_For_Project_F_Context_Clauses : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Project_F_Context_Clauses'Access,
Owner => Type_Index_For_Project,
Member_Type => Type_Index_For_With_Decl_List,
Null_For => null,
Indexes => Indexes_For_Project_F_Context_Clauses'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Project_F_Project_Decl : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Project => 2);
Member_Name_For_Project_F_Project_Decl : aliased constant Text_Type :=
"F_Project_Decl";
Member_Desc_For_Project_F_Project_Decl : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Project_F_Project_Decl'Access,
Owner => Type_Index_For_Project,
Member_Type => Type_Index_For_Project_Declaration,
Null_For => null,
Indexes => Indexes_For_Project_F_Project_Decl'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Project_Declaration_F_Qualifier : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Project_Declaration => 1);
Member_Name_For_Project_Declaration_F_Qualifier : aliased constant Text_Type :=
"F_Qualifier";
Member_Desc_For_Project_Declaration_F_Qualifier : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Project_Declaration_F_Qualifier'Access,
Owner => Type_Index_For_Project_Declaration,
Member_Type => Type_Index_For_Project_Qualifier,
Null_For => null,
Indexes => Indexes_For_Project_Declaration_F_Qualifier'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Project_Declaration_F_Project_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Project_Declaration => 2);
Member_Name_For_Project_Declaration_F_Project_Name : aliased constant Text_Type :=
"F_Project_Name";
Member_Desc_For_Project_Declaration_F_Project_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Project_Declaration_F_Project_Name'Access,
Owner => Type_Index_For_Project_Declaration,
Member_Type => Type_Index_For_Expr,
Null_For => null,
Indexes => Indexes_For_Project_Declaration_F_Project_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Project_Declaration_F_Extension : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Project_Declaration => 3);
Member_Name_For_Project_Declaration_F_Extension : aliased constant Text_Type :=
"F_Extension";
Member_Desc_For_Project_Declaration_F_Extension : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Project_Declaration_F_Extension'Access,
Owner => Type_Index_For_Project_Declaration,
Member_Type => Type_Index_For_Project_Extension,
Null_For => null,
Indexes => Indexes_For_Project_Declaration_F_Extension'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Project_Declaration_F_Decls : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Project_Declaration => 4);
Member_Name_For_Project_Declaration_F_Decls : aliased constant Text_Type :=
"F_Decls";
Member_Desc_For_Project_Declaration_F_Decls : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Project_Declaration_F_Decls'Access,
Owner => Type_Index_For_Project_Declaration,
Member_Type => Type_Index_For_Gpr_Node_List,
Null_For => null,
Indexes => Indexes_For_Project_Declaration_F_Decls'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Project_Declaration_F_End_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Project_Declaration => 5);
Member_Name_For_Project_Declaration_F_End_Name : aliased constant Text_Type :=
"F_End_Name";
Member_Desc_For_Project_Declaration_F_End_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Project_Declaration_F_End_Name'Access,
Owner => Type_Index_For_Project_Declaration,
Member_Type => Type_Index_For_Expr,
Null_For => null,
Indexes => Indexes_For_Project_Declaration_F_End_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Project_Extension_F_Is_All : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Project_Extension => 1);
Member_Name_For_Project_Extension_F_Is_All : aliased constant Text_Type :=
"F_Is_All";
Member_Desc_For_Project_Extension_F_Is_All : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Project_Extension_F_Is_All'Access,
Owner => Type_Index_For_Project_Extension,
Member_Type => Type_Index_For_All_Qualifier,
Null_For => null,
Indexes => Indexes_For_Project_Extension_F_Is_All'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Project_Extension_F_Path_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Project_Extension => 2);
Member_Name_For_Project_Extension_F_Path_Name : aliased constant Text_Type :=
"F_Path_Name";
Member_Desc_For_Project_Extension_F_Path_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Project_Extension_F_Path_Name'Access,
Owner => Type_Index_For_Project_Extension,
Member_Type => Type_Index_For_String_Literal,
Null_For => null,
Indexes => Indexes_For_Project_Extension_F_Path_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_String_Literal_At_F_Str_Lit : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_String_Literal_At => 1);
Member_Name_For_String_Literal_At_F_Str_Lit : aliased constant Text_Type :=
"F_Str_Lit";
Member_Desc_For_String_Literal_At_F_Str_Lit : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_String_Literal_At_F_Str_Lit'Access,
Owner => Type_Index_For_String_Literal_At,
Member_Type => Type_Index_For_String_Literal,
Null_For => null,
Indexes => Indexes_For_String_Literal_At_F_Str_Lit'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_String_Literal_At_F_At_Lit : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_String_Literal_At => 2);
Member_Name_For_String_Literal_At_F_At_Lit : aliased constant Text_Type :=
"F_At_Lit";
Member_Desc_For_String_Literal_At_F_At_Lit : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_String_Literal_At_F_At_Lit'Access,
Owner => Type_Index_For_String_Literal_At,
Member_Type => Type_Index_For_Num_Literal,
Null_For => null,
Indexes => Indexes_For_String_Literal_At_F_At_Lit'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Terms_F_Terms : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Terms => 1);
Member_Name_For_Terms_F_Terms : aliased constant Text_Type :=
"F_Terms";
Member_Desc_For_Terms_F_Terms : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Terms_F_Terms'Access,
Owner => Type_Index_For_Terms,
Member_Type => Type_Index_For_Term_List_List,
Null_For => null,
Indexes => Indexes_For_Terms_F_Terms'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Type_Reference_F_Var_Type_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Type_Reference => 1);
Member_Name_For_Type_Reference_F_Var_Type_Name : aliased constant Text_Type :=
"F_Var_Type_Name";
Member_Desc_For_Type_Reference_F_Var_Type_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Type_Reference_F_Var_Type_Name'Access,
Owner => Type_Index_For_Type_Reference,
Member_Type => Type_Index_For_Identifier_List,
Null_For => null,
Indexes => Indexes_For_Type_Reference_F_Var_Type_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Typed_String_Decl_F_Type_Id : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Typed_String_Decl => 1);
Member_Name_For_Typed_String_Decl_F_Type_Id : aliased constant Text_Type :=
"F_Type_Id";
Member_Desc_For_Typed_String_Decl_F_Type_Id : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Typed_String_Decl_F_Type_Id'Access,
Owner => Type_Index_For_Typed_String_Decl,
Member_Type => Type_Index_For_Identifier,
Null_For => null,
Indexes => Indexes_For_Typed_String_Decl_F_Type_Id'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Typed_String_Decl_F_String_Literals : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Typed_String_Decl => 2);
Member_Name_For_Typed_String_Decl_F_String_Literals : aliased constant Text_Type :=
"F_String_Literals";
Member_Desc_For_Typed_String_Decl_F_String_Literals : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Typed_String_Decl_F_String_Literals'Access,
Owner => Type_Index_For_Typed_String_Decl,
Member_Type => Type_Index_For_String_Literal_List,
Null_For => null,
Indexes => Indexes_For_Typed_String_Decl_F_String_Literals'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Variable_Decl_F_Var_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Variable_Decl => 1);
Member_Name_For_Variable_Decl_F_Var_Name : aliased constant Text_Type :=
"F_Var_Name";
Member_Desc_For_Variable_Decl_F_Var_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Variable_Decl_F_Var_Name'Access,
Owner => Type_Index_For_Variable_Decl,
Member_Type => Type_Index_For_Identifier,
Null_For => null,
Indexes => Indexes_For_Variable_Decl_F_Var_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Variable_Decl_F_Var_Type : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Variable_Decl => 2);
Member_Name_For_Variable_Decl_F_Var_Type : aliased constant Text_Type :=
"F_Var_Type";
Member_Desc_For_Variable_Decl_F_Var_Type : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Variable_Decl_F_Var_Type'Access,
Owner => Type_Index_For_Variable_Decl,
Member_Type => Type_Index_For_Type_Reference,
Null_For => null,
Indexes => Indexes_For_Variable_Decl_F_Var_Type'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Variable_Decl_F_Expr : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Variable_Decl => 3);
Member_Name_For_Variable_Decl_F_Expr : aliased constant Text_Type :=
"F_Expr";
Member_Desc_For_Variable_Decl_F_Expr : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Variable_Decl_F_Expr'Access,
Owner => Type_Index_For_Variable_Decl,
Member_Type => Type_Index_For_Term_List,
Null_For => null,
Indexes => Indexes_For_Variable_Decl_F_Expr'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Variable_Reference_F_Variable_Name : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Variable_Reference => 1);
Member_Name_For_Variable_Reference_F_Variable_Name : aliased constant Text_Type :=
"F_Variable_Name";
Member_Desc_For_Variable_Reference_F_Variable_Name : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Variable_Reference_F_Variable_Name'Access,
Owner => Type_Index_For_Variable_Reference,
Member_Type => Type_Index_For_Identifier_List,
Null_For => null,
Indexes => Indexes_For_Variable_Reference_F_Variable_Name'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_Variable_Reference_F_Attribute_Ref : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_Variable_Reference => 2);
Member_Name_For_Variable_Reference_F_Attribute_Ref : aliased constant Text_Type :=
"F_Attribute_Ref";
Member_Desc_For_Variable_Reference_F_Attribute_Ref : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Variable_Reference_F_Attribute_Ref'Access,
Owner => Type_Index_For_Variable_Reference,
Member_Type => Type_Index_For_Attribute_Reference,
Null_For => null,
Indexes => Indexes_For_Variable_Reference_F_Attribute_Ref'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_With_Decl_F_Is_Limited : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_With_Decl => 1);
Member_Name_For_With_Decl_F_Is_Limited : aliased constant Text_Type :=
"F_Is_Limited";
Member_Desc_For_With_Decl_F_Is_Limited : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_With_Decl_F_Is_Limited'Access,
Owner => Type_Index_For_With_Decl,
Member_Type => Type_Index_For_Limited,
Null_For => null,
Indexes => Indexes_For_With_Decl_F_Is_Limited'Access,
Arguments => (
1 .. 0 => <>
));
Indexes_For_With_Decl_F_Path_Names : aliased constant Syntax_Field_Indexes :=
(Type_Index_For_With_Decl => 2);
Member_Name_For_With_Decl_F_Path_Names : aliased constant Text_Type :=
"F_Path_Names";
Member_Desc_For_With_Decl_F_Path_Names : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_With_Decl_F_Path_Names'Access,
Owner => Type_Index_For_With_Decl,
Member_Type => Type_Index_For_String_Literal_List,
Null_For => null,
Indexes => Indexes_For_With_Decl_F_Path_Names'Access,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_Parent : aliased constant Text_Type :=
"Parent";
Member_Desc_For_Parent : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Parent'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_Gpr_Node,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Arg_Name_1 : aliased constant Text_Type :=
"With_Self";
Member_Name_For_Parents : aliased constant Text_Type :=
"Parents";
Member_Desc_For_Parents : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 1,
Name => Member_Name_For_Parents'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_Gpr_Node_Array,
Null_For => null,
Indexes => null,
Arguments => (
1 => (Name => Arg_Name_1'Access, Argument_Type => Type_Index_For_Bool, Default_Value => (Kind => Boolean_Value, Boolean_Value => True))
));
Member_Name_For_Children : aliased constant Text_Type :=
"Children";
Member_Desc_For_Children : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Children'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_Gpr_Node_Array,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_Token_Start : aliased constant Text_Type :=
"Token_Start";
Member_Desc_For_Token_Start : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Token_Start'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_Token,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_Token_End : aliased constant Text_Type :=
"Token_End";
Member_Desc_For_Token_End : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Token_End'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_Token,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_Child_Index : aliased constant Text_Type :=
"Child_Index";
Member_Desc_For_Child_Index : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Child_Index'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_Int,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_Previous_Sibling : aliased constant Text_Type :=
"Previous_Sibling";
Member_Desc_For_Previous_Sibling : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Previous_Sibling'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_Gpr_Node,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_Next_Sibling : aliased constant Text_Type :=
"Next_Sibling";
Member_Desc_For_Next_Sibling : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Next_Sibling'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_Gpr_Node,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_Unit : aliased constant Text_Type :=
"Unit";
Member_Desc_For_Unit : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Unit'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_Analysis_Unit,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_Is_Ghost : aliased constant Text_Type :=
"Is_Ghost";
Member_Desc_For_Is_Ghost : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Is_Ghost'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_Bool,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_Full_Sloc_Image : aliased constant Text_Type :=
"Full_Sloc_Image";
Member_Desc_For_Full_Sloc_Image : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Full_Sloc_Image'Access,
Owner => Type_Index_For_Gpr_Node,
Member_Type => Type_Index_For_String,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_All_Qualifier_P_As_Bool : aliased constant Text_Type :=
"P_As_Bool";
Member_Desc_For_All_Qualifier_P_As_Bool : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_All_Qualifier_P_As_Bool'Access,
Owner => Type_Index_For_All_Qualifier,
Member_Type => Type_Index_For_Bool,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Member_Name_For_Limited_Node_P_As_Bool : aliased constant Text_Type :=
"P_As_Bool";
Member_Desc_For_Limited_Node_P_As_Bool : aliased constant Struct_Member_Descriptor :=
(Last_Argument => 0,
Name => Member_Name_For_Limited_Node_P_As_Bool'Access,
Owner => Type_Index_For_Limited,
Member_Type => Type_Index_For_Bool,
Null_For => null,
Indexes => null,
Arguments => (
1 .. 0 => <>
));
Struct_Members : aliased constant Struct_Member_Descriptor_Array := (
Member_Index_For_Attribute_Decl_F_Attr_Name => Member_Desc_For_Attribute_Decl_F_Attr_Name'Access,
Member_Index_For_Attribute_Decl_F_Attr_Index => Member_Desc_For_Attribute_Decl_F_Attr_Index'Access,
Member_Index_For_Attribute_Decl_F_Expr => Member_Desc_For_Attribute_Decl_F_Expr'Access,
Member_Index_For_Attribute_Reference_F_Attribute_Name => Member_Desc_For_Attribute_Reference_F_Attribute_Name'Access,
Member_Index_For_Attribute_Reference_F_Attribute_Index => Member_Desc_For_Attribute_Reference_F_Attribute_Index'Access,
Member_Index_For_Builtin_Function_Call_F_Function_Name => Member_Desc_For_Builtin_Function_Call_F_Function_Name'Access,
Member_Index_For_Builtin_Function_Call_F_Parameters => Member_Desc_For_Builtin_Function_Call_F_Parameters'Access,
Member_Index_For_Case_Construction_F_Var_Ref => Member_Desc_For_Case_Construction_F_Var_Ref'Access,
Member_Index_For_Case_Construction_F_Items => Member_Desc_For_Case_Construction_F_Items'Access,
Member_Index_For_Case_Item_F_Choice => Member_Desc_For_Case_Item_F_Choice'Access,
Member_Index_For_Case_Item_F_Decls => Member_Desc_For_Case_Item_F_Decls'Access,
Member_Index_For_Compilation_Unit_F_Project => Member_Desc_For_Compilation_Unit_F_Project'Access,
Member_Index_For_Prefix_F_Prefix => Member_Desc_For_Prefix_F_Prefix'Access,
Member_Index_For_Prefix_F_Suffix => Member_Desc_For_Prefix_F_Suffix'Access,
Member_Index_For_Package_Decl_F_Pkg_Name => Member_Desc_For_Package_Decl_F_Pkg_Name'Access,
Member_Index_For_Package_Decl_F_Pkg_Spec => Member_Desc_For_Package_Decl_F_Pkg_Spec'Access,
Member_Index_For_Package_Extension_F_Extended_Name => Member_Desc_For_Package_Extension_F_Extended_Name'Access,
Member_Index_For_Package_Renaming_F_Renamed_Name => Member_Desc_For_Package_Renaming_F_Renamed_Name'Access,
Member_Index_For_Package_Spec_F_Extension => Member_Desc_For_Package_Spec_F_Extension'Access,
Member_Index_For_Package_Spec_F_Decls => Member_Desc_For_Package_Spec_F_Decls'Access,
Member_Index_For_Package_Spec_F_End_Name => Member_Desc_For_Package_Spec_F_End_Name'Access,
Member_Index_For_Project_F_Context_Clauses => Member_Desc_For_Project_F_Context_Clauses'Access,
Member_Index_For_Project_F_Project_Decl => Member_Desc_For_Project_F_Project_Decl'Access,
Member_Index_For_Project_Declaration_F_Qualifier => Member_Desc_For_Project_Declaration_F_Qualifier'Access,
Member_Index_For_Project_Declaration_F_Project_Name => Member_Desc_For_Project_Declaration_F_Project_Name'Access,
Member_Index_For_Project_Declaration_F_Extension => Member_Desc_For_Project_Declaration_F_Extension'Access,
Member_Index_For_Project_Declaration_F_Decls => Member_Desc_For_Project_Declaration_F_Decls'Access,
Member_Index_For_Project_Declaration_F_End_Name => Member_Desc_For_Project_Declaration_F_End_Name'Access,
Member_Index_For_Project_Extension_F_Is_All => Member_Desc_For_Project_Extension_F_Is_All'Access,
Member_Index_For_Project_Extension_F_Path_Name => Member_Desc_For_Project_Extension_F_Path_Name'Access,
Member_Index_For_String_Literal_At_F_Str_Lit => Member_Desc_For_String_Literal_At_F_Str_Lit'Access,
Member_Index_For_String_Literal_At_F_At_Lit => Member_Desc_For_String_Literal_At_F_At_Lit'Access,
Member_Index_For_Terms_F_Terms => Member_Desc_For_Terms_F_Terms'Access,
Member_Index_For_Type_Reference_F_Var_Type_Name => Member_Desc_For_Type_Reference_F_Var_Type_Name'Access,
Member_Index_For_Typed_String_Decl_F_Type_Id => Member_Desc_For_Typed_String_Decl_F_Type_Id'Access,
Member_Index_For_Typed_String_Decl_F_String_Literals => Member_Desc_For_Typed_String_Decl_F_String_Literals'Access,
Member_Index_For_Variable_Decl_F_Var_Name => Member_Desc_For_Variable_Decl_F_Var_Name'Access,
Member_Index_For_Variable_Decl_F_Var_Type => Member_Desc_For_Variable_Decl_F_Var_Type'Access,
Member_Index_For_Variable_Decl_F_Expr => Member_Desc_For_Variable_Decl_F_Expr'Access,
Member_Index_For_Variable_Reference_F_Variable_Name => Member_Desc_For_Variable_Reference_F_Variable_Name'Access,
Member_Index_For_Variable_Reference_F_Attribute_Ref => Member_Desc_For_Variable_Reference_F_Attribute_Ref'Access,
Member_Index_For_With_Decl_F_Is_Limited => Member_Desc_For_With_Decl_F_Is_Limited'Access,
Member_Index_For_With_Decl_F_Path_Names => Member_Desc_For_With_Decl_F_Path_Names'Access,
Member_Index_For_Parent => Member_Desc_For_Parent'Access,
Member_Index_For_Parents => Member_Desc_For_Parents'Access,
Member_Index_For_Children => Member_Desc_For_Children'Access,
Member_Index_For_Token_Start => Member_Desc_For_Token_Start'Access,
Member_Index_For_Token_End => Member_Desc_For_Token_End'Access,
Member_Index_For_Child_Index => Member_Desc_For_Child_Index'Access,
Member_Index_For_Previous_Sibling => Member_Desc_For_Previous_Sibling'Access,
Member_Index_For_Next_Sibling => Member_Desc_For_Next_Sibling'Access,
Member_Index_For_Unit => Member_Desc_For_Unit'Access,
Member_Index_For_Is_Ghost => Member_Desc_For_Is_Ghost'Access,
Member_Index_For_Full_Sloc_Image => Member_Desc_For_Full_Sloc_Image'Access,
Member_Index_For_All_Qualifier_P_As_Bool => Member_Desc_For_All_Qualifier_P_As_Bool'Access,
Member_Index_For_Limited_Node_P_As_Bool => Member_Desc_For_Limited_Node_P_As_Bool'Access
);
-----------------------------
-- Struct type descriptors --
-----------------------------
Node_Name_For_Gpr_Node : aliased constant Text_Type :=
"Gpr_Node";
Node_Repr_Name_For_Gpr_Node : aliased constant Text_Type :=
"GprNode";
Node_Desc_For_Gpr_Node : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 27,
Member_Count => 11,
Base_Type => No_Type_Index,
Is_Abstract => True,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Gpr_Node'Access,
Repr_Name => Node_Repr_Name_For_Gpr_Node'Access,
Inherited_Members => 11,
Derivations => (
1 => Type_Index_For_All_Qualifier,
2 => Type_Index_For_Attribute_Decl,
3 => Type_Index_For_Attribute_Reference,
4 => Type_Index_For_Base_List,
5 => Type_Index_For_Builtin_Function_Call,
6 => Type_Index_For_Case_Construction,
7 => Type_Index_For_Case_Item,
8 => Type_Index_For_Compilation_Unit,
9 => Type_Index_For_Empty_Decl,
10 => Type_Index_For_Expr,
11 => Type_Index_For_Limited,
12 => Type_Index_For_Others_Designator,
13 => Type_Index_For_Package_Decl,
14 => Type_Index_For_Package_Extension,
15 => Type_Index_For_Package_Renaming,
16 => Type_Index_For_Package_Spec,
17 => Type_Index_For_Project,
18 => Type_Index_For_Project_Declaration,
19 => Type_Index_For_Project_Extension,
20 => Type_Index_For_Project_Qualifier,
21 => Type_Index_For_String_Literal_At,
22 => Type_Index_For_Terms,
23 => Type_Index_For_Type_Reference,
24 => Type_Index_For_Typed_String_Decl,
25 => Type_Index_For_Variable_Decl,
26 => Type_Index_For_Variable_Reference,
27 => Type_Index_For_With_Decl
),
Members => (
1 => Member_Index_For_Parent,
2 => Member_Index_For_Parents,
3 => Member_Index_For_Children,
4 => Member_Index_For_Token_Start,
5 => Member_Index_For_Token_End,
6 => Member_Index_For_Child_Index,
7 => Member_Index_For_Previous_Sibling,
8 => Member_Index_For_Next_Sibling,
9 => Member_Index_For_Unit,
10 => Member_Index_For_Is_Ghost,
11 => Member_Index_For_Full_Sloc_Image
));
Node_Name_For_All_Qualifier : aliased constant Text_Type :=
"All_Qualifier";
Node_Repr_Name_For_All_Qualifier : aliased constant Text_Type :=
"AllQualifier";
Node_Desc_For_All_Qualifier : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 2,
Member_Count => 1,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => True,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_All_Qualifier'Access,
Repr_Name => Node_Repr_Name_For_All_Qualifier'Access,
Inherited_Members => 12,
Derivations => (
1 => Type_Index_For_All_Qualifier_Absent,
2 => Type_Index_For_All_Qualifier_Present
),
Members => (
1 => Member_Index_For_All_Qualifier_P_As_Bool
));
Node_Name_For_All_Qualifier_Absent : aliased constant Text_Type :=
"All_Qualifier_Absent";
Node_Repr_Name_For_All_Qualifier_Absent : aliased constant Text_Type :=
"AllQualifierAbsent";
Node_Desc_For_All_Qualifier_Absent : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_All_Qualifier,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_All_Qualifier_Absent'Access,
Repr_Name => Node_Repr_Name_For_All_Qualifier_Absent'Access,
Inherited_Members => 12,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_All_Qualifier_Present : aliased constant Text_Type :=
"All_Qualifier_Present";
Node_Repr_Name_For_All_Qualifier_Present : aliased constant Text_Type :=
"AllQualifierPresent";
Node_Desc_For_All_Qualifier_Present : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_All_Qualifier,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_All_Qualifier_Present'Access,
Repr_Name => Node_Repr_Name_For_All_Qualifier_Present'Access,
Inherited_Members => 12,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Attribute_Decl : aliased constant Text_Type :=
"Attribute_Decl";
Node_Repr_Name_For_Attribute_Decl : aliased constant Text_Type :=
"AttributeDecl";
Node_Desc_For_Attribute_Decl : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 3,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Attribute_Decl'Access,
Repr_Name => Node_Repr_Name_For_Attribute_Decl'Access,
Inherited_Members => 14,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Attribute_Decl_F_Attr_Name,
2 => Member_Index_For_Attribute_Decl_F_Attr_Index,
3 => Member_Index_For_Attribute_Decl_F_Expr
));
Node_Name_For_Attribute_Reference : aliased constant Text_Type :=
"Attribute_Reference";
Node_Repr_Name_For_Attribute_Reference : aliased constant Text_Type :=
"AttributeReference";
Node_Desc_For_Attribute_Reference : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Attribute_Reference'Access,
Repr_Name => Node_Repr_Name_For_Attribute_Reference'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Attribute_Reference_F_Attribute_Name,
2 => Member_Index_For_Attribute_Reference_F_Attribute_Index
));
Node_Name_For_Base_List : aliased constant Text_Type :=
"Base_List";
Node_Repr_Name_For_Base_List : aliased constant Text_Type :=
"BaseList";
Node_Desc_For_Base_List : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 6,
Member_Count => 0,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => True,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Base_List'Access,
Repr_Name => Node_Repr_Name_For_Base_List'Access,
Inherited_Members => 11,
Derivations => (
1 => Type_Index_For_Case_Item_List,
2 => Type_Index_For_Gpr_Node_List,
3 => Type_Index_For_Identifier_List,
4 => Type_Index_For_String_Literal_List,
5 => Type_Index_For_Term_List_List,
6 => Type_Index_For_With_Decl_List
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Case_Item_List : aliased constant Text_Type :=
"Case_Item_List";
Node_Repr_Name_For_Case_Item_List : aliased constant Text_Type :=
"CaseItemList";
Node_Desc_For_Case_Item_List : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Base_List,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => True,
Name => Node_Name_For_Case_Item_List'Access,
Repr_Name => Node_Repr_Name_For_Case_Item_List'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Gpr_Node_List : aliased constant Text_Type :=
"Gpr_Node_List";
Node_Repr_Name_For_Gpr_Node_List : aliased constant Text_Type :=
"GprNodeList";
Node_Desc_For_Gpr_Node_List : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 2,
Member_Count => 0,
Base_Type => Type_Index_For_Base_List,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => True,
Name => Node_Name_For_Gpr_Node_List'Access,
Repr_Name => Node_Repr_Name_For_Gpr_Node_List'Access,
Inherited_Members => 11,
Derivations => (
1 => Type_Index_For_Choices,
2 => Type_Index_For_Term_List
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Choices : aliased constant Text_Type :=
"Choices";
Node_Repr_Name_For_Choices : aliased constant Text_Type :=
"Choices";
Node_Desc_For_Choices : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Gpr_Node_List,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => True,
Name => Node_Name_For_Choices'Access,
Repr_Name => Node_Repr_Name_For_Choices'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Term_List : aliased constant Text_Type :=
"Term_List";
Node_Repr_Name_For_Term_List : aliased constant Text_Type :=
"TermList";
Node_Desc_For_Term_List : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Gpr_Node_List,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => True,
Name => Node_Name_For_Term_List'Access,
Repr_Name => Node_Repr_Name_For_Term_List'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Identifier_List : aliased constant Text_Type :=
"Identifier_List";
Node_Repr_Name_For_Identifier_List : aliased constant Text_Type :=
"IdentifierList";
Node_Desc_For_Identifier_List : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Base_List,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => True,
Name => Node_Name_For_Identifier_List'Access,
Repr_Name => Node_Repr_Name_For_Identifier_List'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_String_Literal_List : aliased constant Text_Type :=
"String_Literal_List";
Node_Repr_Name_For_String_Literal_List : aliased constant Text_Type :=
"StringLiteralList";
Node_Desc_For_String_Literal_List : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Base_List,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => True,
Name => Node_Name_For_String_Literal_List'Access,
Repr_Name => Node_Repr_Name_For_String_Literal_List'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Term_List_List : aliased constant Text_Type :=
"Term_List_List";
Node_Repr_Name_For_Term_List_List : aliased constant Text_Type :=
"TermListList";
Node_Desc_For_Term_List_List : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Base_List,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => True,
Name => Node_Name_For_Term_List_List'Access,
Repr_Name => Node_Repr_Name_For_Term_List_List'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_With_Decl_List : aliased constant Text_Type :=
"With_Decl_List";
Node_Repr_Name_For_With_Decl_List : aliased constant Text_Type :=
"WithDeclList";
Node_Desc_For_With_Decl_List : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Base_List,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => True,
Name => Node_Name_For_With_Decl_List'Access,
Repr_Name => Node_Repr_Name_For_With_Decl_List'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Builtin_Function_Call : aliased constant Text_Type :=
"Builtin_Function_Call";
Node_Repr_Name_For_Builtin_Function_Call : aliased constant Text_Type :=
"BuiltinFunctionCall";
Node_Desc_For_Builtin_Function_Call : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Builtin_Function_Call'Access,
Repr_Name => Node_Repr_Name_For_Builtin_Function_Call'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Builtin_Function_Call_F_Function_Name,
2 => Member_Index_For_Builtin_Function_Call_F_Parameters
));
Node_Name_For_Case_Construction : aliased constant Text_Type :=
"Case_Construction";
Node_Repr_Name_For_Case_Construction : aliased constant Text_Type :=
"CaseConstruction";
Node_Desc_For_Case_Construction : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Case_Construction'Access,
Repr_Name => Node_Repr_Name_For_Case_Construction'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Case_Construction_F_Var_Ref,
2 => Member_Index_For_Case_Construction_F_Items
));
Node_Name_For_Case_Item : aliased constant Text_Type :=
"Case_Item";
Node_Repr_Name_For_Case_Item : aliased constant Text_Type :=
"CaseItem";
Node_Desc_For_Case_Item : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Case_Item'Access,
Repr_Name => Node_Repr_Name_For_Case_Item'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Case_Item_F_Choice,
2 => Member_Index_For_Case_Item_F_Decls
));
Node_Name_For_Compilation_Unit : aliased constant Text_Type :=
"Compilation_Unit";
Node_Repr_Name_For_Compilation_Unit : aliased constant Text_Type :=
"CompilationUnit";
Node_Desc_For_Compilation_Unit : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 1,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Compilation_Unit'Access,
Repr_Name => Node_Repr_Name_For_Compilation_Unit'Access,
Inherited_Members => 12,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Compilation_Unit_F_Project
));
Node_Name_For_Empty_Decl : aliased constant Text_Type :=
"Empty_Decl";
Node_Repr_Name_For_Empty_Decl : aliased constant Text_Type :=
"EmptyDecl";
Node_Desc_For_Empty_Decl : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Empty_Decl'Access,
Repr_Name => Node_Repr_Name_For_Empty_Decl'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Expr : aliased constant Text_Type :=
"Expr";
Node_Repr_Name_For_Expr : aliased constant Text_Type :=
"Expr";
Node_Desc_For_Expr : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 2,
Member_Count => 0,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => True,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Expr'Access,
Repr_Name => Node_Repr_Name_For_Expr'Access,
Inherited_Members => 11,
Derivations => (
1 => Type_Index_For_Prefix,
2 => Type_Index_For_Single_Tok_Node
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Prefix : aliased constant Text_Type :=
"Prefix";
Node_Repr_Name_For_Prefix : aliased constant Text_Type :=
"Prefix";
Node_Desc_For_Prefix : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Expr,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Prefix'Access,
Repr_Name => Node_Repr_Name_For_Prefix'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Prefix_F_Prefix,
2 => Member_Index_For_Prefix_F_Suffix
));
Node_Name_For_Single_Tok_Node : aliased constant Text_Type :=
"Single_Tok_Node";
Node_Repr_Name_For_Single_Tok_Node : aliased constant Text_Type :=
"SingleTokNode";
Node_Desc_For_Single_Tok_Node : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 3,
Member_Count => 0,
Base_Type => Type_Index_For_Expr,
Is_Abstract => True,
Is_Token_Node => True,
Is_List_Node => False,
Name => Node_Name_For_Single_Tok_Node'Access,
Repr_Name => Node_Repr_Name_For_Single_Tok_Node'Access,
Inherited_Members => 11,
Derivations => (
1 => Type_Index_For_Identifier,
2 => Type_Index_For_Num_Literal,
3 => Type_Index_For_String_Literal
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Identifier : aliased constant Text_Type :=
"Identifier";
Node_Repr_Name_For_Identifier : aliased constant Text_Type :=
"Id";
Node_Desc_For_Identifier : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Single_Tok_Node,
Is_Abstract => False,
Is_Token_Node => True,
Is_List_Node => False,
Name => Node_Name_For_Identifier'Access,
Repr_Name => Node_Repr_Name_For_Identifier'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Num_Literal : aliased constant Text_Type :=
"Num_Literal";
Node_Repr_Name_For_Num_Literal : aliased constant Text_Type :=
"Num";
Node_Desc_For_Num_Literal : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Single_Tok_Node,
Is_Abstract => False,
Is_Token_Node => True,
Is_List_Node => False,
Name => Node_Name_For_Num_Literal'Access,
Repr_Name => Node_Repr_Name_For_Num_Literal'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_String_Literal : aliased constant Text_Type :=
"String_Literal";
Node_Repr_Name_For_String_Literal : aliased constant Text_Type :=
"Str";
Node_Desc_For_String_Literal : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Single_Tok_Node,
Is_Abstract => False,
Is_Token_Node => True,
Is_List_Node => False,
Name => Node_Name_For_String_Literal'Access,
Repr_Name => Node_Repr_Name_For_String_Literal'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Limited_Node : aliased constant Text_Type :=
"Limited_Node";
Node_Repr_Name_For_Limited_Node : aliased constant Text_Type :=
"LimitedNode";
Node_Desc_For_Limited_Node : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 2,
Member_Count => 1,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => True,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Limited_Node'Access,
Repr_Name => Node_Repr_Name_For_Limited_Node'Access,
Inherited_Members => 12,
Derivations => (
1 => Type_Index_For_Limited_Absent,
2 => Type_Index_For_Limited_Present
),
Members => (
1 => Member_Index_For_Limited_Node_P_As_Bool
));
Node_Name_For_Limited_Absent : aliased constant Text_Type :=
"Limited_Absent";
Node_Repr_Name_For_Limited_Absent : aliased constant Text_Type :=
"LimitedAbsent";
Node_Desc_For_Limited_Absent : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Limited,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Limited_Absent'Access,
Repr_Name => Node_Repr_Name_For_Limited_Absent'Access,
Inherited_Members => 12,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Limited_Present : aliased constant Text_Type :=
"Limited_Present";
Node_Repr_Name_For_Limited_Present : aliased constant Text_Type :=
"LimitedPresent";
Node_Desc_For_Limited_Present : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Limited,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Limited_Present'Access,
Repr_Name => Node_Repr_Name_For_Limited_Present'Access,
Inherited_Members => 12,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Others_Designator : aliased constant Text_Type :=
"Others_Designator";
Node_Repr_Name_For_Others_Designator : aliased constant Text_Type :=
"OthersDesignator";
Node_Desc_For_Others_Designator : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Others_Designator'Access,
Repr_Name => Node_Repr_Name_For_Others_Designator'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Package_Decl : aliased constant Text_Type :=
"Package_Decl";
Node_Repr_Name_For_Package_Decl : aliased constant Text_Type :=
"PackageDecl";
Node_Desc_For_Package_Decl : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Package_Decl'Access,
Repr_Name => Node_Repr_Name_For_Package_Decl'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Package_Decl_F_Pkg_Name,
2 => Member_Index_For_Package_Decl_F_Pkg_Spec
));
Node_Name_For_Package_Extension : aliased constant Text_Type :=
"Package_Extension";
Node_Repr_Name_For_Package_Extension : aliased constant Text_Type :=
"PackageExtension";
Node_Desc_For_Package_Extension : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 1,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Package_Extension'Access,
Repr_Name => Node_Repr_Name_For_Package_Extension'Access,
Inherited_Members => 12,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Package_Extension_F_Extended_Name
));
Node_Name_For_Package_Renaming : aliased constant Text_Type :=
"Package_Renaming";
Node_Repr_Name_For_Package_Renaming : aliased constant Text_Type :=
"PackageRenaming";
Node_Desc_For_Package_Renaming : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 1,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Package_Renaming'Access,
Repr_Name => Node_Repr_Name_For_Package_Renaming'Access,
Inherited_Members => 12,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Package_Renaming_F_Renamed_Name
));
Node_Name_For_Package_Spec : aliased constant Text_Type :=
"Package_Spec";
Node_Repr_Name_For_Package_Spec : aliased constant Text_Type :=
"PackageSpec";
Node_Desc_For_Package_Spec : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 3,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Package_Spec'Access,
Repr_Name => Node_Repr_Name_For_Package_Spec'Access,
Inherited_Members => 14,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Package_Spec_F_Extension,
2 => Member_Index_For_Package_Spec_F_Decls,
3 => Member_Index_For_Package_Spec_F_End_Name
));
Node_Name_For_Project : aliased constant Text_Type :=
"Project";
Node_Repr_Name_For_Project : aliased constant Text_Type :=
"Project";
Node_Desc_For_Project : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Project'Access,
Repr_Name => Node_Repr_Name_For_Project'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Project_F_Context_Clauses,
2 => Member_Index_For_Project_F_Project_Decl
));
Node_Name_For_Project_Declaration : aliased constant Text_Type :=
"Project_Declaration";
Node_Repr_Name_For_Project_Declaration : aliased constant Text_Type :=
"ProjectDeclaration";
Node_Desc_For_Project_Declaration : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 5,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Project_Declaration'Access,
Repr_Name => Node_Repr_Name_For_Project_Declaration'Access,
Inherited_Members => 16,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Project_Declaration_F_Qualifier,
2 => Member_Index_For_Project_Declaration_F_Project_Name,
3 => Member_Index_For_Project_Declaration_F_Extension,
4 => Member_Index_For_Project_Declaration_F_Decls,
5 => Member_Index_For_Project_Declaration_F_End_Name
));
Node_Name_For_Project_Extension : aliased constant Text_Type :=
"Project_Extension";
Node_Repr_Name_For_Project_Extension : aliased constant Text_Type :=
"ProjectExtension";
Node_Desc_For_Project_Extension : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Project_Extension'Access,
Repr_Name => Node_Repr_Name_For_Project_Extension'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Project_Extension_F_Is_All,
2 => Member_Index_For_Project_Extension_F_Path_Name
));
Node_Name_For_Project_Qualifier : aliased constant Text_Type :=
"Project_Qualifier";
Node_Repr_Name_For_Project_Qualifier : aliased constant Text_Type :=
"ProjectQualifier";
Node_Desc_For_Project_Qualifier : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 6,
Member_Count => 0,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => True,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Project_Qualifier'Access,
Repr_Name => Node_Repr_Name_For_Project_Qualifier'Access,
Inherited_Members => 11,
Derivations => (
1 => Type_Index_For_Project_Qualifier_Abstract,
2 => Type_Index_For_Project_Qualifier_Aggregate,
3 => Type_Index_For_Project_Qualifier_Aggregate_Library,
4 => Type_Index_For_Project_Qualifier_Configuration,
5 => Type_Index_For_Project_Qualifier_Library,
6 => Type_Index_For_Project_Qualifier_Standard
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Project_Qualifier_Abstract : aliased constant Text_Type :=
"Project_Qualifier_Abstract";
Node_Repr_Name_For_Project_Qualifier_Abstract : aliased constant Text_Type :=
"ProjectQualifierAbstract";
Node_Desc_For_Project_Qualifier_Abstract : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Project_Qualifier,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Project_Qualifier_Abstract'Access,
Repr_Name => Node_Repr_Name_For_Project_Qualifier_Abstract'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Project_Qualifier_Aggregate : aliased constant Text_Type :=
"Project_Qualifier_Aggregate";
Node_Repr_Name_For_Project_Qualifier_Aggregate : aliased constant Text_Type :=
"ProjectQualifierAggregate";
Node_Desc_For_Project_Qualifier_Aggregate : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Project_Qualifier,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Project_Qualifier_Aggregate'Access,
Repr_Name => Node_Repr_Name_For_Project_Qualifier_Aggregate'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Project_Qualifier_Aggregate_Library : aliased constant Text_Type :=
"Project_Qualifier_Aggregate_Library";
Node_Repr_Name_For_Project_Qualifier_Aggregate_Library : aliased constant Text_Type :=
"ProjectQualifierAggregateLibrary";
Node_Desc_For_Project_Qualifier_Aggregate_Library : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Project_Qualifier,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Project_Qualifier_Aggregate_Library'Access,
Repr_Name => Node_Repr_Name_For_Project_Qualifier_Aggregate_Library'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Project_Qualifier_Configuration : aliased constant Text_Type :=
"Project_Qualifier_Configuration";
Node_Repr_Name_For_Project_Qualifier_Configuration : aliased constant Text_Type :=
"ProjectQualifierConfiguration";
Node_Desc_For_Project_Qualifier_Configuration : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Project_Qualifier,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Project_Qualifier_Configuration'Access,
Repr_Name => Node_Repr_Name_For_Project_Qualifier_Configuration'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Project_Qualifier_Library : aliased constant Text_Type :=
"Project_Qualifier_Library";
Node_Repr_Name_For_Project_Qualifier_Library : aliased constant Text_Type :=
"ProjectQualifierLibrary";
Node_Desc_For_Project_Qualifier_Library : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Project_Qualifier,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Project_Qualifier_Library'Access,
Repr_Name => Node_Repr_Name_For_Project_Qualifier_Library'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_Project_Qualifier_Standard : aliased constant Text_Type :=
"Project_Qualifier_Standard";
Node_Repr_Name_For_Project_Qualifier_Standard : aliased constant Text_Type :=
"ProjectQualifierStandard";
Node_Desc_For_Project_Qualifier_Standard : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 0,
Base_Type => Type_Index_For_Project_Qualifier,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Project_Qualifier_Standard'Access,
Repr_Name => Node_Repr_Name_For_Project_Qualifier_Standard'Access,
Inherited_Members => 11,
Derivations => (
1 .. 0 => <>
),
Members => (
1 .. 0 => <>
));
Node_Name_For_String_Literal_At : aliased constant Text_Type :=
"String_Literal_At";
Node_Repr_Name_For_String_Literal_At : aliased constant Text_Type :=
"StringLiteralAt";
Node_Desc_For_String_Literal_At : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_String_Literal_At'Access,
Repr_Name => Node_Repr_Name_For_String_Literal_At'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_String_Literal_At_F_Str_Lit,
2 => Member_Index_For_String_Literal_At_F_At_Lit
));
Node_Name_For_Terms : aliased constant Text_Type :=
"Terms";
Node_Repr_Name_For_Terms : aliased constant Text_Type :=
"Terms";
Node_Desc_For_Terms : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 1,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Terms'Access,
Repr_Name => Node_Repr_Name_For_Terms'Access,
Inherited_Members => 12,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Terms_F_Terms
));
Node_Name_For_Type_Reference : aliased constant Text_Type :=
"Type_Reference";
Node_Repr_Name_For_Type_Reference : aliased constant Text_Type :=
"TypeReference";
Node_Desc_For_Type_Reference : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 1,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Type_Reference'Access,
Repr_Name => Node_Repr_Name_For_Type_Reference'Access,
Inherited_Members => 12,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Type_Reference_F_Var_Type_Name
));
Node_Name_For_Typed_String_Decl : aliased constant Text_Type :=
"Typed_String_Decl";
Node_Repr_Name_For_Typed_String_Decl : aliased constant Text_Type :=
"TypedStringDecl";
Node_Desc_For_Typed_String_Decl : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Typed_String_Decl'Access,
Repr_Name => Node_Repr_Name_For_Typed_String_Decl'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Typed_String_Decl_F_Type_Id,
2 => Member_Index_For_Typed_String_Decl_F_String_Literals
));
Node_Name_For_Variable_Decl : aliased constant Text_Type :=
"Variable_Decl";
Node_Repr_Name_For_Variable_Decl : aliased constant Text_Type :=
"VariableDecl";
Node_Desc_For_Variable_Decl : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 3,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Variable_Decl'Access,
Repr_Name => Node_Repr_Name_For_Variable_Decl'Access,
Inherited_Members => 14,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Variable_Decl_F_Var_Name,
2 => Member_Index_For_Variable_Decl_F_Var_Type,
3 => Member_Index_For_Variable_Decl_F_Expr
));
Node_Name_For_Variable_Reference : aliased constant Text_Type :=
"Variable_Reference";
Node_Repr_Name_For_Variable_Reference : aliased constant Text_Type :=
"VariableReference";
Node_Desc_For_Variable_Reference : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_Variable_Reference'Access,
Repr_Name => Node_Repr_Name_For_Variable_Reference'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_Variable_Reference_F_Variable_Name,
2 => Member_Index_For_Variable_Reference_F_Attribute_Ref
));
Node_Name_For_With_Decl : aliased constant Text_Type :=
"With_Decl";
Node_Repr_Name_For_With_Decl : aliased constant Text_Type :=
"WithDecl";
Node_Desc_For_With_Decl : aliased constant Struct_Type_Descriptor :=
(Derivations_Count => 0,
Member_Count => 2,
Base_Type => Type_Index_For_Gpr_Node,
Is_Abstract => False,
Is_Token_Node => False,
Is_List_Node => False,
Name => Node_Name_For_With_Decl'Access,
Repr_Name => Node_Repr_Name_For_With_Decl'Access,
Inherited_Members => 13,
Derivations => (
1 .. 0 => <>
),
Members => (
1 => Member_Index_For_With_Decl_F_Is_Limited,
2 => Member_Index_For_With_Decl_F_Path_Names
));
Struct_Types : aliased constant Struct_Type_Descriptor_Array := (
Type_Index_For_Gpr_Node => Node_Desc_For_Gpr_Node'Access,
Type_Index_For_All_Qualifier => Node_Desc_For_All_Qualifier'Access,
Type_Index_For_All_Qualifier_Absent => Node_Desc_For_All_Qualifier_Absent'Access,
Type_Index_For_All_Qualifier_Present => Node_Desc_For_All_Qualifier_Present'Access,
Type_Index_For_Attribute_Decl => Node_Desc_For_Attribute_Decl'Access,
Type_Index_For_Attribute_Reference => Node_Desc_For_Attribute_Reference'Access,
Type_Index_For_Base_List => Node_Desc_For_Base_List'Access,
Type_Index_For_Case_Item_List => Node_Desc_For_Case_Item_List'Access,
Type_Index_For_Gpr_Node_List => Node_Desc_For_Gpr_Node_List'Access,
Type_Index_For_Choices => Node_Desc_For_Choices'Access,
Type_Index_For_Term_List => Node_Desc_For_Term_List'Access,
Type_Index_For_Identifier_List => Node_Desc_For_Identifier_List'Access,
Type_Index_For_String_Literal_List => Node_Desc_For_String_Literal_List'Access,
Type_Index_For_Term_List_List => Node_Desc_For_Term_List_List'Access,
Type_Index_For_With_Decl_List => Node_Desc_For_With_Decl_List'Access,
Type_Index_For_Builtin_Function_Call => Node_Desc_For_Builtin_Function_Call'Access,
Type_Index_For_Case_Construction => Node_Desc_For_Case_Construction'Access,
Type_Index_For_Case_Item => Node_Desc_For_Case_Item'Access,
Type_Index_For_Compilation_Unit => Node_Desc_For_Compilation_Unit'Access,
Type_Index_For_Empty_Decl => Node_Desc_For_Empty_Decl'Access,
Type_Index_For_Expr => Node_Desc_For_Expr'Access,
Type_Index_For_Prefix => Node_Desc_For_Prefix'Access,
Type_Index_For_Single_Tok_Node => Node_Desc_For_Single_Tok_Node'Access,
Type_Index_For_Identifier => Node_Desc_For_Identifier'Access,
Type_Index_For_Num_Literal => Node_Desc_For_Num_Literal'Access,
Type_Index_For_String_Literal => Node_Desc_For_String_Literal'Access,
Type_Index_For_Limited => Node_Desc_For_Limited_Node'Access,
Type_Index_For_Limited_Absent => Node_Desc_For_Limited_Absent'Access,
Type_Index_For_Limited_Present => Node_Desc_For_Limited_Present'Access,
Type_Index_For_Others_Designator => Node_Desc_For_Others_Designator'Access,
Type_Index_For_Package_Decl => Node_Desc_For_Package_Decl'Access,
Type_Index_For_Package_Extension => Node_Desc_For_Package_Extension'Access,
Type_Index_For_Package_Renaming => Node_Desc_For_Package_Renaming'Access,
Type_Index_For_Package_Spec => Node_Desc_For_Package_Spec'Access,
Type_Index_For_Project => Node_Desc_For_Project'Access,
Type_Index_For_Project_Declaration => Node_Desc_For_Project_Declaration'Access,
Type_Index_For_Project_Extension => Node_Desc_For_Project_Extension'Access,
Type_Index_For_Project_Qualifier => Node_Desc_For_Project_Qualifier'Access,
Type_Index_For_Project_Qualifier_Abstract => Node_Desc_For_Project_Qualifier_Abstract'Access,
Type_Index_For_Project_Qualifier_Aggregate => Node_Desc_For_Project_Qualifier_Aggregate'Access,
Type_Index_For_Project_Qualifier_Aggregate_Library => Node_Desc_For_Project_Qualifier_Aggregate_Library'Access,
Type_Index_For_Project_Qualifier_Configuration => Node_Desc_For_Project_Qualifier_Configuration'Access,
Type_Index_For_Project_Qualifier_Library => Node_Desc_For_Project_Qualifier_Library'Access,
Type_Index_For_Project_Qualifier_Standard => Node_Desc_For_Project_Qualifier_Standard'Access,
Type_Index_For_String_Literal_At => Node_Desc_For_String_Literal_At'Access,
Type_Index_For_Terms => Node_Desc_For_Terms'Access,
Type_Index_For_Type_Reference => Node_Desc_For_Type_Reference'Access,
Type_Index_For_Typed_String_Decl => Node_Desc_For_Typed_String_Decl'Access,
Type_Index_For_Variable_Decl => Node_Desc_For_Variable_Decl'Access,
Type_Index_For_Variable_Reference => Node_Desc_For_Variable_Reference'Access,
Type_Index_For_With_Decl => Node_Desc_For_With_Decl'Access
);
First_Node : constant Type_Index := Type_Index_For_Gpr_Node;
First_Property : constant Struct_Member_Index :=
Member_Index_For_Parent;
function Eval_Node_Member
(Node : Internal_Acc_Node;
Member : Struct_Member_Index;
Arguments : Internal_Value_Array) return Internal_Value_Access;
-- Implementation for the Eval_Node_Member operation in the language
-- descriptor.
Builtin_Types : aliased constant Builtin_Types_Record :=
(Analysis_Unit => Type_Index_For_Analysis_Unit,
Big_Int => Type_Index_For_Big_Int,
Bool => Type_Index_For_Bool,
Char => Type_Index_For_Character,
Int => Type_Index_For_Int,
Source_Location_Range => Type_Index_For_Source_Location_Range,
String => Type_Index_For_String,
Token => Type_Index_For_Token,
Symbol => Type_Index_For_Symbol);
Node_Kinds : constant array (Gpr_Node_Kind_Type) of Type_Index :=
(Gpr_All_Qualifier_Absent => Type_Index_For_All_Qualifier_Absent, Gpr_All_Qualifier_Present => Type_Index_For_All_Qualifier_Present, Gpr_Attribute_Decl => Type_Index_For_Attribute_Decl, Gpr_Attribute_Reference => Type_Index_For_Attribute_Reference, Gpr_Case_Item_List => Type_Index_For_Case_Item_List, Gpr_Gpr_Node_List => Type_Index_For_Gpr_Node_List, Gpr_Choices => Type_Index_For_Choices, Gpr_Term_List => Type_Index_For_Term_List, Gpr_Identifier_List => Type_Index_For_Identifier_List, Gpr_String_Literal_List => Type_Index_For_String_Literal_List, Gpr_Term_List_List => Type_Index_For_Term_List_List, Gpr_With_Decl_List => Type_Index_For_With_Decl_List, Gpr_Builtin_Function_Call => Type_Index_For_Builtin_Function_Call, Gpr_Case_Construction => Type_Index_For_Case_Construction, Gpr_Case_Item => Type_Index_For_Case_Item, Gpr_Compilation_Unit => Type_Index_For_Compilation_Unit, Gpr_Empty_Decl => Type_Index_For_Empty_Decl, Gpr_Prefix => Type_Index_For_Prefix, Gpr_Identifier => Type_Index_For_Identifier, Gpr_Num_Literal => Type_Index_For_Num_Literal, Gpr_String_Literal => Type_Index_For_String_Literal, Gpr_Limited_Absent => Type_Index_For_Limited_Absent, Gpr_Limited_Present => Type_Index_For_Limited_Present, Gpr_Others_Designator => Type_Index_For_Others_Designator, Gpr_Package_Decl => Type_Index_For_Package_Decl, Gpr_Package_Extension => Type_Index_For_Package_Extension, Gpr_Package_Renaming => Type_Index_For_Package_Renaming, Gpr_Package_Spec => Type_Index_For_Package_Spec, Gpr_Project => Type_Index_For_Project, Gpr_Project_Declaration => Type_Index_For_Project_Declaration, Gpr_Project_Extension => Type_Index_For_Project_Extension, Gpr_Project_Qualifier_Abstract => Type_Index_For_Project_Qualifier_Abstract, Gpr_Project_Qualifier_Aggregate => Type_Index_For_Project_Qualifier_Aggregate, Gpr_Project_Qualifier_Aggregate_Library => Type_Index_For_Project_Qualifier_Aggregate_Library, Gpr_Project_Qualifier_Configuration => Type_Index_For_Project_Qualifier_Configuration, Gpr_Project_Qualifier_Library => Type_Index_For_Project_Qualifier_Library, Gpr_Project_Qualifier_Standard => Type_Index_For_Project_Qualifier_Standard, Gpr_String_Literal_At => Type_Index_For_String_Literal_At, Gpr_Terms => Type_Index_For_Terms, Gpr_Type_Reference => Type_Index_For_Type_Reference, Gpr_Typed_String_Decl => Type_Index_For_Typed_String_Decl, Gpr_Variable_Decl => Type_Index_For_Variable_Decl, Gpr_Variable_Reference => Type_Index_For_Variable_Reference, Gpr_With_Decl => Type_Index_For_With_Decl);
-- Associate a type index to each concrete node
-----------------------------------------------------
-- Getter/setter helpers for introspection values --
-----------------------------------------------------
-- These helpers factorize common code needed in array/struct generic
-- access/construction operations.
procedure Set_Unit
(Intr_Value : Internal_Acc_Analysis_Unit;
Actual_Value : Analysis_Unit);
function Get_Unit
(Intr_Value : Internal_Rec_Analysis_Unit)
return Analysis_Unit;
procedure Set_Big_Int
(Intr_Value : Internal_Acc_Big_Int;
Actual_Value : Big_Integer);
procedure Get_Big_Int
(Intr_Value : Internal_Rec_Big_Int;
Actual_Value : out Big_Integer);
procedure Set_Node
(Intr_Value : Internal_Acc_Node;
Actual_Value : Gpr_Node'Class);
function Get_Node
(Intr_Value : Internal_Rec_Node)
return Gpr_Node;
end Gpr_Parser.Generic_Introspection;
|
io7m/coreland-lua-ada | Ada | 189 | ads | package Lua.Check_Raise is
function Check_Raise (State : Lua.State_t) return Lua.Integer_t;
pragma Convention (C, Check_Raise);
Check_Raise_Error : exception;
end Lua.Check_Raise;
|
charlie5/lace | Ada | 899 | adb | with
float_Math.Geometry.d3.Modeller.Forge,
ada.text_IO;
procedure launch_basic_geometry_Demo
--
-- A simple demonstration of the geometry packages.
--
is
package Math renames float_Math;
use Math,
math.Geometry,
math.Geometry.d3.Modeller;
procedure log (Message : in String)
renames ada.text_IO.put_Line;
the_Modeller : d3.Modeller.item;
begin
declare
use float_math.Geometry.d3,
float_math.Geometry.d3.Modeller.Forge;
the_Model : float_math.Geometry.d3.a_Model := to_box_Model;
begin
log ("Box Model: " & Image (the_Model));
end;
declare
use float_math.Geometry.d3,
float_math.Geometry.d3.Modeller.Forge;
the_Model : float_math.Geometry.d3.a_Model := to_capsule_Model;
begin
log ("Capsule Model: " & Image (the_Model));
end;
end launch_basic_geometry_Demo;
|
mirror/ncurses | Ada | 4,253 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_User_Data --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright 2018,2020 Thomas E. Dickey --
-- Copyright 1999-2009,2014 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.17 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
-- |
-- |=====================================================================
-- | man page form_field_userptr.3x
-- |=====================================================================
-- |
package body Terminal_Interface.Curses.Forms.Field_User_Data is
-- |
-- |
-- |
procedure Set_User_Data (Fld : Field;
Data : User_Access)
is
function Set_Field_Userptr (Fld : Field;
Usr : User_Access) return Eti_Error;
pragma Import (C, Set_Field_Userptr, "set_field_userptr");
begin
Eti_Exception (Set_Field_Userptr (Fld, Data));
end Set_User_Data;
-- |
-- |
-- |
function Get_User_Data (Fld : Field) return User_Access
is
function Field_Userptr (Fld : Field) return User_Access;
pragma Import (C, Field_Userptr, "field_userptr");
begin
return Field_Userptr (Fld);
end Get_User_Data;
procedure Get_User_Data (Fld : Field;
Data : out User_Access)
is
begin
Data := Get_User_Data (Fld);
end Get_User_Data;
end Terminal_Interface.Curses.Forms.Field_User_Data;
|
iyan22/AprendeAda | Ada | 3,070 | adb | with Ada.Text_Io; use Ada.Text_Io;
with vectores; use vectores;
with esta_en_vector_ordenado;
procedure prueba_esta_en_vector_ordenado is
-- este programa hace llamadas a la funcion esta_en_vector_ordenado y es util
-- para comprobar si su funcionamiento es correcto
procedure escribir_booleano(valor: in Boolean) is
begin
if(valor) then
put("True");
else
put("False");
end if;
end escribir_booleano;
vector1: Vector_de_enteros(1..10);
vector2: Vector_de_enteros(-10..10);
vector3: Vector_de_enteros(-4..5);
vector4: Vector_de_enteros(0..3);
rdo: boolean;
begin
vector1 :=(1,3,5,7,9,11,13,15,17,19);
put_line("Caso 1: el valor esta en medio");
put_line(" esta_en_vector_ordenado(13, (1,3,5,7,9,11,13,15,17,19))");
put_Line(" debe ser True y el resultado es ");
rdo:=esta_en_vector_ordenado(13, vector1);
escribir_booleano(rdo);
new_line(3);
put_Line("Pulsa return para continuar");
skip_line;
new_line(3);
vector1 :=(1,3,5,7,9,11,13,15,17,19);
put_line("Caso 2: el valor esta al final");
put_line(" esta_en_vector_ordenado(19, (1,3,5,7,9,11,13,15,17,19))");
put_line(" debe ser True y el resultado es ");
rdo:=esta_en_vector_ordenado(19, vector1);
escribir_booleano(rdo);
new_line(3);
put_Line("Pulsa return para continuar");
skip_line;
new_line(3);
vector1 :=(1,3,5,7,9,11,13,15,17,19);
put_line("Caso 3: el valor no esta, se debe recorrer todo el vector");
put_line(" esta_en_vector_ordenado(45, (1,3,5,7,9,11,13,15,17,19))");
put_line(" debe ser False y el resultado es ");
rdo:=esta_en_vector_ordenado(45, vector1);
escribir_booleano(rdo);
new_line(3);
put_Line("Pulsa return para continuar");
skip_line;
new_line(3);
--Mis casos de prueba
vector2 :=(1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41);
put_line("Caso 4: vector largo, el valor esta en medio");
put_line(" esta_en_vector_ordenado(25, (1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39))");
put_Line(" debe ser True y el resultado es ");
rdo:=esta_en_vector_ordenado(25, vector2);
escribir_booleano(rdo);
new_line(3);
put_Line("Pulsa return para continuar");
skip_line;
new_line(3);
vector3 :=(1,3,5,7,9,11,13,15,17,19);
put_line("Caso 5: el valor no esta, se debe recorrer todo el vector");
put_line(" esta_en_vector_ordenado(21, (1,3,5,7,9,11,13,15,17,19))");
put_line(" debe ser False y el resultado es ");
rdo:=esta_en_vector_ordenado(21, vector3);
escribir_booleano(rdo);
new_line(3);
put_Line("Pulsa return para continuar");
skip_line;
new_line(3);
vector4 :=(1,3,5,7);
put_line("Caso 6: vector corto, el valor no esta, se debe recorrer todo el vector");
put_line(" esta_en_vector_ordenado(45, (1,3,5,7)");
put_line(" debe ser False y el resultado es ");
rdo:=esta_en_vector_ordenado(45, vector4);
escribir_booleano(rdo);
new_line(3);
put_Line("Pulsa return para continuar");
skip_line;
new_line(3);
end prueba_esta_en_vector_ordenado;
|
persan/advent-of-code-2020 | Ada | 48 | adb | package body Adventofcode is
end Adventofcode;
|
reznikmm/matreshka | Ada | 20,318 | 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$
------------------------------------------------------------------------------
with AMF.Internals.UML_Named_Elements;
with AMF.UML.Activities;
with AMF.UML.Activity_Edges.Collections;
with AMF.UML.Activity_Groups.Collections;
with AMF.UML.Activity_Nodes.Collections;
with AMF.UML.Activity_Partitions.Collections;
with AMF.UML.Classifiers.Collections;
with AMF.UML.Constraints.Collections;
with AMF.UML.Dependencies.Collections;
with AMF.UML.Exception_Handlers.Collections;
with AMF.UML.Input_Pins.Collections;
with AMF.UML.Interruptible_Activity_Regions.Collections;
with AMF.UML.Named_Elements;
with AMF.UML.Namespaces;
with AMF.UML.Output_Pins.Collections;
with AMF.UML.Packages.Collections;
with AMF.UML.Properties;
with AMF.UML.Read_Link_Object_End_Qualifier_Actions;
with AMF.UML.Redefinable_Elements.Collections;
with AMF.UML.String_Expressions;
with AMF.UML.Structured_Activity_Nodes;
with AMF.Visitors;
package AMF.Internals.UML_Read_Link_Object_End_Qualifier_Actions is
type UML_Read_Link_Object_End_Qualifier_Action_Proxy is
limited new AMF.Internals.UML_Named_Elements.UML_Named_Element_Proxy
and AMF.UML.Read_Link_Object_End_Qualifier_Actions.UML_Read_Link_Object_End_Qualifier_Action with null record;
overriding function Get_Object
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Input_Pins.UML_Input_Pin_Access;
-- Getter of ReadLinkObjectEndQualifierAction::object.
--
-- Gives the input pin from which the link object is obtained.
overriding procedure Set_Object
(Self : not null access UML_Read_Link_Object_End_Qualifier_Action_Proxy;
To : AMF.UML.Input_Pins.UML_Input_Pin_Access);
-- Setter of ReadLinkObjectEndQualifierAction::object.
--
-- Gives the input pin from which the link object is obtained.
overriding function Get_Qualifier
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Properties.UML_Property_Access;
-- Getter of ReadLinkObjectEndQualifierAction::qualifier.
--
-- The attribute representing the qualifier to be read.
overriding procedure Set_Qualifier
(Self : not null access UML_Read_Link_Object_End_Qualifier_Action_Proxy;
To : AMF.UML.Properties.UML_Property_Access);
-- Setter of ReadLinkObjectEndQualifierAction::qualifier.
--
-- The attribute representing the qualifier to be read.
overriding function Get_Result
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Output_Pins.UML_Output_Pin_Access;
-- Getter of ReadLinkObjectEndQualifierAction::result.
--
-- Pin where the result value is placed.
overriding procedure Set_Result
(Self : not null access UML_Read_Link_Object_End_Qualifier_Action_Proxy;
To : AMF.UML.Output_Pins.UML_Output_Pin_Access);
-- Setter of ReadLinkObjectEndQualifierAction::result.
--
-- Pin where the result value is placed.
overriding function Get_Context
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access;
-- Getter of Action::context.
--
-- The classifier that owns the behavior of which this action is a part.
overriding function Get_Input
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin;
-- Getter of Action::input.
--
-- The ordered set of input pins connected to the Action. These are among
-- the total set of inputs.
overriding function Get_Is_Locally_Reentrant
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return Boolean;
-- Getter of Action::isLocallyReentrant.
--
-- If true, the action can begin a new, concurrent execution, even if
-- there is already another execution of the action ongoing. If false, the
-- action cannot begin a new execution until any previous execution has
-- completed.
overriding procedure Set_Is_Locally_Reentrant
(Self : not null access UML_Read_Link_Object_End_Qualifier_Action_Proxy;
To : Boolean);
-- Setter of Action::isLocallyReentrant.
--
-- If true, the action can begin a new, concurrent execution, even if
-- there is already another execution of the action ongoing. If false, the
-- action cannot begin a new execution until any previous execution has
-- completed.
overriding function Get_Local_Postcondition
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
-- Getter of Action::localPostcondition.
--
-- Constraint that must be satisfied when executed is completed.
overriding function Get_Local_Precondition
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint;
-- Getter of Action::localPrecondition.
--
-- Constraint that must be satisfied when execution is started.
overriding function Get_Output
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin;
-- Getter of Action::output.
--
-- The ordered set of output pins connected to the Action. The action
-- places its results onto pins in this set.
overriding function Get_Handler
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Exception_Handlers.Collections.Set_Of_UML_Exception_Handler;
-- Getter of ExecutableNode::handler.
--
-- A set of exception handlers that are examined if an uncaught exception
-- propagates to the outer level of the executable node.
overriding function Get_Activity
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Activities.UML_Activity_Access;
-- Getter of ActivityNode::activity.
--
-- Activity containing the node.
overriding procedure Set_Activity
(Self : not null access UML_Read_Link_Object_End_Qualifier_Action_Proxy;
To : AMF.UML.Activities.UML_Activity_Access);
-- Setter of ActivityNode::activity.
--
-- Activity containing the node.
overriding function Get_In_Group
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group;
-- Getter of ActivityNode::inGroup.
--
-- Groups containing the node.
overriding function Get_In_Interruptible_Region
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region;
-- Getter of ActivityNode::inInterruptibleRegion.
--
-- Interruptible regions containing the node.
overriding function Get_In_Partition
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition;
-- Getter of ActivityNode::inPartition.
--
-- Partitions containing the node.
overriding function Get_In_Structured_Node
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access;
-- Getter of ActivityNode::inStructuredNode.
--
-- Structured activity node containing the node.
overriding procedure Set_In_Structured_Node
(Self : not null access UML_Read_Link_Object_End_Qualifier_Action_Proxy;
To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access);
-- Setter of ActivityNode::inStructuredNode.
--
-- Structured activity node containing the node.
overriding function Get_Incoming
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge;
-- Getter of ActivityNode::incoming.
--
-- Edges that have the node as target.
overriding function Get_Outgoing
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge;
-- Getter of ActivityNode::outgoing.
--
-- Edges that have the node as source.
overriding function Get_Redefined_Node
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node;
-- Getter of ActivityNode::redefinedNode.
--
-- Inherited nodes replaced by this node in a specialization of the
-- activity.
overriding function Get_Is_Leaf
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return Boolean;
-- Getter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding procedure Set_Is_Leaf
(Self : not null access UML_Read_Link_Object_End_Qualifier_Action_Proxy;
To : Boolean);
-- Setter of RedefinableElement::isLeaf.
--
-- Indicates whether it is possible to further redefine a
-- RedefinableElement. If the value is true, then it is not possible to
-- further redefine the RedefinableElement. Note that this property is
-- preserved through package merge operations; that is, the capability to
-- redefine a RedefinableElement (i.e., isLeaf=false) must be preserved in
-- the resulting RedefinableElement of a package merge operation where a
-- RedefinableElement with isLeaf=false is merged with a matching
-- RedefinableElement with isLeaf=true: the resulting RedefinableElement
-- will have isLeaf=false. Default value is false.
overriding function Get_Redefined_Element
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element;
-- Getter of RedefinableElement::redefinedElement.
--
-- The redefinable element that is being redefined by this element.
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier;
-- Getter of RedefinableElement::redefinitionContext.
--
-- References the contexts that this element may be redefined from.
overriding function Get_Client_Dependency
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency;
-- Getter of NamedElement::clientDependency.
--
-- Indicates the dependencies that reference the client.
overriding function Get_Name_Expression
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access;
-- Getter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding procedure Set_Name_Expression
(Self : not null access UML_Read_Link_Object_End_Qualifier_Action_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access);
-- Setter of NamedElement::nameExpression.
--
-- The string expression used to define the name of this named element.
overriding function Get_Namespace
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Getter of NamedElement::namespace.
--
-- Specifies the namespace that owns the NamedElement.
overriding function Get_Qualified_Name
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.Optional_String;
-- Getter of NamedElement::qualifiedName.
--
-- A name which allows the NamedElement to be identified within a
-- hierarchy of nested Namespaces. It is constructed from the names of the
-- containing namespaces starting at the root of the hierarchy and ending
-- with the name of the NamedElement itself.
overriding function Context
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access;
-- Operation Action::context.
--
-- Missing derivation for Action::/context : Classifier
overriding function Is_Consistent_With
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isConsistentWith.
--
-- The query isConsistentWith() specifies, for any two RedefinableElements
-- in a context in which redefinition is possible, whether redefinition
-- would be logically consistent. By default, this is false; this
-- operation must be overridden for subclasses of RedefinableElement to
-- define the consistency conditions.
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean;
-- Operation RedefinableElement::isRedefinitionContextValid.
--
-- The query isRedefinitionContextValid() specifies whether the
-- redefinition contexts of this RedefinableElement are properly related
-- to the redefinition contexts of the specified RedefinableElement to
-- allow this element to redefine the other. By default at least one of
-- the redefinition contexts of this element must be a specialization of
-- at least one of the redefinition contexts of the specified element.
overriding function All_Owning_Packages
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package;
-- Operation NamedElement::allOwningPackages.
--
-- The query allOwningPackages() returns all the directly or indirectly
-- owning packages.
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean;
-- Operation NamedElement::isDistinguishableFrom.
--
-- The query isDistinguishableFrom() determines whether two NamedElements
-- may logically co-exist within a Namespace. By default, two named
-- elements are distinguishable if (a) they have unrelated types or (b)
-- they have related types but different names.
overriding function Namespace
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access;
-- Operation NamedElement::namespace.
--
-- Missing derivation for NamedElement::/namespace : Namespace
overriding procedure Enter_Element
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Leave_Element
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of visitor interface.
overriding procedure Visit_Element
(Self : not null access constant UML_Read_Link_Object_End_Qualifier_Action_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control);
-- Dispatch call to corresponding subprogram of iterator interface.
end AMF.Internals.UML_Read_Link_Object_End_Qualifier_Actions;
|
RREE/ada-util | Ada | 3,145 | ads | -----------------------------------------------------------------------
-- util-streams-raw -- Raw streams for Unix based systems
-- Copyright (C) 2011, 2016, 2018, 2019 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.Finalization;
with Util.Systems.Os;
with Util.Systems.Types;
-- == Raw files ==
-- The <b>Util.Streams.Raw</b> package provides a stream directly on top of
-- file system operations <b>read</b> and <b>write</b>.
package Util.Streams.Raw is
-- -----------------------
-- File stream
-- -----------------------
-- The <b>Raw_Stream</b> is an output/input stream that reads or writes
-- into a file-based stream.
type Raw_Stream is new Ada.Finalization.Limited_Controlled and Output_Stream
and Input_Stream with private;
type Raw_Stream_Access is access all Raw_Stream'Class;
-- Initialize the raw stream to read and write on the given file descriptor.
procedure Initialize (Stream : in out Raw_Stream;
File : in Util.Systems.Os.File_Type);
-- Get the file descriptor associated with the stream.
function Get_File (Stream : in Raw_Stream) return Util.Systems.Os.File_Type;
-- Set the file descriptor to be used by the stream.
procedure Set_File (Stream : in out Raw_Stream;
File : in Util.Systems.Os.File_Type);
-- Close the stream.
overriding
procedure Close (Stream : in out Raw_Stream);
-- Write the buffer array to the output stream.
procedure Write (Stream : in out Raw_Stream;
Buffer : in Ada.Streams.Stream_Element_Array);
-- Read into the buffer as many bytes as possible and return in
-- <b>last</b> the position of the last byte read.
procedure Read (Stream : in out Raw_Stream;
Into : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset);
-- Reposition the read/write file offset.
procedure Seek (Stream : in out Raw_Stream;
Pos : in Util.Systems.Types.off_t;
Mode : in Util.Systems.Types.Seek_Mode);
private
use Ada.Streams;
-- Flush the stream and release the buffer.
procedure Finalize (Object : in out Raw_Stream);
type Raw_Stream is new Ada.Finalization.Limited_Controlled
and Output_Stream and Input_Stream with record
File : Util.Systems.Os.File_Type := Util.Systems.Os.NO_FILE;
end record;
end Util.Streams.Raw;
|
zhmu/ananas | Ada | 13,590 | adb | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . M E M O R Y --
-- --
-- B o d y --
-- --
-- Copyright (C) 2001-2022, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This version contains allocation tracking capability
-- The object file corresponding to this instrumented version is to be found
-- in libgmem.
-- When enabled, the subsystem logs all the calls to __gnat_malloc and
-- __gnat_free. This log can then be processed by gnatmem to detect
-- dynamic memory leaks.
-- To use this functionality, you must compile your application with -g
-- and then link with this object file:
-- gnatmake -g program -largs -lgmem
-- After compilation, you may use your program as usual except that upon
-- completion, it will generate in the current directory the file gmem.out.
-- You can then investigate for possible memory leaks and mismatch by calling
-- gnatmem with this file as an input:
-- gnatmem -i gmem.out program
-- See gnatmem section in the GNAT User's Guide for more details
-- NOTE: This capability is currently supported on the following targets:
-- Windows
-- AIX
-- GNU/Linux
-- HP-UX
-- Solaris
-- NOTE FOR FUTURE PLATFORMS SUPPORT: It is assumed that type Duration is
-- 64 bit. If the need arises to support architectures where this assumption
-- is incorrect, it will require changing the way timestamps of allocation
-- events are recorded.
pragma Source_File_Name (System.Memory, Body_File_Name => "memtrack.adb");
with Ada.Exceptions;
with GNAT.IO;
with System.Soft_Links;
with System.Traceback;
with System.Traceback_Entries;
with System.CRTL;
with System.OS_Lib;
with System.OS_Primitives;
package body System.Memory is
use Ada.Exceptions;
use System.Soft_Links;
use System.Traceback;
use System.Traceback_Entries;
use GNAT.IO;
function c_malloc (Size : size_t) return System.Address;
pragma Import (C, c_malloc, "malloc");
procedure c_free (Ptr : System.Address);
pragma Import (C, c_free, "free");
function c_realloc
(Ptr : System.Address; Size : size_t) return System.Address;
pragma Import (C, c_realloc, "realloc");
In_Child_After_Fork : Integer;
pragma Import (C, In_Child_After_Fork, "__gnat_in_child_after_fork");
subtype File_Ptr is CRTL.FILEs;
procedure Write (Ptr : System.Address; Size : size_t);
procedure Putc (Char : Character);
procedure Finalize;
pragma Export (C, Finalize, "__gnat_finalize");
-- Replace the default __gnat_finalize to properly close the log file
Address_Size : constant := System.Address'Max_Size_In_Storage_Elements;
-- Size in bytes of a pointer
Max_Call_Stack : constant := 200;
-- Maximum number of frames supported
Tracebk : Tracebacks_Array (1 .. Max_Call_Stack);
Num_Calls : aliased Integer := 0;
Gmemfname : constant String := "gmem.out" & ASCII.NUL;
-- Allocation log of a program is saved in a file gmem.out
-- ??? What about Ada.Command_Line.Command_Name & ".out" instead of static
-- gmem.out
Gmemfile : File_Ptr;
-- Global C file pointer to the allocation log
Needs_Init : Boolean := True;
-- Reset after first call to Gmem_Initialize
procedure Gmem_Initialize;
-- Initialization routine; opens the file and writes a header string. This
-- header string is used as a magic-tag to know if the .out file is to be
-- handled by GDB or by the GMEM (instrumented malloc/free) implementation.
First_Call : Boolean := True;
-- Depending on implementation, some of the traceback routines may
-- themselves do dynamic allocation. We use First_Call flag to avoid
-- infinite recursion
function Allow_Trace return Boolean;
pragma Inline (Allow_Trace);
-- Check if the memory trace is allowed
-----------------
-- Allow_Trace --
-----------------
function Allow_Trace return Boolean is
begin
if First_Call then
First_Call := False;
return In_Child_After_Fork = 0;
else
return False;
end if;
end Allow_Trace;
-----------
-- Alloc --
-----------
function Alloc (Size : size_t) return System.Address is
Result : aliased System.Address;
Actual_Size : aliased size_t := Size;
Timestamp : aliased Duration;
begin
if Size = size_t'Last then
Raise_Exception (Storage_Error'Identity, "object too large");
end if;
-- Change size from zero to non-zero. We still want a proper pointer
-- for the zero case because pointers to zero length objects have to
-- be distinct, but we can't just go ahead and allocate zero bytes,
-- since some malloc's return zero for a zero argument.
if Size = 0 then
Actual_Size := 1;
end if;
Lock_Task.all;
Result := c_malloc (Actual_Size);
if Allow_Trace then
-- Logs allocation call
-- format is:
-- 'A' <mem addr> <size chunk> <len backtrace> <addr1> ... <addrn>
if Needs_Init then
Gmem_Initialize;
end if;
Timestamp := System.OS_Primitives.Clock;
Call_Chain
(Tracebk, Max_Call_Stack, Num_Calls, Skip_Frames => 2);
Putc ('A');
Write (Result'Address, Address_Size);
Write (Actual_Size'Address, size_t'Max_Size_In_Storage_Elements);
Write (Timestamp'Address, Duration'Max_Size_In_Storage_Elements);
Write (Num_Calls'Address, Integer'Max_Size_In_Storage_Elements);
for J in Tracebk'First .. Tracebk'First + Num_Calls - 1 loop
declare
Ptr : System.Address := PC_For (Tracebk (J));
begin
Write (Ptr'Address, Address_Size);
end;
end loop;
First_Call := True;
end if;
Unlock_Task.all;
if Result = System.Null_Address then
Raise_Exception (Storage_Error'Identity, "heap exhausted");
end if;
return Result;
end Alloc;
--------------
-- Finalize --
--------------
procedure Finalize is
begin
if not Needs_Init and then CRTL.fclose (Gmemfile) /= 0 then
Put_Line ("gmem close error: " & OS_Lib.Errno_Message);
end if;
end Finalize;
----------
-- Free --
----------
procedure Free (Ptr : System.Address) is
Addr : aliased constant System.Address := Ptr;
Timestamp : aliased Duration;
begin
Lock_Task.all;
if Allow_Trace then
-- Logs deallocation call
-- format is:
-- 'D' <mem addr> <len backtrace> <addr1> ... <addrn>
if Needs_Init then
Gmem_Initialize;
end if;
Call_Chain
(Tracebk, Max_Call_Stack, Num_Calls, Skip_Frames => 2);
Timestamp := System.OS_Primitives.Clock;
Putc ('D');
Write (Addr'Address, Address_Size);
Write (Timestamp'Address, Duration'Max_Size_In_Storage_Elements);
Write (Num_Calls'Address, Integer'Max_Size_In_Storage_Elements);
for J in Tracebk'First .. Tracebk'First + Num_Calls - 1 loop
declare
Ptr : System.Address := PC_For (Tracebk (J));
begin
Write (Ptr'Address, Address_Size);
end;
end loop;
c_free (Ptr);
First_Call := True;
end if;
Unlock_Task.all;
end Free;
---------------------
-- Gmem_Initialize --
---------------------
procedure Gmem_Initialize is
Timestamp : aliased Duration;
File_Mode : constant String := "wb" & ASCII.NUL;
begin
if Needs_Init then
Needs_Init := False;
System.OS_Primitives.Initialize;
Timestamp := System.OS_Primitives.Clock;
Gmemfile := CRTL.fopen (Gmemfname'Address, File_Mode'Address);
if Gmemfile = System.Null_Address then
Put_Line ("Couldn't open gnatmem log file for writing");
OS_Lib.OS_Exit (255);
end if;
declare
S : constant String := "GMEM DUMP" & ASCII.LF;
begin
Write (S'Address, S'Length);
Write (Timestamp'Address, Duration'Max_Size_In_Storage_Elements);
end;
end if;
end Gmem_Initialize;
----------
-- Putc --
----------
procedure Putc (Char : Character) is
C : constant Integer := Character'Pos (Char);
begin
if CRTL.fputc (C, Gmemfile) /= C then
Put_Line ("gmem fputc error: " & OS_Lib.Errno_Message);
end if;
end Putc;
-------------
-- Realloc --
-------------
function Realloc
(Ptr : System.Address;
Size : size_t) return System.Address
is
Addr : aliased constant System.Address := Ptr;
Result : aliased System.Address;
Timestamp : aliased Duration;
begin
-- For the purposes of allocations logging, we treat realloc as a free
-- followed by malloc. This is not exactly accurate, but is a good way
-- to fit it into malloc/free-centered reports.
if Size = size_t'Last then
Raise_Exception (Storage_Error'Identity, "object too large");
end if;
Abort_Defer.all;
Lock_Task.all;
if Allow_Trace then
-- We first log deallocation call
if Needs_Init then
Gmem_Initialize;
end if;
Call_Chain
(Tracebk, Max_Call_Stack, Num_Calls, Skip_Frames => 2);
Timestamp := System.OS_Primitives.Clock;
Putc ('D');
Write (Addr'Address, Address_Size);
Write (Timestamp'Address, Duration'Max_Size_In_Storage_Elements);
Write (Num_Calls'Address, Integer'Max_Size_In_Storage_Elements);
for J in Tracebk'First .. Tracebk'First + Num_Calls - 1 loop
declare
Ptr : System.Address := PC_For (Tracebk (J));
begin
Write (Ptr'Address, Address_Size);
end;
end loop;
-- Now perform actual realloc
Result := c_realloc (Ptr, Size);
-- Log allocation call using the same backtrace
Putc ('A');
Write (Result'Address, Address_Size);
Write (Size'Address, size_t'Max_Size_In_Storage_Elements);
Write (Timestamp'Address, Duration'Max_Size_In_Storage_Elements);
Write (Num_Calls'Address, Integer'Max_Size_In_Storage_Elements);
for J in Tracebk'First .. Tracebk'First + Num_Calls - 1 loop
declare
Ptr : System.Address := PC_For (Tracebk (J));
begin
Write (Ptr'Address, Address_Size);
end;
end loop;
First_Call := True;
end if;
Unlock_Task.all;
Abort_Undefer.all;
if Result = System.Null_Address then
Raise_Exception (Storage_Error'Identity, "heap exhausted");
end if;
return Result;
end Realloc;
-----------
-- Write --
-----------
procedure Write (Ptr : System.Address; Size : size_t) is
function fwrite
(buffer : System.Address;
size : size_t;
count : size_t;
stream : File_Ptr) return size_t;
pragma Import (C, fwrite);
begin
if fwrite (Ptr, Size, 1, Gmemfile) /= 1 then
Put_Line ("gmem fwrite error: " & OS_Lib.Errno_Message);
end if;
end Write;
end System.Memory;
|
zhmu/ananas | Ada | 12,237 | ads | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . I N T E R R U P T S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies, Inc. --
-- --
------------------------------------------------------------------------------
-- Note: the compiler generates direct calls to this interface, via Rtsfind.
-- Any changes to this interface may require corresponding compiler changes.
-- This package encapsulates the implementation of interrupt or signal
-- handlers. It is logically an extension of the body of Ada.Interrupts. It
-- is made a child of System to allow visibility of various runtime system
-- internal data and operations.
-- See System.Interrupt_Management for core interrupt/signal interfaces
-- These two packages are separated to allow System.Interrupt_Management to be
-- used without requiring the whole tasking implementation to be linked and
-- elaborated.
with System.Tasking;
with System.Tasking.Protected_Objects.Entries;
with System.OS_Interface;
package System.Interrupts is
pragma Elaborate_Body;
-- Comment needed on why this is here ???
-------------------------
-- Constants and types --
-------------------------
Default_Interrupt_Priority : constant System.Interrupt_Priority :=
System.Interrupt_Priority'Last;
-- Default value used when a pragma Interrupt_Handler or Attach_Handler is
-- specified without an Interrupt_Priority pragma, see D.3(10).
type Ada_Interrupt_ID is range 0 .. System.OS_Interface.Max_Interrupt;
-- Avoid inheritance by Ada.Interrupts.Interrupt_ID of unwanted operations
type Interrupt_ID is range 0 .. System.OS_Interface.Max_Interrupt;
subtype System_Interrupt_Id is Interrupt_ID;
-- This synonym is introduced so that the type is accessible through
-- rtsfind, otherwise the name clashes with its homonym in Ada.Interrupts.
type Parameterless_Handler is access protected procedure;
----------------------
-- General services --
----------------------
-- Attempt to attach a Handler to an Interrupt to which an Entry is
-- already bound will raise a Program_Error.
function Is_Reserved (Interrupt : Interrupt_ID) return Boolean;
function Is_Entry_Attached (Interrupt : Interrupt_ID) return Boolean;
function Is_Handler_Attached (Interrupt : Interrupt_ID) return Boolean;
function Current_Handler
(Interrupt : Interrupt_ID) return Parameterless_Handler;
-- Calling the following procedures with New_Handler = null and Static =
-- true means that we want to modify the current handler regardless of the
-- previous handler's binding status. (i.e. we do not care whether it is a
-- dynamic or static handler)
procedure Attach_Handler
(New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
Static : Boolean := False);
procedure Exchange_Handler
(Old_Handler : out Parameterless_Handler;
New_Handler : Parameterless_Handler;
Interrupt : Interrupt_ID;
Static : Boolean := False);
procedure Detach_Handler
(Interrupt : Interrupt_ID;
Static : Boolean := False);
function Reference
(Interrupt : Interrupt_ID) return System.Address;
--------------------------------
-- Interrupt Entries Services --
--------------------------------
-- Routines needed for Interrupt Entries
procedure Bind_Interrupt_To_Entry
(T : System.Tasking.Task_Id;
E : System.Tasking.Task_Entry_Index;
Int_Ref : System.Address);
-- Bind the given interrupt to the given entry. If the interrupt is
-- already bound to another entry, Program_Error will be raised.
procedure Detach_Interrupt_Entries (T : System.Tasking.Task_Id);
-- This procedure detaches all the Interrupt Entries bound to a task
------------------------------
-- POSIX.5 Signals Services --
------------------------------
-- Routines needed for POSIX dot5 POSIX_Signals
procedure Block_Interrupt (Interrupt : Interrupt_ID);
-- Block the Interrupt on the process level
procedure Unblock_Interrupt (Interrupt : Interrupt_ID);
function Unblocked_By
(Interrupt : Interrupt_ID) return System.Tasking.Task_Id;
-- It returns the ID of the last Task which Unblocked this Interrupt.
-- It returns Null_Task if no tasks have ever requested the Unblocking
-- operation or the Interrupt is currently Blocked.
function Is_Blocked (Interrupt : Interrupt_ID) return Boolean;
-- Comment needed ???
procedure Ignore_Interrupt (Interrupt : Interrupt_ID);
-- Set the sigaction for the interrupt to SIG_IGN
procedure Unignore_Interrupt (Interrupt : Interrupt_ID);
-- Comment needed ???
function Is_Ignored (Interrupt : Interrupt_ID) return Boolean;
-- Comment needed ???
-- Note : Direct calls to sigaction, sigprocmask, thr_sigsetmask, or any
-- other low-level interface that changes the signal action or signal mask
-- needs careful thought.
-- One may achieve the effect of system calls first making RTS blocked (by
-- calling Block_Interrupt) for the signal under consideration. This will
-- make all the tasks in RTS blocked for the Interrupt.
----------------------
-- Protection Types --
----------------------
-- Routines and types needed to implement Interrupt_Handler and
-- Attach_Handler.
-- There are two kinds of protected objects that deal with interrupts:
-- (1) Only Interrupt_Handler pragmas are used. We need to be able to tell
-- if an Interrupt_Handler applies to a given procedure, so
-- Register_Interrupt_Handler has to be called for all the potential
-- handlers, it should be done by calling Register_Interrupt_Handler with
-- the handler code address. On finalization, which can happen only has
-- part of library level finalization since PO with Interrupt_Handler
-- pragmas can only be declared at library level, nothing special needs to
-- be done since the default handlers have been restored as part of task
-- completion which is done just before global finalization.
-- Dynamic_Interrupt_Protection should be used in this case.
-- (2) Attach_Handler pragmas are used, and possibly Interrupt_Handler
-- pragma. We need to attach the handlers to the given interrupts when the
-- object is elaborated. This should be done by constructing an array of
-- pairs (interrupt, handler) from the pragmas and calling Install_Handlers
-- with it (types to be used are New_Handler_Item and New_Handler_Array).
-- On finalization, we need to restore the handlers that were installed
-- before the elaboration of the PO, so we need to store these previous
-- handlers. This is also done by Install_Handlers, the room for this
-- information is provided by adding a discriminant which is the number
-- of Attach_Handler pragmas and an array of this size in the protection
-- type, Static_Interrupt_Protection.
procedure Register_Interrupt_Handler
(Handler_Addr : System.Address);
-- This routine should be called by the compiler to allow the handler be
-- used as an Interrupt Handler. That means call this procedure for each
-- pragma Interrupt_Handler providing the address of the handler (not
-- including the pointer to the actual PO, this way this routine is called
-- only once for each type definition of PO).
type Static_Handler_Index is range 0 .. Integer'Last;
subtype Positive_Static_Handler_Index is
Static_Handler_Index range 1 .. Static_Handler_Index'Last;
-- Comment needed ???
type Previous_Handler_Item is record
Interrupt : Interrupt_ID;
Handler : Parameterless_Handler;
Static : Boolean;
end record;
-- Contains all the information needed to restore a previous handler
type Previous_Handler_Array is array
(Positive_Static_Handler_Index range <>) of Previous_Handler_Item;
type New_Handler_Item is record
Interrupt : Interrupt_ID;
Handler : Parameterless_Handler;
end record;
-- Contains all the information from an Attach_Handler pragma
type New_Handler_Array is
array (Positive_Static_Handler_Index range <>) of New_Handler_Item;
-- Comment needed ???
-- Case (1)
type Dynamic_Interrupt_Protection is new
Tasking.Protected_Objects.Entries.Protection_Entries with null record;
-- ??? Finalize is not overloaded since we currently have no
-- way to detach the handlers during library level finalization.
function Has_Interrupt_Or_Attach_Handler
(Object : access Dynamic_Interrupt_Protection) return Boolean;
-- Returns True
-- Case (2)
type Static_Interrupt_Protection
(Num_Entries : Tasking.Protected_Objects.Protected_Entry_Index;
Num_Attach_Handler : Static_Handler_Index)
is new
Tasking.Protected_Objects.Entries.Protection_Entries (Num_Entries) with
record
Previous_Handlers : Previous_Handler_Array (1 .. Num_Attach_Handler);
end record;
function Has_Interrupt_Or_Attach_Handler
(Object : access Static_Interrupt_Protection) return Boolean;
-- Returns True
overriding procedure Finalize (Object : in out Static_Interrupt_Protection);
-- Restore previous handlers as required by C.3.1(12) then call
-- Finalize (Protection).
procedure Install_Handlers
(Object : access Static_Interrupt_Protection;
New_Handlers : New_Handler_Array);
-- Store the old handlers in Object.Previous_Handlers and install
-- the new static handlers.
procedure Install_Restricted_Handlers
(Prio : Interrupt_Priority;
Handlers : New_Handler_Array);
-- Install the static Handlers for the given interrupts and do not
-- store previously installed handlers. This procedure is used when
-- the Ravenscar restrictions are in place since in that case there
-- are only library-level protected handlers that will be installed
-- at initialization and never be replaced.
end System.Interrupts;
|
reznikmm/clic | Ada | 784 | ads | package CLIC.Config.Info is
function List (This : CLIC.Config.Instance;
Filter : String := ".*";
Show_Origin : Boolean := False)
return AAA.Strings.Vector;
-- Return a Vector of String that contains a list of configuration
-- key/value as seen in the configuration. When Show_Origin is true,
-- the configuration file where each key was loaded is also listed.
--
-- The keys not matching the Filter regular expression (see GNAT.Regpat)
-- are ignored.
function List_Keys (This : CLIC.Config.Instance;
Filter : String := ".*")
return AAA.Strings.Vector;
-- Same as above but only return the config keys
end CLIC.Config.Info;
|
reznikmm/matreshka | Ada | 24,670 | adb | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
package body AMF.Internals.UML_Destroy_Link_Actions is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Destroy_Link_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Destroy_Link_Action
(AMF.UML.Destroy_Link_Actions.UML_Destroy_Link_Action_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Destroy_Link_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Destroy_Link_Action
(AMF.UML.Destroy_Link_Actions.UML_Destroy_Link_Action_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Destroy_Link_Action_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Destroy_Link_Action
(Visitor,
AMF.UML.Destroy_Link_Actions.UML_Destroy_Link_Action_Access (Self),
Control);
end if;
end Visit_Element;
------------------
-- Get_End_Data --
------------------
overriding function Get_End_Data
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Link_End_Destruction_Datas.Collections.Set_Of_UML_Link_End_Destruction_Data is
begin
return
AMF.UML.Link_End_Destruction_Datas.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_End_Data
(Self.Element)));
end Get_End_Data;
------------------
-- Get_End_Data --
------------------
overriding function Get_End_Data
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Link_End_Datas.Collections.Set_Of_UML_Link_End_Data is
begin
return
AMF.UML.Link_End_Datas.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_End_Data
(Self.Element)));
end Get_End_Data;
---------------------
-- Get_Input_Value --
---------------------
overriding function Get_Input_Value
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Input_Pins.Collections.Set_Of_UML_Input_Pin is
begin
return
AMF.UML.Input_Pins.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Input_Value
(Self.Element)));
end Get_Input_Value;
-----------------
-- Get_Context --
-----------------
overriding function Get_Context
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access is
begin
return
AMF.UML.Classifiers.UML_Classifier_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Context
(Self.Element)));
end Get_Context;
---------------
-- Get_Input --
---------------
overriding function Get_Input
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin is
begin
return
AMF.UML.Input_Pins.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Input
(Self.Element)));
end Get_Input;
------------------------------
-- Get_Is_Locally_Reentrant --
------------------------------
overriding function Get_Is_Locally_Reentrant
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Locally_Reentrant
(Self.Element);
end Get_Is_Locally_Reentrant;
------------------------------
-- Set_Is_Locally_Reentrant --
------------------------------
overriding procedure Set_Is_Locally_Reentrant
(Self : not null access UML_Destroy_Link_Action_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Locally_Reentrant
(Self.Element, To);
end Set_Is_Locally_Reentrant;
-----------------------------
-- Get_Local_Postcondition --
-----------------------------
overriding function Get_Local_Postcondition
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
begin
return
AMF.UML.Constraints.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Postcondition
(Self.Element)));
end Get_Local_Postcondition;
----------------------------
-- Get_Local_Precondition --
----------------------------
overriding function Get_Local_Precondition
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
begin
return
AMF.UML.Constraints.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Precondition
(Self.Element)));
end Get_Local_Precondition;
----------------
-- Get_Output --
----------------
overriding function Get_Output
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin is
begin
return
AMF.UML.Output_Pins.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Output
(Self.Element)));
end Get_Output;
-----------------
-- Get_Handler --
-----------------
overriding function Get_Handler
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Exception_Handlers.Collections.Set_Of_UML_Exception_Handler is
begin
return
AMF.UML.Exception_Handlers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Handler
(Self.Element)));
end Get_Handler;
------------------
-- Get_Activity --
------------------
overriding function Get_Activity
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Activities.UML_Activity_Access is
begin
return
AMF.UML.Activities.UML_Activity_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Activity
(Self.Element)));
end Get_Activity;
------------------
-- Set_Activity --
------------------
overriding procedure Set_Activity
(Self : not null access UML_Destroy_Link_Action_Proxy;
To : AMF.UML.Activities.UML_Activity_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Activity
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Activity;
------------------
-- Get_In_Group --
------------------
overriding function Get_In_Group
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group is
begin
return
AMF.UML.Activity_Groups.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Group
(Self.Element)));
end Get_In_Group;
---------------------------------
-- Get_In_Interruptible_Region --
---------------------------------
overriding function Get_In_Interruptible_Region
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region is
begin
return
AMF.UML.Interruptible_Activity_Regions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Interruptible_Region
(Self.Element)));
end Get_In_Interruptible_Region;
----------------------
-- Get_In_Partition --
----------------------
overriding function Get_In_Partition
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition is
begin
return
AMF.UML.Activity_Partitions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Partition
(Self.Element)));
end Get_In_Partition;
----------------------------
-- Get_In_Structured_Node --
----------------------------
overriding function Get_In_Structured_Node
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access is
begin
return
AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Structured_Node
(Self.Element)));
end Get_In_Structured_Node;
----------------------------
-- Set_In_Structured_Node --
----------------------------
overriding procedure Set_In_Structured_Node
(Self : not null access UML_Destroy_Link_Action_Proxy;
To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_In_Structured_Node
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_In_Structured_Node;
------------------
-- Get_Incoming --
------------------
overriding function Get_Incoming
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge is
begin
return
AMF.UML.Activity_Edges.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Incoming
(Self.Element)));
end Get_Incoming;
------------------
-- Get_Outgoing --
------------------
overriding function Get_Outgoing
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge is
begin
return
AMF.UML.Activity_Edges.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Outgoing
(Self.Element)));
end Get_Outgoing;
------------------------
-- Get_Redefined_Node --
------------------------
overriding function Get_Redefined_Node
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node is
begin
return
AMF.UML.Activity_Nodes.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Node
(Self.Element)));
end Get_Redefined_Node;
-----------------
-- Get_Is_Leaf --
-----------------
overriding function Get_Is_Leaf
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Leaf
(Self.Element);
end Get_Is_Leaf;
-----------------
-- Set_Is_Leaf --
-----------------
overriding procedure Set_Is_Leaf
(Self : not null access UML_Destroy_Link_Action_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Leaf
(Self.Element, To);
end Set_Is_Leaf;
---------------------------
-- Get_Redefined_Element --
---------------------------
overriding function Get_Redefined_Element
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element is
begin
return
AMF.UML.Redefinable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Element
(Self.Element)));
end Get_Redefined_Element;
------------------------------
-- Get_Redefinition_Context --
------------------------------
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context
(Self.Element)));
end Get_Redefinition_Context;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Destroy_Link_Action_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-----------------
-- Association --
-----------------
overriding function Association
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Associations.UML_Association_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Association unimplemented");
raise Program_Error with "Unimplemented procedure UML_Destroy_Link_Action_Proxy.Association";
return Association (Self);
end Association;
-------------
-- Context --
-------------
overriding function Context
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Context unimplemented");
raise Program_Error with "Unimplemented procedure UML_Destroy_Link_Action_Proxy.Context";
return Context (Self);
end Context;
------------------------
-- Is_Consistent_With --
------------------------
overriding function Is_Consistent_With
(Self : not null access constant UML_Destroy_Link_Action_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Destroy_Link_Action_Proxy.Is_Consistent_With";
return Is_Consistent_With (Self, Redefinee);
end Is_Consistent_With;
-----------------------------------
-- Is_Redefinition_Context_Valid --
-----------------------------------
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Destroy_Link_Action_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented");
raise Program_Error with "Unimplemented procedure UML_Destroy_Link_Action_Proxy.Is_Redefinition_Context_Valid";
return Is_Redefinition_Context_Valid (Self, Redefined);
end Is_Redefinition_Context_Valid;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Destroy_Link_Action_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Destroy_Link_Action_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Destroy_Link_Action_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Destroy_Link_Action_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Destroy_Link_Action_Proxy.Namespace";
return Namespace (Self);
end Namespace;
end AMF.Internals.UML_Destroy_Link_Actions;
|
annexi-strayline/AURA | Ada | 19,694 | adb | ------------------------------------------------------------------------------
-- --
-- Ada User Repository Annex (AURA) --
-- ANNEXI-STRAYLINE Reference Implementation --
-- --
-- Command Line Interface --
-- --
-- ------------------------------------------------------------------------ --
-- --
-- Copyright (C) 2020, ANNEXI-STRAYLINE Trans-Human Ltd. --
-- All rights reserved. --
-- --
-- Original Contributors: --
-- * Richard Wai (ANNEXI-STRAYLINE) --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- --
-- * Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
with Ada.Text_IO;
with Ada.Directories;
with Ada.Assertions;
with Ada.Strings.Wide_Wide_Fixed;
with Unit_Names;
with Platform_Info;
with Repositories;
with Registrar.Queries;
with Registrar.Last_Run;
with Registrar.Subsystems;
with Registrar.Registration;
with Registrar.Library_Units;
with Registrar.Source_Files;
with Workers, Workers.Reporting;
with Child_Processes.Path_Searching;
package body Build.Compilation is
procedure Assert (Check: in Boolean; Message: in String)
renames Ada.Assertions.Assert;
New_Line: Character renames Workers.Reporting.New_Line;
package Program_Paths renames Child_Processes.Path_Searching;
Compiler_Program: aliased constant String
:= Platform_Info.Toolchain_Prefix & "gcc";
Compiler: constant Program_Paths.Elaboration_Path_Search
:= Program_Paths.Initialize (Compiler_Program);
--
-- Compilation Order Support Utilities
--
-- Select_Configuration_Subsystem --
------------------------------------
-- Basically, for non-AURA subsystem units, we need to select the AURA
-- subsystem
function Select_Configuration_Subsystem
(Unit: Registrar.Library_Units.Library_Unit)
return Registrar.Subsystems.Subsystem
is
use Registrar.Subsystems;
begin
return Unit_Subsys: Subsystem
:= Registrar.Queries.Lookup_Subsystem (Unit.Name.Subsystem_Name)
do
if not Unit_Subsys.AURA then
Unit_Subsys := Registrar.Queries.Lookup_Subsystem
(Unit_Names.Set_Name ("aura"));
end if;
end return;
end Select_Configuration_Subsystem;
-- Compute_Arguments --
-----------------------
-- Compute all of the arguments needed to pass to the compiler to compile
-- Unit.
--
-- Opportunistically determine if the Unit is a member of a "System" format
-- Repository
function Compute_Arguments
(Unit : in Registrar.Library_Units.Library_Unit;
Config : in Build_Configuration;
From_System_Repo: out Boolean)
return String
is
package WWF renames Ada.Strings.Wide_Wide_Fixed;
use type Registrar.Source_Files.Source_File_Access;
use UBS;
use Repositories;
use Registrar.Subsystems;
use Registrar.Library_Units;
Unit_Subsys: constant Subsystem := Select_Configuration_Subsystem (Unit);
Available_Subsystems: constant Subsystem_Sets.Set
:= Registrar.Queries.Available_Subsystems;
Buffer: Unbounded_String := To_Unbounded_String ("-c");
procedure Add_Codepaths (Subsys: in Subsystem) is
-- Append includes for the subsystem and all configured codepaths to
-- the buffer
Subsys_Path: constant String := "../" & Subsys.Name.To_UTF8_String;
begin
Append (Buffer, " -I" & Subsys_Path);
for Codepath_Pair of Subsys.Configuration.Codepaths loop
Append (Buffer, " -I" & Subsys_Path & '/'
& UBS.To_String (Codepath_Pair.Value));
end loop;
end Add_Codepaths;
begin
pragma Assert (Unit.State /= Requested
and then Unit.Kind not in Unknown | Subunit);
-- We take advantage of pulling the unit's subsystem to look for
-- units from "System" repositories. Such units are not to be compiled
if Unit_Subsys.AURA and then
Extract_Repository(Unit_Subsys.Source_Repository).Format = System
then
From_System_Repo := True;
return "";
else
From_System_Repo := False;
end if;
-- Includes. Assume the "current directory" of the compiler command
-- is Build_Root (and therefore the root directory is at ../)
-- First include our own subsystem, and codepaths for AURA, or
-- the project root for non-aura
-- (See comment below as to why the next block is commented-out)
-- if Unit_Subsys.AURA then
-- Add_Codepaths (Unit_Subsys);
-- else
-- Append (Buffer, " -I../");
-- end if;
-- Always include the project root, but also the aura subdirectory
-- since that contains the configuration units
Append (Buffer, " -I../");
Append (Buffer, " -I../aura/");
-- Now the subsystems of all dependencies of this unit, and their
-- codepaths. Obviously we don't want to needlessly add the same
-- subsystems over and over, so we'll create a set a subset
-- Note that the below is the "original" code. However, this approach,
-- though more efficient, is not always compatbile with GNAT. If other
-- toolchains can handle this approach, then this code can be selectively
-- reactivated at a later time.
-- declare
-- Dependent_Subsys: Subsystem_Sets.Set;
-- begin
--
-- for Dep of Registrar.Queries.Unit_Dependencies (Unit.Name) loop
-- declare
-- Dep_Subsys: constant Subsystem_Sets.Cursor
-- := Available_Subsystems.Find
-- (Subsystem'(Name => Dep.Subsystem_Name, others => <>));
-- begin
-- Dependent_Subsys.Include (Subsystem_Sets.Element (Dep_Subsys));
-- end;
-- end loop;
--
-- for Subsys of Dependent_Subsys loop
-- Add_Codepaths (Subsys);
-- end loop;
-- end;
-- The issue is that GNAT uses a "macro expansion" approach to generics.
-- This means that generic library units cannot truly be "separately
-- compiled", and where these units (or other public generics) are used,
-- the dependencies of those generics because virtual dependencies of the
-- unit which instantiates the generic.
--
-- After some deep consideration, it was decided that the trade-off of
-- simply including the codepaths for all needed Subsystems for the
-- compilation of every Ada unit was not signficant enough to justify the
-- much more intense approach to do dependency hoisting for generic
-- instantiations, which would be a very singificant effort.
for Subsys of Registrar.Queries.Available_Subsystems loop
-- At the compilation stage, all required subsystems should be
-- available.
-- Don't include non-aura subsystems, since they are all in the
-- root directory
if Subsys.AURA then
Add_Codepaths (Subsys);
end if;
end loop;
-- For external units, we (for now) we support only c files
if Unit.Kind = External_Unit then
Assert (Check => WWF.Tail (Source => Unit.Name.To_String,
Count => 2) = ".c",
Message => "Only ""C"" External Units can be compiled");
-- Definitions
for Def_Pair of Unit_Subsys.Configuration.C_Definitions loop
Append (Buffer, " -D");
Append (Buffer, Def_Pair.Value);
end loop;
-- Compiler options
for Opt_Pair of Unit_Subsys.Configuration.C_Compiler_Opts loop
Append (Buffer, ' ' & UBS.To_String (Opt_Pair.Value));
end loop;
else
-- Must be Ada
-- Compiler options
for Opt_Pair of Unit_Subsys.Configuration.Ada_Compiler_Opts loop
Append (Buffer, ' ' & UBS.To_String (Opt_Pair.Value));
end loop;
end if;
-- Now add the global config options (currently GNAT-specific) - this
-- makes sure that they override any others
if Config.Position_Independent then
Append (Buffer, " -fPIC");
else
Append (Buffer, " -fno-PIC");
end if;
if Config.Debug_Enabled then
Append (Buffer, " -g");
end if;
if Config.All_Assertions and then Unit.Kind /= External_Unit then
Append (Buffer, " -gnata");
end if;
case Config.Optimization is
when None => null;
when Level_1 => Append (Buffer, " -O1");
when Level_2 => Append (Buffer, " -O2");
when Level_3 => Append (Buffer, " -O3");
when Size => Append (Buffer, " -Os");
when Debug => Append (Buffer, " -Og");
end case;
-- Finally append the file name
if Unit.Body_File /= null then
-- This applies to external units and ada units
Append (Buffer, ' ' & Unit.Body_File.Full_Name);
else
pragma Assert (Unit.Kind in Package_Unit | Subprogram_Unit);
Append (Buffer, ' ' & Unit.Spec_File.Full_Name);
end if;
return To_String (Buffer);
end Compute_Arguments;
------------------------
-- Compilation_Orders --
------------------------
type Compilation_Order is new Workers.Work_Order with
record
Unit : Registrar.Library_Units.Library_Unit;
Config: Build_Configuration;
end record;
overriding function Image (Order: Compilation_Order) return String;
overriding procedure Execute (Order: in out Compilation_Order);
function Image (Order: Compilation_Order) return String is
( "[Compilation_Order] (Build.Compilation)" & New_Line
& " Unit: " & Order.Unit.Name.To_UTF8_String);
procedure Execute (Order: in out Compilation_Order) is
package TIO renames Ada.Text_IO;
Unit: Registrar.Library_Units.Library_Unit
renames Order.Unit;
Unit_Name: constant String := Unit.Name.To_UTF8_String;
From_System_Repo: Boolean;
Args: constant String
:= Compute_Arguments (Unit, Order.Config, From_System_Repo);
begin
-- If the unit is a member of a subsystem that is checked out from a
-- "System" format Repository, we never actually compile it - rather
-- the reverse dependencies are triggered. In order to keep that
-- considerably more complicated process (Compute_Recompilations),
-- it treats such units the same as all others.
--
-- Therefore if we find that we have such a unit, we just rehash the
-- compilation products (thus promoting the unit to State = Compiled),
-- and complete the order.
--
-- It just so happens that Compute_Arguments needs to look at the
-- owning subsystem anyways. Therefore the actual logic to check this
-- is in that function, to improve efficiency
if From_System_Repo then
Direct_Hash_Compilation_Products (Unit);
return;
end if;
-- Start by writing out the command line
declare
use TIO;
CMD_OUT: File_Type;
begin
Create (File => CMD_OUT,
Name => Build_Output_Root & '/'
& Unit_Name & ".cmd");
Put_Line (CMD_OUT, "Compiler used:");
Put_Line (CMD_OUT, Program_Paths.Image_Path (Compiler));
Put_Line (CMD_OUT, "Arguments used:");
Put_Line (CMD_OUT, Args);
Close (CMD_OUT);
end;
-- Now do the compilation!
declare
use Child_Processes;
Compile_Process: Child_Process'Class := Spawn_Process
(Image_Path => Program_Paths.Image_Path (Compiler),
Arguments => Args,
Working_Directory => Build_Root);
Timed_Out: Boolean;
Status : Exit_Status;
STDOUT_Buffer, STDERR_Buffer: UBS.Unbounded_String;
begin
Wait_And_Buffer (Process => Compile_Process,
Poll_Rate => 0.2,
Timeout => 600.0, -- Aggressive..
Output => STDOUT_Buffer,
Error => STDERR_Buffer,
Timed_Out => Timed_Out,
Status => Status);
if not Compile_Process.Terminated then
Compile_Process.Kill;
delay 0.5; -- Should be more than long enough!
if not Compile_Process.Terminated then
Compile_Process.Nuke;
end if;
end if;
-- Dump stdout and stderr (if non-empty) to their files
declare
use TIO;
STDOUT_File, STDERR_File: File_Type;
begin
if UBS.Length (STDOUT_Buffer) > 0 then
Create (File => STDOUT_File,
Name => Build_Output_Root & '/'
& Unit_Name & ".out");
Put (STDOUT_File, UBS.To_String (STDOUT_Buffer));
Close (STDOUT_File);
end if;
if UBS.Length (STDERR_Buffer) > 0 then
Create (File => STDERR_File,
Name => Build_Output_Root & '/'
& Unit_Name & ".err");
Put (STDERR_File, UBS.To_String (STDERR_Buffer));
Close (STDERR_File);
end if;
end;
-- Timeout is a fatal error - not your "typical" compilation
-- failure
Assert (Check => not Timed_Out,
Message => "Compilation timed-out. "
& "Check compiler output files.");
-- Unsuccessful exit status generally means the compilation failed,
-- A non-empty STDERR buffer means warnings. Both mean a "common"
-- failure that needs to be intercepted (avoiding a work report),
-- and a submission of the error output to the Compilation_Messages
-- queue
if UBS.Length (STDERR_Buffer) > 0 then
Compiler_Messages.Enqueue
(Compiler_Message'(Unit => Unit,
Context => (if Status = Success then
Warning
else
Error),
STDERR => STDERR_Buffer));
end if;
if Status /= Success then
-- Only actual non-successful exit statuses warrent a "failure"
-- Deatch the tracker so that the worker won't touch it, and then
-- increment failure. There is no phase trigger for compilation
-- orders
Order.Tracker.Increment_Failed_Items;
Order.Tracker := null;
end if;
if Status = Success then
Unit.State := Registrar.Library_Units.Compiled;
Registrar.Registration.Update_Library_Unit (Unit);
end if;
end;
end Execute;
-------------
-- Compile --
-------------
procedure Compile (Configuration: in Build_Configuration) is
use Registrar.Library_Units;
New_Order: Compilation_Order
:= (Tracker => Compilation_Progress'Access,
Config => Configuration,
others => <>);
Avail_Units: constant Library_Unit_Sets.Set
:= Registrar.Queries.Available_Library_Units;
begin
-- Verify that we actually know where the compiler is before we dispatch
-- a bunch of doomed work-orders. This will create one single obvious
-- error rather than an unbounded number of hours if we don't do this
-- here
if not Program_Paths.Found (Compiler) then
raise Program_Error with
"Unable to compile: Could not find the compiler ("
& Compiler_Program & ")!";
end if;
Compilation_Progress.Increase_Total_Items_By
(Natural (Avail_Units.Length));
for Unit of Avail_Units loop
New_Order.Unit := Unit;
Workers.Enqueue_Order (New_Order);
end loop;
end Compile;
end Build.Compilation;
|
charlie5/cBound | Ada | 1,602 | 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_floatv_request_t is
-- Item
--
type Item is record
major_opcode : aliased Interfaces.Unsigned_8;
minor_opcode : aliased Interfaces.Unsigned_8;
length : aliased Interfaces.Unsigned_16;
context_tag : aliased xcb.xcb_glx_context_tag_t;
pname : aliased Interfaces.Unsigned_32;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_glx_get_floatv_request_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_floatv_request_t.Item,
Element_Array => xcb.xcb_glx_get_floatv_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_floatv_request_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_glx_get_floatv_request_t.Pointer,
Element_Array => xcb.xcb_glx_get_floatv_request_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_glx_get_floatv_request_t;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.