repo_name
stringlengths
9
74
language
stringclasses
1 value
length_bytes
int64
11
9.34M
extension
stringclasses
2 values
content
stringlengths
11
9.34M
reznikmm/matreshka
Ada
4,688
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.Has_Persistent_Data_Attributes is ------------ -- Create -- ------------ overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Table_Has_Persistent_Data_Attribute_Node is begin return Self : Table_Has_Persistent_Data_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_Has_Persistent_Data_Attribute_Node) return League.Strings.Universal_String is pragma Unreferenced (Self); begin return Matreshka.ODF_String_Constants.Has_Persistent_Data_Attribute; end Get_Local_Name; begin Matreshka.DOM_Documents.Register_Attribute (Matreshka.ODF_String_Constants.Table_URI, Matreshka.ODF_String_Constants.Has_Persistent_Data_Attribute, Table_Has_Persistent_Data_Attribute_Node'Tag); end Matreshka.ODF_Table.Has_Persistent_Data_Attributes;
reznikmm/webidl
Ada
1,003
ads
-- SPDX-FileCopyrightText: 2021 Max Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT ------------------------------------------------------------- with League.String_Vectors; with WebIDL.Parsers; with WebIDL.Scanners; with WebIDL.String_Sources; with WebIDL.Token_Handlers; with WebIDL.Tokens; package WebIDL.Lexers is pragma Preelaborate; type Lexer is limited new WebIDL.Parsers.Abstract_Lexer with private; procedure Initialize (Self : in out Lexer'Class; Text : League.String_Vectors.Universal_String_Vector); private type Lexer is limited new WebIDL.Parsers.Abstract_Lexer with record Vector : League.String_Vectors.Universal_String_Vector; Source : aliased WebIDL.String_Sources.String_Source; Scanner : aliased WebIDL.Scanners.Scanner; Handler : aliased WebIDL.Token_Handlers.Handler; end record; overriding procedure Next_Token (Self : in out Lexer; Value : out WebIDL.Tokens.Token); end WebIDL.Lexers;
onox/orka
Ada
745
ads
-- SPDX-License-Identifier: Apache-2.0 -- -- Copyright (c) 2022 onox <[email protected]> -- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at -- -- http://www.apache.org/licenses/LICENSE-2.0 -- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. package Orka.SIMD.AVX.Longs.Shift is pragma Pure; end Orka.SIMD.AVX.Longs.Shift;
charlie5/cBound
Ada
1,603
ads
-- This file is generated by SWIG. Please do not modify by hand. -- with Interfaces; with swig; with Interfaces.C; with Interfaces.C.Pointers; package xcb.xcb_ungrab_key_request_t is -- Item -- type Item is record major_opcode : aliased Interfaces.Unsigned_8; key : aliased xcb.xcb_keycode_t; length : aliased Interfaces.Unsigned_16; grab_window : aliased xcb.xcb_window_t; modifiers : aliased Interfaces.Unsigned_16; pad0 : aliased swig.int8_t_Array (0 .. 1); end record; -- Item_Array -- type Item_Array is array (Interfaces.C.size_t range <>) of aliased xcb.xcb_ungrab_key_request_t .Item; -- Pointer -- package C_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_ungrab_key_request_t.Item, Element_Array => xcb.xcb_ungrab_key_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_ungrab_key_request_t .Pointer; -- Pointer_Pointer -- package C_Pointer_Pointers is new Interfaces.C.Pointers (Index => Interfaces.C.size_t, Element => xcb.xcb_ungrab_key_request_t.Pointer, Element_Array => xcb.xcb_ungrab_key_request_t.Pointer_Array, Default_Terminator => null); subtype Pointer_Pointer is C_Pointer_Pointers.Pointer; end xcb.xcb_ungrab_key_request_t;
reznikmm/markdown
Ada
389
ads
-- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT ---------------------------------------------------------------- private package Markdown.Inline_Parsers.Autolinks is procedure Find (Text : Plain_Texts.Plain_Text; Cursor : Position; State : in out Optional_Inline_State); end Markdown.Inline_Parsers.Autolinks;
AdaCore/training_material
Ada
1,061
adb
with Ada.Text_IO; use Ada.Text_IO; procedure Main is -- type Number_Of_Tests_T is ? -- type Test_Score_Total_T is ? -- Number_Of_Tests : Number_Of_Tests_T; -- Test_Score_Total : Test_Score_Total_T; -- type Degrees_T is ? -- Angle : Degrees_T; -- type Cymk_T is ? -- Color : Cymk_T; begin Put_Line ("Basic Types"); -- assignment -- Number_Of_Tests := ? -- Test_Score_Total := ? -- Angle := ? -- Color := ? -- Put_Line (Number_Of_Tests_T'Image(Number_Of_Tests)); -- Put_Line (Test_Score_Total_T'Image(Test_Score_Total)); -- Put_Line (Angle_T'Image(Angle)); -- Put_Line (Color_T'Image(Color)); -- operations / attributes -- Test_Score_Total := ? -- Divide total score by number of tests -- Angle := ? -- Add 359 to the initial value -- Color := ? -- Set to value prior to last possible value -- Put_Line (Test_Score_Total'Image); -- Put_Line (Angle'Image); -- Put_Line (Color'Image); end Main; --Implementation
AdaCore/training_material
Ada
507
adb
with Screen_Interface; use Screen_Interface; with Drawing; use Drawing; with Ada.Real_Time; use Ada.Real_Time; procedure Test is Period : constant Time_Span := Milliseconds (500); Next_Start : Time := Clock + Seconds (1); begin Screen_Interface.Initialize; Fill_Screen (Black); Circle (Center => (100, 100), Radius => 50, Col => Green, Fill => True); loop Next_Start := Next_Start + Period; delay until Next_Start; end loop; end Test;
willbr/gameboy-tests
Ada
1,818
adb
M:main F:G$main$0_0$0({2}DF,SV:S),C,0,0,0,0,0 F:G$timer_isr$0_0$0({2}DF,SV:S),C,0,0,1,256,0 F:G$vblank_isr$0_0$0({2}DF,SV:S),C,0,0,1,256,0 F:G$lcd_isr$0_0$0({2}DF,SV:S),C,0,0,1,256,0 F:G$serial_isr$0_0$0({2}DF,SV:S),C,0,0,1,256,0 F:G$joypad_isr$0_0$0({2}DF,SV:S),C,0,0,1,256,0 S:G$tiles$0_0$0({1}SC:U),E,0,0 S:G$bgmap$0_0$0({1}SC:U),E,0,0 S:G$p1_joy_pad$0_0$0({1}SC:U),I,0,0 S:G$interrupt_flag$0_0$0({1}SC:U),I,0,0 S:G$interrupt_enable$0_0$0({1}SC:U),I,0,0 S:G$NR52$0_0$0({1}SC:U),I,0,0 S:G$LCDC$0_0$0({1}SC:U),I,0,0 S:G$STAT$0_0$0({1}SC:U),I,0,0 S:G$SCY$0_0$0({1}SC:U),I,0,0 S:G$SCX$0_0$0({1}SC:U),I,0,0 S:G$LY$0_0$0({1}SC:U),I,0,0 S:G$LYC$0_0$0({1}SC:U),I,0,0 S:G$BGP$0_0$0({1}SC:U),I,0,0 S:G$memccpy$0_0$0({2}DF,DG,SV:S),C,0,0 S:G$memcpy$0_0$0({2}DF,DG,SV:S),C,0,0 S:G$memmove$0_0$0({2}DF,DG,SV:S),C,0,0 S:G$strcpy$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$strncpy$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$strcat$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$strncat$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$strdup$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$strndup$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$memcmp$0_0$0({2}DF,SI:S),C,0,0 S:G$strcmp$0_0$0({2}DF,SI:S),C,0,0 S:G$strncmp$0_0$0({2}DF,SI:S),C,0,0 S:G$strxfrm$0_0$0({2}DF,SI:U),C,0,0 S:G$memchr$0_0$0({2}DF,DG,SV:S),C,0,0 S:G$strchr$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$strcspn$0_0$0({2}DF,SI:U),C,0,0 S:G$strpbrk$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$strrchr$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$strspn$0_0$0({2}DF,SI:U),C,0,0 S:G$strstr$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$strtok$0_0$0({2}DF,DG,SC:U),C,0,0 S:G$memset$0_0$0({2}DF,DG,SV:S),C,0,0 S:G$strlen$0_0$0({2}DF,SI:U),C,0,0 S:G$__memcpy$0_0$0({2}DF,DG,SV:S),C,0,0 S:G$main$0_0$0({2}DF,SV:S),C,0,0 S:G$timer_isr$0_0$0({2}DF,SV:S),C,0,0 S:G$vblank_isr$0_0$0({2}DF,SV:S),C,0,0 S:G$lcd_isr$0_0$0({2}DF,SV:S),C,0,0 S:G$serial_isr$0_0$0({2}DF,SV:S),C,0,0 S:G$joypad_isr$0_0$0({2}DF,SV:S),C,0,0
reznikmm/matreshka
Ada
58,180
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2018, 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.Characters.Latin; package body League.IRIs is use League.Characters.Latin; use type League.Characters.Universal_Character; package IRI_Parser is procedure Parse_IRI_Reference (Self : in out IRI'Class; Image : League.Strings.Universal_String); -- Parses 'IRI-reference' production. end IRI_Parser; procedure Normalize_Path (Self : in out IRI'Class); function Is_ALPHA (C : League.Characters.Universal_Character) return Boolean; -- Returns True when specified character is ALPHA. function Is_DIGIT (C : League.Characters.Universal_Character) return Boolean; -- Returns True when specified character is DIGIT. function Is_IUnreserved (C : League.Characters.Universal_Character) return Boolean; -- Returns True when specified character is iunreserved. function Is_Sub_Delims (C : League.Characters.Universal_Character) return Boolean; -- Returns True when specified character is sub-delims. --------- -- "=" -- --------- function "=" (Left : IRI; Right : IRI) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, """="" unimplemented"); raise Program_Error; return "=" (Left, Right); end "="; -------------------- -- Append_Segment -- -------------------- procedure Append_Segment (Self : in out IRI'Class; Segment : League.Strings.Universal_String) is begin Self.Path.Append (Segment); end Append_Segment; --------------- -- Authority -- --------------- function Authority (Self : IRI'Class) return League.Strings.Universal_String is begin return Result : League.Strings.Universal_String do -- Append user info. if not Self.User_Info.Is_Empty then Result.Append (Self.User_Info); Result.Append (Commercial_At); end if; -- Append host. Result.Append (Self.Host); -- Append port. if Self.Port /= 0 then declare Image : constant Wide_Wide_String := Integer'Wide_Wide_Image (Self.Port); begin Result.Append (Colon); Result.Append (Image (Image'First + 1 .. Image'Last)); end; end if; end return; end Authority; ----------- -- Clear -- ----------- procedure Clear (Self : in out IRI'Class) is begin Self.Scheme.Clear; Self.Has_Authority := False; Self.User_Info.Clear; Self.Host.Clear; Self.Port := 0; Self.Path_Is_Absolute := True; Self.Path.Clear; Self.Query.Clear; Self.Fragment.Clear; end Clear; ----------------------- -- Encoded_Authority -- ----------------------- function Encoded_Authority (Self : IRI'Class) return League.Stream_Element_Vectors.Stream_Element_Vector is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Encoded_Authority unimplemented"); raise Program_Error; return Encoded_Authority (Self); end Encoded_Authority; ---------------------- -- Encoded_Fragment -- ---------------------- function Encoded_Fragment (Self : IRI'Class) return League.Stream_Element_Vectors.Stream_Element_Vector is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Encoded_Fragment unimplemented"); raise Program_Error; return Encoded_Fragment (Self); end Encoded_Fragment; ------------------ -- Encoded_Host -- ------------------ function Encoded_Host (Self : IRI'Class) return League.Stream_Element_Vectors.Stream_Element_Vector is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Encoded_Host unimplemented"); raise Program_Error; return Encoded_Host (Self); end Encoded_Host; ------------------ -- Encoded_Path -- ------------------ function Encoded_Path (Self : IRI'Class) return League.Stream_Element_Vectors.Stream_Element_Vector is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Encoded_Path unimplemented"); raise Program_Error; return Encoded_Path (Self); end Encoded_Path; ------------------- -- Encoded_Query -- ------------------- function Encoded_Query (Self : IRI'Class) return League.Stream_Element_Vectors.Stream_Element_Vector is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Encoded_Query unimplemented"); raise Program_Error; return Encoded_Query (Self); end Encoded_Query; -------------------- -- Encoded_Scheme -- -------------------- function Encoded_Scheme (Self : IRI'Class) return League.Stream_Element_Vectors.Stream_Element_Vector is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Encoded_Scheme unimplemented"); raise Program_Error; return Encoded_Scheme (Self); end Encoded_Scheme; ----------------------- -- Encoded_User_Info -- ----------------------- function Encoded_User_Info (Self : IRI'Class) return League.Stream_Element_Vectors.Stream_Element_Vector is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Encoded_User_Info unimplemented"); raise Program_Error; return Encoded_User_Info (Self); end Encoded_User_Info; -------------- -- Fragment -- -------------- function Fragment (Self : IRI'Class) return League.Strings.Universal_String is begin return Self.Fragment; end Fragment; ------------------ -- From_Encoded -- ------------------ function From_Encoded (Item : League.Stream_Element_Vectors.Stream_Element_Vector) return IRI is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "From_Encoded unimplemented"); raise Program_Error; return From_Encoded (Item); end From_Encoded; --------------------------- -- From_Universal_String -- --------------------------- function From_Universal_String (Item : League.Strings.Universal_String) return IRI is begin return Result : IRI do Result.Set_IRI (Item); end return; end From_Universal_String; ---------------- -- IRI_Parser -- ---------------- package body IRI_Parser is -- All Parse_'production' subprograms has the same profile: -- -- - Self: object where parsed data is stored; -- -- - Image: textual representation of the IRI; -- -- - First: index of the first character to be parsed by subprogram; -- and index of the first character below successfully parsed -- production. Parameter is unchanged on failure; -- -- - Success: status of parsing. procedure Parse_Scheme (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'scheme' production up to colon delimiter. First will point to -- colon delimiter on success. procedure Parse_IHier_Part (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'ihier-part' production up to first unexpected character. -- First will point to that character. procedure Parse_IAuthority (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'iauthority' production up to first unexpected character. -- First will point to that character. procedure Parse_IPath_Abempty (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'ipath-abempty' production up to first unexpected character. -- First will point to that character. procedure Parse_IPath_Absolute (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'ipath-absolute' production up to first unexpected character. -- First will point to that character. procedure Parse_ISegment (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'isegment' production up to first unexpected character. First -- will point to that character. procedure Parse_IUserInfo (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'iuserinfo' production up to commercial at delimiter. First -- will point to that character. procedure Parse_IHost (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'ihost' production up to first unexpected character. First -- will point to that character. procedure Parse_IReg_Name (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'ireg-name' production up to first unexpected character. First -- will point to that character. procedure Parse_Port (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'port' production up to first unexpected character. First -- will point to that character. procedure Parse_IQuery (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'iquery' production up to first unexpected character. First -- will point to that character. procedure Parse_IFragment (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'ifragment' production up to first unexpected character. First -- will point to that character. procedure Parse_IPath_Noscheme (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean); -- Parses 'ipath-noscheme' production up to first unexpected character. -- First will point to that character. procedure Parse_Pct_Encoded (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean; Result : in out League.Strings.Universal_String); -- Parses 'pct-encoded' production. First will point to the character -- after production. Parsed data is normalized (converted into upper -- case) and appended to Result. -- Character classification subprograms. function Is_HEXDIG (C : League.Characters.Universal_Character) return Boolean; -- Returns True when specified character is HEXDIG. function Is_IPrivate (C : League.Characters.Universal_Character) return Boolean; -- Returns True when specified character is iprivate. --------------- -- Is_HEXDIG -- --------------- function Is_HEXDIG (C : League.Characters.Universal_Character) return Boolean is begin return (Digit_Zero <= C and C <= Digit_Nine) or (Latin_Capital_Letter_A <= C and C <= Latin_Capital_Letter_F) or (Latin_Small_Letter_A <= C and C <= Latin_Small_Letter_F); end Is_HEXDIG; ----------------- -- Is_IPrivate -- ----------------- function Is_IPrivate (C : League.Characters.Universal_Character) return Boolean is begin -- [RFC 3987] -- -- iprivate = %xE000-F8FF / %xF0000-FFFFD / %x100000-10FFFD -- XXX Compatibility with Legacy IRI must be checked! -- XXX Not implemented completely. return Is_IUnreserved (C); end Is_IPrivate; ---------------------- -- Parse_IAuthority -- ---------------------- procedure Parse_IAuthority (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- iauthority = [ iuserinfo "@" ] ihost [ ":" port ] Current : Positive := First; begin Self.Has_Authority := True; -- Try to parse 'iuserinfo' production. By convention, it sets -- Success to True when user info delimiter is not found. Parse_IUserInfo (Self, Image, Current, Success); if not Success then return; end if; if Image.Element (Current) = Commercial_At then Current := Current + 1; end if; -- Parse 'ihost' production. Parse_IHost (Self, Image, Current, Success); if not Success then return; end if; -- Check port delimiter and parse 'port' production. if Current <= Image.Length and then Image.Element (Current) = Colon then Current := Current + 1; -- Skip colon charater. Parse_Port (Self, Image, Current, Success); if not Success then return; end if; end if; First := Current; Success := True; end Parse_IAuthority; --------------------- -- Parse_IFragment -- --------------------- procedure Parse_IFragment (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- ifragment = *( ipchar / "/" / "?" ) -- -- ipchar = iunreserved / pct-encoded / sub-delims / ":" -- / "@" Current : Positive := First; C : League.Characters.Universal_Character; begin while Current <= Image.Length loop C := Image.Element (Current); if Is_IUnreserved (C) or Is_Sub_Delims (C) or C = Colon or C = Commercial_At or C = Solidus or C = Question_Mark then Self.Fragment.Append (C); Current := Current + 1; elsif C = Percent_Sign then Parse_Pct_Encoded (Self, Image, Current, Success, Self.Fragment); if not Success then return; end if; else exit; end if; end loop; First := Current; Success := True; end Parse_IFragment; ---------------------- -- Parse_IHier_Part -- ---------------------- procedure Parse_IHier_Part (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- ihier-part = "//" iauthority ipath-abempty -- / ipath-absolute -- / ipath-rootless -- / ipath-empty -- -- ipath-abempty = *( "/" isegment ) -- -- ipath-absolute = "/" [ isegment-nz *( "/" isegment ) ] -- -- ipath-rootless = isegment-nz *( "/" isegment ) -- -- ipath-empty = 0<ipchar> -- -- isegment = *ipchar -- -- isegment-nz = 1*ipchar Current : Positive := First; begin -- Check whether first two characters are '/' and at least one -- additional character is present. if Current + 2 <= Image.Length and then Image.Element (Current) = Solidus and then Image.Element (Current + 1) = Solidus then -- Parse 'iauthority' and 'ihier-part' productions. Current := Current + 2; Parse_IAuthority (Self, Image, Current, Success); if not Success then return; end if; Parse_IPath_Abempty (Self, Image, Current, Success); if not Success then return; end if; First := Current; elsif Current < Image.Length and then Image.Element (Current) = Solidus then -- Parse 'ipath-absolute' production. Parse_IPath_Absolute (Self, Image, Current, Success); if not Success then return; end if; First := Current; elsif Current <= Image.Length then -- Try to parse 'ipath-rootless' production. -- XXX Not implemented. raise Program_Error; else -- 'ipath-empty' production. Self.Path_Is_Absolute := True; Success := True; end if; end Parse_IHier_Part; ----------------- -- Parse_IHost -- ----------------- procedure Parse_IHost (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- ihost = IP-literal / IPv4address / ireg-name -- -- IP-literal = "[" ( IPv6address / IPvFuture ) "]" -- -- IPv4address = dec-octet "." dec-octet "." dec-octet "." -- dec-octet -- -- ireg-name = *( iunreserved / pct-encoded / sub-delims ) begin if Image.Element (First) = Left_Square_Bracket then -- XXX Not implemented. raise Program_Error; else -- 'IPv4address' production is just a case of 'ireg-name' -- production, it is not handled in some special way. Parse_IReg_Name (Self, Image, First, Success); end if; end Parse_IHost; ------------------------- -- Parse_IPath_Abempty -- ------------------------- procedure Parse_IPath_Abempty (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- ipath-abempty = *( "/" isegment ) Current : Positive := First; begin Self.Path_Is_Absolute := True; while Current <= Image.Length loop exit when Image.Element (Current) /= Solidus; Current := Current + 1; Parse_ISegment (Self, Image, Current, Success); if not Success then return; end if; end loop; First := Current; Success := True; end Parse_IPath_Abempty; -------------------------- -- Parse_IPath_Absolute -- -------------------------- procedure Parse_IPath_Absolute (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- ipath-absolute = "/" [ isegment-nz *( "/" isegment ) ] -- -- isegment-nz = 1*ipchar -- -- isegment = *ipchar Current : Positive := First; Old : Positive; begin -- Check whether first character is path separator. if Image.Element (Current) /= Solidus then Success := False; return; end if; Current := Current + 1; Self.Path_Is_Absolute := True; -- Parse 'isegment-nz' production. Old is used to detect that parsed -- segment has at least one character. Old := Current; Parse_ISegment (Self, Image, Current, Success); if not Success then return; end if; if Old = Current then Success := False; return; end if; -- Parse following segments. while Current <= Image.Length loop exit when Image.Element (Current) /= Solidus; Current := Current + 1; Parse_ISegment (Self, Image, Current, Success); if not Success then return; end if; end loop; First := Current; Success := True; end Parse_IPath_Absolute; -------------------------- -- Parse_IPath_Noscheme -- -------------------------- procedure Parse_IPath_Noscheme (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- ipath-noscheme = isegment-nz-nc *( "/" isegment ) -- -- isegment-nz-nc = 1*( iunreserved / pct-encoded / sub-delims -- / "@" ) Segment : League.Strings.Universal_String; Current : Positive := First; C : League.Characters.Universal_Character; begin Self.Path_Is_Absolute := False; while Current <= Image.Length loop C := Image.Element (Current); if Is_IUnreserved (C) or Is_Sub_Delims (C) or C = Commercial_At then Segment.Append (C); Current := Current + 1; elsif C = Percent_Sign then Parse_Pct_Encoded (Self, Image, Current, Success, Segment); if not Success then return; end if; else exit; end if; end loop; if Segment.Is_Empty then Success := False; return; end if; Self.Path.Append (Segment); while Current <= Image.Length loop if Image.Element (Current) = Solidus then Current := Current + 1; Parse_ISegment (Self, Image, Current, Success); if not Success then return; end if; else exit; end if; end loop; First := Current; Success := True; end Parse_IPath_Noscheme; ------------------ -- Parse_IQuery -- ------------------ procedure Parse_IQuery (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- iquery = *( ipchar / iprivate / "/" / "?" ) -- -- ipchar = iunreserved / pct-encoded / sub-delims / ":" -- / "@" Current : Positive := First; C : League.Characters.Universal_Character; begin while Current <= Image.Length loop C := Image.Element (Current); if Is_IUnreserved (C) or Is_Sub_Delims (C) or C = Colon or C = Commercial_At or C = Solidus or C = Question_Mark or Is_IPrivate (C) then Self.Query.Append (C); Current := Current + 1; elsif C = Percent_Sign then Parse_Pct_Encoded (Self, Image, Current, Success, Self.Query); if not Success then return; end if; else exit; end if; end loop; First := Current; Success := True; end Parse_IQuery; --------------------- -- Parse_IReg_Name -- --------------------- procedure Parse_IReg_Name (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- ireg-name = *( iunreserved / pct-encoded / sub-delims ) C : League.Characters.Universal_Character; Current : Positive := First; begin while Current <= Image.Length loop C := Image.Element (Current); if Is_IUnreserved (C) or Is_Sub_Delims (C) then -- [RFC 3986] -- -- "Although host is case-insensitive, producers and -- normalizers should use lowercase for registered names and -- hexadecimal addresses for the sake of uniformity, while only -- using uppercase letters for percent-encodings." -- -- [RFC 3987] 5.3.2.1. Case Normalization -- -- "When an IRI uses components of the generic syntax, the -- component syntax equivalence rules always apply; namely, -- that the scheme and US-ASCII only host are case insensitive -- and therefore should be normalized to lowercase. if Is_ALPHA (C) then Self.Host.Append (C.Simple_Lowercase_Mapping); else Self.Host.Append (C); end if; Current := Current + 1; elsif C = Percent_Sign then Parse_Pct_Encoded (Self, Image, Current, Success, Self.Host); if not Success then Self.Host.Clear; return; end if; else exit; end if; end loop; First := Current; Success := True; end Parse_IReg_Name; ------------------------- -- Parse_IRI_Reference -- ------------------------- procedure Parse_IRI_Reference (Self : in out IRI'Class; Image : League.Strings.Universal_String) is -- [RFC 3987] -- -- IRI-reference = IRI / irelative-ref -- -- IRI = scheme ":" ihier-part [ "?" iquery ] -- [ "#" ifragment ] -- -- irelative-ref = irelative-part [ "?" iquery ] [ "#" ifragment ] -- -- irelative-part = "//" iauthority ipath-abempty -- / ipath-absolute -- / ipath-noscheme -- / ipath-empty -- -- ipath-absolute = "/" [ isegment-nz *( "/" isegment ) ] -- -- ipath-noscheme = isegment-nz-nc *( "/" isegment ) Success : Boolean; Current : Positive := 1; begin Self.Clear; -- Try to parse 'scheme' production. Parse_Scheme (Self, Image, Current, Success); if Success then -- Skip colon delimiter. Current := Current + 1; Parse_IHier_Part (Self, Image, Current, Success); if not Success then raise Constraint_Error; end if; elsif Current + 2 <= Image.Length and then Image.Element (Current) = Solidus and then Image.Element (Current + 1) = Solidus then -- Parse 'iauthority' and 'ihier-part' productions. Current := Current + 2; Parse_IAuthority (Self, Image, Current, Success); if not Success then raise Constraint_Error; end if; Parse_IPath_Abempty (Self, Image, Current, Success); if not Success then raise Constraint_Error; end if; elsif Current < Image.Length and then Image.Element (Current) = Solidus then -- Parse 'ipath-absolute' production. Parse_IPath_Absolute (Self, Image, Current, Success); if not Success then raise Constraint_Error; end if; elsif Current <= Image.Length then -- Parse 'ipath-noscheme' production. Parse_IPath_Noscheme (Self, Image, Current, Success); if not Success then raise Constraint_Error; end if; end if; -- Parse 'iquery' production if present. if Current <= Image.Length and then Image.Element (Current) = Question_Mark then -- Skip question mark delimiter. Current := Current + 1; Parse_IQuery (Self, Image, Current, Success); if not Success then raise Constraint_Error; end if; end if; -- Parse 'fragment' production if present. if Current <= Image.Length and then Image.Element (Current) = Number_Sign then -- Skip number sign delimiter. Current := Current + 1; Parse_IFragment (Self, Image, Current, Success); if not Success then raise Constraint_Error; end if; end if; if Current <= Image.Length then raise Constraint_Error; end if; end Parse_IRI_Reference; -------------------- -- Parse_ISegment -- -------------------- procedure Parse_ISegment (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- isegment = *ipchar -- -- ipchar = iunreserved / pct-encoded / sub-delims / ":" -- / "@" Segment : League.Strings.Universal_String; C : League.Characters.Universal_Character; Current : Positive := First; begin while Current <= Image.Length loop C := Image.Element (Current); if Is_IUnreserved (C) or Is_Sub_Delims (C) or C = Colon or C = Commercial_At then Segment.Append (C); Current := Current + 1; elsif C = Percent_Sign then -- Percent encoded data. Parse_Pct_Encoded (Self, Image, Current, Success, Segment); if not Success then return; end if; else -- Unexpected character. exit; end if; end loop; -- Append parsed segment to the list of segments when it is not -- empty. if not Segment.Is_Empty then Self.Path.Append (Segment); end if; First := Current; Success := True; end Parse_ISegment; --------------------- -- Parse_IUserInfo -- --------------------- procedure Parse_IUserInfo (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- iuserinfo = *( iunreserved / pct-encoded / sub-delims / ":" ) Current : Positive := First; C : League.Characters.Universal_Character; begin while Current <= Image.Length loop C := Image.Element (Current); if Is_IUnreserved (C) or Is_Sub_Delims (C) or C = Colon then Self.User_Info.Append (C); Current := Current + 1; elsif C = Percent_Sign then Parse_Pct_Encoded (Self, Image, Current, Success, Self.User_Info); if not Success then Self.User_Info.Clear; return; end if; else exit; end if; end loop; Success := True; if Current > Image.Length or else Image.Element (Current) /= Commercial_At then -- By convention, character after 'iuserinfo' should be '@'; -- otherwise it is impossible to distinguish 'ihost' and -- 'iuserinfo'. So, clear accumulated data to be able to try parse -- 'ihost'. Self.User_Info.Clear; else First := Current; end if; end Parse_IUserInfo; ----------------------- -- Parse_Pct_Encoded -- ----------------------- procedure Parse_Pct_Encoded (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean; Result : in out League.Strings.Universal_String) is -- [RFC 3987] -- -- pct-encoded = "%" HEXDIG HEXDIG C1 : League.Characters.Universal_Character; C2 : League.Characters.Universal_Character; begin if First + 2 <= Image.Length and Image.Element (First) = Percent_Sign then C1 := Image.Element (First + 1); C2 := Image.Element (First + 2); if Is_HEXDIG (C1) and Is_HEXDIG (C2) then -- Append to result parsed and normalized (converted to -- uppercase) characters. Result.Append (Percent_Sign); Result.Append (C1.Simple_Uppercase_Mapping); Result.Append (C2.Simple_Uppercase_Mapping); First := First + 3; Success := True; else Success := False; end if; else Success := False; end if; end Parse_Pct_Encoded; ---------------- -- Parse_Port -- ---------------- procedure Parse_Port (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- port = *DIGIT C : League.Characters.Universal_Character; Current : Positive := First; begin Self.Port := 0; while Current <= Image.Length loop C := Image.Element (Current); exit when not IS_DIGIT (C); Self.Port := Self.Port * 10 + (Wide_Wide_Character'Pos (C.To_Wide_Wide_Character) - Wide_Wide_Character'Pos('0')); Current := Current + 1; end loop; Success := True; First := Current; end Parse_Port; ------------------ -- Parse_Scheme -- ------------------ procedure Parse_Scheme (Self : in out IRI'Class; Image : League.Strings.Universal_String; First : in out Positive; Success : out Boolean) is -- [RFC 3987] -- -- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) C : League.Characters.Universal_Character; Current : Positive := First; begin -- Check that at least two characters is available (one character of -- the scheme and colon delimiter). if Image.Length <= Current then Success := False; return; end if; -- Check first character of the scheme. C := Image.Element (Current); if not Is_ALPHA (C) then Success := False; return; else -- Convert to lowercase and append to result. Self.Scheme.Append (C.Simple_Lowercase_Mapping); Current := Current + 1; end if; while Current <= Image.Length loop C := Image.Element (Current); exit when not Is_ALPHA (C) and not IS_DIGIT (C) and C /= Plus_Sign and C /= Hyphen_Minus and C /= Full_Stop; -- Convert to lowercase and append to result. Self.Scheme.Append (C.Simple_Lowercase_Mapping); Current := Current + 1; end loop; -- Check that scheme is terminated by colon delimiter. if C /= Colon then Self.Scheme.Clear; Success := False; return; end if; Success := True; First := Current; end Parse_Scheme; end IRI_Parser; ----------------- -- Is_Absolute -- ----------------- function Is_Absolute (Self : IRI'Class) return Boolean is begin return not Self.Scheme.Is_Empty; end Is_Absolute; -------------- -- Is_ALPHA -- -------------- function Is_ALPHA (C : League.Characters.Universal_Character) return Boolean is begin return (Latin_Capital_Letter_A <= C and C <= Latin_Capital_Letter_Z) or (Latin_Small_Letter_A <= C and C <= Latin_Small_Letter_Z); end Is_ALPHA; -------------- -- Is_DIGIT -- -------------- function Is_DIGIT (C : League.Characters.Universal_Character) return Boolean is begin return Digit_Zero <= C and C <= Digit_Nine; end Is_DIGIT; -------------------- -- Is_IUnreserved -- -------------------- function Is_IUnreserved (C : League.Characters.Universal_Character) return Boolean is begin -- [RFC 3987] -- -- iunreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" / ucschar -- -- ucschar = %xA0-D7FF / %xF900-FDCF / %xFDF0-FFEF -- / %x10000-1FFFD / %x20000-2FFFD / %x30000-3FFFD -- / %x40000-4FFFD / %x50000-5FFFD / %x60000-6FFFD -- / %x70000-7FFFD / %x80000-8FFFD / %x90000-9FFFD -- / %xA0000-AFFFD / %xB0000-BFFFD / %xC0000-CFFFD -- / %xD0000-DFFFD / %xE1000-EFFFD -- XXX Compatibility with Legacy IRI must be checked! -- XXX Not implemented completely. return Is_ALPHA (C) or (Digit_Zero <= C and C <= Digit_Nine) or C = Hyphen_Minus or C = Full_Stop or C = Low_Line or C = Tilde or (C.Is_Valid and No_Break_Space <= C); end Is_IUnreserved; ---------------------- -- Is_Path_Absolute -- ---------------------- function Is_Path_Absolute (Self : IRI'Class) return Boolean is begin return Self.Path_Is_Absolute; end Is_Path_Absolute; ------------------- -- Is_Sub_Delims -- ------------------- function Is_Sub_Delims (C : League.Characters.Universal_Character) return Boolean is begin -- sub-delims = "!" / "$" / "&" / "'" / "(" / ")" -- / "*" / "+" / "," / ";" / "=" return C = Exclamation_Mark or C = Dollar_Sign or C = Ampersand or C = Apostrophe or C = Left_Parenthesis or C = Right_Parenthesis or C = Asterisk or C = Plus_Sign or C = Comma or C = Semicolon or C = Equals_Sign; end Is_Sub_Delims; -------------- -- Is_Valid -- -------------- function Is_Valid (Self : IRI'Class) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Valid unimplemented"); raise Program_Error; return Is_Valid (Self); end Is_Valid; -------------- -- Get_Host -- -------------- function Get_Host (Self : IRI'Class) return League.Strings.Universal_String is begin return Self.Host; end Get_Host; -------------- -- Get_Path -- -------------- function Get_Path (Self : IRI'Class) return League.String_Vectors.Universal_String_Vector is begin return Self.Path; end Get_Path; -------------- -- Get_Port -- -------------- function Get_Port (Self : IRI'Class; Default : Natural := 0) return Natural is begin return Self.Port; end Get_Port; ---------------- -- Get_Scheme -- ---------------- function Get_Scheme (Self : IRI'Class) return League.Strings.Universal_String is begin return Self.Scheme; end Get_Scheme; -------------------- -- Normalize_Path -- -------------------- procedure Normalize_Path (Self : in out IRI'Class) is begin -- XXX Not implemented. null; end Normalize_Path; ----------- -- Query -- ----------- function Query (Self : IRI'Class) return League.Strings.Universal_String is begin return Self.Query; end Query; ------------- -- Resolve -- ------------- function Resolve (Self : IRI'Class; Relative : IRI'Class) return IRI is begin return Result : IRI := IRI (Relative) do if Result.Scheme.Is_Empty then Result.Scheme := Self.Scheme; end if; if not Result.Has_Authority then Result.Has_Authority := Self.Has_Authority; end if; if Result.User_Info.Is_Empty then Result.User_Info := Self.User_Info; end if; if Result.Host.Is_Empty then Result.Host := Self.Host; end if; if Result.Port = 0 then Result.Port := Self.Port; end if; if not Result.Path_Is_Absolute then Result.Path.Prepend (Self.Path); Result.Path_Is_Absolute := Self.Path_Is_Absolute; end if; Normalize_Path (Result); end return; end Resolve; ----------------------- -- Set_Absolute_Path -- ----------------------- procedure Set_Absolute_Path (Self : in out IRI'Class; To : League.String_Vectors.Universal_String_Vector) is begin Self.Path := To; Self.Path_Is_Absolute := True; end Set_Absolute_Path; ------------------- -- Set_Authority -- ------------------- procedure Set_Authority (Self : in out IRI'Class; To : League.Strings.Universal_String) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Authority unimplemented"); raise Program_Error; end Set_Authority; ----------------- -- Set_Encoded -- ----------------- procedure Set_Encoded (Self : in out IRI'Class; To : League.Stream_Element_Vectors.Stream_Element_Vector) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Encoded unimplemented"); raise Program_Error; end Set_Encoded; --------------------------- -- Set_Encoded_Authority -- --------------------------- procedure Set_Encoded_Authority (Self : in out IRI'Class; To : League.Stream_Element_Vectors.Stream_Element_Vector) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Encoded_Authority unimplemented"); raise Program_Error; end Set_Encoded_Authority; -------------------------- -- Set_Encoded_Fragment -- -------------------------- procedure Set_Encoded_Fragment (Self : in out IRI'Class; To : League.Stream_Element_Vectors.Stream_Element_Vector) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Encoded_Fragment unimplemented"); raise Program_Error; end Set_Encoded_Fragment; ---------------------- -- Set_Encoded_Host -- ---------------------- procedure Set_Encoded_Host (Self : in out IRI'Class; To : League.Stream_Element_Vectors.Stream_Element_Vector) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Encoded_Host unimplemented"); raise Program_Error; end Set_Encoded_Host; ---------------------- -- Set_Encoded_Path -- ---------------------- procedure Set_Encoded_Path (Self : in out IRI'Class; To : League.Stream_Element_Vectors.Stream_Element_Vector) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Encoded_Path unimplemented"); raise Program_Error; end Set_Encoded_Path; ----------------------- -- Set_Encoded_Query -- ----------------------- procedure Set_Encoded_Query (Self : in out IRI'Class; To : League.Stream_Element_Vectors.Stream_Element_Vector) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Encoded_Query unimplemented"); raise Program_Error; end Set_Encoded_Query; ------------------------ -- Set_Encoded_Scheme -- ------------------------ procedure Set_Encoded_Scheme (Self : in out IRI'Class; To : League.Stream_Element_Vectors.Stream_Element_Vector) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Encoded_Scheme unimplemented"); raise Program_Error; end Set_Encoded_Scheme; --------------------------- -- Set_Encoded_User_Info -- --------------------------- procedure Set_Encoded_User_Info (Self : in out IRI'Class; To : League.Stream_Element_Vectors.Stream_Element_Vector) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Encoded_User_Info unimplemented"); raise Program_Error; end Set_Encoded_User_Info; ------------------ -- Set_Fragment -- ------------------ procedure Set_Fragment (Self : in out IRI'Class; To : League.Strings.Universal_String) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_Fragment unimplemented"); raise Program_Error; end Set_Fragment; -------------- -- Set_Host -- -------------- procedure Set_Host (Self : in out IRI'Class; To : League.Strings.Universal_String) is begin -- [RFC 3987] -- -- ihost = IP-literal / IPv4address / ireg-name -- -- IP-literal = "[" ( IPv6address / IPvFuture ) "]" -- -- IPv4address = dec-octet "." dec-octet "." dec-octet "." -- dec-octet -- -- ireg-name = *( iunreserved / pct-encoded / sub-delims ) -- XXX Check for valid 'ihost' production should be added. Self.Has_Authority := True; Self.Host := To; end Set_Host; ------------- -- Set_IRI -- ------------- procedure Set_IRI (Self : in out IRI'Class; To : League.Strings.Universal_String) is begin IRI_Parser.Parse_IRI_Reference (Self, To); end Set_IRI; ----------------------- -- Set_Path_Absolute -- ----------------------- procedure Set_Path_Absolute (Self : in out IRI'Class; To : Boolean) is begin Self.Path_Is_Absolute := To; end Set_Path_Absolute; -------------- -- Set_Port -- -------------- procedure Set_Port (Self : in out IRI'Class; To : Natural) is begin Self.Port := To; end Set_Port; --------------- -- Set_Query -- --------------- procedure Set_Query (Self : in out IRI'Class; To : League.Strings.Universal_String) is begin Self.Query := To; end Set_Query; ----------------------- -- Set_Relative_Path -- ----------------------- procedure Set_Relative_Path (Self : in out IRI'Class; To : League.String_Vectors.Universal_String_Vector) is begin Self.Path := To; Self.Path_Is_Absolute := False; end Set_Relative_Path; ---------------- -- Set_Scheme -- ---------------- procedure Set_Scheme (Self : in out IRI'Class; To : League.Strings.Universal_String) is C : League.Characters.Universal_Character; begin if not To.Is_Empty then -- [RFC 3987] -- -- scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) if not Is_ALPHA (To (1)) then raise Constraint_Error with "Invalid scheme"; end if; for J in 2 .. To.Length loop C := To (J); if not Is_ALPHA (C) and then not Is_DIGIT (C) and then C /= Plus_Sign and then C /= Hyphen_Minus and then C /= Full_Stop then raise Constraint_Error with "Invalid scheme"; end if; end loop; end if; Self.Scheme := To; end Set_Scheme; ------------------- -- Set_User_Info -- ------------------- procedure Set_User_Info (Self : in out IRI'Class; To : League.Strings.Universal_String) is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Set_User_Info unimplemented"); raise Program_Error; end Set_User_Info; ---------------- -- To_Encoded -- ---------------- function To_Encoded (Self : IRI'Class) return League.Stream_Element_Vectors.Stream_Element_Vector is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "To_Encoded unimplemented"); raise Program_Error; return To_Encoded (Self); end To_Encoded; ------------------------- -- To_Universal_String -- ------------------------- function To_Universal_String (Self : IRI'Class) return League.Strings.Universal_String is procedure Append_IPChar (Result : in out League.Strings.Universal_String; Character : League.Characters.Universal_Character); -- Append character. All characters except ipchar are encoded. procedure Append_ISegment (Result : in out League.Strings.Universal_String; Segment : League.Strings.Universal_String); -- Append isegment. Encode all non ipchar characters. ------------------- -- Append_IPChar -- ------------------- procedure Append_IPChar (Result : in out League.Strings.Universal_String; Character : League.Characters.Universal_Character) is To_HEX : constant array (Natural range 0 .. 15) of League.Characters.Universal_Character := (Digit_Zero, Digit_One, Digit_Two, Digit_Three, Digit_Four, Digit_Five, Digit_Six, Digit_Seven, Digit_Eight, Digit_Nine, Latin_Capital_Letter_A, Latin_Capital_Letter_B, Latin_Capital_Letter_C, Latin_Capital_Letter_D, Latin_Capital_Letter_E, Latin_Capital_Letter_F); begin -- [RFC 3987] -- -- ipchar = iunreserved / pct-encoded / sub-delims / ":" -- / "@" -- -- Note: isegment-nz-nc doesn't allow ":" character, because it -- conflicts with scheme production. if Is_IUnreserved (Character) or else Is_Sub_Delims (Character) or else Character = Colon or else (not Self.Scheme.Is_Empty and then Character = Commercial_At) then Result.Append (Character); else declare Code : constant Natural := Wide_Wide_Character'Pos (Character.To_Wide_Wide_Character); begin if Code <= 16#7F# then Result.Append (Percent_Sign); Result.Append (To_Hex (Code / 16 mod 16)); Result.Append (To_Hex (Code mod 16)); else raise Program_Error; end if; end; end if; end Append_IPChar; --------------------- -- Append_ISegment -- --------------------- procedure Append_ISegment (Result : in out League.Strings.Universal_String; Segment : League.Strings.Universal_String) is begin for J in 1 .. Segment.Length loop Append_IPChar (Result, Segment (J)); end loop; end Append_ISegment; begin return Result : League.Strings.Universal_String do -- Append scheme when defined. if not Self.Scheme.Is_Empty then Result.Append (Self.Scheme); Result.Append (Colon); end if; -- Append two solidus and authority when present. if Self.Has_Authority then Result.Append (Solidus); Result.Append (Solidus); Result.Append (Self.Authority); end if; -- Append path. for J in 1 .. Self.Path.Length loop if J /= 1 or (J = 1 and Self.Path_Is_Absolute) then Result.Append (Solidus); end if; Append_ISegment (Result, Self.Path.Element (J)); end loop; -- Append query. if not Self.Query.Is_Empty then Result.Append (Question_Mark); Result.Append (Self.Query); end if; -- Append fragment. if not Self.Fragment.Is_Empty then Result.Append (Number_Sign); Result.Append (Self.Fragment); end if; end return; end To_Universal_String; --------------- -- User_Info -- --------------- function User_Info (Self : IRI'Class) return League.Strings.Universal_String is begin return Self.User_Info; end User_Info; end League.IRIs;
AdaCore/Ada_Drivers_Library
Ada
3,583
adb
------------------------------------------------------------------------------ -- -- -- Copyright (C) 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. -- -- -- ------------------------------------------------------------------------------ with LCD_Std_Out; package body Output_Utils is ----------- -- Print -- ----------- procedure Print (X, Y : Natural; Msg : String) renames LCD_Std_Out.Put; -------------------------- -- Print_Static_Content -- -------------------------- procedure Print_Static_Content (Stable : Angle_Rates) is begin -- print the constant offsets computed when the device is motionless Print (0, Line1_Stable, "Stable X:" & Stable.X'Img); Print (0, Line2_Stable, "Stable Y:" & Stable.Y'Img); Print (0, Line3_Stable, "Stable Z:" & Stable.Z'Img); -- print the static labels for the values before the offset is removed Print (0, Line1_Raw, "Raw X:"); Print (0, Line2_Raw, "Raw Y:"); Print (0, Line3_Raw, "Raw Z:"); -- print the static labels for the values after the offset is removed Print (0, Line1_Adjusted, "Adjusted X:"); Print (0, Line2_Adjusted, "Adjusted Y:"); Print (0, Line3_Adjusted, "Adjusted Z:"); -- print the static labels for the final values Print (0, Line1_Final, "X:"); Print (0, Line2_Final, "Y:"); Print (0, Line3_Final, "Z:"); end Print_Static_Content; end Output_Utils;
charlie5/aIDE
Ada
1,983
adb
with AdaM.Factory, AdaM.a_Package, ada.Tags; package body AdaM.a_Type is -- Forge -- procedure destruct (Self : in out Item) is begin raise Program_Error with "'adam.a_Type' subclasses must override the 'destruct' procedure"; end destruct; -- Attributes -- overriding function Name (Self : in Item) return Identifier is begin return +Self.Name; end Name; procedure Name_is (Self : in out Item; Now : in String) is begin Self.Name := +Now; end Name_is; function full_Name (Self : in Item) return Identifier is use type Entity.view; begin if Self.parent_Entity = null then return "Standard." & (+Self.Name); else return a_Package.view (Self.parent_Entity).full_Name & "." & (+Self.Name); end if; end full_Name; -- Streams -- procedure View_write (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : in View) is use Ada.Tags; begin if Self = null then AdaM.Id'write (Stream, null_Id); return; end if; AdaM.Id'write (Stream, Self.Id); String 'output (Stream, external_Tag (Self.all'Tag)); end View_write; procedure View_read (Stream : not null access Ada.Streams.Root_Stream_Type'Class; Self : out View) is Id : AdaM.Id; begin AdaM.Id'read (Stream, Id); if Id = null_Id then Self := null; return; end if; declare use Ada.Tags; the_String : constant String := String'Input (Stream); -- Read tag as string from stream. the_Tag : constant Tag := Descendant_Tag (the_String, Item'Tag); -- Convert to a tag. begin Self := View (AdaM.Factory.to_View (Id, the_Tag)); end; end View_read; end AdaM.a_Type;
charlie5/aIDE
Ada
8,058
adb
with aIDE.GUI, AdaM.exception_Handler, glib, glib.Error, gtk.Builder, gdk.Event; package body aIDE.Editor.of_block is use gtk.Builder, gtk.Widget, glib, glib.Error; function exception_Button_Press (Self : access Gtk_Widget_Record'Class; Event : Gdk.Event.Gdk_Event_Button) return Boolean is Expander : constant my_Expander := my_Expander (Self); begin case Event.Button is when 1 => return False; when 2 => declare new_Handler : constant AdaM.exception_Handler.view := AdaM.exception_Handler.new_Handler (--"constraint_Error", Expander.Editor.Block); begin Expander.Editor.Block.add (new_Handler); Expander.Editor.exception_Handler := aIDE.Editor.of_exception_handler.new_Editor (new_Handler); Expander.Editor.exception_Handler.top_Widget.reparent (Expander.Editor.exception_Box); end; when others => null; end case; return True; end exception_Button_Press; function Button_Press (Self : access Gtk_Widget_Record'Class; Event : Gdk.Event.Gdk_Event_Button) return Boolean is Expander : constant my_Expander := my_Expander (Self); begin case Event.Button is when 1 => return False; when 2 => aIDE.GUI.show_source_entities_Palette (Invoked_by => Expander.Editor.all'Access, Target => Expander.Target); when others => null; end case; return True; end Button_Press; package body Forge is function to_block_Editor (the_Block : in AdaM.Block.view) return View is Self : constant Editor.of_block.view := new Editor.of_block.item; the_Builder : Gtk_Builder; Error : aliased GError; Result : Guint; pragma Unreferenced (Result); use gdk.Event; begin Gtk_New (the_Builder); Result := the_Builder.Add_From_File ("glade/editor/block_editor.glade", Error'Access); if Error /= null then Error_Free (Error); end if; Self.block_editor_Frame := gtk_Frame (the_Builder.get_Object ("block_editor_Frame")); Self.top_Box := gtk_Box (the_Builder.get_Object ("top_Box")); -- declare region -- Self.declare_Expander := new my_Expander_Record; Self.declare_Expander.Target := the_Block.my_Declarations; Self.declare_Expander.Editor := Self; gtk.Expander.Initialize (Self.declare_Expander, "declare"); Self.declare_Expander.On_Button_Press_Event (Button_Press'Access); Self.top_Box.Pack_Start (Self.declare_Expander); Self.declare_Label := Gtk_Label (the_Builder.get_Object ("declare_Label")); Gtk_New_Vbox (Self.declare_Box); Self.declare_Expander.Add (Self.declare_Box); -- begin region -- Self.begin_Expander := new my_Expander_Record; Self.begin_Expander.Target := the_Block.my_Statements; Self.begin_Expander.Editor := Self; gtk.Expander.Initialize (Self.begin_Expander, "begin"); Self.begin_Expander.On_Button_Press_Event (Button_Press'Access); Self.top_Box.Pack_Start (Self.begin_Expander); Gtk_New_Vbox (Self.begin_Box); Self.begin_Expander.Add (Self.begin_Box); -- exception region -- Self.exception_Expander := new my_Expander_Record; Self.exception_Expander.Target := the_Block.my_Handlers; Self.exception_Expander.Editor := Self; gtk.Expander.Initialize (Self.exception_Expander, "exception"); Self.exception_Expander.On_Button_Press_Event (exception_Button_Press'Access); Self.top_Box.Pack_Start (Self.exception_Expander); Gtk_New_Vbox (Self.exception_Box); Self.exception_Expander.Add (Self.exception_Box); Self.Block := the_Block; Self.top_Widget.Show_All; Self.freshen; return Self; end to_block_Editor; end Forge; overriding procedure freshen (Self : in out Item) is use AdaM; begin -- 'declare' Region -- -- Destroy all prior 'declare' entity widgets. -- loop declare the_Child : constant gtk_Widget := Self.declare_Box.get_Child (0); begin exit when the_Child = null; the_Child.destroy; end; end loop; -- Create all 'declare' entity widgets. -- declare -- the_Entities : constant AdaM.Source.Entities_View := Self.Block.my_Declarations; the_Entities : constant AdaM.Entity.Entities_View := Self.Block.my_Declarations; begin for i in 1 .. Integer (the_Entities.Length) loop declare -- the_Entity : AdaM.Source.Entity_view renames the_Entities.Element (i); the_Entity : AdaM.Entity.view renames the_Entities.Element (i); the_Editor : constant aIDE.Editor.view := aIDE.Editor.to_Editor (the_Entity); begin the_Editor.top_Widget.reparent (Self.declare_Box); end; end loop; end; -- 'begin' Region -- -- Destroy all prior 'begin' entity widgets. -- loop declare the_Child : constant gtk_Widget := Self.begin_Box.get_Child (0); begin exit when the_Child = null; the_Child.destroy; end; end loop; -- Create all 'begin' entity widgets. -- declare -- the_Entities : constant access AdaM.Source.Entities := Self.Block.my_Statements; the_Entities : constant access AdaM.Entity.Entities := Self.Block.my_Statements; begin for i in 1 .. Integer (the_Entities.Length) loop declare -- the_Entity : AdaM.Source.Entity_view renames the_Entities.Element (i); the_Entity : AdaM.Entity.view renames the_Entities.Element (i); the_Editor : constant aIDE.Editor.view := aIDE.Editor.to_Editor (the_Entity); begin the_Editor.top_Widget.reparent (Self.begin_Box); end; end loop; end; -- Exceptions -- loop declare use gtk.Widget; the_Child : constant gtk_Widget := Self.exception_Box.Get_Child (0); begin exit when the_Child = null; the_Child.destroy; end; end loop; for i in 1 .. Integer (Self.Block.my_Handlers.Length) loop declare -- the_Entity : constant AdaM.Source.Entity_View := Self.Block.my_Handlers.Element (i); the_Entity : constant AdaM.Entity.view := Self.Block.my_Handlers.Element (i); the_Exception : constant AdaM.exception_Handler.view := AdaM.exception_Handler.view (the_Entity); begin Self.exception_Handler := aIDE.Editor.of_exception_handler.new_Editor (the_Exception); Self.exception_Handler.top_Widget.reparent (Self.exception_Box); end; end loop; end freshen; procedure Target_is (Self : in out Item; Now : AdaM.Block.view) is Unused : Boolean; begin Self.Block := Now; Self.freshen; end Target_is; function Target (Self : in Item) return AdaM.Block.view is begin return Self.Block; end Target; overriding function top_Widget (Self : in Item) return gtk.Widget.Gtk_Widget is begin return gtk.Widget.Gtk_Widget (Self.block_editor_Frame); end top_Widget; end aIDE.Editor.of_block;
guillaume-lin/tsc
Ada
3,875
ads
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding -- -- -- -- Terminal_Interface.Curses.Forms.Field_User_Data -- -- -- -- S P E C -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control: -- $Revision: 1.15 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ generic type User is limited private; type User_Access is access User; package Terminal_Interface.Curses.Forms.Field_User_Data is pragma Preelaborate (Terminal_Interface.Curses.Forms.Field_User_Data); -- |===================================================================== -- | Man page form_field_userptr.3x -- |===================================================================== -- | procedure Set_User_Data (Fld : in Field; Data : in User_Access); -- AKA: set_field_userptr pragma Inline (Set_User_Data); -- | procedure Get_User_Data (Fld : in Field; Data : out User_Access); -- AKA: field_userptr -- | function Get_User_Data (Fld : in Field) return User_Access; -- AKA: field_userptr -- Sama as function pragma Inline (Get_User_Data); end Terminal_Interface.Curses.Forms.Field_User_Data;
sungyeon/drake
Ada
396
ads
pragma License (Unrestricted); -- implementation unit package Ada.Strings.Naked_Maps.Canonical_Composites is pragma Preelaborate; -- not-decomposable characters. function Base_Set return not null Character_Set_Access; -- decomposes and extracts the base character. function Basic_Map return not null Character_Mapping_Access; end Ada.Strings.Naked_Maps.Canonical_Composites;
godunko/adawebui
Ada
5,483
ads
------------------------------------------------------------------------------ -- -- -- 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: 5743 $ $Date: 2017-01-29 12:06:05 +0300 (Sun, 29 Jan 2017) $ ------------------------------------------------------------------------------ with Web.HTML.Inputs; --with Core.Slots_0; --private with Core.Slots_0.Generic_Slots; --private with Core.Slots_0.Emitters; package Web.UI.Widgets.Spin_Boxes is type Abstract_Spin_Box is abstract new Web.UI.Widgets.Abstract_Widget with private; -- not overriding function Editing_Finished_Signal -- (Self : in out Abstract_Spin_Box) -- return not null access Core.Slots_0.Signal'Class; overriding procedure Set_Disabled (Self : in out Abstract_Spin_Box; Disabled : Boolean := True); -- Available as slot. -- not overriding procedure Step_Down -- (Self : in out Abstract_Spin_Box) is abstract; -- -- Available as slot. -- -- not overriding procedure Step_Up -- (Self : in out Abstract_Spin_Box) is abstract; -- -- Available as slot. ----------- -- Slots -- ----------- -- function Step_Down_Slot -- (Self : in out Abstract_Spin_Box'Class) -- return Core.Slots_0.Slot'Class; -- -- function Step_Up_Slot -- (Self : in out Abstract_Spin_Box'Class) -- return Core.Slots_0.Slot'Class; package Constructors is procedure Initialize (Self : in out Abstract_Spin_Box'Class; Element : Web.HTML.Inputs.HTML_Input_Element'Class); end Constructors; private type Abstract_Spin_Box is abstract new Web.UI.Widgets.Abstract_Widget with record null; -- Editing_Finished : aliased -- Core.Slots_0.Emitters.Emitter (Abstract_Spin_Box'Unchecked_Access); end record; ----------- -- Slots -- ----------- -- package Step_Down_Slots is -- new Core.Slots_0.Generic_Slots (Abstract_Spin_Box, Step_Down); -- -- function Step_Down_Slot -- (Self : in out Abstract_Spin_Box'Class) return Core.Slots_0.Slot'Class -- renames Step_Down_Slots.To_Slot; -- -- package Step_Up_Slots is -- new Core.Slots_0.Generic_Slots (Abstract_Spin_Box, Step_Up); -- -- function Step_Up_Slot -- (Self : in out Abstract_Spin_Box'Class) return Core.Slots_0.Slot'Class -- renames Step_Down_Slots.To_Slot; end Web.UI.Widgets.Spin_Boxes;
reznikmm/matreshka
Ada
3,663
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.Classifier_Template_Parameters.Hash is new AMF.Elements.Generic_Hash (UML_Classifier_Template_Parameter, UML_Classifier_Template_Parameter_Access);
RREE/ada-util
Ada
1,747
adb
----------------------------------------------------------------------- -- proplist -- List the properties -- Copyright (C) 2017 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.Text_IO; with Ada.Command_Line; with Util.Properties; procedure Proplist is procedure Print (Name : in String; Value : in Util.Properties.Value); procedure Print (Name : in String; Value : in Util.Properties.Value) is begin if Util.Properties.Is_Manager (Value) then Ada.Text_IO.Put_Line ("[" & Name & "]"); Util.Properties.To_Manager (Value).Iterate (Print'Access); Ada.Text_IO.New_Line; else Ada.Text_IO.Put (Name); Ada.Text_IO.Put ("="); Ada.Text_IO.Put_Line (Util.Properties.To_String (Value)); end if; end Print; Properties : Util.Properties.Manager; begin for I in 1 .. Ada.Command_Line.Argument_Count loop Properties.Load_Properties (Path => Ada.Command_Line.Argument (I)); Properties.Iterate (Print'Access); end loop; end Proplist;
reznikmm/matreshka
Ada
4,359
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2013, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Matreshka.DOM_Nodes; with XML.DOM.Attributes.Internals; package body ODF.DOM.Attributes.Style.Text_Underline_Style.Internals is ------------ -- Create -- ------------ function Create (Node : Matreshka.ODF_Attributes.Style.Text_Underline_Style.Style_Text_Underline_Style_Access) return ODF.DOM.Attributes.Style.Text_Underline_Style.ODF_Style_Text_Underline_Style is begin return (XML.DOM.Attributes.Internals.Create (Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record); end Create; ---------- -- Wrap -- ---------- function Wrap (Node : Matreshka.ODF_Attributes.Style.Text_Underline_Style.Style_Text_Underline_Style_Access) return ODF.DOM.Attributes.Style.Text_Underline_Style.ODF_Style_Text_Underline_Style is begin return (XML.DOM.Attributes.Internals.Wrap (Matreshka.DOM_Nodes.Attribute_Access (Node)) with null record); end Wrap; end ODF.DOM.Attributes.Style.Text_Underline_Style.Internals;
charlie5/lace
Ada
223
adb
with ada.Strings.Hash; package body lace.Event is function Hash (the_Kind : in Kind) return ada.Containers.Hash_type is begin return ada.Strings.Hash (String (the_Kind)); end Hash; end lace.Event;
MinimSecure/unum-sdk
Ada
771
ads
-- 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/>. package Pck is procedure Put(S : String); end Pck;
Fabien-Chouteau/AGATE
Ada
3,493
adb
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017, Fabien Chouteau -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ package body Tools is --------- -- Hex -- --------- function Hex (Value : UInt32) return String is Ret : String (1 .. 10) := "0x........"; Val : UInt32 := Value; begin for Index in reverse Ret'First + 2 .. Ret'Last loop Ret (Index) := (case Val and 16#F# is when 0 => '0', when 1 => '1', when 2 => '2', when 3 => '3', when 4 => '4', when 5 => '5', when 6 => '6', when 7 => '7', when 8 => '8', when 9 => '9', when 10 => 'A', when 11 => 'B', when 12 => 'C', when 13 => 'D', when 14 => 'E', when others => 'F'); Val := Shift_Right (Val, 4); end loop; return Ret; end Hex; end Tools;
optikos/oasis
Ada
14,431
adb
-- Copyright (c) 2019 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- with Ada.Wide_Wide_Characters.Handling; with Program.Source_Buffers; package body Program.Lexical_Handlers is use all type Program.Scanner_Destinations.Token_Kind; subtype Hash_Value is Positive range 2 + 2 * 6 .. 12 + 3 * 115; function Hash (W : Wide_Wide_String) return Hash_Value; function To_Token (X : Wide_Wide_String) return Program.Scanner_Destinations.Token_Kind; Map : constant array (Program.Scanner_States.Rule_Index range 1 .. 27) of Program.Scanner_Destinations.Token_Kind := (1 => Arrow, 2 => Double_Dot, 3 => Double_Star, 4 => Assignment, 5 => Inequality, 6 => Greater_Or_Equal, 7 => Less_Or_Equal, 8 => Left_Label, 9 => Right_Label, 10 => Box, 11 => Ampersand, 12 => Apostrophe, 13 => Left_Parenthesis, 14 => Right_Parenthesis, 15 => Star, 16 => Plus, 17 => Comma, 18 => Hyphen, 19 => Dot, 20 => Slash, 21 => Colon, 22 => Semicolon, 23 => Less, 24 => Equal, 25 => Greater, 26 => Vertical_Line, 27 => Vertical_Line); Id : constant Program.Scanner_Destinations.Token_Kind := Identifier; -- generated by gperf -m 100 Word_Map : constant array (Hash_Value range 22 .. 114) of Program.Scanner_Destinations.Token_Kind := (Else_Keyword, At_Keyword, Task_Keyword, Then_Keyword, Not_Keyword, Range_Keyword, Abs_Keyword, Renames_Keyword, Return_Keyword, End_Keyword, Terminate_Keyword, Case_Keyword, Xor_Keyword, Abstract_Keyword, Synchronized_Keyword, Reverse_Keyword, And_Keyword, Exception_Keyword, Constant_Keyword, Declare_Keyword, Access_Keyword, Record_Keyword, Accept_Keyword, Is_Keyword, In_Keyword, Type_Keyword, Entry_Keyword, Separate_Keyword, Or_Keyword, Requeue_Keyword, Do_Keyword, Select_Keyword, When_Keyword, Exit_Keyword, Array_Keyword, Raise_Keyword, Out_Keyword, Package_Keyword, Interface_Keyword, Pragma_Keyword, Delta_Keyword, Use_Keyword, Digits_Keyword, Abort_Keyword, Tagged_Keyword, Some_Keyword, Aliased_Keyword, Elsif_Keyword, Subtype_Keyword, Id, Generic_Keyword, For_Keyword, Function_Keyword, Id, Mod_Keyword, Null_Keyword, Delay_Keyword, Private_Keyword, Id, Id, All_Keyword, Procedure_Keyword, New_Keyword, While_Keyword, Id, With_Keyword, Protected_Keyword, Others_Keyword, Id, If_Keyword, Goto_Keyword, Of_Keyword, Until_Keyword, Body_Keyword, Overriding_Keyword, Id, Id, Id, Id, Id, Limited_Keyword, Id, Begin_Keyword, Loop_Keyword, Id, Id, Id, Id, Id, Id, Id, Id, Rem_Keyword); Word_Text : constant Wide_Wide_String := "else" & "at" & "task" & "then" & "not" & "range" & "abs" & "renames" & "return" & "end" & "terminate" & "case" & "xor" & "abstract" & "synchronized" & "reverse" & "and" & "exception" & "constant" & "declare" & "access" & "record" & "accept" & "is" & "in" & "type" & "entry" & "separate" & "or" & "requeue" & "do" & "select" & "when" & "exit" & "array" & "raise" & "out" & "package" & "interface" & "pragma" & "delta" & "use" & "digits" & "abort" & "tagged" & "some" & "aliased" & "elsif" & "subtype" & "generic" & "for" & "function" & "mod" & "null" & "delay" & "private" & "all" & "procedure" & "new" & "while" & "with" & "protected" & "others" & "if" & "goto" & "of" & "until" & "body" & "overriding" & "limited" & "begin" & "loop" & "rem"; Word_From : constant array (Hash_Value range 22 .. 114) of Natural := (1, 5, 7, 11, 15, 18, 23, 26, 33, 39, 42, 51, 55, 58, 66, 78, 85, 88, 97, 105, 112, 118, 124, 130, 132, 134, 138, 143, 151, 153, 160, 162, 168, 172, 176, 181, 186, 189, 196, 205, 211, 216, 219, 225, 230, 236, 240, 247, 252, -- Subtype_Keyword, 0, 259, -- Generic_Keyword, 266, -- For_Keyword, 269, -- Function_Keyword, 0, 277, -- Mod_Keyword, 280, -- Null_Keyword, 284, -- Delay_Keyword, 289, -- Private_Keyword, 0, 0, 296, -- All_Keyword, 299, -- Procedure_Keyw 308, -- New_Keyword, 311, -- While_Keyword, 0, 316, -- With_Keyword, 320, -- Protected_Keywo 329, -- Others_Keyword, 0, 335, -- If_Keyword, 337, -- Goto_Keyword, 341, -- Of_Keyword, 343, -- Until_Keyword, 348, -- Body_Keyword, 352, -- Overriding_Keyword, 0, 0, 0, 0, 0, 362, -- Limited_Keyword, 0, 369, -- Begin_Keyword 374, -- Loop_Keyword, 0, 0, 0, 0, 0, 0, 0, 0, 378); -- Rem_Keyword, Total length 381); ----------------------- -- Character_Literal -- ----------------------- overriding procedure Character_Literal (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) is pragma Unreferenced (Rule); Value : Program.Scanner_Destinations.Token; begin Scanner.Set_Start_Condition (Program.Scanner_States.Allow_Char); Token := Character_Literal; Skip := False; Value := (Kind => Token, Span => Scanner.Get_Span); Self.Output.New_Token (Value); Self.Last_Token := Token; end Character_Literal; ------------- -- Comment -- ------------- overriding procedure Comment (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) is pragma Unreferenced (Self, Scanner, Rule, Token); begin Skip := True; end Comment; --------------- -- Delimiter -- --------------- overriding procedure Delimiter (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) is Value : Program.Scanner_Destinations.Token; begin Scanner.Set_Start_Condition (Program.Scanner_States.Allow_Char); Token := Map (Rule); Skip := False; Value := (Kind => Token, Span => Scanner.Get_Span); Self.Output.New_Token (Value); Self.Last_Token := Token; end Delimiter; ----------- -- Error -- ----------- overriding procedure Error (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) is pragma Unreferenced (Rule); Value : Program.Scanner_Destinations.Token; begin Token := Error; Skip := False; Value := (Kind => Token, Span => Scanner.Get_Span); Self.Output.New_Token (Value); Self.Last_Token := Token; end Error; ---------- -- Hash -- ---------- function Hash (W : Wide_Wide_String) return Hash_Value is X : constant array (Wide_Wide_Character range 'a' .. 'y') of Positive := (13, 51, 17, 11, 6, 52, 41, 38, 37, 115, 6, 33, 51, 7, 39, 29, 29, 9, 6, 8, 48, 15, 37, 13, 29); function Y (Val : Wide_Wide_Character) return Positive; function Y (Val : Wide_Wide_Character) return Positive is begin if Val in X'Range then return X (Val); else return 115; end if; end Y; Length : constant Positive := W'Length; Result : Positive := Length; -- 2 .. 12 begin if Length > 2 then Result := Result + Y (W (W'First + 2)); -- 6 .. 115 end if; Result := Result + Y (W (W'First)); -- 6 .. 115 Result := Result + Y (W (Length)); -- 6 .. 115 return Result; end Hash; ---------------- -- Identifier -- ---------------- overriding procedure Identifier (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) is pragma Unreferenced (Rule); Value : Program.Scanner_Destinations.Token; Span : constant Program.Source_Buffers.Span := Scanner.Get_Span; Text : constant Wide_Wide_String := Scanner.Get_Source.Text (Span); Match : constant Wide_Wide_String := Ada.Wide_Wide_Characters.Handling.To_Lower (Text); begin Token := To_Token (Match); Skip := False; if Self.Last_Token = Apostrophe and Token /= Range_Keyword then Token := Id; end if; if Token = Id then Scanner.Set_Start_Condition (Program.Scanner_States.INITIAL); else Scanner.Set_Start_Condition (Program.Scanner_States.Allow_Char); end if; Value := (Kind => Token, Span => Scanner.Get_Span); Self.Output.New_Token (Value); Self.Last_Token := Token; end Identifier; -------------- -- New_Line -- -------------- overriding procedure New_Line (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) is pragma Unreferenced (Scanner, Rule, Token); begin Skip := True; Self.Output.New_Line (Self.Line); Self.Line := Self.Line + 1; end New_Line; --------------------- -- Numeric_Literal -- --------------------- overriding procedure Numeric_Literal (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) is pragma Unreferenced (Rule); Value : Program.Scanner_Destinations.Token; begin Scanner.Set_Start_Condition (Program.Scanner_States.Allow_Char); Token := Numeric_Literal; Skip := False; Value := (Kind => Token, Span => Scanner.Get_Span); Self.Output.New_Token (Value); Self.Last_Token := Token; end Numeric_Literal; --------------------------------- -- Obsolescent_Numeric_Literal -- --------------------------------- overriding procedure Obsolescent_Numeric_Literal (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) renames Numeric_Literal; -------------------------------- -- Obsolescent_String_Literal -- -------------------------------- overriding procedure Obsolescent_String_Literal (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) renames String_Literal; ----------- -- Space -- ----------- overriding procedure Space (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) is pragma Unreferenced (Self, Scanner, Rule, Token); begin Skip := True; end Space; -------------------- -- String_Literal -- -------------------- overriding procedure String_Literal (Self : not null access Handler; Scanner : not null access Program.Scanners.Scanner'Class; Rule : Program.Scanner_States.Rule_Index; Token : out Program.Scanner_Destinations.Token_Kind; Skip : in out Boolean) is pragma Unreferenced (Rule); Value : Program.Scanner_Destinations.Token; begin Scanner.Set_Start_Condition (Program.Scanner_States.Allow_Char); Token := String_Literal; Skip := False; Value := (Kind => Token, Span => Scanner.Get_Span); Self.Output.New_Token (Value); Self.Last_Token := Token; end String_Literal; -------------- -- To_Token -- -------------- function To_Token (X : Wide_Wide_String) return Program.Scanner_Destinations.Token_Kind is H : Hash_Value; begin if X'Length in 2 .. 12 then H := Hash (X); if H in Word_From'Range and then Word_From (H) + X'Length - 1 <= Word_Text'Last and then Word_Text (Word_From (H) .. Word_From (H) + X'Length - 1) = X then return Word_Map (H); end if; end if; return Identifier; end To_Token; end Program.Lexical_Handlers;
hypech/hypech.github.io
Ada
154,885
ads
!FILE_FORMAT=ADS !VERSION=1.0 !Section=Dimensions 'Name|DimensionClass|DimensionAlias|ShortName|UseForCurrency|DimensionSize Alias|Alias|Alias||| Currency|Currency|Currency||| ConsolidationMethod|ConsolidationMethod|ConsolidationMethod||| SecurityClass|SecurityClass|SecurityClass||| Year|Year|Year||| Period|Period|Period||| View|View|View||| Scenario|Scenario|Scenario||| Entity|Entity|Entity||| Account|Account|Account||| Value|Value|Value||| ICP|ICP|ICP||| Custom1|Generic|Custom1|C1|From|Large Custom2|Generic|Custom2|C2|To|Large Custom3|Generic|Custom3|C3|None|Large Custom4|Generic|Custom4|C4|None|Large !Section=DimensionAssociations 'BaseDimension|Property|TargetDimension Scenario|Alias|Alias Scenario|SecurityClass|SecurityClass Scenario|DefaultFrequency|View Scenario|DefFreqForICTrans|View Entity|Alias|Alias Entity|SecurityClass|SecurityClass Entity|Currency|Currency Entity|SecurityAsPartner|SecurityClass Entity|HoldingCompany|Entity Account|Alias|Alias Account|SecurityClass|SecurityClass Account|PlugAccount|Account Custom1|Alias|Alias Custom1|SecurityClass|SecurityClass Custom2|Alias|Alias Custom2|SecurityClass|SecurityClass Custom3|Alias|Alias Custom3|SecurityClass|SecurityClass Custom4|Alias|Alias Custom4|SecurityClass|SecurityClass Value|Alias|Alias ICP|Alias|Alias ICP|SecurityClass|SecurityClass Account|ICPTopMember|ICP Account|CustomTopMemberCustom1|Custom1 Account|CustomTopMemberCustom2|Custom2 Account|CustomTopMemberCustom3|Custom3 Account|CustomTopMemberCustom4|Custom4 Period|Alias|Alias View|Alias|Alias Currency|Alias|Alias ConsolidationMethod|Alias|Alias !Hierarchies=Currency 'Parent|Child|Scale|TranslationOperator|DisplayInICT|Alias=English|Alias=French #root|CAD|Whole||Y|| #root|CHF|Whole||Y|| #root|CNY|Whole||Y|| #root|CZK|Whole||Y|| #root|EUR|Whole||Y|| #root|GBP|Whole||Y|| #root|HUF|Whole||Y|| #root|JPY|Whole||Y|| #root|PLN|Whole||Y|| #root|SGD|Whole||Y|| #root|USD|Whole||Y|| !Hierarchies=ConsolidationMethod 'Parent|Child|UsedByCalcRoutine|IsHoldingMethod|ToPercentControlComp|ToPercentControl|PercentConsol|PercentConsolValue|Control|Alias=English|Alias=French #root|EXIT2|N|N||0||||| #root|EXIT1|N|N||0||||| #root|NON_CONSOL|Y|N|<|20|PERCENTAGE|0|No|| #root|EQUITY|Y|N|<|50|POWNMIN||Limited|| #root|PROPORT|Y|N|<=|50|POWNMIN||Limited|| #root|HOLDING|Y|Y|<=|100|PERCENTAGE|100||| #root|GLOBAL|Y|N|<=|100|PERCENTAGE|100|Full|| !Hierarchies=Scenario 'Parent|Child|IsPrimary|DefaultFrequency|DefaultView|ZeroViewForNonAdj|ZeroViewForAdj|ConsolidateYTD|MaximumReviewLevel|UsesLineItems|HfmEnableProcessManagement|SecurityClass|EnableDataAudit|DefFreqForICTrans|UserDefined1|UserDefined2|UserDefined3|Alias=English|Alias=French #root|[None]|Y|MTD|YTD|YTD|YTD|Y|1|N|Y||N|YTD||||[None]|[None] #root|ACTUAL|Y|MTD|YTD|YTD|YTD|Y|10|N|Y||N|YTD||||Actual|Consolidation #root|BUDGET|Y|MTD|YTD|YTD|YTD|Y|10|N|Y||N|YTD||||Budget|Budget #root|FORECAST|Y|MTD|YTD|YTD|YTD|Y|10|N|Y||N|YTD||||Forecast|Prévisionnel #root|SIMULATION|Y|MTD|YTD|YTD|YTD|Y|10|N|Y||N|YTD||||Simulation|Simulation SIMULATION|SIMU1|Y|MTD|YTD|YTD|YTD|Y|10|N|Y||N|YTD||||Simulation 1|Simulation 1 SIMULATION|SIMU2|Y|MTD|YTD|YTD|YTD|Y|10|N|Y||N|YTD||||Simulation 2|Simulation 2 !Hierarchies=Entity 'Parent|Child|IsPrimary|Currency|AllowAdjs|AllowAdjFromChildren|HoldingCompany|SecurityAsPartner|IsICP|SecurityClass|UserDefined1|UserDefined2|UserDefined3|Alias=English|Alias=French #root|[None]|Y||N|N|||N|||||[None]|[None] #root|GROUP|Y|EUR|Y|Y|Entity_EUR||N|||||Total Group|Total Groupe GROUP|Entity_EUR|Y|EUR|Y|N|||Y|||||Entity in EUR currency|Entité en EUR GROUP|Entity_CAD|Y|CAD|Y|Y|||Y||||LE#|Entity in CAD currency|Entité en CAD Entity_CAD|Entity_CAD1|Y|CAD|Y|N|||Y|||Entity_CAD||BU1 in CAD currency|BU1 en CAD Entity_CAD|Entity_CAD2|Y|CAD|Y|N|||Y|||Entity_CAD||BU2 in CAD currency|BU2 en CAD Entity_CAD|Entity_CAD3|Y|CAD|Y|N|||Y|||Entity_CAD||BU3 in CAD currency|BU3 en CAD GROUP|Entity_CHF|Y|CHF|Y|N|||Y|||||Entity in CHF currency|Entité en CHF GROUP|Entity_CNY|Y|CNY|Y|Y|||Y||||LE#|Entity in CNY currency|Entité en CNY Entity_CNY|Entity_CNY1|Y|CNY|Y|N|||Y|||Entity_CNY||BU1 in CNY currency|BU1 en CNY Entity_CNY|Entity_CNY2|Y|CNY|Y|N|||Y|||Entity_CNY||BU2 in CNY currency|BU2 en CNY GROUP|Entity_CZK|Y|CZK|Y|N|||Y|||||Entity in CZK currency|Entité en CZK GROUP|Entity_GBP|Y|GBP|Y|Y|||Y||||LE#|Entity in GBP currency|Entité en GBP Entity_GBP|Entity_GBP_T1|Y|GBP|Y|Y|||Y|||Entity_GBP|LE#|SubEntity1 in GBP currency|SubEntité1 en GBP Entity_GBP_T1|Entity_GBP1|Y|GBP|Y|N|||Y|||Entity_GBP||BU1 in GBP currency|BU1 en GBP Entity_GBP_T1|Entity_GBP2|Y|GBP|Y|N|||Y|||Entity_GBP||BU2 in GBP currency|BU2 en GBP Entity_GBP|Entity_GBP_T2|Y|GBP|Y|Y|||Y|||Entity_GBP|LE#|SubEntity2 in GBP currency|SubEntité2 en GBP Entity_GBP_T2|Entity_GBP3|Y|GBP|Y|N|||Y|||Entity_GBP||BU3 in GBP currency|BU3 en GBP Entity_GBP_T2|Entity_GBP4|Y|GBP|Y|N|||Y|||Entity_GBP||BU4 in GBP currency|BU4 en GBP GROUP|Entity_HUF|Y|HUF|Y|N|||Y|||||Entity in HUF currency|Entité en HUF GROUP|Entity_JPY|Y|JPY|Y|N|||Y|||||Entity in JPY currency|Entité en JPY GROUP|Entity_PLN|Y|PLN|Y|N|||Y|||||Entity in PLN currency|Entité en PLN GROUP|Entity_SGD|Y|SGD|Y|N|||Y|||||Entity in SGD currency|Entité en SGD GROUP|Entity_USD|Y|USD|Y|N|||Y|||||Entity in USD currency|Entité en USD GROUP|E1|Y|CAD|Y|N|||Y|||||Entity E1|Entité E1 GROUP|E2|Y|CAD|Y|N|||Y|||||Entity E2|Entité E2 GROUP|E3|Y|CAD|Y|N|||Y|||||Entity E3|Entité E3 GROUP|E4|Y|CAD|Y|N|||Y|||||Entity E4|Entité E4 GROUP|E5|Y|CAD|Y|N|||Y|||||Entity E5|Entité E5 GROUP|E6|Y|CAD|Y|N|||Y|||||Entity E6|Entité E6 GROUP|E7|Y|CAD|Y|N|||Y|||||Entity E7|Entité E7 GROUP|E8|Y|CAD|Y|N|||Y|||||Entity E8|Entité E8 GROUP|E9|Y|CAD|Y|N|||Y|||||Entity E9|Entité E9 GROUP|E10|Y|CAD|Y|N|||Y|||||Entity E10|Entité E10 GROUP|E11|Y|CAD|Y|N|||Y|||||Entity E11|Entité E11 GROUP|E12|Y|CAD|Y|N|||Y|||||Entity E12|Entité E12 GROUP|E13|Y|CAD|Y|N|||Y|||||Entity E13|Entité E13 GROUP|E14|Y|CAD|Y|N|||Y|||||Entity E14|Entité E14 GROUP|E15|Y|CAD|Y|N|||Y|||||Entity E15|Entité E15 GROUP|E16|Y|CAD|Y|N|||Y|||||Entity E16|Entité E16 GROUP|E17|Y|CAD|Y|N|||Y|||||Entity E17|Entité E17 GROUP|E18|Y|CAD|Y|N|||Y|||||Entity E18|Entité E18 GROUP|E19|Y|CAD|Y|N|||Y|||||Entity E19|Entité E19 GROUP|E20|Y|CAD|Y|N|||Y|||||Entity E20|Entité E20 GROUP|E21|Y|CAD|Y|N|||Y|||||Entity E21|Entité E21 GROUP|E22|Y|CAD|Y|N|||Y|||||Entity E22|Entité E22 GROUP|E23|Y|CAD|Y|N|||Y|||||Entity E23|Entité E23 GROUP|E24|Y|CAD|Y|N|||Y|||||Entity E24|Entité E24 GROUP|E25|Y|CAD|Y|N|||Y|||||Entity E25|Entité E25 GROUP|E26|Y|CAD|Y|N|||Y|||||Entity E26|Entité E26 GROUP|E27|Y|CAD|Y|N|||Y|||||Entity E27|Entité E27 GROUP|E28|Y|CAD|Y|N|||Y|||||Entity E28|Entité E28 GROUP|E29|Y|CAD|Y|N|||Y|||||Entity E29|Entité E29 GROUP|E30|Y|CAD|Y|N|||Y|||||Entity E30|Entité E30 GROUP|E31|Y|CAD|Y|N|||Y|||||Entity E31|Entité E31 GROUP|E32|Y|CAD|Y|N|||Y|||||Entity E32|Entité E32 GROUP|E33|Y|CAD|Y|N|||Y|||||Entity E33|Entité E33 GROUP|E34|Y|CAD|Y|N|||Y|||||Entity E34|Entité E34 GROUP|E35|Y|CAD|Y|N|||Y|||||Entity E35|Entité E35 GROUP|E36|Y|CAD|Y|N|||Y|||||Entity E36|Entité E36 GROUP|E37|Y|CAD|Y|N|||Y|||||Entity E37|Entité E37 GROUP|E38|Y|CAD|Y|N|||Y|||||Entity E38|Entité E38 GROUP|E39|Y|CAD|Y|N|||Y|||||Entity E39|Entité E39 GROUP|E40|Y|CAD|Y|N|||Y|||||Entity E40|Entité E40 GROUP|E41|Y|CAD|Y|N|||Y|||||Entity E41|Entité E41 GROUP|E42|Y|CAD|Y|N|||Y|||||Entity E42|Entité E42 GROUP|E43|Y|CAD|Y|N|||Y|||||Entity E43|Entité E43 GROUP|E44|Y|CAD|Y|N|||Y|||||Entity E44|Entité E44 GROUP|E45|Y|CAD|Y|N|||Y|||||Entity E45|Entité E45 GROUP|E46|Y|CAD|Y|N|||Y|||||Entity E46|Entité E46 GROUP|E47|Y|CAD|Y|N|||Y|||||Entity E47|Entité E47 GROUP|E48|Y|CAD|Y|N|||Y|||||Entity E48|Entité E48 GROUP|E49|Y|CAD|Y|N|||Y|||||Entity E49|Entité E49 GROUP|E50|Y|CAD|Y|N|||Y|||||Entity E50|Entité E50 GROUP|E51|Y|CAD|Y|N|||Y|||||Entity E51|Entité E51 GROUP|E52|Y|CAD|Y|N|||Y|||||Entity E52|Entité E52 GROUP|E53|Y|CAD|Y|N|||Y|||||Entity E53|Entité E53 GROUP|E54|Y|CAD|Y|N|||Y|||||Entity E54|Entité E54 GROUP|E55|Y|CAD|Y|N|||Y|||||Entity E55|Entité E55 GROUP|E56|Y|CAD|Y|N|||Y|||||Entity E56|Entité E56 GROUP|E57|Y|CAD|Y|N|||Y|||||Entity E57|Entité E57 GROUP|E58|Y|CAD|Y|N|||Y|||||Entity E58|Entité E58 GROUP|E59|Y|CAD|Y|N|||Y|||||Entity E59|Entité E59 GROUP|E60|Y|CAD|Y|N|||Y|||||Entity E60|Entité E60 GROUP|E61|Y|CAD|Y|N|||Y|||||Entity E61|Entité E61 GROUP|E62|Y|CAD|Y|N|||Y|||||Entity E62|Entité E62 GROUP|E63|Y|CAD|Y|N|||Y|||||Entity E63|Entité E63 GROUP|E64|Y|CAD|Y|N|||Y|||||Entity E64|Entité E64 GROUP|E65|Y|CAD|Y|N|||Y|||||Entity E65|Entité E65 GROUP|E66|Y|CAD|Y|N|||Y|||||Entity E66|Entité E66 GROUP|E67|Y|CAD|Y|N|||Y|||||Entity E67|Entité E67 GROUP|E68|Y|CAD|Y|N|||Y|||||Entity E68|Entité E68 GROUP|E69|Y|CAD|Y|N|||Y|||||Entity E69|Entité E69 GROUP|E70|Y|CAD|Y|N|||Y|||||Entity E70|Entité E70 GROUP|E71|Y|CAD|Y|N|||Y|||||Entity E71|Entité E71 GROUP|E72|Y|CAD|Y|N|||Y|||||Entity E72|Entité E72 GROUP|E73|Y|CAD|Y|N|||Y|||||Entity E73|Entité E73 GROUP|E74|Y|CAD|Y|N|||Y|||||Entity E74|Entité E74 GROUP|E75|Y|CAD|Y|N|||Y|||||Entity E75|Entité E75 GROUP|E76|Y|CAD|Y|N|||Y|||||Entity E76|Entité E76 GROUP|E77|Y|CAD|Y|N|||Y|||||Entity E77|Entité E77 GROUP|E78|Y|CAD|Y|N|||Y|||||Entity E78|Entité E78 GROUP|E79|Y|CAD|Y|N|||Y|||||Entity E79|Entité E79 GROUP|E80|Y|CAD|Y|N|||Y|||||Entity E80|Entité E80 GROUP|E81|Y|CAD|Y|N|||Y|||||Entity E81|Entité E81 GROUP|E82|Y|CAD|Y|N|||Y|||||Entity E82|Entité E82 GROUP|E83|Y|CAD|Y|N|||Y|||||Entity E83|Entité E83 GROUP|E84|Y|CAD|Y|N|||Y|||||Entity E84|Entité E84 GROUP|E85|Y|CAD|Y|N|||Y|||||Entity E85|Entité E85 GROUP|E86|Y|CAD|Y|N|||Y|||||Entity E86|Entité E86 GROUP|E87|Y|CAD|Y|N|||Y|||||Entity E87|Entité E87 GROUP|E88|Y|CAD|Y|N|||Y|||||Entity E88|Entité E88 GROUP|E89|Y|CAD|Y|N|||Y|||||Entity E89|Entité E89 GROUP|E90|Y|CAD|Y|N|||Y|||||Entity E90|Entité E90 GROUP|E91|Y|CAD|Y|N|||Y|||||Entity E91|Entité E91 GROUP|E92|Y|CAD|Y|N|||Y|||||Entity E92|Entité E92 GROUP|E93|Y|CAD|Y|N|||Y|||||Entity E93|Entité E93 GROUP|E94|Y|CAD|Y|N|||Y|||||Entity E94|Entité E94 GROUP|E95|Y|CAD|Y|N|||Y|||||Entity E95|Entité E95 GROUP|E96|Y|CAD|Y|N|||Y|||||Entity E96|Entité E96 GROUP|E97|Y|CAD|Y|N|||Y|||||Entity E97|Entité E97 GROUP|E98|Y|CAD|Y|N|||Y|||||Entity E98|Entité E98 GROUP|E99|Y|CAD|Y|N|||Y|||||Entity E99|Entité E99 GROUP|E100|Y|CAD|Y|N|||Y|||||Entity E100|Entité E100 #root|ACTIVITY|Y|EUR|Y|Y|||N||||GROUP|Organisation by activity|Organisation par activité ACTIVITY|ACT1|Y|EUR|Y|Y|||Y||||GROUP|Level activity 1|Niveau d'activité 1 ACT1|Entity_EUR|N|EUR|Y|N|||Y|||||| ACT1|Entity_CAD1|N|CAD|Y|N|||Y|||Entity_CAD||| ACT1|Entity_CHF|N|CHF|Y|N|||Y|||||| ACT1|Entity_CNY1|N|CNY|Y|N|||Y|||Entity_CNY||| ACT1|Entity_GBP1|N|GBP|Y|N|||Y|||Entity_GBP||| ACTIVITY|ACT2|Y|EUR|Y|Y|||Y||||GROUP|Level activity 2|Niveau d'activité 2 ACT2|Entity_CAD2|N|CAD|Y|N|||Y|||Entity_CAD||| ACT2|Entity_CNY2|N|CNY|Y|N|||Y|||Entity_CNY||| ACT2|Entity_CZK|N|CZK|Y|N|||Y|||||| ACT2|Entity_GBP2|N|GBP|Y|N|||Y|||Entity_GBP||| ACT2|Entity_HUF|N|HUF|Y|N|||Y|||||| ACTIVITY|ACT3|Y|EUR|Y|Y|||Y||||GROUP|Level activity 3|Niveau d'activité 3 ACT3|Entity_CAD3|N|CAD|Y|N|||Y|||Entity_CAD||| ACT3|Entity_GBP3|N|GBP|Y|N|||Y|||Entity_GBP||| ACT3|Entity_GBP4|N|GBP|Y|N|||Y|||Entity_GBP||| ACT3|Entity_JPY|N|JPY|Y|N|||Y|||||| ACT3|Entity_PLN|N|PLN|Y|N|||Y|||||| ACT3|Entity_SGD|N|SGD|Y|N|||Y|||||| ACT3|Entity_USD|N|USD|Y|N|||Y|||||| #root|GEO|Y|EUR|Y|Y|||N||||GROUP|Organisation by geographical area|Organisation par zone géographique GEO|AREA1|Y|EUR|Y|Y|||Y||||GROUP|France|France AREA1|Entity_EUR|N|EUR|Y|N|||Y|||||| GEO|AREA2|Y|EUR|Y|Y|||Y||||GROUP|Spain|Espagne AREA2|Entity_CNY|N|CNY|Y|Y|||Y||||LE#|| GEO|AREA3|Y|EUR|Y|Y|||Y||||GROUP|Eastern Europe|Europe Occidentale AREA3|Entity_CHF|N|CHF|Y|N|||Y|||||| AREA3|Entity_CZK|N|CZK|Y|N|||Y|||||| AREA3|Entity_GBP|N|GBP|Y|Y|||Y||||LE#|| AREA3|Entity_HUF|N|HUF|Y|N|||Y|||||| AREA3|Entity_PLN|N|PLN|Y|N|||Y|||||| GEO|AREA4|Y|EUR|Y|Y|||Y||||GROUP|Rest of the world|Reste du monde AREA4|Entity_CAD|N|CAD|Y|Y|||Y||||LE#|| AREA4|Entity_JPY|N|JPY|Y|N|||Y|||||| AREA4|Entity_SGD|N|SGD|Y|N|||Y|||||| AREA4|Entity_USD|N|USD|Y|N|||Y|||||| !Hierarchies=Account 'Parent|Child|IsPrimary|ConsolidationAccountType|IsCalculated|IsConsolidated|PlugAccount|CustomTopMemberCustom1|CustomTopMemberCustom2|CustomTopMemberCustom3|CustomTopMemberCustom4|NumDecimalPlaces|EnableCustomAggrCustom1|EnableCustomAggrCustom2|EnableCustomAggrCustom3|EnableCustomAggrCustom4|XBRLTags|ICPTopMember|IsICP|UsesLineItems|SecurityClass|EnableDataAudit|CalcAttribute|SubmissionGroup|UserDefined1|UserDefined2|UserDefined3|Alias=English|Alias=French #root|[None]|Y|REVENUE|N|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||[None]|[None] #root|RATES|Y|GROUPLABEL|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Currency Rates|Taux de change RATES|AVERATE|Y|CURRENCYRATE|N|N||||||6|Y|Y|Y|Y|||N|N||Y||1||||Average rate|Taux moyen RATES|CLORATE|Y|CURRENCYRATE|N|N||||||6|Y|Y|Y|Y|||N|N||Y||1||||Closing rate|Taux de clôture RATES|AVERATE_N1|Y|CURRENCYRATE|N|N||||||6|Y|Y|Y|Y|||N|N||Y||1||||Average rate n-1|Taux moyen n-1 RATES|CLORATEOPE|Y|CURRENCYRATE|N|N||||||6|Y|Y|Y|Y|||N|N||Y||1||||Closing rate at opening|Taux d ouverture #root|TOTASSET|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Total assets|Total actif TOTASSET|109000|Y|ASSET|N|Y|41L|FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_CA#CAPITAL|ELIM_SUBCAP|Uncalled subscribed capital|Capital souscrit non appelé TOTASSET|ASSET_NC|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Non Current Assets|Actif non courant ASSET_NC|GWTOT|Y|ASSET|Y|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Goodwill (Net)|Ecarts d acquisition (Net) GWTOT|204000|Y|ASSET|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INTANGIBLE|IMPACT_GW|Goodwill (Gross)|Ecarts d acquisition (Brut) GWTOT|290400|Y|LIABILITY|N|Y||FDEPGW|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#IMPGW|IMPACT_GW|Goodwill depreciation|Depr. pour écarts d acquisition ASSET_NC|200TOT|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Intangible assets (Net)|Immobilisations incorporelles (Net) 200TOT|20000T|Y|ASSET|Y|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Intangible assets (Gross)|Immobilisations incorporelles (Brut) 20000T|201000|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INTANGIBLE||Set up costs|Frais d établissement (Brut) 20000T|203000|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INTANGIBLE||Development expenses|Frais de développement (Brut) 20000T|205000|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INTANGIBLE||Concessions, patents, trademarks|Concessions, brevets & licences (Brut) 20000T|206000|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INTANGIBLE||Bus.Goodw. (Comp acc) goodw (Consol acc)|Fonds commercial & droit au bail (Brut) 20000T|208000|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INTANGIBLE||Other intangible assets|Autres immo. incorporelles (Brut) 20000T|237000|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INTANGIBLE||Payments on account|Avances & acptes sur immo. incorp. (Brut 200TOT|28000T|Y|LIABILITY|Y|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Depreciation of intangible assets|Immobilisations incorporelles (Amt&Depr) 28000T|280100|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONI||Deprec of set up costs|Frais d établissement (Amt&Depr) 28000T|280300|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONI||Deprec of development expenses|Frais de développement (Amt&Depr) 28000T|280500|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONI||Deprec of conc., patents, trademarks|Concessions, brevets,licences (Amt&Depr) 28000T|280600|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONI||Depr.of business gw (Comp.Acc)|Fonds commercial,droit bail (Amt&Depr) 28000T|280800|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONI||Deprec of other int. assets|Autres immo. incorporelles (Amt&Depr) 28000T|293700|Y|LIABILITY|N|Y||FIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONI||Deprec of payments on account|Avances & acptes sur immo. incorp. (Prov ASSET_NC|210TOT|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Tangible assets (Net)|Immobilisations corporelles (Net) 210TOT|21000T|Y|ASSET|Y|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Tangible assets (Gross)|Immobilisations corporelles (Brut) 21000T|211010|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TANGIBLE||Land|Terrains & aménagements (Brut) 21000T|213010|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TANGIBLE||Buildings|Constructions & aménagements (Brut) 21000T|215010|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TANGIBLE||Equipment, tools and machinery|Install. tech., matériel & out. (Brut) 21000T|218210|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TANGIBLE||Transport equipment|Matériel de transport (Brut) 21000T|218310|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TANGIBLE||Office equipment and furniture, computer|Matériel de bureau, info. & mob. (Brut) 21000T|218100|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TANGIBLE||Other tangible assets|Autres immo. corporelles (Brut) 21000T|231000|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TANGIBLE||Current tangible assets|Immo. corporelles en cours (Brut) 21000T|238000|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TANGIBLE||Payments on account|Avances & acptes sur immo. corp. (Brut) 210TOT|28100T|Y|LIABILITY|Y|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Depreciation of tangible assets|Immobilisations corporelles (Amt&Depr) 28100T|281101|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONT||Depreciation of land|Terrains & aménagements (Prov) 28100T|281301|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONT||Depreciation of buildings|Constructions & aménagements (Amt&Depr) 28100T|281501|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONT||Deprec of equip., tools and mach.|Install. tech, matériel, outi (Amt&Depr) 28100T|281821|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONT||Deprec of transport equip.|Matériel de transport (Amt&Depr) 28100T|281831|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONT||Depr office equipt & furnit comput|Mat. bureau, info. & mob. (Amt&Depr) 28100T|281810|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONT||Depr of tangible assets|Autres immo. corporelles (Amt&Depr) 28100T|293100|Y|LIABILITY|N|Y||FIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONT||Provisions for tangible assets|Immo. corporelles en cours (Prov) 28100T|293800|Y|LIABILITY|N|Y||FIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONT||Deprec of payments on account|Avances & acptes sur immo. corp. (Prov) ASSET_NC|250TOT|Y|ASSET|Y|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TANGIBLE||Investment Property|Immeuble de placement 250TOT|250000|Y|ASSET|N|Y||FLTREVA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TANGIBLE||Investment Property|Immeuble de placement 250TOT|285000|Y|LIABILITY|N|Y||FLTIMP|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISIONT||Depr of Investment Property|Immeuble de placement (Amt&Depr) ASSET_NC|270TOT|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial assets (net) non current|Actifs financiers (Net) Non courant 270TOT|270EQUI|Y|ASSET|Y|Y||FEQUI|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial assets equity affiliates|Actifs financiers Mise en équi 270EQUI|261EQUI|Y|ASSET|N|Y||FEQUI|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#SHARES|IMPACT_PINT|Investments in equity affiliates|Titres mis en équivalence 270EQUI|204000EQUI|Y|ASSET|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INTANGIBLE|IMPACT_GW|Goodwill in equity affiliates|Ecarts d acquisition (Brut) Mise en équi 270EQUI|290400EQUI|Y|LIABILITY|N|Y||FDEPGWEQUI|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#SHARES|IMPACT_GW|Goodwill depr. in equity affiliates|Depr. pour écarts d'acq Mise en équi 270TOT|27000T|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial assets (gross) non current|Actifs financiers (Brut) Non courant 27000T|261000|Y|ASSET|N|Y||FINV|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_TIT#SHARES|PINT_INV|Investments (Gross)|Titres de participation (Brut) 27000T|267000|Y|ASSET|N|Y|16L|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#FINIMMO|ELIM_INDEB|Loans to affiliates NC|Créances ratt. à des particip. (Brut) NC 27000T|267800|Y|ASSET|N|Y|16L|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INTERESTCR|ELIM_INDEB|Accrued interest on receiv & loans|Intérêts courus sur créances et prêts NC 27000T|272100|Y|ASSET|N|Y|16L|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#FINIMMO|ELIM_INDEB|Held to Maturity – HTM NC|Titres détenus jusqu à échéance(Brut) NC 27000T|272200|Y|ASSET|N|Y|16L|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#FINIMMO|ELIM_INDEB|Held for Trading – HFT NC|Titres détenus pour trading(Brut) NC 27000T|272300|Y|ASSET|N|Y|16L|FLTREVA||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#FINIMMO|ELIM_INDEB|Available for Sale – AFS NC|Titres disponibles à la vente (Brut) NC 27000T|274000|Y|ASSET|N|Y|16L|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#LOAN|ELIM_INDEB|Loans Non current|Prêts (Brut) Non courant 270TOT|29700T|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Provisions for financial assets NC|Prov. sur actifs financiers 29700T|296100|Y|LIABILITY|N|Y||FPRF||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PINV|Provisions for participating interests|Titres de participation (Prov) 29700T|296700|Y|LIABILITY|N|Y||FPRF||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PFIA|Prov. for loans to affiliates NC|Créances ratt. à des particip. (Prov) NC 29700T|297210|Y|LIABILITY|N|Y||FPRF||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PFIA|Prov. Held to Maturity – HTM NC|Titres détenus jusqu à échéance(Prov) NC 29700T|297220|Y|ASSET|N|Y||FPRFIMP||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PFIA|Prov. Held for Trading – HFT NC|Titres détenus pour trading(Prov) NC 29700T|297230|Y|ASSET|N|Y||FPRFIMP||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PFIA|Prov. Available for Sale – AFS NC|Titres disponibles à la vente (Prov) NC 29700T|297400|Y|LIABILITY|N|Y||FPRF||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PFIA|Provisions for loans Non current|Prêts (Prov) Non courant ASSET_NC|5010TOT|Y|ASSET|Y|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Financial derivatives NC - assets|Instruments financiers actif dérivés NC 5010TOT|501010|Y|ASSET|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Financial derivatives assets NC-exchange|Inst fin dérivés actif NC - changes 5010TOT|501020|Y|ASSET|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Financial derivatives assets NC- rate|Inst fin dérivés actif NC - taux 5010TOT|501030|Y|ASSET|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Financial derivatives asset NC-commodity|Inst fin dérivés actif NC - matières ASSET_NC|490TOT|Y|ASSET|Y|Y||FPRST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Other receivables (Net) Non current|Autres créances (Net) Non courant 490TOT|44000T|Y|ASSET|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Other receivables (Gross) Non current|Autres créances (Brut) Non courant 44000T|444010|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Income tax receivable NC|Créances s/l état. (Dont intég.) NC 44000T|455110|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Current accounts receivables NC|Comptes courants filiales (Brut) NC 44000T|462000|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Receivables on sales of fixed assets NC|Créances immo. corp. & incorp. (Brut) NC 44000T|460200|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Receivables on sales of investments NC|Créances sur cession de titres NC 44000T|460010|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Other receivables NC|Débiteurs divers (Brut) NC 44000T|488000|Y|ASSET|N|Y||FDEF||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEFTAXES||Deferred taxes receivables NC|Impôt différé actif NC 490TOT|49000T|Y|LIABILITY|Y|Y||FPR|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Prov. for other receivables Current|Autres créances (Prov) Non courant 49000T|495510|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#OTHER_OP|PROV_POTR|Allowances on current acc. Receiv. NC|Comptes courants filiales (Prov) NC 49000T|496000|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#OTHER_OP|PROV_POTR|Allowances on miscellaneous receiv. NC|Autres créances diverses (Prov) NC 49000T|496020|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#OTHER_OP|PROV_POTR|Allow on receiv. on sales of invest NC|Créances s/cessions de titres. (Prov) NC 49000T|496200|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#OTHER_OP|PROV_POTR|Allow receiv on sales of fixed assets NC|Créances immo. corp. & incorp. (Prov) NC ASSET_NC|480TOT|Y|ASSET|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Accrual and deferred income assets NC|Comptes de regularisation actif NC 480TOT|169000|Y|ASSET|N|Y||FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#OTHER_NOP||Loans & Bond discounts - NC|Prime rmbst emprunts et obligations NC 480TOT|486000|Y|ASSET|N|Y|40L|FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_NOP|ELIM_WCR|Prepayments Non current|Charges constatées d avance NC TOTASSET|ASSET_C|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Current assets|Actif courant ASSET_C|271TOT|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial assets (net) Current|Immo. financieres (Net) Ct 271TOT|27001T|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial assets (gross) Current|Immo. financieres (Brut) Ct 27001T|267001|Y|ASSET|N|Y|16L|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#FINIMMO|ELIM_INDEB|Loans to affiliates Current|Créances ratt. à des particip. (Brut) Ct 27001T|272101|Y|ASSET|N|Y|16L|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#FINIMMO|ELIM_INDEB|Held to Maturity – HTM Current|Titres détenus jusqu à échéance(Brut) Ct 27001T|272201|Y|ASSET|N|Y|16L|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#FINIMMO|ELIM_INDEB|Held for Trading – HFT Current|Titres détenus pour trading(Brut) Ct 27001T|272301|Y|ASSET|N|Y|16L|FLTREVA||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#FINIMMO|ELIM_INDEB|Available for Sale – AFS Current|Titres disponibles à la vente (Brut) Ct 27001T|274001|Y|ASSET|N|Y|16L|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#LOAN|ELIM_INDEB|Loans (Gross) - Current|Prêts (Brut) courant 271TOT|29701T|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Prov. for financial assets Current|Prov. sur immo. financières Ct 29701T|296701|Y|LIABILITY|N|Y||FPRF||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PFIA|Prov. for loans to affiliates Current|Créances ratt. à des particip. (Prov) Ct 29701T|297211|Y|LIABILITY|N|Y||FPRF||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PFIA|Prov. Held to Maturity – HTM Current|Titres détenus jusqu à échéance(Prov) Ct 29701T|297221|Y|ASSET|N|Y||FPRFIMP||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PFIA|Prov. Held for Trading – HFT Current|Titres détenus pour trading(Prov) Ct 29701T|297231|Y|ASSET|N|Y||FPRFIMP||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PFIA|Prov. Available for Sale – AFS Current|Titres disponibles à la vente (Prov) Ct 29701T|297401|Y|LIABILITY|N|Y||FPRF||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PFIA|Provisions for loans Current|Prêts (Prov) Courant ASSET_C|301TOT|Y|ASSET|Y|Y||FPRST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Inventories and WIP (Net)|Stocks & en cours (Net) 301TOT|30000T|Y|ASSET|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Inventories and WIP (Gross)|Stocks & en cours (Brut) 30000T|310000|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INVENTORIES|IMPACT_MSKT|Raw materials|Matières prem. & achats stockés (Brut) 30000T|330000|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INVENTORIES|IMPACT_MSKT|Work in process (Goods)|En cours de prod. de biens (Brut) 30000T|340000|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INVENTORIES|IMPACT_MSKT|Work in process (Services)|En cours de prod. de services (Brut) 30000T|350000|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INVENTORIES|IMPACT_MSKT|Intermediate and finished products|Produits intermédiaires & finis (Brut) 30000T|370000|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INVENTORIES|IMPACT_MSKT|Merchandise|Marchandises (Brut) 301TOT|39000T|Y|LIABILITY|Y|Y||FPRO|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Prov for Invet. & WIP|Stocks & en cours (Prov) 39000T|391000|Y|LIABILITY|N|Y||FPRO|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INVENTORIES||Provision for raw materials|Matières prem. & achats stockés (Prov) 39000T|393000|Y|LIABILITY|N|Y||FPRO|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INVENTORIES||Prov. for work in progress (Goods)|En cours de prod. de biens (Prov) 39000T|394000|Y|LIABILITY|N|Y||FPRO|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INVENTORIES||Prov. for work in progress (Services)|En cours de prod. de services (Prov) 39000T|395000|Y|LIABILITY|N|Y||FPRO|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INVENTORIES||Prov. for intermediate and finish. prod.|Produits intermédiaires et finis (Prov) 39000T|397000|Y|LIABILITY|N|Y||FPRO|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INVENTORIES||Prov. for merchandise|Marchandises (Prov) ASSET_C|411TOT|Y|ASSET|Y|Y||FPRST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Accrual other operat. receivables (Net)|Clients & autres creances d Expl. (Net) 411TOT|41000T|Y|ASSET|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Accrual other operat receivables (Gross)|Clients & autres creances d Expl. (Brut) 41000T|409100|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#RECEIVABLES|ELIM_WCR|Payments on account on orders|Avances & acptes versés sur com. (Brut) 41000T|409800|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#RECEIVABLES|ELIM_WCR|Receivables payables|Avoirs à recevoir des fournis. (Brut) 41000T|410000|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#RECEIVABLES|ELIM_WCR|Accounts receivable|Créances clients & cptes ratt. (Brut) 41000T|420010|Y|ASSET|N|Y||FST||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#RECEIVABLES||Employee receivables|Créances sur personnel 41000T|430010|Y|ASSET|N|Y||FST||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#RECEIVABLES||Social receivables|Créances sociales 411TOT|41900T|Y|LIABILITY|Y|Y||FPRO|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Prov. for acc and oth operat receivables|Clients & autres creances d Expl. (Prov) 41900T|490910|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#RECEIVABLES|PROV_PTRA|Allowances on payments on acc. on orders|Avances & acptes versés sur com. (Prov) 41900T|491100|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#RECEIVABLES|PROV_PTRA|Provisions for accounts receivable|Créances clients & cptes ratt. (Prov) 41900T|490980|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#RECEIVABLES|PROV_PTRA|Provisions for receivables payables|Avoirs à recevoir des fournis. (Prov) ASSET_C|491TOT|Y|ASSET|Y|Y||FPRST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Other receivables (Net) current|Autres creances (Net) Ct 491TOT|44001T|Y|ASSET|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Other receivables (Gross) Current|Autres creances (Brut) Ct 44001T|488001|Y|ASSET|N|Y||FDEF||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEFTAXES||Deferred taxes receivables Current|Impôt différé actif Ct 44001T|444011|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Income tax receivable Current|Créances s/l état. (Dont intég.) Ct 44001T|455111|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Current subsidiaries receivables|Comptes courants filiales (Brut) Ct 44001T|456200|Y|ASSET|N|Y|41L|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_SUBCAP|Unpaid, called subscribed capital|Actionnaire Capital appelé, non versé 44001T|458100|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Receivables snc|Créances snc 44001T|457100|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Partners: Dividend receivables|Associés - dividendes à recevoir 44001T|462001|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Receiv on sales of fixed assets Curr|Créances immo. corp. & incorp. (Brut) Ct 44001T|460201|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Receivables on sales of investments Curr|Créances sur cession de titres Ct 44001T|460011|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_OP|ELIM_WCR|Other receivables Curr|Débiteurs divers (Brut) Ct 44001T|468010|Y|ASSET|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INTERESTCR|ELIM_WCR|Accrued interest on receivables Curr|Intérêts courus sur créances Ct 491TOT|49001T|Y|LIABILITY|Y|Y||FPRO|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Provisions for other receivables Curr|Autres creances (Prov) Ct 49001T|495511|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#OTHER_OP|PROV_POTR|Subsidiaries account receivables|Comptes courants filiales (Prov) 49001T|496001|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#OTHER_OP|PROV_POTR|Allow. On other receivables|Autres créances diverses (Prov) 49001T|496021|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#OTHER_OP|PROV_POTR|Allow on receiv. on sales of invest Curr|Créances s/cessions de titres. (Prov) Ct 49001T|496201|Y|LIABILITY|N|Y||FPRO||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#OTHER_OP|PROV_POTR|Allow receiv on sale of fixed asset Curr|Créances immo. corp. & incorp. (Prov) Ct ASSET_C|5011TOT|Y|ASSET|Y|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Financial derivatives Curr - assets|Instruments financiers actif dérivés Ct 5011TOT|501011|Y|ASSET|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Financ. derivatives assets Curr-exchange|Inst fin dérivés actif Ct - changes 5011TOT|501021|Y|ASSET|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Financial derivatives assets Curr - rate|Inst fin dérivés actif Ct - taux 5011TOT|501031|Y|ASSET|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Financ. derivatives asset Curr-commodity|Inst fin dérivés actif Ct - matières ASSET_C|511TOT|Y|ASSET|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Net cash (Net)|Disponibilites (Net) 511TOT|51000T|Y|ASSET|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Net cash (Gross)|Disponibilites (Brut) 51000T|510010|Y|ASSET|N|Y||FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#CASH||Cash at banks & deposits not remunerated|Banques 51000T|511000|Y|ASSET|N|Y||FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#CASH||Cash in flow|Valeurs à l Encaissement 51000T|516100|Y|ASSET|N|Y||FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#CASH||Fixed term deposit less than 3 months|Dépôts à terme inférieur à 3 mois 51000T|516200|Y|ASSET|N|Y||FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#CASH||Fixed term deposit greater than 3 month|Dépôts à terme supérieur à 3 mois 51000T|530000|Y|ASSET|N|Y||FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#CASH||Cash and bank deposit|Caisses, ccp 511TOT|591000|Y|LIABILITY|N|Y||FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#CASH||Allowances on cash and bank deposits|Disponibilités (Prov) ASSET_C|481TOT|Y|ASSET|Y|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Accrual and deferred income assets Curr|Comptes de regularisation actif courant 481TOT|169001|Y|ASSET|N|Y|40L|FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_NOP|ELIM_WCR|Loans & Bond discounts - Current|Prime rmbst emprunts et obligations Ct 481TOT|476000|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#OTHER_NOP||Adjustment from currency translation|Ecart de conversion actif 481TOT|481000|Y|ASSET|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#OTHER_NOP||Deferred expenses|Charges à répartir 481TOT|486001|Y|ASSET|N|Y|40L|FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_NOP|ELIM_WCR|Prepayments Current|Charges constatées d avance Ct ASSET_C|241TOT|Y|ASSET|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Assets - Discontinuing activities IAS 35|Actif destinés à vente, abandon activité 241TOT|240000|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#OTHER_NOP||Assets - Discontinuing activities IAS 35|Actif destinés à vente, abandon activité TOTASSET|CONTRA|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Total contra-account|Compte de liaison total CONTRA|16L|Y|ASSET|N|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#PLUG|IMPACT_ELIM|Contra accounts long term|Liaison long terme CONTRA|40L|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#PLUG|IMPACT_ELIM|Contra account short term|Liaison court terme CONTRA|18TOT|Y|ASSET|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Contra acc for investment elim|Liaison titres de particip. 18TOT|18L|Y|ASSET|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#PLUG|IMPACT_PINT|Contra acc for investment elim|Liaison titres de particip. (Détentrice) 18TOT|18LP|Y|ASSET|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#PLUG|IMPACT_PINT|Contra acc for invest. elim - affiliates|Liaison titres de particip. (Détenue) CONTRA|41TOT|Y|ASSET|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Contra account subscribed capital|Liaison souscription capital 41TOT|41L|Y|ASSET|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#PLUG|IMPACT_ELIM|Contra account subscribed capital-receiv|Liaison souscription capital (receveuse) 41TOT|41LP|Y|ASSET|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#PLUG|IMPACT_ELIM|Contra account subscribed capital|Liaison souscription capital (versante) #root|TOTLIAB|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Total liability|Total passif TOTLIAB|10TOT|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Shareholders' Equity|Capitaux propres total 10TOT|10100T|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Equity|Capitaux propres 10100T|101000|Y|LIABILITY|N|Y||FCA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#CAPITAL|CAPI_CAP|Subscribed capital|Capital social 10100T|104000|Y|LIABILITY|N|Y||FCA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#CAPITAL|CAPI_CAP|Share issue premium account|Primes d émission, de fusion & d apport 10100T|105000|Y|LIABILITY|N|Y||FCA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#CAPITAL|CAPI_CAP|Revaluation reserve|Réserve de réévaluation 10100T|106100|Y|LIABILITY|N|Y||FCA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#CAPITAL|CAPI_CAP|Legal reserve|Réserve légale 10100T|106500|Y|LIABILITY|N|Y||FCADEF|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#CAPITAL|CAPI_CAP|Other reserves -without dividend distrib|Autres réserves non distribuables 10100T|106800|Y|LIABILITY|N|Y||FCA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#CAPITAL|CAPI_CAP|Reserves (For dividends distribution)|Réserves distribuables 10100T|110000|Y|LIABILITY|N|Y||FCA|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#CAPITAL|CAPI_CAP|Retained earnings|Report à nouveau 10100T|120000|Y|LIABILITY|N|Y||FRES|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||RESULT#NRESULT|RESU_CAP|Income of the year|Résultat de l exercice 10100T|107000|Y|LIABILITY|N|Y||FCAREV|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#RFTA|CAPI_CAPFTA|First time application reserves|Réserves de première application 10100T|10700T|Y|LIABILITY|Y|Y||FCAREV|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#CAPITAL||FV revaluation reserve|Ecart de réev JV 10700T|107100|Y|LIABILITY|N|Y||FCAREV|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#REEV1|CAPI_CAPREV01|FV reserves adjust -fin derivatives|Ecart de réev JV Inst fin Dérivés 10700T|107200|Y|LIABILITY|N|Y||FCAREV|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#REEV2|CAPI_CAPREV02|FV reserves adjust-other fin assets|Ecart de réev JV autres actifs fin. 10700T|107300|Y|LIABILITY|N|Y||FCAREV|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#REEV3|CAPI_CAPREV03|FV reserves adjust- tang/Int assets|Ecart de réev JV immobilisations 10TOT|10600T|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Consolidated result and reserves|Réserves & résultats consolidés 10600T|1060T|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Total consolidated reserves|Total reserves consolidees 1060T|106G|Y|LIABILITY|N|Y||FCR|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_CA#RESERVES|CAPI_CAP|Group reserves|Réserves groupe 1060T|106CG|Y|LIABILITY|N|Y||FCAT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#RESERVES|CAPIC_CAP|Group translation adjust-reserves|Ecarts de conversion sur réserves groupe 1060T|120G|Y|LIABILITY|N|Y||FRES|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||RESULT#NRESULT|RESU_CAP|Group net income (Loss)|Résultat groupe 1060T|120CG|Y|LIABILITY|N|Y||FREST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#RESERVES|RESUC_CAP|Group translat. adjust-net income (Loss)|Ecarts de conversion sur résultat groupe 10600T|106A|Y|LIABILITY|N|Y||FAUTO|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OSHARES|CAPI_CAP|Self owned share|Auto-Contrôle 10600T|106T|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Adjustments and translation effects|Impact retraitements & conversion 106T|106R|Y|LIABILITY|N|Y||FCR|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||HIST_CA#RESERVES|CAPI_CAP|Adjusted reserves|Réserves retraitements 106T|120R|Y|LIABILITY|Y|Y||FRES|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||RESULT#NRESULT|RESU_CAP|Adjusted net income (Loss)|Résultat retraitements 106T|106C|Y|LIABILITY|N|Y||FCAT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#RESERVES|CAPIC_CAP|Translation adjust-reserves|Ecarts de conversion sur réserves 106T|120C|Y|LIABILITY|N|Y||FREST|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#RESERVES|RESUC_CAP|Translation adjust-net income(Loss)|Ecarts de conversion sur résultat 10TOT|1060MT|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Minorities interests|Interets minoritaires 1060MT|106M|Y|LIABILITY|N|Y||FCR|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_CA#RESERVES|IMPACT_CAP|Minority reserves|Réserves minoritaires 1060MT|106CM|Y|LIABILITY|N|Y||FCAT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_CA#RESERVES|IMPACT_CAP|Minority translation adjust-reserves|Ecarts de conversion sur réserves minos 1060MT|120M|Y|LIABILITY|N|Y||FRES|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||RESULT#NRESULT|IMPACT_CAP|Minority net income (Loss)|Résultat minoritaires 1060MT|120CM|Y|LIABILITY|N|Y||FREST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||RESULT#RESERVES|IMPACT_CAP|Mino. translat. adjust-net income (Loss)|Ecarts de conversion sur résultat minos TOTLIAB|LIAB_NC|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Non current Liabilities|Passif non courant LIAB_NC|140TOT|Y|LIABILITY|Y|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Regulatory provisions|Prov. reglementees 140TOT|142000|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for investment|Prov. pour investissement 140TOT|143100|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for prices increase|Prov. pour hausse des prix 140TOT|145000|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Accelerated depreciation|Amort. dérogatoires 140TOT|146000|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Special provision of revaluation|Prov. spéciale de réévaluation 140TOT|147000|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Reinvested gains|Plus-Values réinvesties (Art. 40) 140TOT|148100|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for foreign establishment|Prov. pour implantation à l étranger 140TOT|148200|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Other regulatory provisions|Autres provisions réglementées LIAB_NC|150TOT|Y|LIABILITY|Y|Y||FPR|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Prov. for liabilities and charges NC|Prov. pour risques & charges NC 150TOT|15000T|Y|LIABILITY|Y|Y||FPR|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Provisions for liabilities NC|Prov. pour risques NC 15000T|151100|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for disputes NC|Prov. pour litiges et procès NC 15000T|151200|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for guarantee NC|Prov. pour garantie NC 15000T|151500|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for exchange contingencies|Prov. pour risque de change 15000T|151600|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PSRI|Provisions for subsidiary risk NC|Prov. pour risque filiale NC 15000T|151700|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for restructuring NC|Prov. pour restructuration NC 15000T|151750|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for treasury products|Prov. sur instruments de trésorerie 15000T|151400|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for tax risk|Prov. pour amendes et pénalités 15000T|151800|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_POLC|Other provisions for liabilities NC|Autres provisions pour risques NC 150TOT|15500T|Y|LIABILITY|Y|Y||FPR|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Provisions for expenses NC|Prov. pour charges 15500T|153000|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for pension NC|Prov. pour retraite NC 15500T|155000|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEFTAXES||Provisions for.Deferred taxes NC|Prov. d'impôt différé actif NC 15500T|158000|Y|LIABILITY|N|Y||FPR||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_POLC|Other provisions for expenses NC|Autres provisions pour charges NC LIAB_NC|160TOT|Y|LIABILITY|Y|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial loans and debts|Emprunts & dettes financieres NC 160TOT|161000|Y|LIABILITY|N|Y||FLT||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBT||Convertible bond loans NC|Emprunts obligataires convertibles 160TOT|163000|Y|LIABILITY|N|Y||FLT||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBT||Other bond loans NC|Autres emprunts obligataires 160TOT|164000|Y|LIABILITY|N|Y||FLT||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBT||Loans to banks NC|Emprunts auprès des établ. de crédit 160TOT|164500|Y|LIABILITY|N|Y||FLT||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBT||Loans (Leasing)|Emprunts en crédit-bail 160TOT|165000|Y|LIABILITY|N|Y|16L|FLT||MAT_CURR|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTNC|ELIM_INDEB|Deposit and guarantees received|Dépôts & cautionnements reçus 160TOT|166000|Y|LIABILITY|N|Y||FLT||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBTNC||Non-Voting shares|Participation des salariés 160TOT|170000|Y|LIABILITY|N|Y|16L|FLT||MAT_CURR|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBT|ELIM_INDEB|Sharing linked liabilities|Dettes rattachées à des participations 160TOT|168100|Y|LIABILITY|N|Y|16L|FLT||MAT_CURR|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBT|ELIM_INDEB|Other financial debts|Autres emprunts 160TOT|168800|Y|LIABILITY|N|Y|16L|FLT||MAT_CURR|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INTERESTCP|ELIM_INDEB|Accrued interest on debts|Intérêts courus sur emprunts NC LIAB_NC|450TOT|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Other debts and adjusting accounts NC|Autres dettes & comptes de regul. NC 450TOT|44400T|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Other debts NC|Autres dettes NC 44400T|444020|Y|LIABILITY|N|Y|40L|FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTNC|ELIM_WCR|Taxes payable (Income-tax) NC|Dettes sur état (Dont intég.) NC 44400T|455120|Y|LIABILITY|N|Y|40L|FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTNC|ELIM_WCR|Curr account subsidiary(Debitor)-NC part|Comptes courants filiales NC 44400T|405000|Y|LIABILITY|N|Y|40L|FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTNC|ELIM_WCR|Debt relat to purchase of fixed asset NC|Dettes immobil. & cptes ratt. NC 44400T|460020|Y|LIABILITY|N|Y|40L|FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTNC|ELIM_WCR|Other payables - non current|Créditeurs divers NC 44400T|489000|Y|LIABILITY|N|Y||FDEF||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEFTAXES||Deferred taxes NC|Impôt différé passif NC 450TOT|48700T|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Accrual and deferred income liab NC|Comptes de regularisation passif NC 48700T|130000|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INVSUBSIDIES||Investment subsidies Non current|Subventions d Investissement NC 48700T|167000|Y|LIABILITY|N|Y||FLT||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBTNC||Subordinated loans Non current|Avances conditionnées NC 48700T|487000|Y|LIABILITY|N|Y|40L|FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_NOP|ELIM_WCR|Deferred income NC|Produits constatés d avance NC LIAB_NC|5020TOT|Y|LIABILITY|Y|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Financial derivatives NC - liabilities|Instruments financiers passif dérivés NC 5020TOT|502010|Y|LIABILITY|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Fin. derivatives liabilities NC-exchange|Inst. Fin. dérivés passif NC - changes 5020TOT|502020|Y|LIABILITY|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Fin. derivatives liabilities NC - rate|Inst. Fin. dérivés passif NC - taux 5020TOT|502030|Y|LIABILITY|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Fin derivatives liabilities NC-commodity|Inst. Fin. dérivés passif NC - matières TOTLIAB|LIAB_C|Y|LIABILITY|Y|Y||TF|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Current Liabilities|Passif courant LIAB_C|151TOT|Y|LIABILITY|Y|Y||FPRST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Prov. for liabilities and charges Curr|Prov. pour risques & charges 151TOT|15001T|Y|LIABILITY|Y|Y||FPR|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Provisions for liabilities Current|Prov. pour risques 15001T|151101|Y|LIABILITY|N|Y||FPR|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for disputes Current|Prov. pour litiges et procès Ct 15001T|151201|Y|LIABILITY|N|Y||FPR|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for guarantee Current|Prov. pour garantie Ct 15001T|151601|Y|LIABILITY|N|Y||FPR|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_PSRI|Provisions for subsidiary risk Current|Prov. pour risque filiale Ct 15001T|151701|Y|LIABILITY|N|Y||FPR|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for restructuring Current|Prov. pour restructuration Ct 15001T|151801|Y|LIABILITY|N|Y||FPR|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_POLC|Other provisions for liabilities Current|Autres provisions pour risques Ct 151TOT|15501T|Y|LIABILITY|Y|Y||FPRST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Provisions for expenses Current|Prov. pour charges 15501T|153001|Y|LIABILITY|N|Y||FPR|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PROVISION||Provisions for pension Current|Prov. pour retraite Ct 15501T|155001|Y|LIABILITY|N|Y||FPR|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEFTAXES||Prov. deferred taxes Current|Prov.d'impôt différé actif Ct 15501T|158001|Y|LIABILITY|N|Y||FPR|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PR#PROVISION|PROV_POLC|Other provisions for expenses Current|Autres provisions pour charges Ct LIAB_C|161TOT|Y|LIABILITY|Y|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial loans and debts Current|Emprunts & dettes financieres Ct 161TOT|161001|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBT||Convertible bond loans Current|Emprunts obligataires convertibles Ct 161TOT|163001|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBT||Other bond loans Current|Autres emprunts obligataires 161TOT|164001|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBT||Loans to banks Current|Emprunts auprès des établ. de crédit Ct 161TOT|168101|Y|LIABILITY|N|Y|16L|FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBT|ELIM_INDEB|Other financial debts Current|Autres emprunts Ct 161TOT|168801|Y|LIABILITY|N|Y|16L|FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INTERESTCP|ELIM_INDEB|Accrued interest on debts Current|Intérêts courus sur emprunts Ct LIAB_C|400TOT|Y|LIABILITY|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Trade and other operating debts|Fournisseurs & autres dettes d Exploit. 400TOT|400000|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#PAYABLE|ELIM_WCR|Trade acc. payable and related payables|Dettes fournisseurs & cptes ratt. 400TOT|419100|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#PAYABLE|ELIM_WCR|Payments received on account of orders|Avances & acptes reçus sur com. 400TOT|419800|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#PAYABLE|ELIM_WCR|Notes receivables - customers|Avoir à établir aux clients 400TOT|420020|Y|LIABILITY|N|Y||FST||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBTC||Employee debts|Dettes sur le personnel 400TOT|430020|Y|LIABILITY|N|Y||FST||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBTC||Social contributions|Dettes sociales LIAB_C|451TOT|Y|LIABILITY|Y|Y||FPRST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Other debts and adjusting accounts Curr|Autres dettes & comptes de regul. Ct 451TOT|44401T|Y|LIABILITY|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Other debts Curr|Autres dettes 44401T|269000|Y|LIABILITY|N|Y|41LP|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTC|ELIM_SUBCAP|Payments on securities|Souscription de titres 44401T|269100|Y|LIABILITY|N|Y|41LP|FLT||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTC|ELIM_SUBCAP|Payments on securities to be received|Versement sur titres à libérer 44401T|444021|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTC|ELIM_WCR|Taxes payable (Income-tax) Curr|Dettes sur état (Dont intég.) Ct 44401T|455121|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTC|ELIM_WCR|Curr account subsidiary(Debitor)-ST part|Comptes courants filiales Ct 44401T|458000|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTC|ELIM_WCR|Payables snc|Dettes snc 44401T|457000|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTC|ELIM_WCR|Partners-dividends payable|Associés - dividendes à payer 44401T|404000|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTC|ELIM_WCR|Debts relat. to investments|Dettes sur acquisition de titres 44401T|405001|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTC|ELIM_WCR|Debts relat to purchase of f. asset Curr|Dettes immobil. & cptes ratt. Ct 44401T|424000|Y|LIABILITY|N|Y||FST||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBTC||Employees sharing|Participation des salariés (C/C) 44401T|460021|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#DEBTC|ELIM_WCR|Other debts Curr|Créditeurs divers Ct 44401T|468020|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#INTERESTCP|ELIM_WCR|Accrued interest on debts Curr|Intérêts courus sur dettes Ct 44401T|489001|Y|LIABILITY|N|Y||FDEF||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEFTAXES||Deferred taxes Current|Impôt différé passif Ct 451TOT|48701T|Y|LIABILITY|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Accrual and deferred income liab Curr|Comptes de regularisation passif Ct 48701T|130001|Y|LIABILITY|N|Y||FLT|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#INVSUBSIDIES||Investment subsidies Current|Subventions d Investissement Ct 48701T|167001|Y|LIABILITY|N|Y||FST||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBTC||Subordinated loans Current|Avances conditionnées Ct 48701T|487001|Y|LIABILITY|N|Y|40L|FST||MATURITY|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#OTHER_NOP|ELIM_WCR|Deferred income Curr|Produits constatés d avance Ct 48701T|477000|Y|LIABILITY|N|Y||FST||MATURITY|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#OTHER_NOP||Adjustment from currency translation|Ecart de conversion passif LIAB_C|5021TOT|Y|LIABILITY|Y|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Financial derivatives Curr - liabilities|Instruments financiers passif dérivés Ct 5021TOT|502011|Y|LIABILITY|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Fin derivative liabilities Curr-exchange|Inst. Fin. dérivés passif Ct - changes 5021TOT|502021|Y|LIABILITY|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Fin. derivatives liabilities Curr - rate|Inst. Fin. dérivés passif Ct - taux 5021TOT|502031|Y|LIABILITY|N|Y||FDER|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DERIVINSTR||Fin derivat. liabilities Curr -commodity|Inst. Fin. dérivés passif Ct - matières LIAB_C|519TOT|Y|LIABILITY|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Current banks aids|Concours bancaires courants 519TOT|510020|Y|LIABILITY|N|Y||FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBTC||Current bank supports|Découverts bancaires 519TOT|519000|Y|LIABILITY|N|Y||FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBTC||Short term facilities|Facilités à court terme 519TOT|519100|Y|LIABILITY|N|Y||FST||MAT_CURR|ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DEBTC||Not matured Notes Receivables|Effets escomptés non échus LIAB_C|172TOT|Y|ASSET|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Liab. Discontinuing operation|Passif destinés à vente,abandon activité 172TOT|172000|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#OTHER_NOP||Liab. Discontinuing operation|Passif destinés à vente,abandon activité #root|NETINCG|Y|REVENUE|Y|Y||||COUNTRIES|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Net income group|Resultat net - part du groupe NETINCG|NETINC|Y|REVENUE|Y|Y||||COUNTRIES|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Net income|Resultat net NETINC|NETINC_M|Y|REVENUE|Y|Y||||COUNTRIES|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Net income before mino & gw|Resultat avant minoritaires & survaleur NETINC_M|EBIT|Y|REVENUE|Y|Y||||COUNTRIES|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Earning Before Income Tax|Resultat courant avant impôts EBIT|OPERES|Y|REVENUE|Y|Y||||COUNTRIES|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Operating income|Resultat d exploitation OPERES|OPERCF|Y|REVENUE|Y|Y||||COUNTRIES|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Operating cash flow|Excédent brut Opérationnel OPERCF|70TOT|Y|REVENUE|Y|Y||||COUNTRIES|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Operating products|Produits d exploitation 70TOT|70000T|Y|REVENUE|Y|Y||||COUNTRIES|ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Turnover|Chiffre d affaires 70000T|701000|Y|REVENUE|N|Y|65L|||COUNTRIES|ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Sales of finished products|Ventes de produits finis 70000T|707000|Y|REVENUE|N|Y|65L|||COUNTRIES|ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Sales of merchandise|Ventes de marchandises 70000T|704000|Y|REVENUE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Works|Travaux et Etudes 70000T|706000|Y|REVENUE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Sales of services|Prestations de services 70000T|708000|Y|REVENUE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Revenue from other activities|Produits des activités annexes 70000T|709000|Y|REVENUE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Sales returns and allowances|R.R.R. accordés 70TOT|71000T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Other operating products|Autres produits d exploitation 71000T|713500|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_MSKT|Changes in invent. (Finished products)|Production stockée (Var) 71000T|720000|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Capitalized expenses|Production immobilisée 71000T|740000|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Operating subsidies|Subventions d exploitation 71000T|750000|Y|REVENUE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Other operating revenues|Autres produits d exploitation 71000T|755000|Y|REVENUE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Share upon joint-venture operations|Qp sur opérations faites en commun (Pdt 71000T|777000|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Portion of invest.Subsidies comp./Result|Qp des subventions virée au résultat 71000T|779000|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Effect of method change|Incidence des chgts de méthode 71000T|791000|Y|REVENUE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Transfers of operating expenses|Transfert de charges d exploitation 70TOT|78000T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Reversal of operating provisions|Reprises de provisions d exploitation 78000T|781110|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Reversal of amt intang assets|Repr amort. & Prov immo.incorp 78000T|781120|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Reversal of amt tang assets|Repr amort. & Prov immo.corp 78000T|781510|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Reversal of prov.-liabilities & charges|Repr. expl. prov. pour risques & charge 78000T|781600|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Revers. of oper. deferred taxes|Repr. prov. expl impôts différés 78000T|781710|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Revers.of oper. provis. on inventories|Repr. expl. prov. sur stocks 78000T|781720|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Revers.of oper. provis. on trade receiv.|Repr. expl. prov. sur clients 78000T|781730|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Revers.of oper. provis. on other receiv.|Repr. expl. prov. sur autres créances 78000T|787200|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Revers.of reglementary provisions|Repr. provisions réglementées 78000T|787500|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release used restructuring provisions|Repr. prov. pour restruct. utilisées 78000T|787590|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release non used restructuring prov.|Repr. prov. pour restruct. non utilisée OPERCF|60TOT|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Operating expenses|Charges d exploitation 60TOT|61000T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Total consumed purchase|Achats consommes 61000T|601000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Purch. of raw materials and other prod.|Achats de matières prem. & approv. 61000T|603000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_MSKT|Changes in invent(Rm & goods for resale)|Variation des stocks de mp & approv. 61000T|603700|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_MSKT|Changes in inventories (Merchandises)|Variation des stocks de marchandises 61000T|604000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Purch, and services|Achats études et prestations de services 61000T|606000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Purch.of rm supplies, not in invent.|Achats non stockés matériel et fours 61000T|607000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Purchase of goods for resale|Achats de marchandises 61000T|609000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Discount|R.R.R. obtenus 60TOT|62000T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Other operating expenses|Autres charges d exploitation 62000T|611000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Other purchases and input expenses|Sous-traitance générale 62000T|612000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Leasing|Redevances de crédit-bail mobilier 62000T|613000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Rents|Locations et charges locatives 62000T|615000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Repairs and maintenance|Entretien et réparations 62000T|616000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Insurance|Primes d assurance 62000T|617000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Research and development|Recherches et développement 62000T|618000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Misc documentation|Divers documentation, séminaires 62000T|621000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|External staff|Honoraires, prestations extérieures 62000T|622000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Interim fees|Rémun d intermédiaires & honoraires 62000T|623000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Publicity ans public relation|Pub, publication, relations publiques 62000T|624000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Transp. of goods and of collective staff|Transp de biens, transp coll personnel 62000T|625000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Travel and meetings|Déplacements, missions et réceptions 62000T|626000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Postal and telecom. costs|Frais postaux & de télécommunications 62000T|627000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Bank services and assimilated|Services bancaires & assimilés 62000T|628000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Various services|Prestations de services diverses 62000T|651000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Leasing allowed|Redevances versées 62000T|654000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Loss on receivables|Pertes sur créances irrécouvrables 62000T|655000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Share result of joint venture|Qp sur opérations faites en commun (Chg 62000T|658000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Other operating expenses|Autres charges d exploitation 62000T|678500|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Restructuration costs|Coûts de restructuration 60TOT|63000T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Total tax|Impots & taxes 63000T|631000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Salary taxes|Impôts & taxes sur rémunérations 63000T|635110|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Professional taxes|Taxe professionnelle 63000T|635120|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Real estate taxes|Taxes foncières 63000T|635130|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Other local tax|Autres impôts locaux 63000T|635140|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Tax on company vehicles|Taxe sur les véhicules de sociétés 63000T|635200|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||VAT not recoverable|TVA non récupérable 63000T|637000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Other taxes|Autres impôts & taxes 60TOT|64000T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Payroll costs|Charges de personnel 64000T|641000|Y|EXPENSE|N|Y|65L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_OPE|Wages and salaries|Salaires & traitements 64000T|645000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Social security contributions|Charges de sécurité sociale 64000T|645100|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Contingency funds contributions|Charges de prévoyance 64000T|645200|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Pension contributions|Cotisations de retraite 64000T|647000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Other social contributions|Autres charges sociales 64000T|648000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Other employee contributions|Autres charges de personnel 64000T|691000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Employee profit sharing|Intéressement & participation 60TOT|68000T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Operating amortisation|Dot. aux amort. & prov. d Exploitation 68000T|681110|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Prov/amt intang assets|Dot/ amort. & Prov immo.incorp 68000T|681120|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Prov/amt tang assets|Dot/ amort. & Prov immo.corp 68000T|681510|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Provisions for liabilities and charges|Dot. expl. prov. pour risques & charges 68000T|681600|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Prov. for oper. deferred taxes|Dot. prov. expl. impôts différés 68000T|681710|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Provisions for inventories|Dot. expl. prov. sur stocks 68000T|681720|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Provisions for trade receiv.|Dot. expl. prov. sur clients 68000T|681730|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Provisions for other receiv.|Dot. expl. prov. sur autres créances 68000T|687200|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Provisions of reglementary provisions|Dot. provisions réglementées 68000T|687500|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Provisions for used restructurion|Dot. prov. pour restructuration 68000T|687700|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Provisions for deferred charges|Dot. prov. pour Charges à répartir 60TOT|787TOT|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Impairment fixed assets|Dépréciations sur immobilisations 787TOT|7871T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Release exc. prov & depr on tang. assets|Reprises dépréciations sur immo 7871T|787100|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Impairment on intan assets|Impairment repr sur immo.incorp. 7871T|787110|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Impairment on tang assets|Impairment repr sur immo.corp. 7871T|787120|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Impairment on fin assets|Impairment repr sur immo.fin. 7871T|799000|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Negative Goodwill|Ecarts d acquisition négatif 787TOT|6871T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Provisions and depr on fixed assets|Dotations dépréciations sur immo 6871T|687100|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Reversal of Impairment on intan assets|Impairment dot sur immo.incorp. 6871T|687110|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Reversal of Impairment on tang assets|Impairment dot sur immo.corp. 6871T|687120|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Reversal of Impairment on fin assets|Impairment dot sur immo.fin. 6871T|680400|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_GW|Depreciation of goodwill|Dot. dépr. des écarts d acquisition OPERCF|65L|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_ELIM|Operating contra account|Ecart sur opérations réciproques expl. OPERCF|STKL|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_MSTK|Profit / stock contra account|Compte de liaison marges / stocks OPERES|770TOT|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Proceed of sales of assets|Résultat de cessions d éléments d actif 770TOT|77000T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Sale price of tang &intan asset disposed|Pdts des cessions d élements d actif 77000T|775000|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#GLINTAN|IMPACT_GL|Prod. of sales of intang. assets|Pdts cessions d immo.incorp 77000T|775500|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#GLTAN|IMPACT_GL|Prod. of sales of tang. assets|Pdts cessions immo.corp 770TOT|67000T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Net book value on sales of assets|VNC des elements d actif cedes 67000T|675000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#GLINTAN|IMPACT_GL|Net book val. sales of intang assets|VNC des immo. inc. cédées 67000T|675500|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#GLTAN|IMPACT_GL|Net book val. sales of tang assets|VNC des immo.corp. cédées EBIT|FINRES|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial result|Resultat financier FINRES|76TOT|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial revenues|Produits financiers 76TOT|76000T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial revenues on investments|Produits financiers de participation 76000T|761000|Y|REVENUE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Revenues exp. and assimilated expenses|Revenus d int sur emp & autres dettes 76000T|761100|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||DIVI_DIV|Dividends|Dividendes reçus 76000T|761200|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||INTDIVI_INTDIV|Interim revenues from particip interests|Acomptes sur dividendes reçus 76000T|761500|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Snc profits|Résultats bénéficiaires des snc 76000T|761700|Y|REVENUE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Revenues on subsidiary receivables|Revenus des créances sur filiales 76000T|762000|Y|REVENUE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Revenues from other financial assets|Revenus des autres immo. financières 76000T|763000|Y|REVENUE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Revenues from operating receivables|Revenus des créances d Exploitation 76000T|764000|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Revenues from marketable securities|Revenus des vmp 76000T|766000|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Foreign exchange profit|Gains de change & opérations à terme 76000T|767000|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Net reven. from disp.of mark. securities|Produits nets sur cessions de vmp 76000T|768000|Y|REVENUE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Other interests and assimilated|Autres produits financiers 76000T|769000|Y|REVENUE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Assets withdrawals received|Abandons de créances reçues 76000T|778200|Y|REVENUE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Merger revenue|Boni de fusion 76000T|796000|Y|REVENUE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Transfers of interest expenses|Transfert de charges financières 76TOT|77600T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Proceed on sale of other fin assets|Res de cessions autres actifs financiers 77600T|776000|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#GLFI|IMPACT_GL|Products of sales of sharing|Pdts des cessions de titres de part. 77600T|775600|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#GLFI|IMPACT_GL|Products of sales of other fin. assets|Pdts des cessions d autres immo. fin. 77600T|676000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#GLFI|IMPACT_GL|Net book value on sales of investments|VNC des titres de part. cédés 77600T|675600|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#GLFI|IMPACT_GL|Net book value sales of other fin assets|VNC des autres immo. fin. cédées 76TOT|78600T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Release of financial provisions|Reprises de provisions financieres 78600T|786510|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Rel of prov. for liabilities and charges|Repr. fin. prov. pour charges 78600T|786520|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Release of prov. on subsidiary charges|Reprise prov. risques filiales 78600T|786600|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Revers. of fin. deferred taxes|Repr. prov. fin. impôts différés 78600T|786620|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Release of prov. of other fin. assets|Repr. fin. prov. sur autres immo. fin. 78600T|786621|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Release of provisions for investments|Repr. fin. prov. sur titres de particip. FINRES|66TOT|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial expenses|Charges financieres 66TOT|66000T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Interest and assimilated expenses|Interets & charges assimilees 66000T|661000|Y|EXPENSE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Interest exp. and assimilated expenses|Charges d int sur emp & autres dettes 66000T|661700|Y|EXPENSE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Interest expenses on subsidiaries|Charges d Intérêts sur filiales 66000T|661800|Y|EXPENSE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Interest expenses on operating debts|Charges d Intérêts sur dettes d expl. 66000T|662000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Expenses on financial derivatives|Charges liées aux instruments financiers 66000T|666000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Foreign exchange loss|Pertes de change 66000T|666700|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_DIV|Exchange adjustment dividend ig|Ecart de change sur dividendes ig 66000T|667000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Net exp. from disp. of trans. securities|Charges nettes sur cessions de vmp 66000T|661500|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Snc loss|Résultats déficitaires des snc 66000T|668000|Y|EXPENSE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Various financial expenses|Charges financières diverses 66000T|668100|Y|EXPENSE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Withdrawal debt|Abandon de créances financier 66000T|664000|Y|EXPENSE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Financial assets withdrawals|Abandons de créances accordés 66000T|678200|Y|EXPENSE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||ELIM_FIN|Merger expenses|Mali de fusion 66TOT|68600T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Financial depreciation and amortisation|Dot. aux amort. & prov. financières 68600T|686510|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Prov. for fin.Liabilities and charges|Dot. fin. prov. pour charges 68600T|686520|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Provisions on subsidiary charges|Dotation prov. risques filiales 68600T|686600|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Provisions for fin. deferred taxes|Dot. prov. fin pour impôts différés 68600T|686620|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Prov. fin. for other fin assets|Dot. fin. prov. sur autres immo. fin. 68600T|686621|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_PROV|Provisions for investments|Dot. prov. sur titres de participation FINRES|66L|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_ELIM|Financial contra account|Ecart sur opérations réciproques fin. EBIT|880DIS|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_DETAIL|Shares in net income of equity|Résultat des activités abandonnées NETINC_M|69000T|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Income tax|Impots sur les resultats 69000T|695000|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#TAX||Owed corporate income tax|Impôt exigible (intégration fiscale) 69000T|695000DIS|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#TAX|IMPACT_DETAIL|Profit on stock equity|Impôts - activités abandonnées 69000T|695100|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#TAX|IMPACT_DIV|Distribution tax|Impôt de distribution 69000T|699000|Y|EXPENSE|N|Y|66L||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#TAX|ELIM_FIN|Deferred taxes|Impôts différés 69000T|699200|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#TAX||Carry back|Carry back NETINC|TOTEQUI|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Total shares in net income of equity|Total part résultat net MEE TOTEQUI|880EQUI|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#EQUITY|IMPACT_DETAIL|Shares in net income of equity|Part dans le résultat net MEE TOTEQUI|PSTKEQUI|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||#EQUITY|IMPACT_DETAIL|Profit on stock equity|Marge sur stock MEE NETINCG|MINOINT|Y|EXPENSE|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||IMPACT_CALC|Minority interests|Interets minoritaires #root|FIN_NOTES|Y|GROUPLABEL|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Financial notes|Annexes FIN_NOTES|CASHFLOW|Y|GROUPLABEL|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash flow statement|Tableau des flux de trésorerie CASHFLOW|CFVAR|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash flow - variation (calculated)|Trésorerie - mouvement (calculée) CFVAR|CFOT|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Net cash from operations|Flux de tréso liés aux activités opérat. CFOT|CFO100T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash generated from operations|Tréso dégagée des activités opérat. CFO100T|CFO110|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Income before tax|Resultat avant impôt CFO100T|CFO130|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Gain and loss on disposal of asset|PMV cession d actifs CFO100T|CFO140T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Amortizations and provisions|Amortissements et provisions CFO140T|CFO141|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Amortizations tangible assets|Amort. immos corporelles CFO140T|CFO142|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Depreciations tangible assets|Dépréciation immos corporelles CFO140T|CFO143|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Amortizations intangible assets|Amort. immos incorporelles CFO140T|CFO144|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Depreciations intangible assets|Dépréciation immos incorporelles CFO140T|CFO145|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Goodwill depreciation|Prov. pour écarts d acquisition CFO140T|CFO146|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Amortizations and provisions|Autres Provisions CFO140T|CFO147|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Taxes and deferred taxes|Impôts différés CFO100T|CFO150|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Taxes and deferred taxes|Impôts sur le résultat CFO100T|CFO160|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Interest paid|Intérêts payés CFOT|CFO200T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash generated from operating WCR|Incidence de la var de BFR opérat. CFO200T|CFO210|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Inventories|Stocks CFO200T|CFO220|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Receivables|Créances clients CFO200T|CFO230|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Payables|Fournisseurs CFO200T|CFO240|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Other op WCR|Autres - BFR exploitation CFOT|CFO300T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash generated from non operating WCR|Incidence de la var de BFR non opérat. CFO300T|CFO310|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Other non op WCR|Autres - BFR non opérationnelle CFO300T|CFO320|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Plug account|Comptes de liaison CFOT|CFO400T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Other operations with non cash effect|Autres opérations non cash CFO400T|CFO410|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||FV reserves adjust -fin derivatives|Réévaluation JV Inst fin Dérivés CFO400T|CFO420|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||FV reserves adjust-other fin assets|Réévaluation JV autres actifs fin. CFO400T|CFO430|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||FV reserves adjust- tang/Int assets|Réévaluation JV immobilisations CFO400T|CFO490|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||FV reserves adjust- Group reserves|Réévaluation - Réserves consolidés CFVAR|CFIT|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Net cash used in investing activities|Flux de tréso liés aux activités invest CFIT|CFI100T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash flow from investments|Besoin de trésorerie (investissement) CFI100T|CFI110|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Purchase of tangible assets|Acquisition d immo.corporelles CFI100T|CFI120|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Purchase of intangible assets|Acquisition d immo.incorporelles CFI100T|CFI130|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Purchase of financial assets|Acquisition d immo.financières CFI100T|CFI140|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Purchase of self owned shares|Acquisition des titres - auto contrôle CFI100T|CFI150|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Prêts et avances consentis|Prêts et avances consentis CFI100T|CFI160|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Interest received|Intérêts reçus CFIT|CFI200T|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Resources related to investments|Ressources liées aux investissements CFI200T|CFI210|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Investment subsidies|Subventions d investissements CFI200T|CFI220|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Disposal of tangible assets|Cession d immo.corporelles CFI200T|CFI230|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Disposal of intangible assets|Cession d immo.incorporelles CFI200T|CFI240|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Disposal of financial assets|Cession d immo.financières CFI200T|CFI250|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Dividended received|Dividendes reçus hors mise en équiv. CFI200T|CFI260|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Equity|Résultat des mises en équivalence CFVAR|CFFT|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Net cash used in financing activities|Flux de tréso liés aux activités fin CFFT|CFF100|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Capital increase|Augmentation de capital CFFT|CFF200|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||New debt|Emissions d’emprunts CFFT|CFF300|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Reimbursement of debt|Remboursements d’emprunts CFFT|CFF400|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Increase (dec) other long term debt|Aug (dim) autres dettes financières NC CFFT|CFF500|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Increase (dec) other short term debt|Aug (dim) autres dettes financières Ct CFFT|CFF600|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Paid dividends|Dividendes versés CFVAR|CFDT|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Remaining differences|Ecarts non expliqués CFDT|CFDIFFFX|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Remaining differences - translation diff|Ecarts non expliqués - écarts de conv CFDT|CFDIFFVAR|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Remaining differences - conso method var|Ecarts non expliqués - var méth conso CFDT|CFDIFFREC|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Remaining differences - reclassification|Ecarts non expliqués - reclassement CFDT|CFDIFFMRG|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Remaining differences - merger|Ecarts non expliqués - fusion CFDT|CFDIFFENT|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Remaining differences - new entrance|Ecarts non expliqués - entrée périmètre CFDT|CFDIFFERR|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Remaining differences - check|Ecarts non expliqués - erreur CFDT|CFDIFFEXIT|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Remaining differences - exit|Ecarts non expliqués - sortie CFDT|CFDIFFFTA|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Remaining differences - FTA|Ecarts non expliqués - première appli. CASHFLOW|CFCASHVAR|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash flow|Variation de trésorerie CFCASHVAR|CFCLO|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash flow - closing (calculated)|Trésorerie - clôture (calculée) CFCASHVAR|CFOPE|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash flow - opening|Trésorerie - ouverture CASHFLOW|CFOTHERDIFF|Y|REVENUE|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash Flow - Cash|Autres variation sur trésorerie CFOTHERDIFF|CFOFX|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash Flow - translation diff|écarts de conv sur trésorerie CFOTHERDIFF|CFOVAR|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash Flow - conso method var|var méth conso sur trésorerie CFOTHERDIFF|CFOREC|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash Flow - reclassification|reclassement sur trésorerie CFOTHERDIFF|CFOMRG|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash Flow - merger|fusion sur trésorerie CFOTHERDIFF|CFOENT|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash Flow - new entrance|entrée périmètre sur trésorerie CFOTHERDIFF|CFOERR|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash Flow - check|erreur sur trésorerie CFOTHERDIFF|CFOEXIT|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash Flow - exit|sortie sur trésorerie CFOTHERDIFF|CFOFTA|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Cash Flow - FTA|Ecarts première appli. Trésorerie FIN_NOTES|OG_INVEST|Y|ASSET|Y|Y||TF||||0|Y|Y|Y|Y|||N|N||Y||1||||Invest in non conso cies (outside group)|Titres non consolidés (hors-groupe) OG_INVEST|261_OG|Y|ASSET|N|Y||FINV||OGPART||0|Y|Y|Y|Y|||N|N||Y||1||||Detail of invest in non conso cies|Détail titres non conso (hors-groupe) FIN_NOTES|OFFBS|Y|GROUPLABEL|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Off-Balance sheet|Engagements hors-Bilan OFFBS|GCOMMT|Y|ASSET|Y|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Commitments and guarantees given|Engagements et garanties donnés GCOMMT|GPENSION|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Pensions|Retraites GCOMMT|GMORT|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Mortgages|Hypothèques GCOMMT|GENDOR|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Endorsement given|Avals donnés GCOMMT|GSECUR|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Security given|Cautions données GCOMMT|GGUAR|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Guarantees given|Garanties données GCOMMT|GNOTDUE|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Account receiv not due given|Effets escomptés non échus donnés GCOMMT|GMON_COMM|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Monetary commitments given|Eng marché à terme (Monét) donnés GCOMMT|GMAR_COMM|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Merchandise commitments given|Eng marché à terme (March) donnés GCOMMT|GOTHCOMM|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Other commitments given|Autres engagements donnés OFFBS|RCOMMT|Y|ASSET|Y|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Commitments and guarantees received|Engagements et garanties reçus RCOMMT|RENDOR|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Endorsement received|Avals reçus RCOMMT|RSECUR|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Security received|Cautions reçues RCOMMT|RGUAR|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Guarantees received|Garanties reçues RCOMMT|RRSEC|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Real received securities|Sûretés réelles reçues RCOMMT|RNOTDUE|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Account receiv not due given|Effets escomptés non échus reçus RCOMMT|RRCANCEL|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Receivables cancellation|Abandons de créances RCOMMT|RASSET|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Received assets|Actions déposées RCOMMT|RMON_COMM|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Monetary commitments received|Eng marché à terme (Monét) reçus RCOMMT|RMAR_COMM|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Merchandise commitments received|Eng marché à terme (March) reçus RCOMMT|ROTHCOMM|Y|ASSET|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Other commitments received|Autres engagements reçus FIN_NOTES|HEADCOUNT|Y|GROUPLABEL|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Headcount|Effectifs HEADCOUNT|TOTSTAFF|Y|BALANCE|Y|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Total staff|Total effectifs TOTSTAFF|TOTMGT|Y|BALANCE|Y|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Total management staff|Total management TOTMGT|MGTF|Y|BALANCE|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Management staff - female|Management - femmes TOTMGT|MGTM|Y|BALANCE|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Management staff - male|Management - hommes TOTSTAFF|TOTEMP|Y|BALANCE|Y|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Total non management staff|Total non management TOTEMP|EMPF|Y|BALANCE|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Non management staff - female|Non management - femmes TOTEMP|EMPM|Y|BALANCE|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Non management staff - male|Non management - hommes HEADCOUNT|SALWGES|Y|EXPENSE|Y|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Total salaries & wages|Total salaires SALWGES|MGTCOST|Y|EXPENSE|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Employees costs - management|Salaires management SALWGES|EMPCOST|Y|EXPENSE|N|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Employees costs - non management|Salaires non management FIN_NOTES|RATIO|Y|GROUPLABEL|Y|Y||||||0|Y|Y|Y|Y|||N|N||Y||1||||Ratios|Ratios RATIO|ROE|Y|BALANCE|N|Y||||||2|Y|Y|Y|Y|||N|N||Y||1||||Return on equity|ROE RATIO|ROCE|Y|BALANCE|N|Y||||||2|Y|Y|Y|Y|||N|N||Y||1||||Return on capital employed|ROCE RATIO|RONA|Y|BALANCE|N|Y||||||2|Y|Y|Y|Y|||N|N||Y||1||||Return on net assets|RONA RATIO|NIR|Y|BALANCE|N|Y||||||2|Y|Y|Y|Y|||N|N||Y||1||||Net indebtedness rate|Taux d endettement net RATIO|CAF|Y|BALANCE|N|Y||||||2|Y|Y|Y|Y|||N|N||Y||1||||self-financing capacity|Capacité d autofinancement RATIO|TAF|Y|BALANCE|N|Y||||||2|Y|Y|Y|Y|||N|N||Y||1||||self-financing Rate|Taux d autofinancement #root|TOTCHECK|Y|GROUPLABEL|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Blocking & non blocking checks|Contrôles bloquants et non bloquants TOTCHECK|VALIDATION_CHECK|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||Y|N||Y||1||||Validation Checks|Controles bloquants VALIDATION_CHECK|BC1|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Asset equals liability|Actif égale passif VALIDATION_CHECK|BC2|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||B/S result equals net result (P&L)|Résultat bilan égale résultat net VALIDATION_CHECK|BC3|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Flow error asset is 0|Flux erreur actif à 0 VALIDATION_CHECK|BC4|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Flow error liability is 0|Flux erreur passif à 0 VALIDATION_CHECK|BC5|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Flow reclassification is 0|Flux reclassement à 0 VALIDATION_CHECK|BC6|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Flow for new entrance is 0|Flux d Entrée à 0 VALIDATION_CHECK|BC7|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Flow for appropriation is 0|Flux d Affectation à 0 VALIDATION_CHECK|BC8|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Equi result B/S equals P&L|Résultat mee au bilan égale P&L VALIDATION_CHECK|BC9|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Flow Merge equals Merge P&L|Flux Fusion eq boni mali fusion résultat VALIDATION_CHECK|CANCEL_CHECK|Y|REVENUE|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Cancelation check|Compte administrateur d'annulation TOTCHECK|ADMIN_CHECK|Y|REVENUE|N|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Admin. cancelation check|Compte déclencheur de l'annulation TOTCHECK|CHECK|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Checks|Contrôles non bloquants CHECK|NBC_INVENT|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Var. inventory P&L - BS|Var. stocks resultat - bilan NBC_INVENT|INVENT_713500|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Fin products / var. inventory P&L - BS|Produits / var. stocks résultat - bilan NBC_INVENT|INVENT_603700|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Merchandise / var. inventory P&L - BS|March. / var. stocks résultat - bilan NBC_INVENT|INVENT_603000|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Raw materials / var. inventory P&L - BS|Mat prem / var. stocks résultat - bilan CHECK|NBC_REVERSAL|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Reversal of provisions P&L - BS|Repr. provisions resultat - bilan NBC_REVERSAL|REV_781110|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Reversal of amt intang assets|Repr. amort. & prov. immo.incorp NBC_REVERSAL|REV_781120|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Reversal of amt tang assets|Repr. amort. & prov. immo.corp NBC_REVERSAL|REV_781510|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Reversal of prov.-liabilities & charges|Repr. expl. prov. pour risques & charge NBC_REVERSAL|REV_781710|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Revers.of oper. provis. on inventories|Repr. expl. prov. sur stocks NBC_REVERSAL|REV_781720|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Revers.of oper. provis. on trade receiv.|Repr. expl. prov. sur clients NBC_REVERSAL|REV_781730|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Revers.of oper. provis. on other receiv.|Repr. expl. prov. sur autres créances NBC_REVERSAL|REV_786510|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Rel of prov. for liabilities and charges|Repr. fin. prov. pour charges NBC_REVERSAL|REV_786520|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release of prov. on subsidiary charges|Reprise prov. risques filiales NBC_REVERSAL|REV_786620|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release of prov. of other fin. assets|Repr. fin. prov. sur autres immo. fin. NBC_REVERSAL|REV_786621|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release of provisions for investments|Repr. fin. prov. sur titres de particip. NBC_REVERSAL|REV_787100|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release prov & depr on intan assets|Impairment Repr. sur immo.incorp. NBC_REVERSAL|REV_787110|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release prov & depr on tang assets|Impairment Repr. sur immo.corp. NBC_REVERSAL|REV_787120|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release prov & depr on fin assets|Impairment Repr. sur immo. fin. NBC_REVERSAL|REV_787200|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Releases from reglementary provisions|Dot. provisions réglementées NBC_REVERSAL|REV_787500|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release restructuring provisions|Repr. prov. pour restruct NBC_REVERSAL|REV_781600|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Provisions operat. for deferred taxes|Repr. expl prov. impôts différés NBC_REVERSAL|REV_786600|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Prov. fin. for deferred taxes|Repr. fin prov. impôts différés CHECK|NBC_DEPREC|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Depreciation P&L - BS|Dot. provisions resultat - bilan NBC_DEPREC|DEPR_680400|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Depreciation of goodwill|Dot. amort. des écarts d acquisition NBC_DEPREC|DEPR_681110|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Prov/amt intang assets|Dot/ amort. & prov. immo.incorp NBC_DEPREC|DEPR_681120|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Prov/amt tang assets|Dot/ amort. & prov. immo.corp NBC_DEPREC|DEPR_681510|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Provisions for liabilities and charges|Dot. expl. prov. pour risques & charges NBC_DEPREC|DEPR_681710|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Allowances for inventories|Repr. expl. prov. sur stocks NBC_DEPREC|DEPR_681720|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Allowances for trade receiv.|Repr. expl. prov. sur clients NBC_DEPREC|DEPR_681730|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Allowances for other receiv.|Repr. expl. prov. sur autres créances NBC_DEPREC|DEPR_686510|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Prov. for fin.Liabilities and charges|Dot. fin. prov. pour charges NBC_DEPREC|DEPR_686520|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Provisions for subsidiary charges|Dotation prov. risques filiales NBC_DEPREC|DEPR_686620|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Provisions for other financial assets|Dot. prov. sur autres immo. financières NBC_DEPREC|DEPR_686621|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Provisions for investments|Dot. prov. sur titres de participation NBC_DEPREC|DEPR_687100|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Deprec. & prov on intang assets|Impairment Dot. sur immo.incorp. NBC_DEPREC|DEPR_687110|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Deprec. & prov on tang assets|Impairment Dot. sur immo.corp. NBC_DEPREC|DEPR_687120|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Deprec. & prov on fin assets|Impairment Dot. sur immo. fin. NBC_DEPREC|DEPR_687200|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release on reglementary provisions|Dot. provisions réglementées NBC_DEPREC|DEPR_687500|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Amort. of used restructuring provisions|Dot. prov. pour restructuration NBC_DEPREC|DEPR_681600|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release operat. on deferred taxes|Dot. expl prov. impôts différés NBC_DEPREC|DEPR_686600|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Release financial on deferred taxes|Dot. fin prov. impôts différés NBC_DEPREC|DEPR_687700|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Amort. of prov. on deferred charges|Dot. prov. pour Charges à répartir CHECK|NBC_NBV|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Nbv sales on assets - BS|VNC des immobilisations cedees - bilan NBC_NBV|NBV_675000|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Nbv sales of intang assets - BS|VNC immo. inc. cédées - bilan NBC_NBV|NBV_675500|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Nbv sales of tang assets - BS|VNC immo. corp. cédées - bilan NBC_NBV|NBV_676000|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Nbv sales of investments - BS|VNC des titres de part. cédés - bilan NBC_NBV|NBV_675600|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Nbv sales of other fin assets - BS|VNC des autres immo.fin. cédées - bilan CHECK|NBC_OTH|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Other checks|Autres contrôles NBC_OTH|RES_777000|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Portion invest subsidie comp/Result - BS|Qp des subv. virée au résultat - bilan NBC_OTH|RES_699000|Y|REVENUE|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Deferred tax P&L - BS|Impôts différés résultat - bilan #root|TECH|Y|GROUPLABEL|Y|N|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Technicals accounts|Comptes techniques TECH|GOODWILL|Y|ASSET|Y|Y||FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Goodwill accounts|Comptes déclenchants goodwill GOODWILL|GW|Y|ASSET|N|Y|204000|FLT|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_TP|GW_GW|Goodwill|Ecarts d acquisition (Brut) GOODWILL|AMGW|Y|LIABILITY|N|Y|290400|FDEPGW|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_PT|GWA_AMGW|Goodwill depreciation|Depre. des écarts d acquisition TECH|INVENT|Y|ASSET|Y|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Inventory accounts|Comptes déclenchants stocks INVENT|PS31|Y|ASSET|N|Y|310000|FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_ST|PSTK_PS31|Ps raw materials|Marges sur mat. prem. & achats stockés INVENT|PS33|Y|ASSET|N|Y|330000|FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_ST|PSTK_PS33|Ps work in process (Goods)|Marges sur en cours de prod. de services INVENT|PS34|Y|ASSET|N|Y|340000|FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_ST|PSTK_PS34|Ps work in process (Services)|Marges sur en cours de prod. de biens INVENT|PS35|Y|ASSET|N|Y|350000|FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_ST|PSTK_PS35|Ps intermediate and finished products|Marges sur pdts intermédiaires & finis INVENT|PS37|Y|ASSET|N|Y|370000|FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_ST|PSTK_PS37|Ps merchandise|Marges sur marchandises TECH|DIVID|Y|GROUPLABEL|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Dividends|Dividendes DIVID|DIV|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||DIV|DIV_DIV|Paid dividends|Dividendes versés DIVID|DIVEQUI|Y|LIABILITY|Y|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||DIV|IMPACT_CALC|Paid dividends Equity Entity|Dividende versé Mise en équivalence DIVID|WTAXD|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||WTAXD_DIV|Withholding tax on dividend|Retenue à la source sur dividendes DIVID|INTWTAXD|Y|EXPENSE|N|Y|||||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||WTAXD_INTDIV|Withholding tax on interim dividend|Retenue à la source s/acompte dividendes DIVID|PINTERIM|Y|REVENUE|N|Y||||||0|Y|Y|Y|Y|||Y|N||Y||1|||INTDIV_INTDIV|Paid interim dividends|Acomptes sur dividendes versés DIVID|TECH_DIV|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||TECHDIV|DIVVAR_DIV|Paid dividends|Dividendes versés DIVID|TECH_WTAXD|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||TECHDIVI|DIVVAR_DIV|Withholding tax on dividend|Retenue à la source sur dividendes DIVID|TECH_761100|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||TECHDIVI|DIVIVAR_DIV|Revenues from participating interests|Dividendes recus DIVID|TECH_PINTERIM|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||TECHPINTERIM|DIVVAR_INTDIV|Paid interim dividends|Acomptes sur dividendes versés DIVID|TECH_INTWTAXD|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||TECHDIVI|DIVVAR_INTDIV|Withholding tax on interim dividend|Retenue à la source s/acompt dividendes DIVID|TECH_761200|Y|ASSET|N|Y||FST|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||TECHDIVI|DIVIVAR_INTDIV|Interim revenues from particip interests|Acomptes sur dividendes recus TECH|DISP|Y|ASSET|Y|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Disposal of asset|cession d immobilisations DISP|DISP_INTANG|Y|ASSET|Y|Y||FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Disposal of intangible asset|Cession d'immos incorporelles DISP_INTANG|201000GL|Y|ASSET|N|Y|775000|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_INTANGGL|Disp. of preliminary & training expenses|Cession frais d établissement DISP_INTANG|203000GL|Y|ASSET|N|Y|775000|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_INTANGGL|Disp. of research and development exp|Cession Frais de recherche & dvpt DISP_INTANG|204000GL|Y|ASSET|N|Y|775000|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_INTANGGL|Disp. of goodwill|Cession écarts d acquisition DISP_INTANG|205000GL|Y|ASSET|N|Y|775000|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_INTANGGL|Disp. of concess, patents, trademarks|Cession concessions, brevets & licences DISP_INTANG|206000GL|Y|ASSET|N|Y|775000|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_INTANGGL|Disp. of bus.Goodw. and goodw|Cession fonds commercial & droit au bail DISP_INTANG|208000GL|Y|ASSET|N|Y|775000|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_INTANGGL|Disp. of other intangible assets|Cession autres immo. Incorporelles DISP_INTANG|237000GL|Y|ASSET|N|Y|775000|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_INTANGGL|Disp. of payments on account|Cession avances & acpts sur immo. Incorp DISP|DISP_TANG|Y|ASSET|Y|Y||FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Disposal of tangible asset|Cession d'immos corporelles DISP_TANG|211010GL|Y|ASSET|N|Y|775500|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_TANGGL|Disp. of land|Cession terrains & aménagements DISP_TANG|213010GL|Y|ASSET|N|Y|775500|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_TANGGL|Disp. of buildings|Cession constructions & aménagements DISP_TANG|215010GL|Y|ASSET|N|Y|775500|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_TANGGL|Disp. of equipment, tools and machinery|Cession Install. tech., matériel & out. DISP_TANG|218210GL|Y|ASSET|N|Y|775500|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_TANGGL|Disp. of transport equipment|Cession matériel de transport DISP_TANG|218310GL|Y|ASSET|N|Y|775500|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_TANGGL|Disp. of equipt, furniture, computer|Cession matériel de bureau, info. & mob. DISP_TANG|218100GL|Y|ASSET|N|Y|775500|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_TANGGL|Disp. of other tangible assets|Cession autres immo. corporelles DISP_TANG|231000GL|Y|ASSET|N|Y|775500|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_TANGGL|Disp. of current tangible assets|Cession immo. corporelles en cours DISP_TANG|238000GL|Y|ASSET|N|Y|775500|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_TANGGL|Disp. of payments on account|Cession avances & acptes sur immo. corp. DISP|DISP_FIN|Y|ASSET|Y|Y||FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||||Disposal of fin asset /excl shares|Cession financières (hors titres) DISP_FIN|272100GL|Y|ASSET|N|Y|775600|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_FINGL|Held to Maturity – HTM NC|Titres détenus jusqu à échéance(Brut) NC DISP_FIN|272200GL|Y|ASSET|N|Y|775600|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_FINGL|Held for Trading – HFT NC|Titres détenus pour trading(Brut) NC DISP_FIN|272300GL|Y|ASSET|N|Y|775600|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_FINGL|Available for Sale – AFS NC|Titres disponibles à la vente (Brut) NC DISP_FIN|272101GL|Y|ASSET|N|Y|775600|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_FINGL|Held to Maturity – HTM Current|Titres détenus jusqu à échéance(Brut) Ct DISP_FIN|272201GL|Y|ASSET|N|Y|775600|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_FINGL|Held for Trading – HFT Current|Titres détenus pour trading(Brut) Ct DISP_FIN|272301GL|Y|ASSET|N|Y|775600|FGL|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1||HIST_GL|GL_FINGL|Available for Sale – AFS Current|Titres disponibles à la vente (Brut) Ct DISP|CFDISP_INTANG|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DISPINTANG||CF impact on disp. of intangible asset|TF impact des cessions incorpelles DISP|CFDISP_TANG|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DISPTANG||CF impact on disp. of tangible asset|TF impact des cessions corpelles DISP|CFDISP_FIN|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#DISPFIN||CF impact on disp. of financial asset|TF impact des cessions financieres DISP|CFPURCH_INTANG|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PURCHINTANG||CF impact on purch. of intangible asset|TF impact des achats incorpelles DISP|CFPURCH_TANG|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PURCHTANG||CF impact on purch. of tangible asset|TF impact des achats corpelles DISP|CFPURCH_FIN|Y|REVENUE|N|Y|||||ALL|0|Y|Y|Y|Y|||N|N||Y||1||#PURCHFIN||CF impact on purch. of financial asset|TF impact des achats financieres TECH|HIST|Y|GROUPLABEL|Y|N||||||0|Y|Y|Y|Y|||N|N||Y||1||||Historical rate differances|Ecarts de taux historique HIST|AMGWEH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GWAH_AMGW|Goodwill depreciation hist rate diff|Ecart histo sur amort. des écarts d acq. HIST|GWEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GWH_GW|Goodwill hist rate diff|Ecart histo sur ecarts d acquisition HIST|PS31EH|Y|ASSET|N|Y|310000|FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PSTKH_PS31|Ps raw materials hist rate diff|Ecart histo sur mat. prem. & achats st. HIST|PS33EH|Y|ASSET|N|Y|330000|FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PSTKH_PS33|Ps work in proc. (Goods) hist rate diff|Ecart histo sur en cours de prod. serv. HIST|PS34EH|Y|ASSET|N|Y|340000|FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PSTKH_PS34|Ps work in proc. (Serv.) hist rate diff|Ecart histo sur en cours de prod. biens HIST|PS35EH|Y|ASSET|N|Y|350000|FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PSTKH_PS35|Ps interm. & finis. prdts hist rate diff|Ecart histo sur pdts interm. & finis HIST|PS37EH|Y|ASSET|N|Y|370000|FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PSTKH_PS37|Ps merchandise hist rate diff|Ecart histo sur marchandises HIST|151600EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PSRI|Prov. for subsidiary risk hist rate diff|Ecart histo sur prov. pour risque filial HIST|151601EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PSRI|Provisions for subsidiary risk Current|Prov. pour risque filiale Ct HIST|151800EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POLC|Other prov. for liabilit. hist rate diff|Ecart histo sur autres prov. pour risque HIST|151801EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POLC|Other provisions for liabilities Current|Autres provisions pour risques Ct HIST|158000EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POLC|Other prov. for expenses hist rate diff|Ecart histo sur autres prov. pour charge HIST|158001EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POLC|Other provisions for expenses Current|Autres provisions pour charges Ct HIST|296100EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PINV|Prov. for part. interests hist rate diff|Ecart histo sur titres de part. (Prov) HIST|296700EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PFIA|Prov. loans to affiliates hist rate diff|Ecart histo sur créances ratt. (Prov) HIST|296701EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PFIA|Prov. for loans to affiliates Current|Créances ratt. à des particip. (Prov) Ct HIST|297400EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PFIA|Provisions for loans hist rate diff|Ecart histo sur prêts (Prov) HIST|297401EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PFIA|Provisions for loans Current|Prêts (Prov) Courant HIST|490910EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PTRA|Allow paymt acc on orders hist rate diff|Ecart histo sur avances & acptes (Prov) HIST|490980EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PTRA|Prov. for receiv payables hist rate diff|Ecart histo sur avoirs à recevoir (Prov) HIST|491100EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PTRA|Prov. for acc. receiv. hist rate diff|Ecart histo sur créances clients (Prov) HIST|495510EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POTR|Allowances on current acc. Receiv. NC|Comptes courants filiales (Prov) NC HIST|495511EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POTR|Allow on curr acc receiv hist rate diff|Ecart histo sur c/C filiales (Prov) HIST|496000EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POTR|Allowances on miscellaneous receiv. NC|Autres créances diverses (Prov) NC HIST|496001EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POTR|Allow. on misc. receiv. hist rate diff|Ecart histo sur débiteurs divers (Prov) HIST|496020EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POTR|Allowances on receiv. On invest.|Créances sur cessions de titres. (Prov) HIST|496021EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POTR|Allow on receiv. on sales of invest Curr|Créances s/cessions de titres. (Prov) Ct HIST|496200EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POTR|Allow receiv fixed assets hist rate diff|Ecart histo sur créances immobil. (Prov) HIST|496201EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_POTR|Allow receiv on sale of fixed asset Curr|Créances immo. corp. & incorp. (Prov) Ct HIST|261000EH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PINTH_INV|Part. interests (Gross) hist rate diff|Ecart histo sur titres de part. (Brut) HIST|297210EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PFIA|Prov. Held to Maturity – HTM NC|Titres détenus jusqu à échéance(Prov) NC HIST|297220EH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PFIA|Prov. Held for Trading – HFT NC|Titres détenus pour trading(Prov) NC HIST|297230EH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PFIA|Prov. Available for Sale – AFS NC|Titres disponibles à la vente (Prov) NC HIST|297211EH|Y|LIABILITY|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PFIA|Prov. Held to Maturity – HTM Current|Titres détenus jusqu à échéance(Prov) Ct HIST|297221EH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PFIA|Prov. Held for Trading – HFT Current|Titres détenus pour trading(Prov) Ct HIST|297231EH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||PROVH_PFIA|Prov. Available for Sale – AFS Current|Titres disponibles à la vente (Prov) Ct HIST|201000GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on preliminary & formation expenses|PMV frais d établissement HIST|203000GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on research and development expenses|PMV Frais de recherche & dvpt HIST|204000GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on goodwill|PMV écarts d acquisition HIST|205000GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on concessions, patents, trademarks|PMV concessions, brevets & licences HIST|206000GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on bus.Goodw. and goodw|PMV fonds commercial & droit au bail HIST|208000GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on other intangible assets|PMV autres immo. Incorporelles HIST|237000GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on payments on account|PMV avances & acptes sur immo. incorp. HIST|211010GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on land|PMV terrains & aménagements HIST|213010GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on buildings|PMV constructions & aménagements HIST|215010GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on equipment, tools and machinery|PMV Install. tech., matériel & out. HIST|218210GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on transport equipment|PMV matériel de transport HIST|218310GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on office equipt, furniture, computer|PMV matériel de bureau, info. & mob. HIST|218100GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on other tangible assets|PMV autres immo. corporelles HIST|231000GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on current tangible assets|PMV immo. corporelles en cours HIST|238000GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on payments on account|PMV avances & acptes sur immo. corp. HIST|272100GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on Held to Maturity – HTM NC|PMV Titres échéance NC HIST|272200GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on Held for Trading – HFT NC|PMV Titres trading NC HIST|272300GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL onAvailable for Sale – AFS NC|PMV Titres disponibles vente NC HIST|272101GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on Held to Maturity – HTM Curr|PMV Titres échéance Ct HIST|272201GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL on Held for Trading – HFT Curr|PMV Titres trading Ct HIST|272301GLEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||GLH_IPEXCH|GL onAvailable for Sale – AFS Curr|PMV Titres disponibles vente Ct HIST|TECH_761100EH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||DIVIH_DIV|Revenues from participating interests|PMV autres immo. financières HIST|TECH_761200EH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||DIVIH_INTDIV|Interim revenues from particip interests|PMV autres immo. financières HIST|TECH_WTAXDEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||DIVH_DIV|Withholding tax on dividend|PMV autres immo. financières HIST|TECH_INTWTAXDEH|Y|ASSET|N|Y||FHC|||ALL|0|Y|Y|Y|Y|||Y|N||Y||1|||DIVH_INTDIV|Withholding tax on interim dividend|PMV autres immo. financières #root|DEFTAXES|Y|GROUPLABEL|N|Y||||||0|Y|Y|Y|Y|||Y|N||Y||1||||Deferred tax analysis|Comptes pour impôts diff. DEFTAXES|BASEDT|Y|ASSET|N|Y||FBDT||RATE|ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Base od deferred tax|Bases d'impôts différés DEFTAXES|DEFRATE|Y|BALANCERECURRING|N|Y||||RATE||2|Y|Y|Y|Y|||N|N||Y||1||||Rates|Taux pour impôts différés DEFTAXES|DEFTAX|Y|ASSET|Y|Y||FDT||RATE|ALL|0|Y|Y|Y|Y|||N|N||Y||1||||Deferred tax|Impôts différés DEFTAXES|BTAXPROOF|Y|EXPENSE|Y|Y|||||TAXPROOF|0|Y|Y|Y|Y|||N|N||Y||1||||Base of Tax proof|Base d'impot de la preuve d'impot DEFTAXES|TAXPROOF|Y|EXPENSE|Y|Y|||||TAXPROOF|0|Y|Y|Y|Y|||N|N||Y||1||||Tax Proof|Preuve d'impot !Hierarchies=Custom1 'Parent|Child|AggregationWeight|IsPrimary|SwitchSignForFlow|SwitchTypeForFlow|SecurityClass|IsCalculated|SubmissionGroup|UserDefined1|UserDefined2|UserDefined3|Alias=English|Alias=French #root|[None]|1|Y|N|N||N|1||||[None]|[None] #root|AllCustom1|0|Y|N|N||Y|1||||Total Custom1|Total Custom1 AllCustom1|[None]|1|N|N|N||N|1||||| AllCustom1|TF|1|Y|N|N||Y|1||||Total Flow|Ensemble des flux TF|OPE|1|Y|N|N||Y|1||||Opening|Ouverture TF|ERR|1|Y|N|Y||Y|1||||Check|Erreur TF|APP|1|Y|N|Y||N|1||||Appropriation of N-1 income / loss|Affectation résultat TF|DIV|1|Y|Y|Y||N|1||||Dividends|Dividendes TF|IDIV|1|Y|Y|Y||N|1||||Interim dividends|Acompte sur dividendes TF|NIN|1|Y|N|Y||N|1||||Income / loss|Résultat TF|MVT|1|Y|N|Y||N|1||||Movement|Mouvement TF|INC|1|Y|N|Y||N|1||||Increase|Augmentation TF|DEC|1|Y|Y|Y||N|1||||Decrease|Diminution TF|IDEF|1|Y|N|Y||N|1||||Increase deferred taxes - impact capital|Aug impôts diff- impact capitaux propres TF|DDEF|1|Y|Y|Y||N|1||||Decrease deferred taxes - impact capital|Dim impôts diff- impact capitaux propres TF|CAPINC|1|Y|N|Y||N|1||||Capital increase|Augmentation de capital TF|CAPDEC|1|Y|Y|Y||N|1||||Capital decrease|Diminution de capital TF|ODEP|1|Y|N|Y||N|1||||Operating depreciation|Dotations exploitation TF|FDEP|1|Y|N|Y||N|1||||Financial depreciation|Dotations financières TF|OREV|1|Y|Y|Y||N|1||||Operating reversal|Reprises exploitation TF|FREV|1|Y|Y|Y||N|1||||Financial reversal|Reprises financières TF|IREVA|1|Y|N|Y||N|1||||Revaluation - Increase|Réévaluation - Augmentation TF|DREVA|1|Y|Y|Y||N|1||||Revaluation - Decrease|Réévaluation - Diminution TF|IIMP|1|Y|N|Y||N|1||||Impairment - Increase|Dépréciation JV - Augmentation TF|DIMP|1|Y|Y|Y||N|1||||Impairment - Decrease|Dépréciation JV - Diminution TF|TAO|1|Y|N|Y||N|1||||Translation adjustment - opening|Ecart de conversion sur ouverture TF|TAF|1|Y|N|Y||N|1||||Translation adjustment - flow|Ecart de conversion sur flux TF|TAR|1|Y|N|Y||N|1||||Translation adjustment - result|Ecart de conversion résultat TF|REC|1|Y|N|Y||N|1||||Reclassification|Reclassement TF|VAR|1|Y|N|Y||N|1||||Scope variation|Variation de périmètre TF|CHG|1|Y|N|Y||N|1||||Change in accounting policies|Changement méthode comptable TF|MRG|1|Y|N|Y||N|1||||Merger|Fusion TF|ENT|1|Y|N|Y||N|1||||New entrance|Entrée de périmètre TF|FTA|1|Y|N|Y||N|1||||First Time application|Flux de première application TF|EXIT|1|Y|N|Y||N|1||||Exit|Sortie de périmètre TF|OTH|1|Y|N|N||N|1||||Others|Autres TF|NEWD|1|Y|N|N||N|1||||New|Nouveaux déficits TF|USED|1|Y|N|N||N|1||||Used|Déficits utilisés TF|LOSTD|1|Y|N|N||N|1||||Lost|Déficits perdus TF|RATVAR|1|Y|N|N||N|1||||Rate variation|Variation de taux TF|CLO|0|Y|N|N||N|1||||Closing|Clôture TF|OPEA|0|Y|N|N||N|1||||Opening asset deffered tax|Impôts différés actifs à l'ouverture TF|OPEL|0|Y|N|N||N|1||||Opening liability deffered tax|Impôts différés passifs à l'ouverture TF|CLOA|0|Y|N|N||N|1||||Closing asset deffered tax|Impôts différés actifs à la clôture TF|CLOL|0|Y|N|N||N|1||||Closing liability deffered tax|Impôts différés passifs à la clôture #root|Flow|0|Y|N|N||Y|1||||Flow|Tables des flux Flow|FAUTO|1|Y|N|N||Y|1||||Flow Self owned share|Flux Auto-Contrôle FAUTO|OPE|1|N|N|N||Y|1||||| FAUTO|CLO|0|N|N|N||N|1||||| FAUTO|ERR|1|N|N|Y||Y|1||||| FAUTO|APP|1|N|N|Y||N|1||||| FAUTO|DIV|1|N|Y|Y||N|1||||| FAUTO|IDIV|1|N|Y|Y||N|1||||| FAUTO|INC|1|N|N|Y||N|1||||| FAUTO|DEC|1|N|Y|Y||N|1||||| FAUTO|REC|1|N|N|Y||N|1||||| FAUTO|VAR|1|N|N|Y||N|1||||| FAUTO|CHG|1|N|N|Y||N|1||||| FAUTO|MRG|1|N|N|Y||N|1||||| FAUTO|ENT|1|N|N|Y||N|1||||| FAUTO|FTA|1|N|N|Y||N|1||||| FAUTO|EXIT|1|N|N|Y||N|1||||| Flow|FCA|1|Y|N|N||Y|1||||Flow Capital|Flux capital FCA|OPE|1|N|N|N||Y|1||||| FCA|CLO|0|N|N|N||N|1||||| FCA|ERR|1|N|N|Y||Y|1||||| FCA|APP|1|N|N|Y||N|1||||| FCA|DIV|1|N|Y|Y||N|1||||| FCA|IDIV|1|N|Y|Y||N|1||||| FCA|INC|1|N|N|Y||N|1||||| FCA|DEC|1|N|Y|Y||N|1||||| FCA|REC|1|N|N|Y||N|1||||| FCA|VAR|1|N|N|Y||N|1||||| FCA|CHG|1|N|N|Y||N|1||||| FCA|MRG|1|N|N|Y||N|1||||| FCA|ENT|1|N|N|Y||N|1||||| FCA|FTA|1|N|N|Y||N|1||||| FCA|EXIT|1|N|N|Y||N|1||||| Flow|FCADEF|1|Y|N|N||Y|1||||Flow Capital - impact deferred taxes|Flux capital et impact impot différés FCADEF|OPE|1|N|N|N||Y|1||||| FCADEF|CLO|0|N|N|N||N|1||||| FCADEF|ERR|1|N|N|Y||Y|1||||| FCADEF|APP|1|N|N|Y||N|1||||| FCADEF|DIV|1|N|Y|Y||N|1||||| FCADEF|IDIV|1|N|Y|Y||N|1||||| FCADEF|INC|1|N|N|Y||N|1||||| FCADEF|DEC|1|N|Y|Y||N|1||||| FCADEF|IDEF|1|N|N|Y||N|1||||| FCADEF|DDEF|1|N|Y|Y||N|1||||| FCADEF|REC|1|N|N|Y||N|1||||| FCADEF|VAR|1|N|N|Y||N|1||||| FCADEF|CHG|1|N|N|Y||N|1||||| FCADEF|MRG|1|N|N|Y||N|1||||| FCADEF|ENT|1|N|N|Y||N|1||||| FCADEF|FTA|1|N|N|Y||N|1||||| FCADEF|EXIT|1|N|N|Y||N|1||||| Flow|FCAREV|1|Y|N|N||Y|1||||Flow Capital - revaluation|Flux capital réévaluation FCAREV|OPE|1|N|N|N||Y|1||||| FCAREV|CLO|0|N|N|N||N|1||||| FCAREV|ERR|1|N|N|Y||Y|1||||| FCAREV|APP|1|N|N|Y||N|1||||| FCAREV|DIV|1|N|Y|Y||N|1||||| FCAREV|IDIV|1|N|Y|Y||N|1||||| FCAREV|INC|1|N|N|Y||N|1||||| FCAREV|DEC|1|N|Y|Y||N|1||||| FCAREV|IREVA|1|N|N|Y||N|1||||| FCAREV|DREVA|1|N|Y|Y||N|1||||| FCAREV|REC|1|N|N|Y||N|1||||| FCAREV|VAR|1|N|N|Y||N|1||||| FCAREV|CHG|1|N|N|Y||N|1||||| FCAREV|MRG|1|N|N|Y||N|1||||| FCAREV|ENT|1|N|N|Y||N|1||||| FCAREV|FTA|1|N|N|Y||N|1||||| FCAREV|EXIT|1|N|N|Y||N|1||||| Flow|FCAT|1|Y|N|N||Y|1||||Flow Reserves - translation|Flux réserves de conversion FCAT|OPE|1|N|N|N||Y|1||||| FCAT|CLO|0|N|N|N||N|1||||| FCAT|ERR|1|N|N|Y||Y|1||||| FCAT|APP|1|N|N|Y||N|1||||| FCAT|DIV|1|N|Y|Y||N|1||||| FCAT|IDIV|1|N|Y|Y||N|1||||| FCAT|TAO|1|N|N|Y||N|1||||| FCAT|TAF|1|N|N|Y||N|1||||| FCAT|REC|1|N|N|Y||N|1||||| FCAT|VAR|1|N|N|Y||N|1||||| FCAT|CHG|1|N|N|Y||N|1||||| FCAT|MRG|1|N|N|Y||N|1||||| FCAT|ENT|1|N|N|Y||N|1||||| FCAT|FTA|1|N|N|Y||N|1||||| FCAT|EXIT|1|N|N|Y||N|1||||| Flow|FCR|1|Y|N|N||Y|1||||Flow Consolidated reserves|Flux réserves consolidées FCR|OPE|1|N|N|N||Y|1||||| FCR|CLO|0|N|N|N||N|1||||| FCR|ERR|1|N|N|Y||Y|1||||| FCR|APP|1|N|N|Y||N|1||||| FCR|DIV|1|N|Y|Y||N|1||||| FCR|IDIV|1|N|Y|Y||N|1||||| FCR|INC|1|N|N|Y||N|1||||| FCR|DEC|1|N|Y|Y||N|1||||| FCR|CAPINC|1|N|N|Y||N|1||||| FCR|CAPDEC|1|N|Y|Y||N|1||||| FCR|IREVA|1|N|N|Y||N|1||||| FCR|DREVA|1|N|Y|Y||N|1||||| FCR|IDEF|1|N|N|Y||N|1||||| FCR|DDEF|1|N|Y|Y||N|1||||| FCR|REC|1|N|N|Y||N|1||||| FCR|VAR|1|N|N|Y||N|1||||| FCR|CHG|1|N|N|Y||N|1||||| FCR|MRG|1|N|N|Y||N|1||||| FCR|ENT|1|N|N|Y||N|1||||| FCR|FTA|1|N|N|Y||N|1||||| FCR|EXIT|1|N|N|Y||N|1||||| Flow|FDEF|1|Y|N|N||Y|1||||Flow deferred taxes|Flux impôts différés FDEF|OPE|1|N|N|N||Y|1||||| FDEF|CLO|0|N|N|N||N|1||||| FDEF|MVT|1|N|N|Y||N|1||||| FDEF|IDEF|1|N|N|Y||N|1||||| FDEF|DDEF|1|N|Y|Y||N|1||||| FDEF|TAO|1|N|N|Y||N|1||||| FDEF|TAF|1|N|N|Y||N|1||||| FDEF|REC|1|N|N|Y||N|1||||| FDEF|VAR|1|N|N|Y||N|1||||| FDEF|CHG|1|N|N|Y||N|1||||| FDEF|MRG|1|N|N|Y||N|1||||| FDEF|ENT|1|N|N|Y||N|1||||| FDEF|FTA|1|N|N|Y||N|1||||| FDEF|EXIT|1|N|N|Y||N|1||||| Flow|FDEPGW|1|Y|N|N||Y|1||||Flow Depreciation goodwill|Flux déprécation Ecart d'acquisition FDEPGW|OPE|1|N|N|N||Y|1||||| FDEPGW|CLO|0|N|N|N||N|1||||| FDEPGW|ERR|1|N|N|Y||Y|1||||| FDEPGW|IIMP|1|N|N|Y||N|1||||| FDEPGW|TAO|1|N|N|Y||N|1||||| FDEPGW|TAF|1|N|N|Y||N|1||||| FDEPGW|TAR|1|N|N|Y||N|1||||| FDEPGW|REC|1|N|N|Y||N|1||||| FDEPGW|VAR|1|N|N|Y||N|1||||| FDEPGW|CHG|1|N|N|Y||N|1||||| FDEPGW|MRG|1|N|N|Y||N|1||||| FDEPGW|ENT|1|N|N|Y||N|1||||| FDEPGW|FTA|1|N|N|Y||N|1||||| FDEPGW|EXIT|1|N|N|Y||N|1||||| Flow|FDEPGWEQUI|1|Y|N|N||Y|1||||Flow Depreciation goodwill Equity|Flux dépr Ecart d'acquisition MEE FDEPGWEQUI|OPE|1|N|N|N||Y|1||||| FDEPGWEQUI|CLO|0|N|N|N||N|1||||| FDEPGWEQUI|ERR|1|N|N|Y||Y|1||||| FDEPGWEQUI|NIN|1|N|N|Y||N|1||||| FDEPGWEQUI|TAO|1|N|N|Y||N|1||||| FDEPGWEQUI|TAF|1|N|N|Y||N|1||||| FDEPGWEQUI|TAR|1|N|N|Y||N|1||||| FDEPGWEQUI|REC|1|N|N|Y||N|1||||| FDEPGWEQUI|VAR|1|N|N|Y||N|1||||| FDEPGWEQUI|CHG|1|N|N|Y||N|1||||| FDEPGWEQUI|MRG|1|N|N|Y||N|1||||| FDEPGWEQUI|ENT|1|N|N|Y||N|1||||| FDEPGWEQUI|FTA|1|N|N|Y||N|1||||| FDEPGWEQUI|EXIT|1|N|N|Y||N|1||||| Flow|FDER|1|Y|N|N||Y|1||||Flow Financial derivatives assets|Flux Instruments financiers FDER|OPE|1|N|N|N||Y|1||||| FDER|CLO|0|N|N|N||N|1||||| FDER|ERR|1|N|N|Y||Y|1||||| FDER|INC|1|N|N|Y||N|1||||| FDER|DEC|1|N|Y|Y||N|1||||| FDER|IREVA|1|N|N|Y||N|1||||| FDER|DREVA|1|N|Y|Y||N|1||||| FDER|TAO|1|N|N|Y||N|1||||| FDER|TAF|1|N|N|Y||N|1||||| FDER|REC|1|N|N|Y||N|1||||| FDER|VAR|1|N|N|Y||N|1||||| FDER|CHG|1|N|N|Y||N|1||||| FDER|MRG|1|N|N|Y||N|1||||| FDER|ENT|1|N|N|Y||N|1||||| FDER|FTA|1|N|N|Y||N|1||||| FDER|EXIT|1|N|N|Y||N|1||||| Flow|FEQUI|1|Y|N|N||Y|1||||Flow Equity method|Flux mise en équivalence FEQUI|OPE|1|N|N|N||Y|1||||| FEQUI|CLO|0|N|N|N||N|1||||| FEQUI|ERR|1|N|N|Y||Y|1||||| FEQUI|APP|1|N|N|Y||N|1||||| FEQUI|DIV|1|N|Y|Y||N|1||||| FEQUI|IDIV|1|N|Y|Y||N|1||||| FEQUI|NIN|1|N|N|Y||N|1||||| FEQUI|INC|1|N|N|Y||N|1||||| FEQUI|DEC|1|N|Y|Y||N|1||||| FEQUI|TAO|1|N|N|Y||N|1||||| FEQUI|TAF|1|N|N|Y||N|1||||| FEQUI|REC|1|N|N|Y||N|1||||| FEQUI|VAR|1|N|N|Y||N|1||||| FEQUI|CHG|1|N|N|Y||N|1||||| FEQUI|MRG|1|N|N|Y||N|1||||| FEQUI|ENT|1|N|N|Y||N|1||||| FEQUI|FTA|1|N|N|Y||N|1||||| FEQUI|EXIT|1|N|N|Y||N|1||||| Flow|FIMP|1|Y|N|N||Y|1||||Flow Impairment|Flux dépréciation Juste valeur FIMP|OPE|1|N|N|N||Y|1||||| FIMP|CLO|0|N|N|N||N|1||||| FIMP|ERR|1|N|N|Y||Y|1||||| FIMP|IIMP|1|N|N|Y||N|1||||| FIMP|DIMP|1|N|Y|Y||N|1||||| FIMP|TAO|1|N|N|Y||N|1||||| FIMP|TAF|1|N|N|Y||N|1||||| FIMP|REC|1|N|N|Y||N|1||||| FIMP|VAR|1|N|N|Y||N|1||||| FIMP|CHG|1|N|N|Y||N|1||||| FIMP|MRG|1|N|N|Y||N|1||||| FIMP|ENT|1|N|N|Y||N|1||||| FIMP|FTA|1|N|N|Y||N|1||||| FIMP|EXIT|1|N|N|Y||N|1||||| Flow|FINV|1|Y|N|N||Y|1||||Flow Investment|Flux titres FINV|OPE|1|N|N|N||Y|1||||| FINV|CLO|0|N|N|N||N|1||||| FINV|ERR|1|N|N|Y||Y|1||||| FINV|INC|1|N|N|Y||N|1||||| FINV|DEC|1|N|Y|Y||N|1||||| FINV|CAPINC|1|N|N|Y||N|1||||| FINV|CAPDEC|1|N|Y|Y||N|1||||| FINV|TAO|1|N|N|Y||N|1||||| FINV|TAF|1|N|N|Y||N|1||||| FINV|REC|1|N|N|Y||N|1||||| FINV|VAR|1|N|N|Y||N|1||||| FINV|CHG|1|N|N|Y||N|1||||| FINV|MRG|1|N|N|Y||N|1||||| FINV|ENT|1|N|N|Y||N|1||||| FINV|FTA|1|N|N|Y||N|1||||| FINV|EXIT|1|N|N|Y||N|1||||| Flow|FLT|1|Y|N|N||Y|1||||Flow Long term|Flux long terme FLT|OPE|1|N|N|N||Y|1||||| FLT|CLO|0|N|N|N||N|1||||| FLT|ERR|1|N|N|Y||Y|1||||| FLT|INC|1|N|N|Y||N|1||||| FLT|DEC|1|N|Y|Y||N|1||||| FLT|TAO|1|N|N|Y||N|1||||| FLT|TAF|1|N|N|Y||N|1||||| FLT|REC|1|N|N|Y||N|1||||| FLT|VAR|1|N|N|Y||N|1||||| FLT|CHG|1|N|N|Y||N|1||||| FLT|MRG|1|N|N|Y||N|1||||| FLT|ENT|1|N|N|Y||N|1||||| FLT|FTA|1|N|N|Y||N|1||||| FLT|EXIT|1|N|N|Y||N|1||||| Flow|FLTIMP|1|Y|N|N||Y|1||||Flow Long term - Impairment|Flux long terme - dépr. Juste valeur FLTIMP|OPE|1|N|N|N||Y|1||||| FLTIMP|CLO|0|N|N|N||N|1||||| FLTIMP|ERR|1|N|N|Y||Y|1||||| FLTIMP|INC|1|N|N|Y||N|1||||| FLTIMP|DEC|1|N|Y|Y||N|1||||| FLTIMP|OREV|1|N|Y|Y||N|1||||| FLTIMP|IIMP|1|N|N|Y||N|1||||| FLTIMP|DIMP|1|N|Y|Y||N|1||||| FLTIMP|TAO|1|N|N|Y||N|1||||| FLTIMP|TAF|1|N|N|Y||N|1||||| FLTIMP|REC|1|N|N|Y||N|1||||| FLTIMP|VAR|1|N|N|Y||N|1||||| FLTIMP|CHG|1|N|N|Y||N|1||||| FLTIMP|MRG|1|N|N|Y||N|1||||| FLTIMP|ENT|1|N|N|Y||N|1||||| FLTIMP|FTA|1|N|N|Y||N|1||||| FLTIMP|EXIT|1|N|N|Y||N|1||||| Flow|FLTREVA|1|Y|N|N||Y|1||||Flow Long term - Revaluation|Flux long terme - réévaluation FLTREVA|OPE|1|N|N|N||Y|1||||| FLTREVA|CLO|0|N|N|N||N|1||||| FLTREVA|ERR|1|N|N|Y||Y|1||||| FLTREVA|INC|1|N|N|Y||N|1||||| FLTREVA|DEC|1|N|Y|Y||N|1||||| FLTREVA|IREVA|1|N|N|Y||N|1||||| FLTREVA|DREVA|1|N|Y|Y||N|1||||| FLTREVA|TAO|1|N|N|Y||N|1||||| FLTREVA|TAF|1|N|N|Y||N|1||||| FLTREVA|REC|1|N|N|Y||N|1||||| FLTREVA|VAR|1|N|N|Y||N|1||||| FLTREVA|CHG|1|N|N|Y||N|1||||| FLTREVA|MRG|1|N|N|Y||N|1||||| FLTREVA|ENT|1|N|N|Y||N|1||||| FLTREVA|FTA|1|N|N|Y||N|1||||| FLTREVA|EXIT|1|N|N|Y||N|1||||| Flow|FPR|1|Y|N|N||Y|1||||Flow Provisions|Flux Provisions FPR|OPE|1|N|N|N||Y|1||||| FPR|CLO|0|N|N|N||N|1||||| FPR|ERR|1|N|N|Y||Y|1||||| FPR|ODEP|1|N|N|Y||N|1||||| FPR|FDEP|1|N|N|Y||N|1||||| FPR|OREV|1|N|Y|Y||N|1||||| FPR|FREV|1|N|Y|Y||N|1||||| FPR|TAO|1|N|N|Y||N|1||||| FPR|TAF|1|N|N|Y||N|1||||| FPR|REC|1|N|N|Y||N|1||||| FPR|VAR|1|N|N|Y||N|1||||| FPR|CHG|1|N|N|Y||N|1||||| FPR|MRG|1|N|N|Y||N|1||||| FPR|ENT|1|N|N|Y||N|1||||| FPR|FTA|1|N|N|Y||N|1||||| FPR|EXIT|1|N|N|Y||N|1||||| Flow|FPRO|1|Y|N|N||Y|1||||Flow Provisions Operating|Flux Provisions Opérationnel FPRO|OPE|1|N|N|N||Y|1||||| FPRO|CLO|0|N|N|N||N|1||||| FPRO|ERR|1|N|N|Y||Y|1||||| FPRO|ODEP|1|N|N|Y||N|1||||| FPRO|OREV|1|N|Y|Y||N|1||||| FPRO|TAO|1|N|N|Y||N|1||||| FPRO|TAF|1|N|N|Y||N|1||||| FPRO|REC|1|N|N|Y||N|1||||| FPRO|VAR|1|N|N|Y||N|1||||| FPRO|CHG|1|N|N|Y||N|1||||| FPRO|MRG|1|N|N|Y||N|1||||| FPRO|ENT|1|N|N|Y||N|1||||| FPRO|FTA|1|N|N|Y||N|1||||| FPRO|EXIT|1|N|N|Y||N|1||||| Flow|FPRF|1|Y|N|N||Y|1||||Flow Provisions Financial|Flux Provisions Financier FPRF|OPE|1|N|N|N||Y|1||||| FPRF|CLO|0|N|N|N||N|1||||| FPRF|ERR|1|N|N|Y||Y|1||||| FPRF|FDEP|1|N|N|Y||N|1||||| FPRF|FREV|1|N|Y|Y||N|1||||| FPRF|TAO|1|N|N|Y||N|1||||| FPRF|TAF|1|N|N|Y||N|1||||| FPRF|REC|1|N|N|Y||N|1||||| FPRF|VAR|1|N|N|Y||N|1||||| FPRF|CHG|1|N|N|Y||N|1||||| FPRF|MRG|1|N|N|Y||N|1||||| FPRF|ENT|1|N|N|Y||N|1||||| FPRF|FTA|1|N|N|Y||N|1||||| FPRF|EXIT|1|N|N|Y||N|1||||| Flow|FPRFIMP|1|Y|N|N||Y|1||||Flow Provisions and impairment|Flux Provisions et impairment FPRFIMP|OPE|1|N|N|N||Y|1||||| FPRFIMP|CLO|0|N|N|N||N|1||||| FPRFIMP|ERR|1|N|N|Y||Y|1||||| FPRFIMP|ODEP|1|N|N|Y||N|1||||| FPRFIMP|FDEP|1|N|N|Y||N|1||||| FPRFIMP|OREV|1|N|Y|Y||N|1||||| FPRFIMP|FREV|1|N|Y|Y||N|1||||| FPRFIMP|IIMP|1|N|N|Y||N|1||||| FPRFIMP|DIMP|1|N|Y|Y||N|1||||| FPRFIMP|TAO|1|N|N|Y||N|1||||| FPRFIMP|TAF|1|N|N|Y||N|1||||| FPRFIMP|REC|1|N|N|Y||N|1||||| FPRFIMP|VAR|1|N|N|Y||N|1||||| FPRFIMP|CHG|1|N|N|Y||N|1||||| FPRFIMP|MRG|1|N|N|Y||N|1||||| FPRFIMP|ENT|1|N|N|Y||N|1||||| FPRFIMP|FTA|1|N|N|Y||N|1||||| FPRFIMP|EXIT|1|N|N|Y||N|1||||| Flow|FRES|1|Y|N|N||Y|1||||Flow B/S Net income|Flux résultat du bilan FRES|OPE|1|N|N|N||Y|1||||| FRES|CLO|0|N|N|N||N|1||||| FRES|ERR|1|N|N|Y||Y|1||||| FRES|APP|1|N|N|Y||N|1||||| FRES|NIN|1|N|N|Y||N|1||||| FRES|REC|1|N|N|Y||N|1||||| FRES|VAR|1|N|N|Y||N|1||||| FRES|CHG|1|N|N|Y||N|1||||| FRES|MRG|1|N|N|Y||N|1||||| FRES|ENT|1|N|N|Y||N|1||||| FRES|FTA|1|N|N|Y||N|1||||| FRES|EXIT|1|N|N|Y||N|1||||| Flow|FREST|1|Y|N|N||Y|1||||Flow B/S NI Translation|Flux résultat du bilan - conversion FREST|OPE|1|N|N|N||Y|1||||| FREST|CLO|0|N|N|N||N|1||||| FREST|ERR|1|N|N|Y||Y|1||||| FREST|APP|1|N|N|Y||N|1||||| FREST|DIV|1|N|Y|Y||N|1||||| FREST|IDIV|1|N|Y|Y||N|1||||| FREST|TAO|1|N|N|Y||N|1||||| FREST|TAF|1|N|N|Y||N|1||||| FREST|REC|1|N|N|Y||N|1||||| FREST|VAR|1|N|N|Y||N|1||||| FREST|CHG|1|N|N|Y||N|1||||| FREST|MRG|1|N|N|Y||N|1||||| FREST|ENT|1|N|N|Y||N|1||||| FREST|FTA|1|N|N|Y||N|1||||| FREST|EXIT|1|N|N|Y||N|1||||| Flow|FREVA|1|Y|N|N||Y|1||||Flow Revaluation|Flux réévaluation FREVA|OPE|1|N|N|N||Y|1||||| FREVA|CLO|0|N|N|N||N|1||||| FREVA|ERR|1|N|N|Y||Y|1||||| FREVA|IREVA|1|N|N|Y||N|1||||| FREVA|DREVA|1|N|Y|Y||N|1||||| FREVA|TAO|1|N|N|Y||N|1||||| FREVA|TAF|1|N|N|Y||N|1||||| FREVA|REC|1|N|N|Y||N|1||||| FREVA|VAR|1|N|N|Y||N|1||||| FREVA|CHG|1|N|N|Y||N|1||||| FREVA|MRG|1|N|N|Y||N|1||||| FREVA|ENT|1|N|N|Y||N|1||||| FREVA|FTA|1|N|N|Y||N|1||||| FREVA|EXIT|1|N|N|Y||N|1||||| Flow|FST|1|Y|N|N||Y|1||||Flow Short term|Flux court terme FST|OPE|1|N|N|N||Y|1||||| FST|CLO|0|N|N|N||N|1||||| FST|MVT|1|N|N|Y||N|1||||| FST|TAO|1|N|N|Y||N|1||||| FST|TAF|1|N|N|Y||N|1||||| FST|REC|1|N|N|Y||N|1||||| FST|VAR|1|N|N|Y||N|1||||| FST|CHG|1|N|N|Y||N|1||||| FST|MRG|1|N|N|Y||N|1||||| FST|ENT|1|N|N|Y||N|1||||| FST|FTA|1|N|N|Y||N|1||||| FST|EXIT|1|N|N|Y||N|1||||| Flow|FGL|1|Y|N|N||Y|1||||Flow Disposal of assets|Flux Cession Immo FGL|OPE|1|N|N|N||Y|1||||| FGL|CLO|0|N|N|N||N|1||||| FGL|INC|1|N|N|Y||N|1||||| FGL|TAO|1|N|N|Y||N|1||||| FGL|TAF|1|N|N|Y||N|1||||| FGL|TAR|1|N|N|Y||N|1||||| FGL|REC|1|N|N|Y||N|1||||| FGL|VAR|1|N|N|Y||N|1||||| FGL|CHG|1|N|N|Y||N|1||||| FGL|MRG|1|N|N|Y||N|1||||| FGL|ENT|1|N|N|Y||N|1||||| FGL|EXIT|1|N|N|Y||N|1||||| FGL|FTA|1|N|N|Y||N|1||||| FGL|NBV|1|Y|N|Y||N|1||||Net book value|Valeur nette comptable Flow|FHC|1|Y|N|N||Y|1||||Flow Historical cost|Flux coût historique FHC|OPE|1|N|N|N||Y|1||||| FHC|CLO|0|N|N|N||N|1||||| FHC|TAO|1|N|N|Y||N|1||||| FHC|TAF|1|N|N|Y||N|1||||| FHC|TAR|1|N|N|Y||N|1||||| FHC|REC|1|N|N|Y||N|1||||| FHC|VAR|1|N|N|Y||N|1||||| FHC|CHG|1|N|N|Y||N|1||||| FHC|MRG|1|N|N|Y||N|1||||| FHC|ENT|1|N|N|Y||N|1||||| FHC|FTA|1|N|N|Y||N|1||||| FHC|EXIT|1|N|N|Y||N|1||||| Flow|FBDT|1|Y|N|N||Y|1||||Flow Base of deferred taxes|Flux Base d'impôts différés FBDT|OPE|1|N|N|N||Y|1||||| FBDT|CLO|0|N|N|N||N|1||||| FBDT|NIN|1|N|N|Y||N|1||||| FBDT|OTH|1|N|N|N||N|1||||| FBDT|NEWD|1|N|N|N||N|1||||| FBDT|USED|1|N|N|N||N|1||||| FBDT|LOSTD|1|N|N|N||N|1||||| FBDT|VAR|1|N|N|Y||N|1||||| FBDT|TAO|1|N|N|Y||N|1||||| FBDT|TAF|1|N|N|Y||N|1||||| Flow|FDT|1|Y|N|N||Y|1||||Flow deferred taxes|Flux d'impôts différés FDT|OPE|1|N|N|N||Y|1||||| FDT|CLO|0|N|N|N||N|1||||| FDT|NIN|1|N|N|Y||N|1||||| FDT|OTH|1|N|N|N||N|1||||| FDT|VAR|1|N|N|Y||N|1||||| FDT|RATVAR|1|N|N|N||N|1||||| FDT|TAO|1|N|N|Y||N|1||||| FDT|TAF|1|N|N|Y||N|1||||| FDT|OPEA|0|N|N|N||N|1||||| FDT|OPEL|0|N|N|N||N|1||||| FDT|CLOA|0|N|N|N||N|1||||| FDT|CLOL|0|N|N|N||N|1||||| Flow|TF_WF|1|Y|N|N||Y|1||||Total Flows - Data forms|Ensemble des flux pour les webs forms TF_WF|OPE|1|N|N|N||Y|1||||| TF_WF|CLO|0|N|N|N||N|1||||| TF_WF|ERR|1|N|N|Y||Y|1||||| TF_WF|APP|1|N|N|Y||N|1||||| TF_WF|DIV|1|N|Y|Y||N|1||||| TF_WF|IDIV|1|N|Y|Y||N|1||||| TF_WF|NIN|1|N|N|Y||N|1||||| TF_WF|MVT|1|N|N|Y||N|1||||| TF_WF|INC|1|N|N|Y||N|1||||| TF_WF|DEC|1|N|Y|Y||N|1||||| TF_WF|OREV|1|N|Y|Y||N|1||||| TF_WF|IDEF|1|N|N|Y||N|1||||| TF_WF|DDEF|1|N|Y|Y||N|1||||| TF_WF|CAPINC|1|N|N|Y||N|1||||| TF_WF|CAPDEC|1|N|Y|Y||N|1||||| TF_WF|ODEP|1|N|N|Y||N|1||||| TF_WF|FDEP|1|N|N|Y||N|1||||| TF_WF|FREV|1|N|Y|Y||N|1||||| TF_WF|IREVA|1|N|N|Y||N|1||||| TF_WF|DREVA|1|N|Y|Y||N|1||||| TF_WF|IIMP|1|N|N|Y||N|1||||| TF_WF|DIMP|1|N|Y|Y||N|1||||| TF_WF|REC|1|N|N|Y||N|1||||| TF_WF|MRG|1|N|N|Y||N|1||||| TF_WF|ENT|1|N|N|Y||N|1||||| Flow|FPRST|1|Y|N|N||Y|1||||Flow Provisions and Movment|Flux Provisions et Mouvement FPRST|OPE|1|N|N|N||Y|1||||| FPRST|CLO|0|N|N|N||N|1||||| FPRST|ERR|1|N|N|Y||Y|1||||| FPRST|MVT|1|N|N|Y||N|1||||| FPRST|ODEP|1|N|N|Y||N|1||||| FPRST|FDEP|1|N|N|Y||N|1||||| FPRST|OREV|1|N|Y|Y||N|1||||| FPRST|FREV|1|N|Y|Y||N|1||||| FPRST|TAO|1|N|N|Y||N|1||||| FPRST|TAF|1|N|N|Y||N|1||||| FPRST|REC|1|N|N|Y||N|1||||| FPRST|VAR|1|N|N|Y||N|1||||| FPRST|CHG|1|N|N|Y||N|1||||| FPRST|MRG|1|N|N|Y||N|1||||| FPRST|ENT|1|N|N|Y||N|1||||| FPRST|FTA|1|N|N|Y||N|1||||| FPRST|EXIT|1|N|N|Y||N|1||||| !Hierarchies=Custom2 'Parent|Child|AggregationWeight|IsPrimary|SwitchSignForFlow|SwitchTypeForFlow|SecurityClass|IsCalculated|SubmissionGroup|UserDefined1|UserDefined2|UserDefined3|Alias=English|Alias=French #root|[None]|1|Y|N|N||N|1||||[None]|[None] #root|AllCustom2|1|Y|N|N||N|1||||Total Custom2|Total Custom2 AllCustom2|[None]|1|N|N|N||N|1||||| !Hierarchies=Custom3 'Parent|Child|AggregationWeight|IsPrimary|SwitchSignForFlow|SwitchTypeForFlow|SecurityClass|IsCalculated|SubmissionGroup|UserDefined1|UserDefined2|UserDefined3|Alias=English|Alias=French #root|[None]|1|Y|N|N||N|1||||[None]|[None] #root|AllCustom3|1|Y|N|N||N|1||||AllCustom3|AllCustom3 AllCustom3|COUNTRIES|1|Y|N|N||N|1||||Countries|Pays COUNTRIES|[None]|1|N|N|N||N|1||||| COUNTRIES|TOTCOUNTRIES|1|Y|N|N||N|1||||Total countries|Total pays TOTCOUNTRIES|C1|1|Y|N|N||N|1||||France|France TOTCOUNTRIES|C2|1|Y|N|N||N|1||||Spain|Espagne TOTCOUNTRIES|C3|1|Y|N|N||N|1||||Italy|Italie TOTCOUNTRIES|C4|1|Y|N|N||N|1||||Portugal|Portugal TOTCOUNTRIES|C5|1|Y|N|N||N|1||||Poland|Pologne TOTCOUNTRIES|C6|1|Y|N|N||N|1||||Brazil|Brésil TOTCOUNTRIES|C7|1|Y|N|N||N|1||||China|Chine TOTCOUNTRIES|C8|1|Y|N|N||N|1||||Russia|Russie TOTCOUNTRIES|C9|1|Y|N|N||N|1||||Rest of the world|Reste du monde AllCustom3|MAT_CURR|1|Y|N|N||N|1||||Maturity|Echéancier MAT_CURR|MATURITY|1|Y|N|N||N|1||||Split by Maturity|Ventilation par échéance MATURITY|Input_BS|0|Y|N|N||N|1||||Input BS|Saisie du bilan Input_BS|[None]|1|N|N|N||N|1||||| MATURITY|MATURITYTOT|1|Y|N|N||N|1||||Total Maturity|Total échéancier MATURITYTOT|0_1Y|1|Y|N|N||N|1||||Less than 1 year|moins d'1 an MATURITYTOT|1_5Y|1|Y|N|N||N|1||||1 to 5 years|1 à 5 ans MATURITYTOT|5_Y|1|Y|N|N||N|1||||More than 5 years|plus de 5 ans MAT_CURR|CURRENCY|1|Y|N|N||N|1||||Split by Currency|Ventilation par devise CURRENCY|Input_BS|0|N|N|N||N|1||||| CURRENCY|CURRENCYTOT|1|Y|N|N||N|1||||Total Currency|Total devise CURRENCYTOT|C_EUR|1|Y|N|N||N|1||||EUR|EUR CURRENCYTOT|C_CAD|1|Y|N|N||N|1||||CAD|CAD CURRENCYTOT|C_CHF|1|Y|N|N||N|1||||CHF|CHF CURRENCYTOT|C_CNY|1|Y|N|N||N|1||||CNY|CNY CURRENCYTOT|C_CZK|1|Y|N|N||N|1||||CZK|CZK CURRENCYTOT|C_GBP|1|Y|N|N||N|1||||GBP|GBP CURRENCYTOT|C_HUF|1|Y|N|N||N|1||||HUF|HUF CURRENCYTOT|C_JPY|1|Y|N|N||N|1||||JPY|JPY CURRENCYTOT|C_PLN|1|Y|N|N||N|1||||PLN|PLN CURRENCYTOT|C_SGD|1|Y|N|N||N|1||||SGD|SGD CURRENCYTOT|C_USD|1|Y|N|N||N|1||||USD|USD CURRENCYTOT|C_ZAR|1|Y|N|N||N|1||||ZAR|ZAR AllCustom3|OGPART|1|Y|N|N||N|1||||Outside group part|Part hors-groupe OGPART|Input_BS|0|N|N|N||N|1||||| OGPART|OGTOT|1|Y|N|N||N|1||||Outside group total|Total HG OGTOT|OG1|1|Y|N|N||N|1||||Outside group 1|HG1 OGTOT|OG2|1|Y|N|N||N|1||||Outside group 2|HG2 OGTOT|OG3|1|Y|N|N||N|1||||Outside group 3|HG3 AllCustom3|RATE|0|Y|N|N||N|1||||Rates for deferred taxes|Taux d'impôts RATE|N_RATE|1|Y|N|N||N|1||||Normal rate|Taux normal RATE|R1_RATE|1|Y|N|N||N|1||||Reduced rate 1|Taux réduit 1 RATE|R2_RATE|1|Y|N|N||N|1||||Reduced rate 2|Taux réduit 2 !Hierarchies=Custom4 'Parent|Child|AggregationWeight|IsPrimary|SwitchSignForFlow|SwitchTypeForFlow|SecurityClass|IsCalculated|SubmissionGroup|UserDefined1|UserDefined2|UserDefined3|Alias=English|Alias=French #root|[None]|0|Y|N|N||N|1||||Local|Social #root|AllCustom4|0|Y|N|N||N|1||||Total Custom4|Total Custom4 AllCustom4|[None]|0|N|N|N||N|1||||| AllCustom4|TOTADJ|1|Y|N|N||N|1||||Total IAS gaap|Total retraité TOTADJ|[None]|1|N|N|N||N|1||||| TOTADJ|ManAdj|1|Y|N|N||N|1||||Total manual adjustments|Total retraitements manuels ManAdj|MRET01|1|Y|N|N||N|1||||Deferred expenses|Charges à répartir ManAdj|MRET02|1|Y|N|N||N|1||||Opening Result|Ecart résultat n-1 ManAdj|MRET03|1|Y|N|N||N|1||||Merge|Fusion ManAdj|MRET04|1|Y|N|N||N|1||||homogeneization|Homogénéisation ManAdj|MRET06|1|Y|N|N||N|1||||Intercalary interests|Intérêts intercalaires ManAdj|MRET07|1|Y|N|N||N|1||||Loans discount IAS23|Prime rmbst emprunt IAS23 ManAdj|MRET08|1|Y|N|N||N|1||||Revenue IAS 18|Prod activités ordinaires ManAdj|MRET99|1|Y|N|N||N|1||||Miscallaneous|Divers ManAdj|MASS01|1|Y|N|N||N|1||||Leasing|Locations financement ManAdj|MASS02|1|Y|N|N||N|1||||Depreciation of Leasing|Amortissement locations financement ManAdj|MASS03|1|Y|N|N||N|1||||Surplus evaluation|Ecarts d'évaluation ManAdj|MASS04|1|Y|N|N||N|1||||Depreciation of Surplus evaluation|Amortissements ecarts d'évaluation ManAdj|MASS06|1|Y|N|N||N|1||||Depr of R&D expenses|Amts Frais de R&D ManAdj|MASS05|1|Y|N|N||N|1||||R&D expenses|Frais de R&D ManAdj|MASS07|1|Y|N|N||N|1||||Tang assets depreciation period|Durée amortissement Immos Corpo ManAdj|MASS08|1|Y|N|N||N|1||||Intangible assets - depreciation period|Durée amortissement Immos Incorp ManAdj|MASS09|1|Y|N|N||N|1||||Other adj - depre of assets|Autres retraitmt sur amts sur immo ManAdj|MASS99|1|Y|N|N||N|1||||Other adj - assets|Autres retraitmt sur immo ManAdj|MREV01|1|Y|N|N||N|1||||FV adjust fin derivatives|Ecart de réev JV Inst fin Dérivés ManAdj|MREV02|1|Y|N|N||N|1||||FV adjust other fin assets|Ecart de réev JV autres actifs fin. ManAdj|MREV03|1|Y|N|N||N|1||||FV adjust tang/Int assets|Ecart de réev JV immobilisations ManAdj|MIMP02|1|Y|N|N||N|1||||Impairment test other fin assets|Impairment test autres actifs fin. ManAdj|MIMP03|1|Y|N|N||N|1||||Impairment test tang/Int assets|Impairment test immobilisations ManAdj|MFIN01|1|Y|N|N||N|1||||Reclassification Fin asset in equity|Reclst Inst Fin hybrides en capitaux ManAdj|MFIN99|1|Y|N|N||N|1||||Financial Instruments|Autres Instruments financiers ManAdj|MPR01|1|Y|N|N||N|1||||Provisions for restructuring|Prov. pour restructurat. ManAdj|MPR02|1|Y|N|N||N|1||||Provisions for pension|Provisions pour retraite ManAdj|MPR99|1|Y|N|N||N|1||||Other Provisions|Autres retraitement sur provisions ManAdj|MDEF01|1|Y|N|N||N|1||||Deferred tax on fixed assets|Impôts différés sur immos ManAdj|MDEF02|1|Y|N|N||N|1||||Deferred tax on contingencies|Impôts différés sur provision ManAdj|MDEF03|1|Y|N|N||N|1||||Write-off of deferred tax discounting|Impôts différés sur désactualisation ManAdj|MDEF04|1|Y|N|N||N|1||||Deferred tax on other assets|Impôts différés sur autres actifs ManAdj|MDEF05|1|Y|N|N||N|1||||Deferred tax on other liabilities|Impôts différés sur autres passifs ManAdj|MDEF06|1|Y|N|N||N|1||||Deferred taxes|Impôts différés sur inst fin actif ManAdj|MDEF07|1|Y|N|N||N|1||||Deferred taxes|Impôts différés sur inst fin passif ManAdj|MCON01|1|Y|N|N||N|1||||Manual adj Goodwill|Retraitmt Ecarts d'acq positif ManAdj|MCON02|1|Y|N|N||N|1||||Manual adj Depr Goodwill|Retraitmt Dépr. écarts d'acq positif ManAdj|MCON03|1|Y|N|N||N|1||||Manual adj Badwill|Retraitmt Ecarts d'acq négatif ManAdj|MCON04|1|Y|N|N||N|1||||Manual adj Net Book Value assets|Retraitmt manuel PMV cession actif ManAdj|MCON05|1|Y|N|N||N|1||||Manual adj Net Book Value investments|Retraitmt manuel PMV cession titres ManAdj|MCASH01|1|Y|N|N||N|1||||Manual adj Cash Flow|Retraitmt Tableau de flux TOTADJ|AutoAdj|1|Y|N|N||N|1||||Total automatic adjustments|Total retraitements automatiques AutoAdj|ARET01|1|Y|N|N||N|1||||Accelerated depreciation|Amortissements dérogatoires AutoAdj|ARET02|1|Y|N|N||N|1||||Provisions for exchange risk|Prov. pour risques de change AutoAdj|ARET03|1|Y|N|N||N|1||||Provisions for foreign establishment|Prov. implantation à l'étranger AutoAdj|ARET04|1|Y|N|N||N|1||||Reinvested gains|Plus-values réinvesties AutoAdj|ARET05|1|Y|N|N||N|1||||Other regulated provisions|Autres provisions réglementées AutoAdj|ARET06|1|Y|N|N||N|1||||Preliminary & formation expenses|Frais d'établissement AutoAdj|ARET07|1|Y|N|N||N|1||||Depr on preliminary & formation exp|Frais d'etablissement amortissement AutoAdj|ARET08|1|Y|N|N||N|1||||Provision for investment|Prov pour investissement AutoAdj|ARET09|1|Y|N|N||N|1||||Reglementary provisions|Prov. pour hausse de prix AutoAdj|ARET10|1|Y|N|N||N|1||||Special provision of revaluation|Prov. spéciale de réevaluation AutoAdj|ARET11|1|Y|N|N||N|1||||Investment subsidies|Subventions d'investissements AutoAdj|ARET12|1|Y|N|N||N|1||||Translation adjustment asset|Ecart de conversion actif AutoAdj|ARET13|1|Y|N|N||N|1||||Translation adjustment liability|Ecart de conversion passif TOTADJ|Elim|1|Y|N|N||Y|1||||Total Eliminations|Total éliminations automatiques Elim|AMGW|1|Y|N|N||Y|1||||Goodwilll depreciation|Dépréciation pour écart d'acquisition Elim|CAP|1|Y|N|N||Y|1||||Capital|Capitaux propres sociaux Elim|CAPFTA|1|Y|N|N||Y|1||||Capital First Time Application|Capitaux propres première application Elim|CAPREV01|1|Y|N|N||Y|1||||FV reserves adjust -fin derivatives|Ecart de réev JV Inst fin Dérivés Elim|CAPREV02|1|Y|N|N||Y|1||||FV reserves adjust-other fin assets|Ecart de réev JV autres actifs fin. Elim|CAPREV03|1|Y|N|N||Y|1||||FV reserves adjust- tang/Int assets|Ecart de réev JV immobilisations Elim|DIV|1|Y|N|N||Y|1||||Dividends|Dividendes Elim|INV|1|Y|N|N||Y|1||||Investments|Titres participation Elim|INTDIV|1|Y|N|N||Y|1||||Interim on dividends|Acomptes sur dividendes Elim|FIN|1|Y|N|N||Y|1||||Financial|Financier Elim|GW|1|Y|N|N||Y|1||||Goodwill gross value|Ecart d'acquisition Elim|INDEB|1|Y|N|N||Y|1||||Indebtedness|Créances dettes récip. Elim|OPE|1|Y|N|N||Y|1||||Operating|Exploitation Elim|PFIA|1|Y|N|N||Y|1||||Provisions on other financial assets|Provisions autres immo financières Elim|PINV|1|Y|N|N||Y|1||||Provisions on investments|Provisions titres participation Elim|POLC|1|Y|N|N||Y|1||||Provisions on other liab & charges|Provisions autres risques et charges Elim|POTR|1|Y|N|N||Y|1||||Provisions on other receivable|Provisions autres créances Elim|PSRI|1|Y|N|N||Y|1||||Provisions on subsidiary risks|Provisions risques filiales Elim|PTRA|1|Y|N|N||Y|1||||Provisions on trade receivable|Provisions clients Elim|PS31|1|Y|N|N||Y|1||||Raw materials and inventories|Matières premières et achats stockés Elim|PS33|1|Y|N|N||Y|1||||Inventories WIP (Goods)|En-cours de production de biens Elim|PS34|1|Y|N|N||Y|1||||Inventories WIP (Services)|En-cours de production de services Elim|PS35|1|Y|N|N||Y|1||||Profit in stocks intermediate & fin prod|Produits intermédiaires et finis Elim|PS37|1|Y|N|N||Y|1||||Inventories Merchandise|Marchandises Elim|INTANGGL|1|Y|N|N||Y|1||||GL on disposal of intangible assets|PMV cession sur immo incorporelles Elim|TANGGL|1|Y|N|N||Y|1||||GL on disposal of tangible assets|PMV cession sur immo corporelles Elim|FINGL|1|Y|N|N||Y|1||||GL on disposal of financial assets|PMV cession sur immo financières Elim|WCR|1|Y|N|N||Y|1||||Working capital requirements|Actif circulant Elim|IPEXCH|1|Y|N|N||Y|1||||Exchange on internal profit|Ecart de change sur profit interne Elim|SUBCAP|1|Y|N|N||Y|1||||Subscribed capital|Souscription de capital AllCustom4|DEFTAX|0|Y|N|N||Y|1||||Deferred tax analysis|Analyse des impots différés DEFTAX|ACCADJ|0|Y|N|N||Y|1||||Total of accounting adjustments|Total des retraitements comptables ACCADJ|ACCADJ_T|1|Y|N|N||Y|1||||Total of temporary adjustments|Total retraitements temporaires ACCADJ_T|MRET01|1|N|N|N||N|1||||| ACCADJ_T|MRET02|1|N|N|N||N|1||||| ACCADJ_T|MRET03|1|N|N|N||N|1||||| ACCADJ_T|MRET04|1|N|N|N||N|1||||| ACCADJ_T|MRET06|1|N|N|N||N|1||||| ACCADJ_T|MRET07|1|N|N|N||N|1||||| ACCADJ_T|MRET08|1|N|N|N||N|1||||| ACCADJ_T|MRET99|1|N|N|N||N|1||||| ACCADJ_T|MASS01|1|N|N|N||N|1||||| ACCADJ_T|MASS02|1|N|N|N||N|1||||| ACCADJ_T|MASS03|1|N|N|N||N|1||||| ACCADJ_T|MASS04|1|N|N|N||N|1||||| ACCADJ_T|MASS06|1|N|N|N||N|1||||| ACCADJ_T|MASS05|1|N|N|N||N|1||||| ACCADJ_T|MASS07|1|N|N|N||N|1||||| ACCADJ_T|MASS99|1|N|N|N||N|1||||| ACCADJ_T|MREV01|1|N|N|N||N|1||||| ACCADJ_T|MREV02|1|N|N|N||N|1||||| ACCADJ_T|MREV03|1|N|N|N||N|1||||| ACCADJ_T|MIMP02|1|N|N|N||N|1||||| ACCADJ_T|MIMP03|1|N|N|N||N|1||||| ACCADJ_T|MFIN01|1|N|N|N||N|1||||| ACCADJ_T|MFIN99|1|N|N|N||N|1||||| ACCADJ_T|MPR01|1|N|N|N||N|1||||| ACCADJ_T|MPR02|1|N|N|N||N|1||||| ACCADJ_T|MPR99|1|N|N|N||N|1||||| ACCADJ_T|ARET01|1|N|N|N||N|1||||| ACCADJ_T|ARET02|1|N|N|N||N|1||||| ACCADJ_T|ARET03|1|N|N|N||N|1||||| ACCADJ_T|ARET07|1|N|N|N||N|1||||| ACCADJ_T|ARET08|1|N|N|N||N|1||||| ACCADJ_T|ARET09|1|N|N|N||N|1||||| ACCADJ_T|ARET10|1|N|N|N||N|1||||| ACCADJ_T|ARET11|1|N|N|N||N|1||||| ACCADJ_T|ARET12|1|N|N|N||N|1||||| ACCADJ_T|ARET13|1|N|N|N||N|1||||| ACCADJ|ACCADJ_P|1|Y|N|N||Y|1||||Total of permanent adjustment|Total retraitements permanents ACCADJ_P|MASS08|1|N|N|N||N|1||||| ACCADJ_P|MASS09|1|N|N|N||N|1||||| ACCADJ_P|ARET04|1|N|N|N||N|1||||| ACCADJ_P|ARET05|1|N|N|N||N|1||||| ACCADJ_P|ARET06|1|N|N|N||N|1||||| DEFTAX|TAXADJ|0|Y|N|N||Y|1||||Total fiscals adjusments|Total des retraitements fiscaux TAXADJ|TAXADJ_T|1|Y|N|N||Y|1||||Total temporary adjustments|Total retraitements temporaires TAXADJ_T|TAXADJ_T1|1|Y|N|N||Y|1||||Defferred cost|Charges à déductibilité différée TAXADJ_T1|TAXADJ_T11|1|Y|N|N||N|1||||Defferred cost|Charges à déductibilité différée TAXADJ_T1|TAXADJ_T12|1|Y|N|N||N|1||||Cost A|Charges A TAXADJ_T1|TAXADJ_T13|1|Y|N|N||N|1||||Cost B|Charges B TAXADJ_T|TAXADJ_T2|1|Y|N|N||Y|1||||Deferred taxed income|Produit à taxation différée TAXADJ_T2|TAXADJ_T21|1|Y|N|N||N|1||||Deferred taxed income|Produit à taxation différée TAXADJ_T2|TAXADJ_T22|1|Y|N|N||N|1||||Deferred taxed income|Produit à taxation différée TAXADJ_T2|TAXADJ_T23|1|Y|N|N||N|1||||Deferred taxed income|Produit à taxation différée TAXADJ|TAXADJ_P|1|Y|N|N||Y|1||||Total fixed adjusments|Total retraitements permanents TAXADJ_P|TAXADJ_P1|1|Y|N|N||Y|1||||Cost ND|Charges ND TAXADJ_P1|TAXADJ_P11|1|Y|N|N||N|1||||Cost ND|Charges ND TAXADJ_P1|TAXADJ_P12|1|Y|N|N||N|1||||Cost ND|Charges ND TAXADJ_P1|TAXADJ_P13|1|Y|N|N||N|1||||Cost ND|Charges ND TAXADJ_P|TAXADJ_P2|1|Y|N|N||Y|1||||Other|Autres TAXADJ_P2|TAXADJ_P21|1|Y|N|N||N|1||||Other|Autres TAXADJ_P2|TAXADJ_P22|1|Y|N|N||N|1||||Other|Autres TAXADJ_P2|TAXADJ_P23|1|Y|N|N||N|1||||Other|Autres DEFTAX|VALADJ|0|Y|N|N||Y|1||||Total valorization differences|Total des différences de valorisation VALADJ|VALADJ_1|1|Y|N|N||Y|1||||Ecarts évaluation lors d'une acquisition|Ecarts évaluation lors d'une acquisition VALADJ_1|VALADJ_11|1|Y|N|N||Y|1||||Asset|Actifs VALADJ_11|VALADJ_111|1|Y|N|N||N|1||||Intangible asset|Actifs incorporels VALADJ_11|VALADJ_112|1|Y|N|N||N|1||||Tangible asset|Actifs corporels VALADJ_11|VALADJ_113|1|Y|N|N||N|1||||Financial asset|Actifs financiers VALADJ_1|VALADJ_12|1|Y|N|N||Y|1||||Liability|Passif VALADJ_12|VALADJ_121|1|Y|N|N||N|1||||Liability|Passif VALADJ|VALADJ_2|1|Y|N|N||Y|1||||Liability|PV en sursis d'imposition VALADJ_2|VALADJ_21|1|Y|N|N||Y|1||||Gains on intangible asset|PV Actifs incorporels VALADJ_2|VALADJ_22|1|Y|N|N||N|1||||Gains on tangible asset|PV Actifs corporels VALADJ_2|VALADJ_23|1|Y|N|N||N|1||||Gains on financial asset|PV Actifs financiers VALADJ|VALADJ_3|1|Y|N|N||Y|1||||Free adjusts|Réévaluations libres VALADJ_3|VALADJ_31|1|Y|N|N||Y|1||||Intangible asset|Actifs incorporels VALADJ_3|VALADJ_32|1|Y|N|N||N|1||||Tangible asset|Actifs corporels VALADJ_3|VALADJ_33|1|Y|N|N||N|1||||Financial asset|Actifs financiers VALADJ_3|VALADJ_34|1|Y|N|N||N|1||||Liability|Passif DEFTAX|TAXDEBT|0|Y|N|N||Y|1||||Tax deficit|Déficit d'impôts TAXDEBT|TAXDEBT_1|1|Y|N|N||N|1||||Tax deficit 1|Déficit d'impôts 1 TAXDEBT|TAXDEBT_2|1|Y|N|N||N|1||||Tax deficit 2| DEFTAX|TAXPROOF|0|Y|N|N||Y|1||||Taxproof detail|Détail de la preuve d'impôts TAXPROOF|TAXPROOF_1|0|Y|N|N||N|1||||Earning adjusted before taxes|Résultat retraité avant impôts TAXPROOF|TAXPROOF_2|0|Y|N|N||N|1||||Accounting current tax|Impôt courant comptabilisé TAXPROOF|TAXPROOF_3|0|Y|N|N||N|1||||Accounting defferred tax|Impôt différé comptabilisé TAXPROOF|TAXPROOF_4|0|Y|N|N||N|1||||Accounting social tax|Impôt social comptabilisé TAXPROOF|TAXPROOF_5|0|Y|N|N||N|1||||Theoretical social tax|Impôt social théorique TAXPROOF|TAXPROOF_6|0|Y|N|N||N|1||||From accounting ajustments|Issues des Rts comptables TAXPROOF|TAXPROOF_7|0|Y|N|N||N|1||||From fiscal adjustments|Issues des Rts fiscaux TAXPROOF|TAXPROOF_8|0|Y|N|N||N|1||||From accounting adjustments|Issues des Rts comptables TAXPROOF|TAXPROOF_9|0|Y|N|N||N|1||||From fiscal adjustments|Issues des Rts fiscaux TAXPROOF|TAXPROOF_10|0|Y|N|N||N|1||||Due to purchase|Lors d'une acquisition TAXPROOF|TAXPROOF_11|0|Y|N|N||N|1||||Reported tax|Report d'imposition TAXPROOF|TAXPROOF_12|0|Y|N|N||N|1||||Revaluation|Réévaluation TAXPROOF|TAXPROOF_13|0|Y|N|N||N|1||||From accounting ajustments|Issues des Rts comptables TAXPROOF|TAXPROOF_14|0|Y|N|N||N|1||||From fiscal adjustments|Issues des Rts fiscaux TAXPROOF|TAXPROOF_15|0|Y|N|N||N|1||||From valorization difference|Issues des diff. de valorisation TAXPROOF|TAXPROOF_16|0|Y|N|N||N|1||||Prior fiscal loss|Déficits fiscaux antérieurs imputés TAXPROOF|TAXPROOF_17|0|Y|N|N||N|1||||Non active fiscal loss|Déficits fiscaux N non activés #root|Tech|0|Y|N|N||Y|1||||Technical members| Tech|Equity|0|Y|N|N||Y|1||||Tech for Equity Method|Tech pour Méthode Proportionnelle Tech|Minority|0|Y|N|N||Y|1||||Tech for Minority|Tech pour Méthode Proportionnelle Tech|Prop|0|Y|N|N||Y|1||||Tech for Proportional Method|Tech pour Méthode Proportionnelle Prop|PropU|0|Y|N|N||Y|1||||Tech for Proportional Method|Tech pour Méthode Proportionnelle Prop|PropE|0|Y|N|N||Y|1||||Tech for Proportional Method|Tech pour Méthode Proportionnelle !Hierarchies=SecurityClass 'Parent|Child #root|[Default] #root|SUBCONSO !Hierarchies=Year 'Parent|Child #root|2001 #root|2002 #root|2003 #root|2004 #root|2005 #root|2006 #root|2007 #root|2008 #root|2009 #root|2010 #root|2011 #root|2012 #root|2013 #root|2014 #root|2015 !Hierarchies=Period 'Parent|Child|Alias=English|Alias=French|Alias=German|Alias=Spanish|Alias=Italian|Alias=L6|Alias=L7|Alias=L8|Alias=L9|Alias=L10 #root|[Year]|||||||||| [Year]|HalfYear1|Half Year 1||||||||| [Year]|HalfYear2|Half Year 2||||||||| HalfYear1|Quarter1|Quarter 1||||||||| HalfYear1|Quarter2|Quarter 2||||||||| HalfYear2|Quarter3|Quarter 3||||||||| HalfYear2|Quarter4|Quarter 4||||||||| Quarter1|January|January||||||||| Quarter1|February|February||||||||| Quarter1|March|March||||||||| Quarter2|April|April||||||||| Quarter2|May|May||||||||| Quarter2|June|June||||||||| Quarter3|July|July||||||||| Quarter3|August|August||||||||| Quarter3|September|September||||||||| Quarter4|October|October||||||||| Quarter4|November|November||||||||| Quarter4|December|December||||||||| !Hierarchies=View 'Parent|Child|Alias=English|Alias=French|Alias=German|Alias=Spanish|Alias=Italian|Alias=L6|Alias=L7|Alias=L8|Alias=L9|Alias=L10 #root|YTD|||||||||| #root|HYTD|||||||||| #root|QTD|||||||||| #root|MTD|||||||||| !Hierarchies=Alias 'Parent|Child #root|English #root|French #root|German #root|Spanish #root|Italian #root|L6 #root|L7 #root|L8 #root|L9 #root|L10
zhmu/ananas
Ada
1,438
ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- ADA.NUMERICS.COMPLEX.ELEMENTARY_FUNCTIONS -- -- -- -- S p e c -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. In accordance with the copyright of that document, you can freely -- -- copy and modify this specification, provided that if you redistribute a -- -- modified version, any changes that you have made are clearly indicated. -- -- -- ------------------------------------------------------------------------------ with Ada.Numerics.Complex_Types; with Ada.Numerics.Generic_Complex_Elementary_Functions; package Ada.Numerics.Complex_Elementary_Functions is new Ada.Numerics.Generic_Complex_Elementary_Functions (Ada.Numerics.Complex_Types); pragma Pure (Ada.Numerics.Complex_Elementary_Functions);
zhmu/ananas
Ada
3,183
ads
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . V A L _ F I X E D _ 3 2 -- -- -- -- S p e c -- -- -- -- Copyright (C) 2020-2022, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ -- This package contains routines for scanning values for decimal fixed point -- types up to 32-bit small and mantissa, for use in Text_IO.Decimal_IO, and -- the Value attribute for such decimal types. with Interfaces; with System.Arith_32; with System.Value_F; package System.Val_Fixed_32 is pragma Preelaborate; subtype Int32 is Interfaces.Integer_32; subtype Uns32 is Interfaces.Unsigned_32; package Impl is new Value_F (Int32, Uns32, Arith_32.Scaled_Divide32); function Scan_Fixed32 (Str : String; Ptr : not null access Integer; Max : Integer; Num : Int32; Den : Int32) return Int32 renames Impl.Scan_Fixed; function Value_Fixed32 (Str : String; Num : Int32; Den : Int32) return Int32 renames Impl.Value_Fixed; end System.Val_Fixed_32;
zhmu/ananas
Ada
100
ads
package Inline10_Pkg is procedure Test (I : Integer); pragma Inline (Test); end Inline10_Pkg;
annexi-strayline/ASAP-Unicode
Ada
3,729
ads
------------------------------------------------------------------------------ -- -- -- Unicode Utilities -- -- -- -- Unicode Character Database (UCD) Facilities -- -- -- -- ------------------------------------------------------------------------ -- -- -- -- Copyright (C) 2019, ANNEXI-STRAYLINE Trans-Human Ltd. -- -- All rights reserved. -- -- -- -- Original Contributors: -- -- * Richard Wai (ANNEXI-STRAYLINE) -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- -- -- * Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -- -- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- This unit parses CaseFolding.txt to generate the function body for -- Unicode.Case_Folding.Simple procedure Unicode.UCD.Generate_Case_Folding.Simple (CaseFolding_Path: in String := "CaseFolding.txt"; Body_Path : in String := "aura-unicode-case_folding-simple.adb"); -- note The Body file is open in Create mode.
jrmarino/AdaBase
Ada
5,127
ads
-- This file is covered by the Internet Software Consortium (ISC) License -- Reference: ../../License.txt with CommonText; with Spatial_Data.Well_Known_Binary; with Ada.Calendar.Formatting; with Ada.Strings.Wide_Unbounded; with Ada.Strings.Wide_Wide_Unbounded; with Ada.Strings.UTF_Encoding; package AdaBase.Results is package CT renames CommonText; package AC renames Ada.Calendar; package ACF renames Ada.Calendar.Formatting; package SUW renames Ada.Strings.Wide_Unbounded; package SUWW renames Ada.Strings.Wide_Wide_Unbounded; package SUTF renames Ada.Strings.UTF_Encoding; package GEO renames Spatial_Data; package WKB renames Spatial_Data.Well_Known_Binary; subtype Textual is CT.Text; subtype Textwide is SUW.Unbounded_Wide_String; subtype Textsuper is SUWW.Unbounded_Wide_Wide_String; subtype Text_UTF8 is SUTF.UTF_8_String; TARGET_TYPE_TOO_NARROW : exception; CONVERSION_FAILED : exception; UNSUPPORTED_CONVERSION : exception; COLUMN_DOES_NOT_EXIST : exception; CONSTRUCTOR_DO_NOT_USE : exception; ------------------------------------------- -- Supported Field Types (Standardized) -- ------------------------------------------- type Bit1 is mod 2 ** 1; type NByte1 is mod 2 ** 8; type NByte2 is mod 2 ** 16; type NByte3 is mod 2 ** 24; type NByte4 is mod 2 ** 32; type NByte8 is mod 2 ** 64; type Byte8 is range -2 ** 63 .. 2 ** 63 - 1; type Byte4 is range -2 ** 31 .. 2 ** 31 - 1; type Byte3 is range -2 ** 23 .. 2 ** 23 - 1; type Byte2 is range -2 ** 15 .. 2 ** 15 - 1; type Byte1 is range -2 ** 7 .. 2 ** 7 - 1; type Real9 is digits 9; type Real18 is digits 18; subtype NByte0 is Boolean; type Enumtype is record enumeration : Textual; end record; type Settype is array (Positive range <>) of Enumtype; type Chain is array (Positive range <>) of NByte1; type Bits is array (Natural range <>) of Bit1; type NByte0_Access is access all NByte0; type NByte1_Access is access all NByte1; type NByte2_Access is access all NByte2; type NByte3_Access is access all NByte3; type NByte4_Access is access all NByte4; type NByte8_Access is access all NByte8; type Byte1_Access is access all Byte1; type Byte2_Access is access all Byte2; type Byte3_Access is access all Byte3; type Byte4_Access is access all Byte4; type Byte8_Access is access all Byte8; type Real9_Access is access all Real9; type Real18_Access is access all Real18; type Str1_Access is access all Textual; type Str2_Access is access all Textwide; type Str4_Access is access all Textsuper; type Time_Access is access all AC.Time; type Chain_Access is access all Chain; type Enum_Access is access all Enumtype; type Settype_Access is access all Settype; type Geometry_Access is access all GEO.Geometry; type Bits_Access is access all Bits; type S_UTF8_Access is access all Text_UTF8; Blank_String : constant Textual := CT.blank; Blank_WString : constant Textwide := SUW.Null_Unbounded_Wide_String; Blank_WWString : constant Textsuper := SUWW.Null_Unbounded_Wide_Wide_String; ------------------------------------------------ -- CONSTANTS FOR PARAMETER TYPE DEFINITIONS -- ------------------------------------------------ PARAM_IS_BOOLEAN : constant NByte0 := False; PARAM_IS_NBYTE_1 : constant NByte1 := 0; PARAM_IS_NBYTE_2 : constant NByte2 := 0; PARAM_IS_NBYTE_3 : constant NByte3 := 0; PARAM_IS_NBYTE_4 : constant NByte4 := 0; PARAM_IS_NBYTE_8 : constant NByte8 := 0; PARAM_IS_BYTE_1 : constant Byte1 := 0; PARAM_IS_BYTE_2 : constant Byte2 := 0; PARAM_IS_BYTE_3 : constant Byte3 := 0; PARAM_IS_BYTE_4 : constant Byte4 := 0; PARAM_IS_BYTE_8 : constant Byte8 := 0; PARAM_IS_REAL_9 : constant Real9 := 0.0; PARAM_IS_REAL_18 : constant Real18 := 0.0; PARAM_IS_CHAIN : constant Chain := (1 .. 1 => 0); PARAM_IS_BITS : constant Bits := (0 .. 0 => 0); PARAM_IS_ENUM : constant Enumtype := (enumeration => Blank_String); PARAM_IS_SET : constant Settype := (1 .. 1 => (PARAM_IS_ENUM)); PARAM_IS_TEXTUAL : constant Textual := Blank_String; PARAM_IS_TEXTWIDE : constant Textwide := Blank_WString; PARAM_IS_TEXTSUPER : constant Textsuper := Blank_WWString; PARAM_IS_TEXT_UTF8 : constant Text_UTF8 := blankstring; PARAM_IS_TIMESTAMP : constant AC.Time := ACF.Time_Of (Year => AC.Year_Number'First, Month => AC.Month_Number'First, Day => AC.Day_Number'First, Hour => ACF.Hour_Number'First, Minute => ACF.Minute_Number'First, Second => ACF.Second_Number'First, Sub_Second => ACF.Second_Duration'First); end AdaBase.Results;
faelys/natools
Ada
931
adb
with Interfaces; use Interfaces; package body Natools.Static_Maps.S_Expressions.Templates.Integers.AC is P : constant array (0 .. 0) of Natural := (0 .. 0 => 1); T1 : constant array (0 .. 0) of Unsigned_8 := (0 .. 0 => 3); T2 : constant array (0 .. 0) of Unsigned_8 := (0 .. 0 => 5); G : constant array (0 .. 6) of Unsigned_8 := (0, 0, 0, 0, 0, 1, 2); function Hash (S : String) return Natural is F : constant Natural := S'First - 1; L : constant Natural := S'Length; F1, F2 : Natural := 0; J : Natural; begin for K in P'Range loop exit when L < P (K); J := Character'Pos (S (P (K) + F)); F1 := (F1 + Natural (T1 (K)) * J) mod 7; F2 := (F2 + Natural (T2 (K)) * J) mod 7; end loop; return (Natural (G (F1)) + Natural (G (F2))) mod 3; end Hash; end Natools.Static_Maps.S_Expressions.Templates.Integers.AC;
reznikmm/matreshka
Ada
20,243
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Elements; with AMF.Internals.Element_Collections; with AMF.Internals.Helpers; with AMF.Internals.Tables.UML_Attributes; with AMF.UML.Comments.Collections; with AMF.UML.Dependencies.Collections; with AMF.UML.Elements.Collections; with AMF.UML.Named_Elements; with AMF.UML.Namespaces.Collections; with AMF.UML.Packages.Collections; with AMF.UML.Parameterable_Elements; with AMF.UML.String_Expressions; with AMF.UML.Template_Parameters; with AMF.Visitors.UMLDI_Iterators; with AMF.Visitors.UMLDI_Visitors; with League.Strings.Internals; with Matreshka.Internals.Strings; package body AMF.Internals.UMLDI_UML_Styles is ------------------- -- Get_Font_Name -- ------------------- overriding function Get_Font_Name (Self : not null access constant UMLDI_UML_Style_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_Font_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_Font_Name; ------------------- -- Set_Font_Name -- ------------------- overriding procedure Set_Font_Name (Self : not null access UMLDI_UML_Style_Proxy; To : AMF.Optional_String) is begin if To.Is_Empty then AMF.Internals.Tables.UML_Attributes.Internal_Set_Font_Name (Self.Element, null); else AMF.Internals.Tables.UML_Attributes.Internal_Set_Font_Name (Self.Element, League.Strings.Internals.Internal (To.Value)); end if; end Set_Font_Name; ------------------- -- Get_Font_Size -- ------------------- overriding function Get_Font_Size (Self : not null access constant UMLDI_UML_Style_Proxy) return AMF.Optional_Real is begin return AMF.Internals.Tables.UML_Attributes.Internal_Get_Font_Size (Self.Element); end Get_Font_Size; ------------------- -- Set_Font_Size -- ------------------- overriding procedure Set_Font_Size (Self : not null access UMLDI_UML_Style_Proxy; To : AMF.Optional_Real) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Font_Size (Self.Element, To); end Set_Font_Size; --------------------------- -- Get_Client_Dependency -- --------------------------- overriding function Get_Client_Dependency (Self : not null access constant UMLDI_UML_Style_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 -- -------------- overriding function Get_Name (Self : not null access constant UMLDI_UML_Style_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_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_Name; -------------- -- Set_Name -- -------------- overriding procedure Set_Name (Self : not null access UMLDI_UML_Style_Proxy; To : AMF.Optional_String) is begin if To.Is_Empty then AMF.Internals.Tables.UML_Attributes.Internal_Set_Name (Self.Element, null); else AMF.Internals.Tables.UML_Attributes.Internal_Set_Name (Self.Element, League.Strings.Internals.Internal (To.Value)); end if; end Set_Name; ------------------------- -- Get_Name_Expression -- ------------------------- overriding function Get_Name_Expression (Self : not null access constant UMLDI_UML_Style_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 UMLDI_UML_Style_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 UMLDI_UML_Style_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 UMLDI_UML_Style_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_Comment -- ----------------------- overriding function Get_Owned_Comment (Self : not null access constant UMLDI_UML_Style_Proxy) return AMF.UML.Comments.Collections.Set_Of_UML_Comment is begin return AMF.UML.Comments.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Comment (Self.Element))); end Get_Owned_Comment; ----------------------- -- Get_Owned_Element -- ----------------------- overriding function Get_Owned_Element (Self : not null access constant UMLDI_UML_Style_Proxy) return AMF.UML.Elements.Collections.Set_Of_UML_Element is begin return AMF.UML.Elements.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owned_Element (Self.Element))); end Get_Owned_Element; --------------- -- Get_Owner -- --------------- overriding function Get_Owner (Self : not null access constant UMLDI_UML_Style_Proxy) return AMF.UML.Elements.UML_Element_Access is begin return AMF.UML.Elements.UML_Element_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owner (Self.Element))); end Get_Owner; ----------------------------------- -- Get_Owning_Template_Parameter -- ----------------------------------- overriding function Get_Owning_Template_Parameter (Self : not null access constant UMLDI_UML_Style_Proxy) return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is begin return AMF.UML.Template_Parameters.UML_Template_Parameter_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Owning_Template_Parameter (Self.Element))); end Get_Owning_Template_Parameter; ----------------------------------- -- Set_Owning_Template_Parameter -- ----------------------------------- overriding procedure Set_Owning_Template_Parameter (Self : not null access UMLDI_UML_Style_Proxy; To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Owning_Template_Parameter (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Owning_Template_Parameter; ---------------------------- -- Get_Template_Parameter -- ---------------------------- overriding function Get_Template_Parameter (Self : not null access constant UMLDI_UML_Style_Proxy) return AMF.UML.Template_Parameters.UML_Template_Parameter_Access is begin return AMF.UML.Template_Parameters.UML_Template_Parameter_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.UML_Attributes.Internal_Get_Template_Parameter (Self.Element))); end Get_Template_Parameter; ---------------------------- -- Set_Template_Parameter -- ---------------------------- overriding procedure Set_Template_Parameter (Self : not null access UMLDI_UML_Style_Proxy; To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access) is begin AMF.Internals.Tables.UML_Attributes.Internal_Set_Template_Parameter (Self.Element, AMF.Internals.Helpers.To_Element (AMF.Elements.Element_Access (To))); end Set_Template_Parameter; -------------------- -- All_Namespaces -- -------------------- overriding function All_Namespaces (Self : not null access constant UMLDI_UML_Style_Proxy) return AMF.UML.Namespaces.Collections.Ordered_Set_Of_UML_Namespace is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "All_Namespaces unimplemented"); raise Program_Error with "Unimplemented procedure UMLDI_UML_Style_Proxy.All_Namespaces"; return All_Namespaces (Self); end All_Namespaces; ------------------------- -- All_Owning_Packages -- ------------------------- overriding function All_Owning_Packages (Self : not null access constant UMLDI_UML_Style_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 UMLDI_UML_Style_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 UMLDI_UML_Style_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 UMLDI_UML_Style_Proxy.Is_Distinguishable_From"; return Is_Distinguishable_From (Self, N, Ns); end Is_Distinguishable_From; --------------- -- Namespace -- --------------- overriding function Namespace (Self : not null access constant UMLDI_UML_Style_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 UMLDI_UML_Style_Proxy.Namespace"; return Namespace (Self); end Namespace; -------------------- -- Qualified_Name -- -------------------- overriding function Qualified_Name (Self : not null access constant UMLDI_UML_Style_Proxy) return League.Strings.Universal_String is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Qualified_Name unimplemented"); raise Program_Error with "Unimplemented procedure UMLDI_UML_Style_Proxy.Qualified_Name"; return Qualified_Name (Self); end Qualified_Name; --------------- -- Separator -- --------------- overriding function Separator (Self : not null access constant UMLDI_UML_Style_Proxy) return League.Strings.Universal_String is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Separator unimplemented"); raise Program_Error with "Unimplemented procedure UMLDI_UML_Style_Proxy.Separator"; return Separator (Self); end Separator; ------------------------ -- All_Owned_Elements -- ------------------------ overriding function All_Owned_Elements (Self : not null access constant UMLDI_UML_Style_Proxy) return AMF.UML.Elements.Collections.Set_Of_UML_Element is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "All_Owned_Elements unimplemented"); raise Program_Error with "Unimplemented procedure UMLDI_UML_Style_Proxy.All_Owned_Elements"; return All_Owned_Elements (Self); end All_Owned_Elements; ------------------------ -- Is_Compatible_With -- ------------------------ overriding function Is_Compatible_With (Self : not null access constant UMLDI_UML_Style_Proxy; P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Compatible_With unimplemented"); raise Program_Error with "Unimplemented procedure UMLDI_UML_Style_Proxy.Is_Compatible_With"; return Is_Compatible_With (Self, P); end Is_Compatible_With; --------------------------- -- Is_Template_Parameter -- --------------------------- overriding function Is_Template_Parameter (Self : not null access constant UMLDI_UML_Style_Proxy) return Boolean is begin -- Generated stub: replace with real body! pragma Compile_Time_Warning (Standard.True, "Is_Template_Parameter unimplemented"); raise Program_Error with "Unimplemented procedure UMLDI_UML_Style_Proxy.Is_Template_Parameter"; return Is_Template_Parameter (Self); end Is_Template_Parameter; ------------------- -- Enter_Element -- ------------------- overriding procedure Enter_Element (Self : not null access constant UMLDI_UML_Style_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class then AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class (Visitor).Enter_UML_Style (AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access (Self), Control); end if; end Enter_Element; ------------------- -- Leave_Element -- ------------------- overriding procedure Leave_Element (Self : not null access constant UMLDI_UML_Style_Proxy; Visitor : in out AMF.Visitors.Abstract_Visitor'Class; Control : in out AMF.Visitors.Traverse_Control) is begin if Visitor in AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class then AMF.Visitors.UMLDI_Visitors.UMLDI_Visitor'Class (Visitor).Leave_UML_Style (AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access (Self), Control); end if; end Leave_Element; ------------------- -- Visit_Element -- ------------------- overriding procedure Visit_Element (Self : not null access constant UMLDI_UML_Style_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.UMLDI_Iterators.UMLDI_Iterator'Class then AMF.Visitors.UMLDI_Iterators.UMLDI_Iterator'Class (Iterator).Visit_UML_Style (Visitor, AMF.UMLDI.UML_Styles.UMLDI_UML_Style_Access (Self), Control); end if; end Visit_Element; end AMF.Internals.UMLDI_UML_Styles;
reznikmm/matreshka
Ada
3,957
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Db_Command_Attributes; package Matreshka.ODF_Db.Command_Attributes is type Db_Command_Attribute_Node is new Matreshka.ODF_Db.Abstract_Db_Attribute_Node and ODF.DOM.Db_Command_Attributes.ODF_Db_Command_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Db_Command_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Db_Command_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Db.Command_Attributes;
coopht/axmpp
Ada
3,522
ads
------------------------------------------------------------------------------ -- -- -- AXMPP Project -- -- -- -- XMPP Library for Ada -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011, Alexander Basov <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Alexander Basov, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Ada.Containers.Vectors; with League.Strings; package XMPP.Services_Features is function Image (X : XMPP.Feature) return League.Strings.Universal_String; package Features_Vectors is new Ada.Containers.Vectors (Natural, XMPP.Feature); subtype Features_Vector is Features_Vectors.Vector; end XMPP.Services_Features;
zhmu/ananas
Ada
4,581
adb
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- SYSTEM.TASK_PRIMITIVES.OPERATIONS.SPECIFIC -- -- -- -- B o d y -- -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ -- This is a version for Solaris native threads separate (System.Task_Primitives.Operations) package body Specific is ---------------- -- Initialize -- ---------------- procedure Initialize (Environment_Task : Task_Id) is pragma Unreferenced (Environment_Task); Result : Interfaces.C.int; begin Result := thr_keycreate (ATCB_Key'Access, System.Null_Address); pragma Assert (Result = 0); end Initialize; ------------------- -- Is_Valid_Task -- ------------------- function Is_Valid_Task return Boolean is Unknown_Task : aliased System.Address; Result : Interfaces.C.int; begin Result := thr_getspecific (ATCB_Key, Unknown_Task'Unchecked_Access); pragma Assert (Result = 0); return Unknown_Task /= System.Null_Address; end Is_Valid_Task; --------- -- Set -- --------- procedure Set (Self_Id : Task_Id) is Result : Interfaces.C.int; begin Result := thr_setspecific (ATCB_Key, To_Address (Self_Id)); pragma Assert (Result = 0); end Set; ---------- -- Self -- ---------- -- To make Ada tasks and C threads interoperate better, we have -- added some functionality to Self. Suppose a C main program -- (with threads) calls an Ada procedure and the Ada procedure -- calls the tasking run-time system. Eventually, a call will be -- made to self. Since the call is not coming from an Ada task, -- there will be no corresponding ATCB. -- What we do in Self is to catch references that do not come -- from recognized Ada tasks, and create an ATCB for the calling -- thread. -- The new ATCB will be "detached" from the normal Ada task -- master hierarchy, much like the existing implicitly created -- signal-server tasks. function Self return Task_Id is Result : Interfaces.C.int; Self_Id : aliased System.Address; begin Result := thr_getspecific (ATCB_Key, Self_Id'Unchecked_Access); pragma Assert (Result = 0); if Self_Id = System.Null_Address then return Register_Foreign_Thread; else return To_Task_Id (Self_Id); end if; end Self; end Specific;
zhmu/ananas
Ada
2,612
ads
------------------------------------------------------------------------------ -- -- -- GNAT LIBRARY COMPONENTS -- -- -- -- ADA.STRINGS.LESS_CASE_INSENSITIVE -- -- -- -- S p e c -- -- -- -- Copyright (C) 2004-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/>. -- -- -- -- This unit was originally developed by Matthew J Heaney. -- ------------------------------------------------------------------------------ function Ada.Strings.Less_Case_Insensitive (Left, Right : String) return Boolean; pragma Pure (Ada.Strings.Less_Case_Insensitive); -- Performs a case-insensitive lexicographic comparison of Left and -- Right. This is useful as the generic actual less-than operator when -- instantiating an ordered container package with type String as the key, -- allowing case-insensitive equivalence tests.
landgraf/nanomsg-ada
Ada
1,712
adb
-- The MIT License (MIT) -- Copyright (c) 2015 Pavel Zhukov <[email protected]> -- Permission is hereby granted, free of charge, to any person obtaining a copy -- of this software and associated documentation files (the "Software"), to deal -- in the Software without restriction, including without limitation the rights -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -- copies of the Software, and to permit persons to whom the Software is -- furnished to do so, subject to the following conditions: -- The above copyright notice and this permission notice shall be included in all -- copies or substantial portions of the Software. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -- SOFTWARE. with Aunit.Assertions; package body Nanomsg.Test_Message_Text_Convert is function Name (T : TC) return Message_String is begin return Aunit.Format ("Test case name : Message from_string/to_string test"); end Name; procedure Run_Test (T : in out TC) is use Aunit.Assertions; begin Nanomsg.Messages.From_String (T.Message, Text); Assert (Condition => T.Message.Text = Text, Message => "Message convert failed"); end Run_Test; end Nanomsg.Test_Message_Text_Convert;
godunko/adawebpack
Ada
3,461
ads
------------------------------------------------------------------------------ -- -- -- AdaWebPack -- -- -- ------------------------------------------------------------------------------ -- Copyright © 2020-2021, Vadim Godunko -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- ------------------------------------------------------------------------------ with Interfaces; package Web is pragma Pure; subtype DOM_Long is Interfaces.Integer_32; subtype DOM_Short is Interfaces.Integer_16; subtype DOM_Unsigned_Short is Interfaces.Unsigned_16; subtype DOM_Unsigned_Long is Interfaces.Unsigned_32; subtype DOM_Double is Interfaces.IEEE_Float_64; ---------------------------------- -- High Resolution Time Level 2 -- ---------------------------------- type DOM_High_Res_Time_Stamp is new DOM_Double; private use type DOM_Long; use type DOM_Unsigned_Long; use type DOM_Unsigned_Short; use type DOM_Double; -- Use all subtypes to provide default operators in all children -- packages. end Web;
AdaCore/training_material
Ada
506
adb
with Ada.Text_IO; with Devices.Radars; with Radar_Internals; procedure Main is E : Devices.Radars.Event_T; begin while True loop Devices.Radars.Radar.Wait_Event (E); Ada.Text_IO.Put_Line ("event " & Radar_Internals.Object_Type_T'Image (E.Object) & " " & Radar_Internals.Object_Status_T'Image (E.Status) ); Ada.Text_IO.Put_Line ("radar at angle " & Radar_Internals.Angle_Degrees_T'Image (Devices.Radars.Radar.Angle)); end loop; end Main;
FrankBuss/Ada_Synth
Ada
2,160
adb
-- This sample program receives MIDI events from a keyboard and from -- rotary encoders and outputs audio, like a synthesizer. -- Call it like this from Linux: -- -- amidi -p "hw:1,0,0" -r >(./obj/ada_synth | \ -- aplay -f S16_LE -c1 -r44100 --buffer-size=4096) -- -- The BASH syntax ">(program)" creates a temporary FIFO file, because amidi -- needs a file where it writes the received MIDI events. In case of problems, -- you can also create a named FIFO with "mkfifo", then start amidi in the -- background writing to this file, and then the ada_synth program like this: -- -- cat midi | ./ada_synth | aplay -f S16_LE -c1 -r44100 --buffer-size=4096) -- -- where "midi" is the named FIFO file. If it keeps playing a tone when you -- stop the program with ctrl-c, try this command: -- -- killall amidi aplay -- -- You can see the list of available MIDI devices with "amidi -l". -- For testing it is useful to use the AMIDI "--dump" option. -- For lower latency, you might need to change the Linux pipe size: -- -- sudo sysctl fs.pipe-max-size=4096 with GNAT.OS_Lib; with Interfaces; use Interfaces; with MIDI_Synthesizer; use MIDI_Synthesizer; procedure Ada_Synth is Data : Unsigned_8; Ignore : Integer; Main_Synthesizer : constant access Synthesizer'Class := Create_Synthesizer; task Main_Task is entry Data_Received (Data : Unsigned_8); end Main_Task; task body Main_Task is Sample : Float; Int_Smp : Short_Integer := 0; Ignore : Integer; begin loop select accept Data_Received (Data : Unsigned_8) do Main_Synthesizer.Parse_MIDI_Byte (Data); end Data_Received; else Sample := Main_Synthesizer.Next_Sample; Int_Smp := Short_Integer (Sample * 32767.0); Ignore := GNAT.OS_Lib.Write (GNAT.OS_Lib.Standout, Int_Smp'Address, Int_Smp'Size / 8); end select; end loop; end Main_Task; begin loop Ignore := GNAT.OS_Lib.Read (GNAT.OS_Lib.Standin, Data'Address, Data'Size / 8); Main_Task.Data_Received (Data); end loop; end Ada_Synth;
reznikmm/matreshka
Ada
6,500
adb
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Localization, Internationalization, Globalization for Ada -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2010 Vadim Godunko <[email protected]> -- -- -- -- Matreshka is free software; you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 2, or (at your option) any later -- -- version. Matreshka is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -- -- Public License for more details. You should have received a copy of the -- -- GNU General Public License distributed with Matreshka; see file COPYING. -- -- If not, write to the Free Software Foundation, 51 Franklin Street, -- -- Fifth Floor, Boston, MA 02110-1301, USA. -- -- -- -- As a special exception, if other files instantiate generics from this -- -- unit, or you link this unit with other files to produce an executable, -- -- this unit does not by itself cause the resulting executable to be -- -- covered by the GNU General Public License. This exception does not -- -- however invalidate any other reasons why the executable file might be -- -- covered by the GNU Public License. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with Ada.Unchecked_Conversion; package body Matreshka.Internals.SIMD.Intel.SSE2 is function To_Integer_16 is new Ada.Unchecked_Conversion (Interfaces.Unsigned_16, Interfaces.Integer_16); function To_v16qi is new Ada.Unchecked_Conversion (Integer_16_Vector_8, v16qi); function To_v16qi is new Ada.Unchecked_Conversion (Unsigned_16_Vector_8, v16qi); function To_v8hi is new Ada.Unchecked_Conversion (Integer_16_Vector_8, v8hi); function To_v8hi is new Ada.Unchecked_Conversion (Unsigned_16_Vector_8, v8hi); function To_v2di is new Ada.Unchecked_Conversion (Integer_16_Vector_8, v2di); function To_v2di is new Ada.Unchecked_Conversion (Unsigned_16_Vector_8, v2di); function To_Integer_16_Vector_8 is new Ada.Unchecked_Conversion (v8hi, Integer_16_Vector_8); function To_Unsigned_16_Vector_8 is new Ada.Unchecked_Conversion (v8hi, Unsigned_16_Vector_8); function To_Integer_16_Vector_8 is new Ada.Unchecked_Conversion (v2di, Integer_16_Vector_8); function To_Unsigned_16_Vector_8 is new Ada.Unchecked_Conversion (v2di, Unsigned_16_Vector_8); ------------ -- mm_and -- ------------ function mm_and (A : Integer_16_Vector_8; B : Integer_16_Vector_8) return Integer_16_Vector_8 is begin return To_Integer_16_Vector_8 (mm_and_si128 (To_v2di (A), To_v2di (B))); end mm_and; ------------ -- mm_and -- ------------ function mm_and (A : Unsigned_16_Vector_8; B : Unsigned_16_Vector_8) return Unsigned_16_Vector_8 is begin return To_Unsigned_16_Vector_8 (mm_and_si128 (To_v2di (A), To_v2di (B))); end mm_and; -------------- -- mm_cmpeq -- -------------- function mm_cmpeq (A : Integer_16_Vector_8; B : Integer_16_Vector_8) return Integer_16_Vector_8 is begin return To_Integer_16_Vector_8 (mm_cmpeq_epi16 (To_v8hi (A), To_v8hi (B))); end mm_cmpeq; -------------- -- mm_cmpeq -- -------------- function mm_cmpeq (A : Unsigned_16_Vector_8; B : Unsigned_16_Vector_8) return Unsigned_16_Vector_8 is begin return To_Unsigned_16_Vector_8 (mm_cmpeq_epi16 (To_v8hi (A), To_v8hi (B))); end mm_cmpeq; ----------------- -- mm_movemask -- ----------------- function mm_movemask (A : Integer_16_Vector_8) return Interfaces.Unsigned_32 is begin return mm_movemask_epi8 (To_v16qi (A)); end mm_movemask; ----------------- -- mm_movemask -- ----------------- function mm_movemask (A : Unsigned_16_Vector_8) return Interfaces.Unsigned_32 is begin return mm_movemask_epi8 (To_v16qi (A)); end mm_movemask; ---------------------------- -- To_Integer_16_Vector_8 -- ---------------------------- function To_Integer_16_Vector_8 (Q7 : Interfaces.Integer_16; Q6 : Interfaces.Integer_16; Q5 : Interfaces.Integer_16; Q4 : Interfaces.Integer_16; Q3 : Interfaces.Integer_16; Q2 : Interfaces.Integer_16; Q1 : Interfaces.Integer_16; Q0 : Interfaces.Integer_16) return Integer_16_Vector_8 is begin return (Q7, Q6, Q5, Q4, Q3, Q2, Q1, Q0); end To_Integer_16_Vector_8; ----------------------------- -- To_Unsigned_16_Vector_8 -- ----------------------------- function To_Unsigned_16_Vector_8 (Q7 : Interfaces.Unsigned_16; Q6 : Interfaces.Unsigned_16; Q5 : Interfaces.Unsigned_16; Q4 : Interfaces.Unsigned_16; Q3 : Interfaces.Unsigned_16; Q2 : Interfaces.Unsigned_16; Q1 : Interfaces.Unsigned_16; Q0 : Interfaces.Unsigned_16) return Unsigned_16_Vector_8 is begin return (To_Integer_16 (Q7), To_Integer_16 (Q6), To_Integer_16 (Q5), To_Integer_16 (Q4), To_Integer_16 (Q3), To_Integer_16 (Q2), To_Integer_16 (Q1), To_Integer_16 (Q0)); end To_Unsigned_16_Vector_8; end Matreshka.Internals.SIMD.Intel.SSE2;
tum-ei-rcs/StratoX
Ada
1,410
ads
-- Institution: Technische Universitaet Muenchen -- Department: Realtime Computer Systems (RCS) -- Project: StratoX -- Author: Martin Becker ([email protected]) with ULog; with Interfaces; -- @summary -- implements ULOG GPS message package ULog.GPS with SPARK_Mode is type fixtype is (NOFIX, DEADR, FIX2D, FIX3D, FIX3DDEADR, FIXTIME); -- extends base record, specific for GPS. Implicitely tagged (RM 3.9-2). type Message is new ULog.Message with record gps_week : Interfaces.Integer_16 := 0; gps_msec : Interfaces.Unsigned_64 := 0; fix : fixtype := NOFIX; nsat : Interfaces.Unsigned_8 := 0; lat : Interfaces.IEEE_Float_32 := 0.0; lon : Interfaces.IEEE_Float_32 := 0.0; alt : Interfaces.IEEE_Float_32 := 0.0; end record; function Copy (msg : in Message) return Message; -- what happens if we have two class-wide types in the signature? procedure Describe_Func (msg : in Message; namestring : out String); private overriding function Self (msg : in Message) return ULog.Message'Class; overriding procedure Get_Serialization (msg : in Message; bytes : out HIL.Byte_Array); overriding function Get_Size (msg : in Message) return Interfaces.Unsigned_16; overriding procedure Get_Format (msg : in Message; bytes : out HIL.Byte_Array); end ULog.GPS;
zhmu/ananas
Ada
60,819
adb
------------------------------------------------------------------------------ -- -- -- GNAT COMPILER COMPONENTS -- -- -- -- S Y S T E M . R E G E X P -- -- -- -- B o d y -- -- -- -- Copyright (C) 1999-2022, AdaCore -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; with System.Case_Util; package body System.Regexp is Initial_Max_States_In_Primary_Table : constant := 100; -- Initial size for the number of states in the indefinite state -- machine. The number of states will be increased as needed. -- -- This is also used as the maximal number of meta states (groups of -- states) in the secondary table. Open_Paren : constant Character := '('; Close_Paren : constant Character := ')'; Open_Bracket : constant Character := '['; Close_Bracket : constant Character := ']'; type State_Index is new Natural; type Column_Index is new Natural; type Regexp_Array is array (State_Index range <>, Column_Index range <>) of State_Index; -- First index is for the state number. Second index is for the character -- type. Contents is the new State. type Regexp_Array_Access is access Regexp_Array; -- Use this type through the functions Set below, so that it can grow -- dynamically depending on the needs. type Mapping is array (Character'Range) of Column_Index; -- Mapping between characters and column in the Regexp_Array type Boolean_Array is array (State_Index range <>) of Boolean; type Regexp_Value (Alphabet_Size : Column_Index; Num_States : State_Index) is record Map : Mapping; Case_Sensitive : Boolean; States : Regexp_Array (1 .. Num_States, 0 .. Alphabet_Size); Is_Final : Boolean_Array (1 .. Num_States); end record; -- Deterministic finite-state machine ----------------------- -- Local Subprograms -- ----------------------- procedure Set (Table : in out Regexp_Array_Access; State : State_Index; Column : Column_Index; Value : State_Index); -- Sets a value in the table. If the table is too small, reallocate it -- dynamically so that (State, Column) is a valid index in it. function Get (Table : Regexp_Array_Access; State : State_Index; Column : Column_Index) return State_Index; -- Returns the value in the table at (State, Column). If this index does -- not exist in the table, returns zero. procedure Free is new Ada.Unchecked_Deallocation (Regexp_Array, Regexp_Array_Access); ------------ -- Adjust -- ------------ procedure Adjust (R : in out Regexp) is Tmp : Regexp_Access; begin if R.R /= null then Tmp := new Regexp_Value (Alphabet_Size => R.R.Alphabet_Size, Num_States => R.R.Num_States); Tmp.all := R.R.all; R.R := Tmp; end if; end Adjust; ------------- -- Compile -- ------------- function Compile (Pattern : String; Glob : Boolean := False; Case_Sensitive : Boolean := True) return Regexp is S : String := Pattern; -- The pattern which is really compiled (when the pattern is case -- insensitive, we convert this string to lower-cases). Map : Mapping := [others => 0]; -- Mapping between characters and columns in the tables Alphabet_Size : Column_Index := 0; -- Number of significant characters in the regular expression. -- This total does not include special operators, such as *, (, ... procedure Check_Well_Formed_Pattern; -- Check that the pattern to compile is well-formed, so that subsequent -- code can rely on this without performing each time the checks to -- avoid accessing the pattern outside its bounds. However, not all -- well-formedness rules are checked. In particular, rules about special -- characters not being treated as regular characters are not checked. procedure Create_Mapping; -- Creates a mapping between characters in the regexp and columns -- in the tables representing the regexp. Test that the regexp is -- well-formed Modifies Alphabet_Size and Map procedure Create_Primary_Table (Table : out Regexp_Array_Access; Num_States : out State_Index; Start_State : out State_Index; End_State : out State_Index); -- Creates the first version of the regexp (this is a non deterministic -- finite state machine, which is unadapted for a fast pattern -- matching algorithm). We use a recursive algorithm to process the -- parenthesis sub-expressions. -- -- Table : at the end of the procedure : Column 0 is for any character -- ('.') and the last columns are for no character (closure). Num_States -- is set to the number of states in the table Start_State is the number -- of the starting state in the regexp End_State is the number of the -- final state when the regexp matches. procedure Create_Primary_Table_Glob (Table : out Regexp_Array_Access; Num_States : out State_Index; Start_State : out State_Index; End_State : out State_Index); -- Same function as above, but it deals with the second possible -- grammar for 'globbing pattern', which is a kind of subset of the -- whole regular expression grammar. function Create_Secondary_Table (First_Table : Regexp_Array_Access; Start_State : State_Index; End_State : State_Index) return Regexp; -- Creates the definitive table representing the regular expression -- This is actually a transformation of the primary table First_Table, -- where every state is grouped with the states in its 'no-character' -- columns. The transitions between the new states are then recalculated -- and if necessary some new states are created. -- -- Note that the resulting finite-state machine is not optimized in -- terms of the number of states : it would be more time-consuming to -- add a third pass to reduce the number of states in the machine, with -- no speed improvement... procedure Raise_Exception (M : String; Index : Integer); pragma No_Return (Raise_Exception); -- Raise an exception, indicating an error at character Index in S ------------------------------- -- Check_Well_Formed_Pattern -- ------------------------------- procedure Check_Well_Formed_Pattern is J : Integer; Past_Elmt : Boolean := False; -- Set to True everywhere an elmt has been parsed, if Glob=False, -- meaning there can be now an occurrence of '*', '+' and '?'. Past_Term : Boolean := False; -- Set to True everywhere a term has been parsed, if Glob=False, -- meaning there can be now an occurrence of '|'. Parenthesis_Level : Integer := 0; Curly_Level : Integer := 0; Last_Open : Integer := S'First - 1; -- The last occurrence of an opening parenthesis, if Glob=False, -- or the last occurrence of an opening curly brace, if Glob=True. procedure Find_Close_Bracket; -- Go through the pattern to find a closing bracket. Raise an -- exception if none is found. procedure Raise_Exception_If_No_More_Chars (K : Integer := 0); -- If J + K > S'Last then call Raise_Exception ------------------------ -- Find_Close_Bracket -- ------------------------ procedure Find_Close_Bracket is Possible_Range_Start : Boolean := True; -- Set True everywhere a range character '-' can occur begin loop exit when S (J) = Close_Bracket; Raise_Exception_If_No_More_Chars (1); -- The current character is not a close_bracket, thus it should -- be followed by at least one more char. If not, no close -- bracket is present and the pattern is ill-formed. if S (J) = '-' and then S (J + 1) /= Close_Bracket then if not Possible_Range_Start then Raise_Exception ("No mix of ranges is allowed in " & "regular expression", J); end if; J := J + 1; Raise_Exception_If_No_More_Chars (1); Possible_Range_Start := False; -- Range cannot be followed by '-' character, -- except as last character in the set. else Possible_Range_Start := True; end if; if S (J) = '\' then J := J + 1; Raise_Exception_If_No_More_Chars (1); -- We ignore the next character and need to check we have -- one more available character. This is necessary for -- the erroneous [\] pattern which stands for [\]] or [\\]. end if; J := J + 1; end loop; end Find_Close_Bracket; -------------------------------------- -- Raise_Exception_If_No_More_Chars -- -------------------------------------- procedure Raise_Exception_If_No_More_Chars (K : Integer := 0) is begin if J + K > S'Last then Raise_Exception ("Ill-formed pattern while parsing", J); end if; end Raise_Exception_If_No_More_Chars; -- Start of processing for Check_Well_Formed_Pattern begin J := S'First; while J <= S'Last loop case S (J) is when Open_Bracket => J := J + 1; Raise_Exception_If_No_More_Chars; if not Glob then if S (J) = '^' then J := J + 1; Raise_Exception_If_No_More_Chars; end if; end if; -- Characters ']' and '-' are meant as literals when first -- in the list. As such, they have no special meaning and -- we pass them. if S (J) = ']' or else S (J) = '-' then J := J + 1; Raise_Exception_If_No_More_Chars; end if; if S (J) = ']' then -- ??? This message is misleading since the check forbids -- the sets []] and [-] but not the empty set []. Raise_Exception ("Set of characters cannot be empty in regular " & "expression", J); end if; Find_Close_Bracket; -- A closing bracket can end an elmt or term Past_Elmt := True; Past_Term := True; when Close_Bracket => -- A close bracket must follow a open_bracket, and cannot be -- found alone on the line. Raise_Exception ("Incorrect character ']' in regular expression", J); when '\' => if J < S'Last then J := J + 1; -- Any character can be an elmt or a term Past_Elmt := True; Past_Term := True; else -- \ not allowed at the end of the regexp Raise_Exception ("Incorrect character '\' in regular expression", J); end if; when Open_Paren => if not Glob then Parenthesis_Level := Parenthesis_Level + 1; Last_Open := J; -- An open parenthesis does not end an elmt or term Past_Elmt := False; Past_Term := False; end if; when Close_Paren => if not Glob then Parenthesis_Level := Parenthesis_Level - 1; if Parenthesis_Level < 0 then Raise_Exception ("')' is not associated with '(' in regular " & "expression", J); end if; if J = Last_Open + 1 then Raise_Exception ("Empty parentheses not allowed in regular " & "expression", J); end if; if not Past_Term then Raise_Exception ("Closing parenthesis not allowed here in regular " & "expression", J); end if; -- A closing parenthesis can end an elmt or term Past_Elmt := True; Past_Term := True; end if; when '{' => if Glob then Curly_Level := Curly_Level + 1; Last_Open := J; else -- Any character can be an elmt or a term Past_Elmt := True; Past_Term := True; end if; -- No need to check for ',' as the code always accepts them when '}' => if Glob then Curly_Level := Curly_Level - 1; if Curly_Level < 0 then Raise_Exception ("'}' is not associated with '{' in regular " & "expression", J); end if; if J = Last_Open + 1 then Raise_Exception ("Empty curly braces not allowed in regular " & "expression", J); end if; else -- Any character can be an elmt or a term Past_Elmt := True; Past_Term := True; end if; when '*' | '?' | '+' => if not Glob then -- These operators must apply to an elmt sub-expression, -- and cannot be found if one has not just been parsed. if not Past_Elmt then Raise_Exception ("'*', '+' and '?' operators must be " & "applied to an element in regular expression", J); end if; Past_Elmt := False; Past_Term := True; end if; when '|' => if not Glob then -- This operator must apply to a term sub-expression, -- and cannot be found if one has not just been parsed. if not Past_Term then Raise_Exception ("'|' operator must be " & "applied to a term in regular expression", J); end if; -- A second term must follow Raise_Exception_If_No_More_Chars (K => 1); Past_Elmt := False; Past_Term := False; end if; when others => if not Glob then -- Any character can be an elmt or a term Past_Elmt := True; Past_Term := True; end if; end case; J := J + 1; end loop; -- A closing parenthesis must follow an open parenthesis if Parenthesis_Level /= 0 then Raise_Exception ("'(' must always be associated with a ')'", J); end if; -- A closing curly brace must follow an open curly brace if Curly_Level /= 0 then Raise_Exception ("'{' must always be associated with a '}'", J); end if; end Check_Well_Formed_Pattern; -------------------- -- Create_Mapping -- -------------------- procedure Create_Mapping is procedure Add_In_Map (C : Character); -- Add a character in the mapping, if it is not already defined ---------------- -- Add_In_Map -- ---------------- procedure Add_In_Map (C : Character) is begin if Map (C) = 0 then Alphabet_Size := Alphabet_Size + 1; Map (C) := Alphabet_Size; end if; end Add_In_Map; J : Integer := S'First; Parenthesis_Level : Integer := 0; Curly_Level : Integer := 0; Last_Open : Integer := S'First - 1; -- Start of processing for Create_Mapping begin while J <= S'Last loop case S (J) is when Open_Bracket => J := J + 1; if S (J) = '^' then J := J + 1; end if; if S (J) = ']' or else S (J) = '-' then J := J + 1; end if; -- The first character never has a special meaning loop if J > S'Last then Raise_Exception ("Ran out of characters while parsing ", J); end if; exit when S (J) = Close_Bracket; if S (J) = '-' and then S (J + 1) /= Close_Bracket then declare Start : constant Integer := J - 1; begin J := J + 1; if S (J) = '\' then J := J + 1; end if; for Char in S (Start) .. S (J) loop Add_In_Map (Char); end loop; end; else if S (J) = '\' then J := J + 1; end if; Add_In_Map (S (J)); end if; J := J + 1; end loop; -- A close bracket must follow a open_bracket and cannot be -- found alone on the line when Close_Bracket => Raise_Exception ("Incorrect character ']' in regular expression", J); when '\' => if J < S'Last then J := J + 1; Add_In_Map (S (J)); else -- Back slash \ not allowed at the end of the regexp Raise_Exception ("Incorrect character '\' in regular expression", J); end if; when Open_Paren => if not Glob then Parenthesis_Level := Parenthesis_Level + 1; Last_Open := J; else Add_In_Map (Open_Paren); end if; when Close_Paren => if not Glob then Parenthesis_Level := Parenthesis_Level - 1; if Parenthesis_Level < 0 then Raise_Exception ("')' is not associated with '(' in regular " & "expression", J); end if; if J = Last_Open + 1 then Raise_Exception ("Empty parenthesis not allowed in regular " & "expression", J); end if; else Add_In_Map (Close_Paren); end if; when '.' => if Glob then Add_In_Map ('.'); end if; when '{' => if not Glob then Add_In_Map (S (J)); else Curly_Level := Curly_Level + 1; end if; when '}' => if not Glob then Add_In_Map (S (J)); else Curly_Level := Curly_Level - 1; end if; when '*' | '?' => if not Glob then if J = S'First then Raise_Exception ("'*', '+', '?' and '|' operators cannot be in " & "first position in regular expression", J); end if; end if; when '|' | '+' => if not Glob then if J = S'First then -- These operators must apply to a sub-expression, -- and cannot be found at the beginning of the line Raise_Exception ("'*', '+', '?' and '|' operators cannot be in " & "first position in regular expression", J); end if; else Add_In_Map (S (J)); end if; when others => Add_In_Map (S (J)); end case; J := J + 1; end loop; -- A closing parenthesis must follow an open parenthesis if Parenthesis_Level /= 0 then Raise_Exception ("'(' must always be associated with a ')'", J); end if; if Curly_Level /= 0 then Raise_Exception ("'{' must always be associated with a '}'", J); end if; end Create_Mapping; -------------------------- -- Create_Primary_Table -- -------------------------- procedure Create_Primary_Table (Table : out Regexp_Array_Access; Num_States : out State_Index; Start_State : out State_Index; End_State : out State_Index) is Empty_Char : constant Column_Index := Alphabet_Size + 1; Current_State : State_Index := 0; -- Index of the last created state procedure Add_Empty_Char (State : State_Index; To_State : State_Index); -- Add a empty-character transition from State to To_State procedure Create_Repetition (Repetition : Character; Start_Prev : State_Index; End_Prev : State_Index; New_Start : out State_Index; New_End : in out State_Index); -- Create the table in case we have a '*', '+' or '?'. -- Start_Prev .. End_Prev should indicate respectively the start and -- end index of the previous expression, to which '*', '+' or '?' is -- applied. procedure Create_Simple (Start_Index : Integer; End_Index : Integer; Start_State : out State_Index; End_State : out State_Index); -- Fill the table for the regexp Simple. This is the recursive -- procedure called to handle () expressions If End_State = 0, then -- the call to Create_Simple creates an independent regexp, not a -- concatenation Start_Index .. End_Index is the starting index in -- the string S. -- -- Warning: it may look like we are creating too many empty-string -- transitions, but they are needed to get the correct regexp. -- The table is filled as follow ( s means start-state, e means -- end-state) : -- -- regexp state_num | a b * empty_string -- ------- ------------------------------ -- a 1 (s) | 2 - - - -- 2 (e) | - - - - -- -- ab 1 (s) | 2 - - - -- 2 | - - - 3 -- 3 | - 4 - - -- 4 (e) | - - - - -- -- a|b 1 | 2 - - - -- 2 | - - - 6 -- 3 | - 4 - - -- 4 | - - - 6 -- 5 (s) | - - - 1,3 -- 6 (e) | - - - - -- -- a* 1 | 2 - - - -- 2 | - - - 4 -- 3 (s) | - - - 1,4 -- 4 (e) | - - - 3 -- -- (a) 1 (s) | 2 - - - -- 2 (e) | - - - - -- -- a+ 1 | 2 - - - -- 2 | - - - 4 -- 3 (s) | - - - 1 -- 4 (e) | - - - 3 -- -- a? 1 | 2 - - - -- 2 | - - - 4 -- 3 (s) | - - - 1,4 -- 4 (e) | - - - - -- -- . 1 (s) | 2 2 2 - -- 2 (e) | - - - - function Next_Sub_Expression (Start_Index : Integer; End_Index : Integer) return Integer; -- Returns the index of the last character of the next sub-expression -- in Simple. Index cannot be greater than End_Index. -------------------- -- Add_Empty_Char -- -------------------- procedure Add_Empty_Char (State : State_Index; To_State : State_Index) is J : Column_Index := Empty_Char; begin while Get (Table, State, J) /= 0 loop J := J + 1; end loop; Set (Table, State, J, To_State); end Add_Empty_Char; ----------------------- -- Create_Repetition -- ----------------------- procedure Create_Repetition (Repetition : Character; Start_Prev : State_Index; End_Prev : State_Index; New_Start : out State_Index; New_End : in out State_Index) is begin New_Start := Current_State + 1; if New_End /= 0 then Add_Empty_Char (New_End, New_Start); end if; Current_State := Current_State + 2; New_End := Current_State; Add_Empty_Char (End_Prev, New_End); Add_Empty_Char (New_Start, Start_Prev); if Repetition /= '+' then Add_Empty_Char (New_Start, New_End); end if; if Repetition /= '?' then Add_Empty_Char (New_End, New_Start); end if; end Create_Repetition; ------------------- -- Create_Simple -- ------------------- procedure Create_Simple (Start_Index : Integer; End_Index : Integer; Start_State : out State_Index; End_State : out State_Index) is J : Integer := Start_Index; Last_Start : State_Index := 0; begin Start_State := 0; End_State := 0; while J <= End_Index loop case S (J) is when Open_Paren => declare J_Start : constant Integer := J + 1; Next_Start : State_Index; Next_End : State_Index; begin J := Next_Sub_Expression (J, End_Index); Create_Simple (J_Start, J - 1, Next_Start, Next_End); if J < End_Index and then (S (J + 1) = '*' or else S (J + 1) = '+' or else S (J + 1) = '?') then J := J + 1; Create_Repetition (S (J), Next_Start, Next_End, Last_Start, End_State); else Last_Start := Next_Start; if End_State /= 0 then Add_Empty_Char (End_State, Last_Start); end if; End_State := Next_End; end if; end; when '|' => declare Start_Prev : constant State_Index := Start_State; End_Prev : constant State_Index := End_State; Start_J : constant Integer := J + 1; Start_Next : State_Index := 0; End_Next : State_Index := 0; begin J := Next_Sub_Expression (J, End_Index); -- Create a new state for the start of the alternative Current_State := Current_State + 1; Last_Start := Current_State; Start_State := Last_Start; -- Create the tree for the second part of alternative Create_Simple (Start_J, J, Start_Next, End_Next); -- Create the end state Add_Empty_Char (Last_Start, Start_Next); Add_Empty_Char (Last_Start, Start_Prev); Current_State := Current_State + 1; End_State := Current_State; Add_Empty_Char (End_Prev, End_State); Add_Empty_Char (End_Next, End_State); end; when Open_Bracket => Current_State := Current_State + 1; declare Next_State : State_Index := Current_State + 1; begin J := J + 1; if S (J) = '^' then J := J + 1; Next_State := 0; for Column in 0 .. Alphabet_Size loop Set (Table, Current_State, Column, Value => Current_State + 1); end loop; end if; -- Automatically add the first character if S (J) = '-' or else S (J) = ']' then Set (Table, Current_State, Map (S (J)), Value => Next_State); J := J + 1; end if; -- Loop till closing bracket found loop exit when S (J) = Close_Bracket; if S (J) = '-' and then S (J + 1) /= ']' then declare Start : constant Integer := J - 1; begin J := J + 1; if S (J) = '\' then J := J + 1; end if; for Char in S (Start) .. S (J) loop Set (Table, Current_State, Map (Char), Value => Next_State); end loop; end; else if S (J) = '\' then J := J + 1; end if; Set (Table, Current_State, Map (S (J)), Value => Next_State); end if; J := J + 1; end loop; end; Current_State := Current_State + 1; -- If the next symbol is a special symbol if J < End_Index and then (S (J + 1) = '*' or else S (J + 1) = '+' or else S (J + 1) = '?') then J := J + 1; Create_Repetition (S (J), Current_State - 1, Current_State, Last_Start, End_State); else Last_Start := Current_State - 1; if End_State /= 0 then Add_Empty_Char (End_State, Last_Start); end if; End_State := Current_State; end if; when Close_Bracket | Close_Paren | '*' | '+' | '?' => Raise_Exception ("Incorrect character in regular expression :", J); when others => Current_State := Current_State + 1; -- Create the state for the symbol S (J) if S (J) = '.' then for K in 0 .. Alphabet_Size loop Set (Table, Current_State, K, Value => Current_State + 1); end loop; else if S (J) = '\' then J := J + 1; end if; Set (Table, Current_State, Map (S (J)), Value => Current_State + 1); end if; Current_State := Current_State + 1; -- If the next symbol is a special symbol if J < End_Index and then (S (J + 1) = '*' or else S (J + 1) = '+' or else S (J + 1) = '?') then J := J + 1; Create_Repetition (S (J), Current_State - 1, Current_State, Last_Start, End_State); else Last_Start := Current_State - 1; if End_State /= 0 then Add_Empty_Char (End_State, Last_Start); end if; End_State := Current_State; end if; end case; if Start_State = 0 then Start_State := Last_Start; end if; J := J + 1; end loop; end Create_Simple; ------------------------- -- Next_Sub_Expression -- ------------------------- function Next_Sub_Expression (Start_Index : Integer; End_Index : Integer) return Integer is J : Integer := Start_Index; Start_On_Alter : Boolean := False; begin if S (J) = '|' then Start_On_Alter := True; end if; loop exit when J = End_Index; J := J + 1; case S (J) is when '\' => J := J + 1; when Open_Bracket => loop J := J + 1; exit when S (J) = Close_Bracket; if S (J) = '\' then J := J + 1; end if; end loop; when Open_Paren => J := Next_Sub_Expression (J, End_Index); when Close_Paren => return J; when '|' => if Start_On_Alter then return J - 1; end if; when others => null; end case; end loop; return J; end Next_Sub_Expression; -- Start of processing for Create_Primary_Table begin Table.all := [others => [others => 0]]; Create_Simple (S'First, S'Last, Start_State, End_State); Num_States := Current_State; end Create_Primary_Table; ------------------------------- -- Create_Primary_Table_Glob -- ------------------------------- procedure Create_Primary_Table_Glob (Table : out Regexp_Array_Access; Num_States : out State_Index; Start_State : out State_Index; End_State : out State_Index) is Empty_Char : constant Column_Index := Alphabet_Size + 1; Current_State : State_Index := 0; -- Index of the last created state procedure Add_Empty_Char (State : State_Index; To_State : State_Index); -- Add a empty-character transition from State to To_State procedure Create_Simple (Start_Index : Integer; End_Index : Integer; Start_State : out State_Index; End_State : out State_Index); -- Fill the table for the S (Start_Index .. End_Index). -- This is the recursive procedure called to handle () expressions -------------------- -- Add_Empty_Char -- -------------------- procedure Add_Empty_Char (State : State_Index; To_State : State_Index) is J : Column_Index; begin J := Empty_Char; while Get (Table, State, J) /= 0 loop J := J + 1; end loop; Set (Table, State, J, Value => To_State); end Add_Empty_Char; ------------------- -- Create_Simple -- ------------------- procedure Create_Simple (Start_Index : Integer; End_Index : Integer; Start_State : out State_Index; End_State : out State_Index) is J : Integer; Last_Start : State_Index := 0; begin Start_State := 0; End_State := 0; J := Start_Index; while J <= End_Index loop case S (J) is when Open_Bracket => Current_State := Current_State + 1; declare Next_State : State_Index := Current_State + 1; begin J := J + 1; if S (J) = '^' then J := J + 1; Next_State := 0; for Column in 0 .. Alphabet_Size loop Set (Table, Current_State, Column, Value => Current_State + 1); end loop; end if; -- Automatically add the first character if S (J) = '-' or else S (J) = ']' then Set (Table, Current_State, Map (S (J)), Value => Current_State); J := J + 1; end if; -- Loop till closing bracket found loop exit when S (J) = Close_Bracket; if S (J) = '-' and then S (J + 1) /= ']' then declare Start : constant Integer := J - 1; begin J := J + 1; if S (J) = '\' then J := J + 1; end if; for Char in S (Start) .. S (J) loop Set (Table, Current_State, Map (Char), Value => Next_State); end loop; end; else if S (J) = '\' then J := J + 1; end if; Set (Table, Current_State, Map (S (J)), Value => Next_State); end if; J := J + 1; end loop; end; Last_Start := Current_State; Current_State := Current_State + 1; if End_State /= 0 then Add_Empty_Char (End_State, Last_Start); end if; End_State := Current_State; when '{' => declare End_Sub : Integer; Start_Regexp_Sub : State_Index; End_Regexp_Sub : State_Index; Create_Start : State_Index := 0; Create_End : State_Index := 0; -- Initialized to avoid junk warning begin while S (J) /= '}' loop -- First step : find sub pattern End_Sub := J + 1; while S (End_Sub) /= ',' and then S (End_Sub) /= '}' loop End_Sub := End_Sub + 1; end loop; -- Second step : create a sub pattern Create_Simple (J + 1, End_Sub - 1, Start_Regexp_Sub, End_Regexp_Sub); J := End_Sub; -- Third step : create an alternative if Create_Start = 0 then Current_State := Current_State + 1; Create_Start := Current_State; Add_Empty_Char (Create_Start, Start_Regexp_Sub); Current_State := Current_State + 1; Create_End := Current_State; Add_Empty_Char (End_Regexp_Sub, Create_End); else Current_State := Current_State + 1; Add_Empty_Char (Current_State, Create_Start); Create_Start := Current_State; Add_Empty_Char (Create_Start, Start_Regexp_Sub); Add_Empty_Char (End_Regexp_Sub, Create_End); end if; end loop; if End_State /= 0 then Add_Empty_Char (End_State, Create_Start); end if; End_State := Create_End; Last_Start := Create_Start; end; when '*' => Current_State := Current_State + 1; if End_State /= 0 then Add_Empty_Char (End_State, Current_State); end if; Add_Empty_Char (Current_State, Current_State + 1); Add_Empty_Char (Current_State, Current_State + 3); Last_Start := Current_State; Current_State := Current_State + 1; for K in 0 .. Alphabet_Size loop Set (Table, Current_State, K, Value => Current_State + 1); end loop; Current_State := Current_State + 1; Add_Empty_Char (Current_State, Current_State + 1); Current_State := Current_State + 1; Add_Empty_Char (Current_State, Last_Start); End_State := Current_State; when others => Current_State := Current_State + 1; if S (J) = '?' then for K in 0 .. Alphabet_Size loop Set (Table, Current_State, K, Value => Current_State + 1); end loop; else if S (J) = '\' then J := J + 1; end if; -- Create the state for the symbol S (J) Set (Table, Current_State, Map (S (J)), Value => Current_State + 1); end if; Last_Start := Current_State; Current_State := Current_State + 1; if End_State /= 0 then Add_Empty_Char (End_State, Last_Start); end if; End_State := Current_State; end case; if Start_State = 0 then Start_State := Last_Start; end if; J := J + 1; end loop; end Create_Simple; -- Start of processing for Create_Primary_Table_Glob begin Table.all := [others => [others => 0]]; Create_Simple (S'First, S'Last, Start_State, End_State); Num_States := Current_State; end Create_Primary_Table_Glob; ---------------------------- -- Create_Secondary_Table -- ---------------------------- function Create_Secondary_Table (First_Table : Regexp_Array_Access; Start_State : State_Index; End_State : State_Index) return Regexp is Last_Index : constant State_Index := First_Table'Last (1); type Meta_State is array (0 .. Last_Index) of Boolean; pragma Pack (Meta_State); -- Whether a state from first_table belongs to a metastate. No_States : constant Meta_State := [others => False]; type Meta_States_Array is array (State_Index range <>) of Meta_State; type Meta_States_List is access all Meta_States_Array; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Meta_States_Array, Meta_States_List); Meta_States : Meta_States_List; -- Components of meta-states. A given state might belong to -- several meta-states. -- This array grows dynamically. type Char_To_State is array (0 .. Alphabet_Size) of State_Index; type Meta_States_Transition_Arr is array (State_Index range <>) of Char_To_State; type Meta_States_Transition is access all Meta_States_Transition_Arr; procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Meta_States_Transition_Arr, Meta_States_Transition); Table : Meta_States_Transition; -- Documents the transitions between each meta-state. The -- first index is the meta-state, the second column is the -- character seen in the input, the value is the new meta-state. Temp_State_Not_Null : Boolean; Current_State : State_Index := 1; -- The current meta-state we are creating Nb_State : State_Index := 1; -- The total number of meta-states created so far. procedure Closure (Meta_State : State_Index; State : State_Index); -- Compute the closure of the state (that is every other state which -- has a empty-character transition) and add it to the state procedure Ensure_Meta_State (Meta : State_Index); -- grows the Meta_States array as needed to make sure that there -- is enough space to store the new meta state. ----------------------- -- Ensure_Meta_State -- ----------------------- procedure Ensure_Meta_State (Meta : State_Index) is Tmp : Meta_States_List := Meta_States; Tmp2 : Meta_States_Transition := Table; begin if Meta_States = null then Meta_States := new Meta_States_Array (1 .. State_Index'Max (Last_Index, Meta) + 1); Meta_States (Meta_States'Range) := [others => No_States]; Table := new Meta_States_Transition_Arr (1 .. State_Index'Max (Last_Index, Meta) + 1); Table.all := [others => [others => 0]]; elsif Meta > Meta_States'Last then Meta_States := new Meta_States_Array (1 .. State_Index'Max (2 * Tmp'Last, Meta)); Meta_States (Tmp'Range) := Tmp.all; Meta_States (Tmp'Last + 1 .. Meta_States'Last) := [others => No_States]; Unchecked_Free (Tmp); Table := new Meta_States_Transition_Arr (1 .. State_Index'Max (2 * Tmp2'Last, Meta) + 1); Table (Tmp2'Range) := Tmp2.all; Table (Tmp2'Last + 1 .. Table'Last) := [others => [others => 0]]; Unchecked_Free (Tmp2); end if; end Ensure_Meta_State; ------------- -- Closure -- ------------- procedure Closure (Meta_State : State_Index; State : State_Index) is begin if not Meta_States (Meta_State)(State) then Meta_States (Meta_State)(State) := True; -- For each transition on empty-character for Column in Alphabet_Size + 1 .. First_Table'Last (2) loop exit when First_Table (State, Column) = 0; Closure (Meta_State, First_Table (State, Column)); end loop; end if; end Closure; -- Start of processing for Create_Secondary_Table begin -- Create a new state Ensure_Meta_State (Current_State); Closure (Current_State, Start_State); while Current_State <= Nb_State loop -- We will be trying, below, to create the next meta-state Ensure_Meta_State (Nb_State + 1); -- For every character in the regexp, calculate the possible -- transitions from Current_State. for Column in 0 .. Alphabet_Size loop Temp_State_Not_Null := False; for K in Meta_States (Current_State)'Range loop if Meta_States (Current_State)(K) and then First_Table (K, Column) /= 0 then Closure (Nb_State + 1, First_Table (K, Column)); Temp_State_Not_Null := True; end if; end loop; -- If at least one transition existed if Temp_State_Not_Null then -- Check if this new state corresponds to an old one for K in 1 .. Nb_State loop if Meta_States (K) = Meta_States (Nb_State + 1) then Table (Current_State)(Column) := K; -- Reset data, for the next time we try that state Meta_States (Nb_State + 1) := No_States; exit; end if; end loop; -- If not, create a new state if Table (Current_State)(Column) = 0 then Nb_State := Nb_State + 1; Ensure_Meta_State (Nb_State + 1); Table (Current_State)(Column) := Nb_State; end if; end if; end loop; Current_State := Current_State + 1; end loop; -- Returns the regexp declare R : Regexp_Access; begin R := new Regexp_Value (Alphabet_Size => Alphabet_Size, Num_States => Nb_State); R.Map := Map; R.Case_Sensitive := Case_Sensitive; for S in 1 .. Nb_State loop R.Is_Final (S) := Meta_States (S)(End_State); end loop; for State in 1 .. Nb_State loop for K in 0 .. Alphabet_Size loop R.States (State, K) := Table (State)(K); end loop; end loop; Unchecked_Free (Meta_States); Unchecked_Free (Table); return (Ada.Finalization.Controlled with R => R); end; end Create_Secondary_Table; --------------------- -- Raise_Exception -- --------------------- procedure Raise_Exception (M : String; Index : Integer) is begin raise Error_In_Regexp with M & " at offset" & Index'Img; end Raise_Exception; -- Start of processing for Compile begin -- Special case for the empty string: it always matches, and the -- following processing would fail on it. if S = "" then return (Ada.Finalization.Controlled with R => new Regexp_Value' (Alphabet_Size => 0, Num_States => 1, Map => [others => 0], States => [others => [others => 1]], Is_Final => [others => True], Case_Sensitive => True)); end if; if not Case_Sensitive then System.Case_Util.To_Lower (S); end if; -- Check the pattern is well-formed before any treatment Check_Well_Formed_Pattern; Create_Mapping; -- Creates the primary table declare Table : Regexp_Array_Access; Num_States : State_Index; Start_State : State_Index; End_State : State_Index; R : Regexp; begin Table := new Regexp_Array (1 .. Initial_Max_States_In_Primary_Table, 0 .. Alphabet_Size + 10); if not Glob then Create_Primary_Table (Table, Num_States, Start_State, End_State); else Create_Primary_Table_Glob (Table, Num_States, Start_State, End_State); end if; -- Creates the secondary table R := Create_Secondary_Table (Table, Start_State, End_State); Free (Table); return R; end; end Compile; -------------- -- Finalize -- -------------- procedure Finalize (R : in out Regexp) is procedure Free is new Ada.Unchecked_Deallocation (Regexp_Value, Regexp_Access); begin Free (R.R); end Finalize; --------- -- Get -- --------- function Get (Table : Regexp_Array_Access; State : State_Index; Column : Column_Index) return State_Index is begin if State <= Table'Last (1) and then Column <= Table'Last (2) then return Table (State, Column); else return 0; end if; end Get; ----------- -- Match -- ----------- function Match (S : String; R : Regexp) return Boolean is Current_State : State_Index := 1; begin if R.R = null then raise Constraint_Error; end if; for Char in S'Range loop if R.R.Case_Sensitive then Current_State := R.R.States (Current_State, R.R.Map (S (Char))); else Current_State := R.R.States (Current_State, R.R.Map (System.Case_Util.To_Lower (S (Char)))); end if; if Current_State = 0 then return False; end if; end loop; return R.R.Is_Final (Current_State); end Match; --------- -- Set -- --------- procedure Set (Table : in out Regexp_Array_Access; State : State_Index; Column : Column_Index; Value : State_Index) is New_Lines : State_Index; New_Columns : Column_Index; New_Table : Regexp_Array_Access; begin if State <= Table'Last (1) and then Column <= Table'Last (2) then Table (State, Column) := Value; else -- Doubles the size of the table until it is big enough that -- (State, Column) is a valid index. New_Lines := Table'Last (1) * (State / Table'Last (1) + 1); New_Columns := Table'Last (2) * (Column / Table'Last (2) + 1); New_Table := new Regexp_Array (Table'First (1) .. New_Lines, Table'First (2) .. New_Columns); New_Table.all := [others => [others => 0]]; for J in Table'Range (1) loop for K in Table'Range (2) loop New_Table (J, K) := Table (J, K); end loop; end loop; Free (Table); Table := New_Table; Table (State, Column) := Value; end if; end Set; end System.Regexp;
onox/orka
Ada
1,630
ads
-- 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. private package Orka.Terminals is pragma Preelaborate; type Style is (Default, Bold, Dark, Italic, Underline, Blink, Reversed, Cross_Out); type Color is (Default, Grey, Red, Green, Yellow, Blue, Magenta, Cyan, White); function Colorize (Text : String; Foreground, Background : Color := Default; Attribute : Style := Default) return String; -- Colorize the given text with a foreground color, background color, -- and/or style using ANSI escape sequences procedure Set_Time_Zero (Time : Duration); function Time_Image return String; function Image (Value : Duration) return String with Pre => Value in -1000.0 .. 1000.0 or else raise Constraint_Error with Value'Image & " not within +/- 1000.0"; -- Return the image of the given duration with an appropriate suffix function Trim (Value : String) return String; function Strip_Line_Term (Value : String) return String; end Orka.Terminals;
ekoeppen/STM32_Generic_Ada_Drivers
Ada
12,904
ads
-- This spec has been automatically generated from STM32L0x1.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with System; package STM32_SVD.EXTI is pragma Preelaborate; --------------- -- Registers -- --------------- -- IMR_IM array type IMR_IM_Field_Array is array (0 .. 26) of STM32_SVD.Bit with Component_Size => 1, Size => 27; -- Type definition for IMR_IM type IMR_IM_Field (As_Array : Boolean := False) is record case As_Array is when False => -- IM as a value Val : STM32_SVD.UInt27; when True => -- IM as an array Arr : IMR_IM_Field_Array; end case; end record with Unchecked_Union, Size => 27; for IMR_IM_Field use record Val at 0 range 0 .. 26; Arr at 0 range 0 .. 26; end record; -- IMR_IM array type IMR_IM_Field_Array_1 is array (28 .. 29) of STM32_SVD.Bit with Component_Size => 1, Size => 2; -- Type definition for IMR_IM type IMR_IM_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- IM as a value Val : STM32_SVD.UInt2; when True => -- IM as an array Arr : IMR_IM_Field_Array_1; end case; end record with Unchecked_Union, Size => 2; for IMR_IM_Field_1 use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Interrupt mask register (EXTI_IMR) type IMR_Register is record -- Interrupt Mask on line 0 IM : IMR_IM_Field; -- unspecified Reserved_27_27 : STM32_SVD.Bit; -- Interrupt Mask on line 27 IM_1 : IMR_IM_Field_1; -- unspecified Reserved_30_31 : STM32_SVD.UInt2; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for IMR_Register use record IM at 0 range 0 .. 26; Reserved_27_27 at 0 range 27 .. 27; IM_1 at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- EMR_EM array type EMR_EM_Field_Array is array (0 .. 26) of STM32_SVD.Bit with Component_Size => 1, Size => 27; -- Type definition for EMR_EM type EMR_EM_Field (As_Array : Boolean := False) is record case As_Array is when False => -- EM as a value Val : STM32_SVD.UInt27; when True => -- EM as an array Arr : EMR_EM_Field_Array; end case; end record with Unchecked_Union, Size => 27; for EMR_EM_Field use record Val at 0 range 0 .. 26; Arr at 0 range 0 .. 26; end record; -- EMR_EM array type EMR_EM_Field_Array_1 is array (28 .. 29) of STM32_SVD.Bit with Component_Size => 1, Size => 2; -- Type definition for EMR_EM type EMR_EM_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- EM as a value Val : STM32_SVD.UInt2; when True => -- EM as an array Arr : EMR_EM_Field_Array_1; end case; end record with Unchecked_Union, Size => 2; for EMR_EM_Field_1 use record Val at 0 range 0 .. 1; Arr at 0 range 0 .. 1; end record; -- Event mask register (EXTI_EMR) type EMR_Register is record -- Event Mask on line 0 EM : EMR_EM_Field; -- unspecified Reserved_27_27 : STM32_SVD.Bit; -- Event Mask on line 28 EM_1 : EMR_EM_Field_1; -- unspecified Reserved_30_31 : STM32_SVD.UInt2; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for EMR_Register use record EM at 0 range 0 .. 26; Reserved_27_27 at 0 range 27 .. 27; EM_1 at 0 range 28 .. 29; Reserved_30_31 at 0 range 30 .. 31; end record; -- RTSR_RT array type RTSR_RT_Field_Array is array (0 .. 17) of STM32_SVD.Bit with Component_Size => 1, Size => 18; -- Type definition for RTSR_RT type RTSR_RT_Field (As_Array : Boolean := False) is record case As_Array is when False => -- RT as a value Val : STM32_SVD.UInt18; when True => -- RT as an array Arr : RTSR_RT_Field_Array; end case; end record with Unchecked_Union, Size => 18; for RTSR_RT_Field use record Val at 0 range 0 .. 17; Arr at 0 range 0 .. 17; end record; -- RTSR_RT array type RTSR_RT_Field_Array_1 is array (19 .. 22) of STM32_SVD.Bit with Component_Size => 1, Size => 4; -- Type definition for RTSR_RT type RTSR_RT_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- RT as a value Val : STM32_SVD.UInt4; when True => -- RT as an array Arr : RTSR_RT_Field_Array_1; end case; end record with Unchecked_Union, Size => 4; for RTSR_RT_Field_1 use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- Rising Trigger selection register (EXTI_RTSR) type RTSR_Register is record -- Rising trigger event configuration of line 0 RT : RTSR_RT_Field; -- unspecified Reserved_18_18 : STM32_SVD.Bit; -- Rising trigger event configuration of line 19 RT_1 : RTSR_RT_Field_1; -- unspecified Reserved_23_31 : STM32_SVD.UInt9; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for RTSR_Register use record RT at 0 range 0 .. 17; Reserved_18_18 at 0 range 18 .. 18; RT_1 at 0 range 19 .. 22; Reserved_23_31 at 0 range 23 .. 31; end record; -- FTSR_FT array type FTSR_FT_Field_Array is array (0 .. 17) of STM32_SVD.Bit with Component_Size => 1, Size => 18; -- Type definition for FTSR_FT type FTSR_FT_Field (As_Array : Boolean := False) is record case As_Array is when False => -- FT as a value Val : STM32_SVD.UInt18; when True => -- FT as an array Arr : FTSR_FT_Field_Array; end case; end record with Unchecked_Union, Size => 18; for FTSR_FT_Field use record Val at 0 range 0 .. 17; Arr at 0 range 0 .. 17; end record; -- FTSR_FT array type FTSR_FT_Field_Array_1 is array (19 .. 22) of STM32_SVD.Bit with Component_Size => 1, Size => 4; -- Type definition for FTSR_FT type FTSR_FT_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- FT as a value Val : STM32_SVD.UInt4; when True => -- FT as an array Arr : FTSR_FT_Field_Array_1; end case; end record with Unchecked_Union, Size => 4; for FTSR_FT_Field_1 use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- Falling Trigger selection register (EXTI_FTSR) type FTSR_Register is record -- Falling trigger event configuration of line 0 FT : FTSR_FT_Field; -- unspecified Reserved_18_18 : STM32_SVD.Bit; -- Falling trigger event configuration of line 19 FT_1 : FTSR_FT_Field_1; -- unspecified Reserved_23_31 : STM32_SVD.UInt9; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for FTSR_Register use record FT at 0 range 0 .. 17; Reserved_18_18 at 0 range 18 .. 18; FT_1 at 0 range 19 .. 22; Reserved_23_31 at 0 range 23 .. 31; end record; -- SWIER_SWI array type SWIER_SWI_Field_Array is array (0 .. 17) of STM32_SVD.Bit with Component_Size => 1, Size => 18; -- Type definition for SWIER_SWI type SWIER_SWI_Field (As_Array : Boolean := False) is record case As_Array is when False => -- SWI as a value Val : STM32_SVD.UInt18; when True => -- SWI as an array Arr : SWIER_SWI_Field_Array; end case; end record with Unchecked_Union, Size => 18; for SWIER_SWI_Field use record Val at 0 range 0 .. 17; Arr at 0 range 0 .. 17; end record; -- SWIER_SWI array type SWIER_SWI_Field_Array_1 is array (19 .. 22) of STM32_SVD.Bit with Component_Size => 1, Size => 4; -- Type definition for SWIER_SWI type SWIER_SWI_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- SWI as a value Val : STM32_SVD.UInt4; when True => -- SWI as an array Arr : SWIER_SWI_Field_Array_1; end case; end record with Unchecked_Union, Size => 4; for SWIER_SWI_Field_1 use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- Software interrupt event register (EXTI_SWIER) type SWIER_Register is record -- Software Interrupt on line 0 SWI : SWIER_SWI_Field; -- unspecified Reserved_18_18 : STM32_SVD.Bit; -- Software Interrupt on line 19 SWI_1 : SWIER_SWI_Field_1; -- unspecified Reserved_23_31 : STM32_SVD.UInt9; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for SWIER_Register use record SWI at 0 range 0 .. 17; Reserved_18_18 at 0 range 18 .. 18; SWI_1 at 0 range 19 .. 22; Reserved_23_31 at 0 range 23 .. 31; end record; -- PR_PIF array type PR_PIF_Field_Array is array (0 .. 17) of STM32_SVD.Bit with Component_Size => 1, Size => 18; -- Type definition for PR_PIF type PR_PIF_Field (As_Array : Boolean := False) is record case As_Array is when False => -- PIF as a value Val : STM32_SVD.UInt18; when True => -- PIF as an array Arr : PR_PIF_Field_Array; end case; end record with Unchecked_Union, Size => 18; for PR_PIF_Field use record Val at 0 range 0 .. 17; Arr at 0 range 0 .. 17; end record; -- PR_PIF array type PR_PIF_Field_Array_1 is array (19 .. 22) of STM32_SVD.Bit with Component_Size => 1, Size => 4; -- Type definition for PR_PIF type PR_PIF_Field_1 (As_Array : Boolean := False) is record case As_Array is when False => -- PIF as a value Val : STM32_SVD.UInt4; when True => -- PIF as an array Arr : PR_PIF_Field_Array_1; end case; end record with Unchecked_Union, Size => 4; for PR_PIF_Field_1 use record Val at 0 range 0 .. 3; Arr at 0 range 0 .. 3; end record; -- Pending register (EXTI_PR) type PR_Register is record -- Pending bit 0 PIF : PR_PIF_Field; -- unspecified Reserved_18_18 : STM32_SVD.Bit; -- Pending bit 19 PIF_1 : PR_PIF_Field_1; -- unspecified Reserved_23_31 : STM32_SVD.UInt9; end record with Volatile_Full_Access, Object_Size => 32, Bit_Order => System.Low_Order_First; for PR_Register use record PIF at 0 range 0 .. 17; Reserved_18_18 at 0 range 18 .. 18; PIF_1 at 0 range 19 .. 22; Reserved_23_31 at 0 range 23 .. 31; end record; ----------------- -- Peripherals -- ----------------- -- External interrupt/event controller type EXTI_Peripheral is record -- Interrupt mask register (EXTI_IMR) IMR : aliased IMR_Register; -- Event mask register (EXTI_EMR) EMR : aliased EMR_Register; -- Rising Trigger selection register (EXTI_RTSR) RTSR : aliased RTSR_Register; -- Falling Trigger selection register (EXTI_FTSR) FTSR : aliased FTSR_Register; -- Software interrupt event register (EXTI_SWIER) SWIER : aliased SWIER_Register; -- Pending register (EXTI_PR) PR : aliased PR_Register; end record with Volatile; for EXTI_Peripheral use record IMR at 16#0# range 0 .. 31; EMR at 16#4# range 0 .. 31; RTSR at 16#8# range 0 .. 31; FTSR at 16#C# range 0 .. 31; SWIER at 16#10# range 0 .. 31; PR at 16#14# range 0 .. 31; end record; -- External interrupt/event controller EXTI_Periph : aliased EXTI_Peripheral with Import, Address => EXTI_Base; end STM32_SVD.EXTI;
flyx/OpenGLAda
Ada
1,223
adb
-- part of OpenGLAda, (c) 2017 Felix Krause -- released under the terms of the MIT license, see the file "COPYING" with Glfw.API; with Interfaces.C.Strings; package body Glfw is use type Interfaces.C.int; procedure Init is begin if API.Init = 0 then raise Initialization_Exception; end if; end Init; procedure Shutdown is begin API.Glfw_Terminate; end Shutdown; procedure Version (Major, Minor, Rev : out Natural) is Raw_Major, Raw_Minor, Raw_Rev : C.int; begin API.Get_Version (Raw_Major, Raw_Minor, Raw_Rev); Major := Natural (Raw_Major); Minor := Natural (Raw_Minor); Rev := Natural (Raw_Rev); end Version; function Version_String return String is begin return Interfaces.C.Strings.Value (API.Get_Version_String); end Version_String; function Time return Seconds is begin return API.Get_Time; end Time; procedure Set_Time (Value : Seconds) is begin API.Set_Time (Value); end Set_Time; function Extension_Supported (Name : String) return Boolean is begin return Boolean (API.Extension_Supported (Interfaces.C.To_C (Name))); end Extension_Supported; end Glfw;
reznikmm/matreshka
Ada
3,612
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.Change_Events.Hash is new AMF.Elements.Generic_Hash (UML_Change_Event, UML_Change_Event_Access);
damaki/libkeccak
Ada
4,453
ads
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with Keccak.Keccak_1600.Rounds_12; with Keccak.Generic_Parallel_Sponge; with Keccak.Padding; pragma Elaborate_All (Keccak.Generic_Parallel_Sponge); package Keccak.Parallel_Keccak_1600.Rounds_12 with SPARK_Mode => On is procedure Permute_All_P2 is new KeccakF_1600_P2.Permute_All (Keccak.Keccak_1600.Rounds_12.Permute); procedure Permute_All_P4 is new KeccakF_1600_P4.Permute_All (Keccak.Keccak_1600.Rounds_12.Permute); procedure Permute_All_P8 is new KeccakF_1600_P8.Permute_All (Keccak.Keccak_1600.Rounds_12.Permute); package Parallel_Sponge_P2 is new Keccak.Generic_Parallel_Sponge (State_Size => 1600, State_Type => KeccakF_1600_P2.Parallel_State, Parallelism => 2, Init => KeccakF_1600_P2.Init, Permute_All => Permute_All_P2, XOR_Bits_Into_State_Separate => KeccakF_1600_P2.XOR_Bits_Into_State_Separate, XOR_Bits_Into_State_All => KeccakF_1600_P2.XOR_Bits_Into_State_All, Extract_Bytes => KeccakF_1600_P2.Extract_Bytes, Pad => Keccak.Padding.Pad101_Single_Block, Min_Padding_Bits => Keccak.Padding.Pad101_Min_Bits); package Parallel_Sponge_P4 is new Keccak.Generic_Parallel_Sponge (State_Size => 1600, State_Type => KeccakF_1600_P4.Parallel_State, Parallelism => 4, Init => KeccakF_1600_P4.Init, Permute_All => Permute_All_P4, XOR_Bits_Into_State_Separate => KeccakF_1600_P4.XOR_Bits_Into_State_Separate, XOR_Bits_Into_State_All => KeccakF_1600_P4.XOR_Bits_Into_State_All, Extract_Bytes => KeccakF_1600_P4.Extract_Bytes, Pad => Keccak.Padding.Pad101_Single_Block, Min_Padding_Bits => Keccak.Padding.Pad101_Min_Bits); package Parallel_Sponge_P8 is new Keccak.Generic_Parallel_Sponge (State_Size => 1600, State_Type => KeccakF_1600_P8.Parallel_State, Parallelism => 8, Init => KeccakF_1600_P8.Init, Permute_All => Permute_All_P8, XOR_Bits_Into_State_Separate => KeccakF_1600_P8.XOR_Bits_Into_State_Separate, XOR_Bits_Into_State_All => KeccakF_1600_P8.XOR_Bits_Into_State_All, Extract_Bytes => KeccakF_1600_P8.Extract_Bytes, Pad => Keccak.Padding.Pad101_Single_Block, Min_Padding_Bits => Keccak.Padding.Pad101_Min_Bits); end Keccak.Parallel_Keccak_1600.Rounds_12;
AaronC98/PlaneSystem
Ada
2,835
adb
------------------------------------------------------------------------------ -- Ada Web Server -- -- -- -- Copyright (C) 2004-2013, AdaCore -- -- -- -- This library is free software; you can redistribute it and/or modify -- -- it under terms of the GNU General Public License as published by the -- -- Free Software Foundation; either version 3, or (at your option) any -- -- later version. This library is distributed in the hope that it will be -- -- useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -- -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ------------------------------------------------------------------------------ package body AWS.Services.Split_Pages.Uniform.Overlapping is --------------------- -- Get_Page_Ranges -- --------------------- overriding function Get_Page_Ranges (This : Splitter; Table : Templates.Translate_Set) return Ranges_Table is Result : Ranges_Table := Get_Page_Ranges (Uniform.Splitter (This), Table); begin for I in Result'First + 1 .. Result'Last loop Result (I).First := Integer'Max (Result (I).First - This.Overlap, 1); end loop; return Result; end Get_Page_Ranges; end AWS.Services.Split_Pages.Uniform.Overlapping;
sungyeon/drake
Ada
13,400
ads
pragma License (Unrestricted); -- Ada 2005 with Ada.Iterator_Interfaces; -- diff (Ada.References) private with Ada.Containers.Copy_On_Write; private with Ada.Finalization; private with Ada.Streams; generic type Index_Type is range <>; type Element_Type (<>) is private; with function "=" (Left, Right : Element_Type) return Boolean is <>; package Ada.Containers.Indefinite_Vectors is pragma Preelaborate; pragma Remote_Types; subtype Extended_Index is Index_Type'Base range Index_Type'First - 1 .. Index_Type'Min (Index_Type'Base'Last - 1, Index_Type'Last) + 1; No_Index : constant Extended_Index := Extended_Index'First; type Vector is tagged private with Constant_Indexing => Constant_Reference, Variable_Indexing => Reference, -- diff -- diff Default_Iterator => Iterate, Iterator_Element => Element_Type; pragma Preelaborable_Initialization (Vector); -- modified -- type Cursor is private; -- pragma Preelaborable_Initialization (Cursor); subtype Cursor is Extended_Index; -- modified -- Empty_Vector : constant Vector; function Empty_Vector return Vector; No_Element : Cursor renames No_Index; function Has_Element (Position : Cursor) return Boolean; package Vector_Iterator_Interfaces is new Iterator_Interfaces (Cursor, Has_Element); overriding function "=" (Left, Right : Vector) return Boolean; function To_Vector (Length : Count_Type) return Vector; function To_Vector (New_Item : Element_Type; Length : Count_Type) return Vector; -- diff (Generic_Array_To_Vector) -- -- -- function "&" (Left, Right : Vector) return Vector; function "&" (Left : Vector; Right : Element_Type) return Vector; function "&" (Left : Element_Type; Right : Vector) return Vector; function "&" (Left, Right : Element_Type) return Vector; function Capacity (Container : Vector) return Count_Type; procedure Reserve_Capacity ( Container : in out Vector; Capacity : Count_Type); function Length (Container : Vector) return Count_Type; procedure Set_Length (Container : in out Vector; Length : Count_Type); function Is_Empty (Container : Vector) return Boolean; procedure Clear (Container : in out Vector); -- modified function To_Cursor ( Container : Vector'Class; -- not primitive Index : Extended_Index) return Cursor; function To_Index (Position : Cursor) return Extended_Index renames "+"; -- modified function Element ( Container : Vector'Class; -- not primitive Index : Index_Type) return Element_Type; -- function Element (Position : Cursor) return Element_Type; -- procedure Replace_Element ( -- Container : in out Vector; -- Index : Index_Type; -- New_Item : Element_Type); procedure Replace_Element ( Container : in out Vector; Position : Cursor; New_Item : Element_Type); -- modified procedure Query_Element ( Container : Vector'Class; -- not primitive Index : Index_Type; Process : not null access procedure (Element : Element_Type)); -- procedure Query_Element ( -- Position : Cursor; -- Process : not null access procedure (Element : Element_Type)); -- procedure Update_Element ( -- Container : in out Vector; -- Index : Index_Type; -- Process : not null access procedure (Element : in out Element_Type)); -- modified procedure Update_Element ( Container : in out Vector'Class; -- not primitive Position : Cursor; Process : not null access procedure (Element : in out Element_Type)); type Constant_Reference_Type ( Element : not null access constant Element_Type) is private with Implicit_Dereference => Element; type Reference_Type (Element : not null access Element_Type) is private with Implicit_Dereference => Element; -- function Constant_Reference ( -- Container : aliased Vector; -- Index : Index_Type) -- return Constant_Reference_Type; -- function Reference (Container : aliased in out Vector; Index : Index_Type) -- return Reference_Type; function Constant_Reference (Container : aliased Vector; Position : Cursor) return Constant_Reference_Type; function Reference (Container : aliased in out Vector; Position : Cursor) return Reference_Type; procedure Assign (Target : in out Vector; Source : Vector); function Copy (Source : Vector; Capacity : Count_Type := 0) return Vector; procedure Move (Target : in out Vector; Source : in out Vector); -- procedure Insert ( -- Container : in out Vector; -- Before : Extended_Index; -- New_Item : Vector); procedure Insert ( Container : in out Vector; Before : Cursor; New_Item : Vector); procedure Insert ( Container : in out Vector; Before : Cursor; New_Item : Vector; Position : out Cursor); -- procedure Insert ( -- Container : in out Vector; -- Before : Extended_Index; -- New_Item : Element_Type; -- Count : Count_Type := 1); procedure Insert ( Container : in out Vector; Before : Cursor; New_Item : Element_Type; Count : Count_Type := 1); procedure Insert ( Container : in out Vector; Before : Cursor; New_Item : Element_Type; Position : out Cursor; Count : Count_Type := 1); -- diff (Insert) -- -- -- -- diff (Insert) -- -- -- -- procedure Prepend (Container : in out Vector; New_Item : Vector); procedure Prepend ( Container : in out Vector; New_Item : Element_Type; Count : Count_Type := 1); procedure Append (Container : in out Vector; New_Item : Vector); procedure Append ( Container : in out Vector; New_Item : Element_Type; Count : Count_Type := 1); -- modified procedure Insert_Space ( Container : in out Vector'Class; -- not primitive Before : Extended_Index; Count : Count_Type := 1); procedure Insert_Space ( Container : in out Vector; Before : Cursor; Position : out Cursor; Count : Count_Type := 1); -- procedure Delete ( -- Container : in out Vector; -- Index : Extended_Index; -- Count : Count_Type := 1); procedure Delete ( Container : in out Vector; Position : in out Cursor; Count : Count_Type := 1); -- modified procedure Delete_First ( Container : in out Vector'Class; -- not primitive Count : Count_Type := 1); -- modified procedure Delete_Last ( Container : in out Vector'Class; -- not primitive Count : Count_Type := 1); procedure Reverse_Elements (Container : in out Vector); -- procedure Swap (Container : in out Vector; I, J : Index_Type); procedure Swap (Container : in out Vector; I, J : Cursor); -- modified function First_Index (Container : Vector'Class) -- not primitive return Index_Type; pragma Inline (First_Index); function First (Container : Vector) return Cursor; -- modified function First_Element (Container : Vector'Class) -- not primitive return Element_Type; -- modified function Last_Index (Container : Vector'Class) -- not primitive return Extended_Index; pragma Inline (Last_Index); function Last (Container : Vector) return Cursor; -- modified function Last_Element (Container : Vector'Class) -- not primitive return Element_Type; -- function Next (Position : Cursor) return Cursor; -- procedure Next (Position : in out Cursor); -- function Previous (Position : Cursor) return Cursor; -- procedure Previous (Position : in out Cursor); -- modified function Find_Index ( Container : Vector'Class; -- not primitive Item : Element_Type; Index : Index_Type := Index_Type'First) return Extended_Index; -- modified -- function Find ( -- Container : Vector; -- Item : Element_Type; -- Position : Cursor := No_Element) -- return Cursor; function Find ( Container : Vector; Item : Element_Type) return Cursor; function Find ( Container : Vector; Item : Element_Type; Position : Cursor) return Cursor; -- modified function Reverse_Find_Index ( Container : Vector'Class; -- not primitive Item : Element_Type; Index : Index_Type := Index_Type'Last) return Extended_Index; -- modified -- function Reverse_Find ( -- Container : Vector; -- Item : Element_Type; -- Position : Cursor := No_Element) -- return Cursor; function Reverse_Find ( Container : Vector; Item : Element_Type) return Cursor; function Reverse_Find ( Container : Vector; Item : Element_Type; Position : Cursor) return Cursor; function Contains (Container : Vector; Item : Element_Type) return Boolean; -- modified procedure Iterate ( Container : Vector'Class; -- not primitive Process : not null access procedure (Position : Cursor)); -- modified procedure Reverse_Iterate ( Container : Vector'Class; -- not primitive Process : not null access procedure (Position : Cursor)); -- modified function Iterate (Container : Vector'Class) -- not primitive return Vector_Iterator_Interfaces.Reversible_Iterator'Class; -- function Iterate (Container : Vector; Start : Cursor) -- return Vector_Iterator_Interfaces.Reversible_Iterator'Class; -- extended function Iterate (Container : Vector'Class; First, Last : Cursor) return Vector_Iterator_Interfaces.Reversible_Iterator'Class; -- diff (Element_Array, Slicing, Constant_Reference, Reference) -- -- -- -- -- -- -- -- -- -- -- -- -- generic with function "<" (Left, Right : Element_Type) return Boolean is <>; package Generic_Sorting is function Is_Sorted (Container : Vector) return Boolean; procedure Sort (Container : in out Vector); procedure Merge (Target : in out Vector; Source : in out Vector); end Generic_Sorting; -- diff (Equivalents) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- non-overloaded subprograms -- diff (Constant_Indexing) -- -- -- -- diff (Indexing) -- -- -- -- diff (pragma Inline) -- diff (pragma Inline) private type Element_Access is access Element_Type; type Element_Array is array (Index_Type range <>) of Element_Access; type Data (Capacity_Last : Extended_Index) is limited record Super : aliased Copy_On_Write.Data; Max_Length : aliased Count_Type; Items : aliased Element_Array (Index_Type'First .. Capacity_Last); end record; -- place Super at first for Data use record Super at 0 range 0 .. Copy_On_Write.Data_Size - 1; end record; type Data_Access is access all Data; type Vector is new Finalization.Controlled with record Super : aliased Copy_On_Write.Container; Length : Count_Type := 0; end record; overriding procedure Adjust (Object : in out Vector); overriding procedure Finalize (Object : in out Vector) renames Clear; type Constant_Reference_Type ( Element : not null access constant Element_Type) is null record; type Reference_Type (Element : not null access Element_Type) is null record; type Vector_Iterator is new Vector_Iterator_Interfaces.Reversible_Iterator with record First : Extended_Index; Last : Extended_Index; end record; overriding function First (Object : Vector_Iterator) return Cursor; overriding function Next (Object : Vector_Iterator; Position : Cursor) return Cursor; overriding function Last (Object : Vector_Iterator) return Cursor; overriding function Previous (Object : Vector_Iterator; Position : Cursor) return Cursor; package Streaming is procedure Read ( Stream : not null access Streams.Root_Stream_Type'Class; Item : out Vector); procedure Write ( Stream : not null access Streams.Root_Stream_Type'Class; Item : Vector); procedure Missing_Read ( Stream : access Streams.Root_Stream_Type'Class; Item : out Constant_Reference_Type) with Import, Convention => Ada, External_Name => "__drake_program_error"; procedure Missing_Write ( Stream : access Streams.Root_Stream_Type'Class; Item : Constant_Reference_Type) with Import, Convention => Ada, External_Name => "__drake_program_error"; procedure Missing_Read ( Stream : access Streams.Root_Stream_Type'Class; Item : out Reference_Type) with Import, Convention => Ada, External_Name => "__drake_program_error"; procedure Missing_Write ( Stream : access Streams.Root_Stream_Type'Class; Item : Reference_Type) with Import, Convention => Ada, External_Name => "__drake_program_error"; end Streaming; for Vector'Read use Streaming.Read; for Vector'Write use Streaming.Write; for Constant_Reference_Type'Read use Streaming.Missing_Read; for Constant_Reference_Type'Write use Streaming.Missing_Write; for Reference_Type'Read use Streaming.Missing_Read; for Reference_Type'Write use Streaming.Missing_Write; end Ada.Containers.Indefinite_Vectors;
Fabien-Chouteau/coffee-clock
Ada
3,150
ads
------------------------------------------------------------------------------- -- -- -- Coffee Clock -- -- -- -- Copyright (C) 2016-2017 Fabien Chouteau -- -- -- -- Coffee Clock 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. -- -- -- -- Coffee Clock 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 We Noise Maker. If not, see <http://www.gnu.org/licenses/>. -- -- -- ------------------------------------------------------------------------------- with Giza.Window; with Giza.Widget.Button; with Giza.Widget.Tiles; with Giza.Widget.Frame; use Giza.Widget; with Giza.Image; with Giza.Events; use Giza.Events; with Giza.Types; use Giza.Types; package Dialog_Window is type Answer_T is (Unknown_Answer, Answer_Top, Answer_Bottom); subtype Parent is Giza.Window.Instance; type Instance (Panel_Size : Natural) is abstract new Parent with private; subtype Class is Instance'Class; type Ref is access all Class; overriding procedure On_Init (This : in out Instance); overriding function On_Position_Event (This : in out Instance; Evt : Position_Event_Ref; Pos : Point_T) return Boolean; overriding function Get_Size (This : Instance) return Size_T; function Get_Answer (This : Instance) return Answer_T; procedure Clear_Answer (This : in out Instance); procedure Set_Top_Image (This : in out Instance; Img : Giza.Image.Ref); procedure Set_Icon_Image (This : in out Instance; Img : Giza.Image.Ref); procedure Set_Bottom_Image (This : in out Instance; Img : Giza.Image.Ref); private type Instance (Panel_Size : Natural) is abstract new Parent with record Top_Btn, Bottom_Btn : aliased Button.Instance; Icon : aliased Frame.Instance; Tile : aliased Tiles.Instance (3, Tiles.Top_Down); Answer : Answer_T := Unknown_Answer; end record; end Dialog_Window;
Tim-Tom/project-euler
Ada
2,351
adb
with Ada.Text_IO; with PrimeUtilities; package body Problem_70 is package IO renames Ada.Text_IO; subtype Ten_Million is Integer range 1 .. 9_999_999; package Ten_Million_Primes is new PrimeUtilities(Ten_Million); type Digit_Count is Array(Character range '0' .. '9') of Natural; procedure Solve is sieve : constant Ten_Million_Primes.Sieve := Ten_Million_Primes.Generate_Sieve(Ten_Million'Last / 2); best : Ten_Million := 1; best_ratio : Long_Float := 0.0; function Convert(num : Ten_Million) return Digit_Count is str : constant String := Ten_Million'Image(num); counts : Digit_Count := (others => 0); begin for i in 2 .. str'Last loop counts(str(i)) := counts(str(i)) + 1; end loop; return counts; end Convert; procedure Check(num, euler : Ten_Million; ratio : Long_Float) is num_c : constant Digit_Count := Convert(num); euler_c : constant Digit_Count := Convert(euler); begin for c in num_c'Range loop if num_c(c) /= euler_c(c) then return; end if; end loop; best := num; best_ratio := ratio; end Check; procedure Solve_Recursive(min_index : Positive; start_ratio : Long_Float; start_euler, so_far : Ten_Million) is prime : Ten_Million; total : Ten_Million; euler : Ten_Million; ratio : Long_Float; begin for prime_index in min_index .. sieve'Last loop prime := sieve(prime_index); exit when Ten_Million'Last / prime < so_far; total := so_far * prime; euler := start_euler * (prime - 1); ratio := start_ratio * (1.0 - 1.0 / Long_Float(prime)); exit when ratio < 0.1; loop if ratio > best_ratio then Check(total, euler, ratio); end if; Solve_Recursive(prime_index + 1, ratio, euler, total); exit when Ten_Million'Last / prime < total; total := total * prime; euler := euler * prime; end loop; end loop; end Solve_Recursive; begin Solve_Recursive(sieve'First, 1.0, 1, 1); IO.Put_Line(Integer'Image(best)); end Solve; end Problem_70;
eqcola/ada-ado
Ada
30,260
adb
----------------------------------------------------------------------- -- ADO Parameters -- Parameters for queries -- Copyright (C) 2010, 2011, 2012, 2013, 2017 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.Strings; with Util.Log.Loggers; with Ada.Calendar.Formatting; package body ADO.Parameters is use Parameter_Vectors; Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("ADO.Parameters"); -- -------------------- -- Set the SQL dialect description object. -- -------------------- procedure Set_Dialect (Params : in out Abstract_List; D : in ADO.Drivers.Dialects.Dialect_Access) is begin Params.Dialect := D; end Set_Dialect; -- -------------------- -- Set the cache expander to be used when expanding the SQL. -- -------------------- procedure Set_Expander (Params : in out Abstract_List; Expander : in ADO.Parameters.Expander_Access) is begin Params.Expander := Expander; end Set_Expander; -- -------------------- -- Get the SQL dialect description object. -- -------------------- function Get_Dialect (From : in Abstract_List) return ADO.Drivers.Dialects.Dialect_Access is begin return From.Dialect; end Get_Dialect; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in Boolean) is Param : constant Parameter := Parameter '(T => T_BOOLEAN, Len => Name'Length, Value_Len => 0, Name => Name, Position => 0, Bool => Value); begin Abstract_List'Class (Params).Add_Parameter (Param); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in Integer) is Param : constant Parameter := Parameter '(T => T_INTEGER, Len => Name'Length, Value_Len => 0, Name => Name, Position => 0, Num => Value); begin Abstract_List'Class (Params).Add_Parameter (Param); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in Long_Long_Integer) is Param : constant Parameter := Parameter '(T => T_LONG_INTEGER, Len => Name'Length, Value_Len => 0, Name => Name, Position => 0, Long_Num => Value); begin Abstract_List'Class (Params).Add_Parameter (Param); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in Identifier) is Param : constant Parameter := Parameter '(T => T_LONG_INTEGER, Len => Name'Length, Value_Len => 0, Name => Name, Position => 0, Long_Num => Long_Long_Integer (Value)); begin Abstract_List'Class (Params).Add_Parameter (Param); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in ADO.Entity_Type) is Param : constant Parameter := Parameter '(T => T_LONG_INTEGER, Len => Name'Length, Value_Len => 0, Name => Name, Position => 0, Long_Num => Long_Long_Integer (Value)); begin Abstract_List'Class (Params).Add_Parameter (Param); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in String) is begin Abstract_List'Class (Params). Add_Parameter (Parameter '(T => T_STRING, Len => Name'Length, Value_Len => Value'Length, Name => Name, Position => 0, Str => Value)); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in Token) is begin Abstract_List'Class (Params). Add_Parameter (Parameter '(T => T_TOKEN, Len => Name'Length, Value_Len => Value'Length, Name => Name, Position => 0, Str => String (Value))); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in ADO.Blob_Ref) is begin Abstract_List'Class (Params). Add_Parameter (Parameter '(T => T_BLOB, Len => Name'Length, Value_Len => 0, Name => Name, Position => 0, Data => Value)); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in ADO.Utils.Identifier_Vector) is S : constant String := ADO.Utils.To_Parameter_List (Value); begin Abstract_List'Class (Params). Add_Parameter (Parameter '(T => T_LIST, Len => Name'Length, Value_Len => S'Length, Name => Name, Position => 0, Str => S)); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in Unbounded_String) is Val : constant String := To_String (Value); Param : constant Parameter := Parameter '(T => T_STRING, Len => Name'Length, Value_Len => Val'Length, Name => Name, Position => 0, Str => Val); begin Abstract_List'Class (Params).Add_Parameter (Param); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Name : in String; Value : in Ada.Calendar.Time) is Param : constant Parameter := Parameter '(T => T_DATE, Len => Name'Length, Value_Len => 0, Name => Name, Position => 0, Time => Value); begin Abstract_List'Class (Params).Add_Parameter (Param); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Position : in Natural; Value : in Boolean) is P : Parameter := Parameter '(T => T_BOOLEAN, Len => 0, Value_Len => 0, Name => "", Position => Position, Bool => Value); begin if Position = 0 then P.Position := Abstract_List'Class (Params).Length + 1; end if; Abstract_List'Class (Params).Add_Parameter (P); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Position : in Natural; Value : in Long_Long_Integer) is P : Parameter := Parameter '(T => T_LONG_INTEGER, Len => 0, Value_Len => 0, Name => "", Position => Position, Long_Num => Value); begin if Position = 0 then P.Position := Abstract_List'Class (Params).Length + 1; end if; Abstract_List'Class (Params).Add_Parameter (P); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Position : in Natural; Value : in Identifier) is P : Parameter := Parameter '(T => T_LONG_INTEGER, Len => 0, Value_Len => 0, Name => "", Position => Position, Long_Num => Long_Long_Integer (Value)); begin if Position = 0 then P.Position := Abstract_List'Class (Params).Length + 1; end if; Abstract_List'Class (Params).Add_Parameter (P); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Position : in Natural; Value : in Integer) is P : Parameter := Parameter '(T => T_INTEGER, Len => 0, Value_Len => 0, Name => "", Position => Position, Num => Value); begin if Position = 0 then P.Position := Abstract_List'Class (Params).Length + 1; end if; Abstract_List'Class (Params).Add_Parameter (P); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Position : in Natural; Value : in Entity_Type) is P : Parameter := Parameter '(T => T_INTEGER, Len => 0, Value_Len => 0, Name => "", Position => Position, Num => Integer (Value)); begin if Position = 0 then P.Position := Abstract_List'Class (Params).Length + 1; end if; Abstract_List'Class (Params).Add_Parameter (P); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Position : in Natural; Value : in String) is P : Parameter := Parameter '(T => T_STRING, Len => 0, Value_Len => Value'Length, Name => "", Position => Position, Str => Value); begin if Position = 0 then P.Position := Abstract_List'Class (Params).Length + 1; end if; Abstract_List'Class (Params).Add_Parameter (P); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Position : in Natural; Value : in Unbounded_String) is Val : constant String := To_String (Value); P : Parameter := Parameter '(T => T_STRING, Len => 0, Value_Len => Val'Length, Name => "", Position => Position, Str => Val); begin if Position = 0 then P.Position := Abstract_List'Class (Params).Length + 1; end if; Abstract_List'Class (Params).Add_Parameter (P); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Position : in Natural; Value : in Ada.Calendar.Time) is P : Parameter := Parameter '(T => T_DATE, Len => 0, Value_Len => 0, Name => "", Position => Position, Time => Value); begin if Position = 0 then P.Position := Abstract_List'Class (Params).Length + 1; end if; Abstract_List'Class (Params).Add_Parameter (P); end Bind_Param; procedure Bind_Param (Params : in out Abstract_List; Position : in Natural; Value : in ADO.Blob_Ref) is P : Parameter := Parameter '(T => T_BLOB, Len => 0, Value_Len => 0, Name => "", Position => Position, Data => Value); begin if Position = 0 then P.Position := Abstract_List'Class (Params).Length + 1; end if; Abstract_List'Class (Params).Add_Parameter (P); end Bind_Param; procedure Bind_Null_Param (Params : in out Abstract_List; Position : in Natural) is P : Parameter := Parameter '(T => T_NULL, Len => 0, Value_Len => 0, Name => "", Position => Position); begin if Position = 0 then P.Position := Abstract_List'Class (Params).Length + 1; end if; Abstract_List'Class (Params).Add_Parameter (P); end Bind_Null_Param; procedure Bind_Null_Param (Params : in out Abstract_List; Name : in String) is P : constant Parameter := Parameter '(T => T_NULL, Len => Name'Length, Value_Len => 0, Name => Name, Position => 0); begin Abstract_List'Class (Params).Add_Parameter (P); end Bind_Null_Param; procedure Add_Param (Params : in out Abstract_List; Value : in Boolean) is begin Params.Bind_Param (Position => 0, Value => Value); end Add_Param; procedure Add_Param (Params : in out Abstract_List; Value : in Long_Long_Integer) is begin Params.Bind_Param (Position => 0, Value => Value); end Add_Param; procedure Add_Param (Params : in out Abstract_List; Value : in Identifier) is begin Params.Bind_Param (Position => 0, Value => Value); end Add_Param; procedure Add_Param (Params : in out Abstract_List; Value : in Integer) is begin Params.Bind_Param (Position => 0, Value => Value); end Add_Param; procedure Add_Param (Params : in out Abstract_List; Value : in String) is begin Params.Bind_Param (Position => 0, Value => Value); end Add_Param; procedure Add_Param (Params : in out Abstract_List; Value : in Unbounded_String) is begin Params.Bind_Param (Position => 0, Value => Value); end Add_Param; procedure Add_Param (Params : in out Abstract_List; Value : in Ada.Calendar.Time) is begin Params.Bind_Param (Position => 0, Value => Value); end Add_Param; -- ------------------------------ -- Add a null parameter. -- ------------------------------ procedure Add_Null_Param (Params : in out Abstract_List) is begin Params.Bind_Null_Param (Position => 0); end Add_Null_Param; -- ------------------------------ -- Expand the SQL string with the query parameters. The following parameters syntax -- are recognized and replaced: -- <ul> -- <li>? is replaced according to the current parameter index. The index is incremented -- after each occurrence of ? character. -- <li>:nnn is replaced by the parameter at index <b>nnn</b>. -- <li>:name is replaced by the parameter with the name <b>name</b> -- <li>$group[var-name] is replaced by using the expander interface. -- </ul> -- Parameter strings are escaped. When a parameter is not found, an empty string is used. -- Returns the expanded SQL string. -- ------------------------------ function Expand (Params : in Abstract_List'Class; SQL : in String) return String is use ADO.Parameters; -- Format and append the date to the buffer. procedure Append_Date (Buffer : in out Unbounded_String; Time : in Ada.Calendar.Time); -- Replace the given parameter. procedure Replace_Parameter (Param : in Parameter); -- Find and replace the parameter identified by the name. procedure Replace_Parameter (Name : in String); -- Find and replace the parameter at the given index. procedure Replace_Parameter (Position : in Natural); -- Find and replace the variable by using the expander and looking up in the -- group identified by <tt>Group</tt> a value with the name <tt>Name</tt>. procedure Replace_Expander (Group : in String; Name : in STring); -- ------------------------------ -- Format and append the date to the buffer. -- ------------------------------ procedure Append_Date (Buffer : in out Unbounded_String; Time : in Ada.Calendar.Time) is begin Append (Buffer, "'"); Append (Buffer, Ada.Calendar.Formatting.Image (Time, True)); Append (Buffer, "'"); end Append_Date; Max : constant Natural := Params.Length; Buffer : Unbounded_String; -- ------------------------------ -- Replace the given parameter. -- ------------------------------ procedure Replace_Parameter (Param : in Parameter) is begin case Param.T is when T_LONG_INTEGER => Append (Buffer, Util.Strings.Image (Param.Long_Num)); when T_INTEGER => Append (Buffer, Util.Strings.Image (Param.Num)); when T_BOOLEAN => if Param.Bool then Append (Buffer, '1'); else Append (Buffer, '0'); end if; when T_DATE => Append_Date (Buffer, Param.Time); when T_NULL => Append (Buffer, "NULL"); when T_TOKEN | T_LIST => Append (Buffer, Param.Str); when T_BLOB => Append (Buffer, '''); Params.Dialect.Escape_Sql (Buffer, Param.Data); Append (Buffer, '''); when others => Append (Buffer, '''); Params.Dialect.Escape_Sql (Buffer, Param.Str); Append (Buffer, '''); end case; end Replace_Parameter; -- ------------------------------ -- Find and replace the parameter at the given index. -- ------------------------------ procedure Replace_Parameter (Position : in Natural) is begin if Position = 0 or Position > Max then Log.Warn ("Invalid parameter '{0}' in query '{1}'", Natural'Image (Position), SQL); else Params.Query_Element (Position => Position, Process => Replace_Parameter'Access); end if; end Replace_Parameter; -- ------------------------------ -- Find and replace the parameter identified by the name. -- ------------------------------ procedure Replace_Parameter (Name : in String) is -- Check if the parameter matches and replace it. procedure Process (Param : in Parameter); Found : Boolean := False; -- ------------------------------ -- Check if the parameter matches and replace it. -- ------------------------------ procedure Process (Param : in Parameter) is begin if Param.Name = Name then Replace_Parameter (Param); Found := True; end if; end Process; begin -- We assume that in most queries, the number of parameters is relatively small -- (1, 2 or 3) and even complex queries should not have a lot of parameters. -- To avoid the cost and complexity of hash map, we use a simple search. for I in 1 .. Max loop Params.Query_Element (I, Process'Access); if Found then return; end if; end loop; Log.Warn ("Parameter '{0}' not found in query '{1}'", Name, SQL); end Replace_Parameter; -- ------------------------------ -- Find and replace the variable by using the expander and looking up in the -- group identified by <tt>Group</tt> a value with the name <tt>Name</tt>. -- ------------------------------ procedure Replace_Expander (Group : in String; Name : in STring) is begin if Params.Expander = null then Log.Warn ("There is no expander to evaluate ${0}[{1}]", Group, Name); else Replace_Parameter (Params.Expander.Expand (Group, Name)); end if; exception when others => Log.Warn ("No value ${0}[{1}] in the cache expander", Group, Name); end Replace_Expander; Num : Natural := 0; Pos : Natural; C : Character; First_Pos : Natural; begin -- Build the SQL query by injecting the parameters. Pos := SQL'First; First_Pos := Pos; while Pos <= SQL'Last loop C := SQL (Pos); if C = '\' then if First_Pos <= Pos - 1 then Append (Buffer, SQL (First_Pos .. Pos - 1)); end if; First_Pos := Pos + 1; exit when Pos + 1 > SQL'Last; Pos := Pos + 2; elsif C = ':' and Pos + 1 <= SQL'Last then if First_Pos <= Pos - 1 then Append (Buffer, SQL (First_Pos .. Pos - 1)); end if; Pos := Pos + 1; C := SQL (Pos); if C >= '0' and C <= '9' then Num := 0; loop Num := Num * 10 + Natural (Character'Pos (C) - Character'Pos ('0')); Pos := Pos + 1; exit when Pos > SQL'Last; C := SQL (Pos); exit when not (C >= '0' and C <= '9'); end loop; Replace_Parameter (Position => Num); First_Pos := Pos; else declare Start_Pos : constant Natural := Pos; begin -- Isolate the parameter name. loop exit when not (C >= 'a' and C <= 'z') and not (C >= 'A' and C <= 'Z') and not (C >= '0' and C <= '9') and C /= '_'; Pos := Pos + 1; exit when Pos > SQL'Last; C := SQL (Pos); end loop; -- And replace it with its value. Replace_Parameter (Name => SQL (Start_Pos .. Pos - 1)); First_Pos := Pos; end; end if; elsif C = '?' then if First_Pos <= Pos - 1 then Append (Buffer, SQL (First_Pos .. Pos - 1)); end if; Num := Num + 1; Replace_Parameter (Position => Num); Pos := Pos + 1; First_Pos := Pos; elsif C = '$' then if First_Pos <= Pos - 1 then Append (Buffer, SQL (First_Pos .. Pos - 1)); end if; -- We have a variable to lookup in a cache with the form: $group[var-name] Pos := Pos + 1; declare Group_Start : constant Natural := Pos; Group_End : Natural; begin -- Isolate the parameter name. loop C := SQL (Pos); exit when C = '['; Pos := Pos + 1; exit when Pos > SQL'Last; C := SQL (Pos); end loop; if C = '[' then Group_End := Pos; loop C := SQL (Pos); exit when C = ']'; Pos := Pos + 1; exit when Pos > SQL'Last; C := SQL (Pos); end loop; if C = ']' then Replace_Expander (Group => SQL (Group_Start .. Group_End - 1), Name => SQL (Group_End + 1 .. Pos - 1)); Pos := Pos + 1; end if; end if; -- And replace it with its value. First_Pos := Pos; end; else Pos := Pos + 1; end if; end loop; if First_Pos <= SQL'Last then Append (Buffer, SQL (First_Pos .. SQL'Last)); end if; return To_String (Buffer); end Expand; function Compare_On_Name (Left, Right : in Parameter) return Boolean is begin return Left.Name = Right.Name; end Compare_On_Name; -- ------------------------------ -- Add the parameter in the list. -- ------------------------------ procedure Add_Parameter (Params : in out List; Param : in Parameter) is Pos : Parameter_Vectors.Extended_Index; begin if Param.Position = 0 then Pos := Params.Params.Find_Index (Param); if Pos /= Parameter_Vectors.No_Index then Params.Params.Replace_Element (Index => Pos, New_Item => Param); else Params.Params.Append (Param); end if; elsif Param.Position = Natural (Length (Params.Params)) + 1 then Params.Params.Append (Param); else Params.Params.Replace_Element (Index => Param.Position, New_Item => Param); end if; end Add_Parameter; -- ------------------------------ -- Return the number of parameters in the list. -- ------------------------------ function Length (Params : in List) return Natural is begin return Natural (Length (Params.Params)); end Length; -- ------------------------------ -- Clear the list of parameters. -- ------------------------------ procedure Clear (Params : in out List) is begin Parameter_Vectors.Clear (Params.Params); end Clear; -- ------------------------------ -- Set the parameters from another parameter list. -- ------------------------------ procedure Set_Parameters (Params : in out List; From : in Abstract_List'Class) is L : constant List'Class := List'Class (From); begin Params.Params := L.Params; end Set_Parameters; -- ------------------------------ -- Return the parameter at the given position -- ------------------------------ function Element (Params : in List; Position : in Natural) return Parameter is begin return Element (Params.Params, Position); end Element; -- ------------------------------ -- Execute the <b>Process</b> procedure with the given parameter as argument. -- ------------------------------ procedure Query_Element (Params : in List; Position : in Natural; Process : not null access procedure (Element : in Parameter)) is begin Query_Element (Params.Params, Position, Process); end Query_Element; end ADO.Parameters;
pdaxrom/Kino2
Ada
8,503
adb
------------------------------------------------------------------------------ -- -- -- GNAT ncurses Binding Samples -- -- -- -- Sample -- -- -- -- B O D Y -- -- -- ------------------------------------------------------------------------------ -- Copyright (c) 1998 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- -- "Software"), to deal in the Software without restriction, including -- -- without limitation the rights to use, copy, modify, merge, publish, -- -- distribute, distribute with modifications, sublicense, and/or sell -- -- copies of the Software, and to permit persons to whom the Software is -- -- furnished to do so, subject to the following conditions: -- -- -- -- The above copyright notice and this permission notice shall be included -- -- in all copies or substantial portions of the Software. -- -- -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- -- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- -- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -- -- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- -- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- -- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR -- -- THE USE OR OTHER DEALINGS IN THE SOFTWARE. -- -- -- -- Except as contained in this notice, the name(s) of the above copyright -- -- holders shall not be used in advertising or otherwise to promote the -- -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control -- $Revision: 1.13 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Text_IO; with Ada.Exceptions; use Ada.Exceptions; with Terminal_Interface.Curses; use Terminal_Interface.Curses; with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels; with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus; with Terminal_Interface.Curses.Menus.Menu_User_Data; with Terminal_Interface.Curses.Menus.Item_User_Data; with Sample.Manifest; use Sample.Manifest; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Header_Handler; use Sample.Header_Handler; with Sample.Explanation; use Sample.Explanation; with Sample.Menu_Demo.Handler; with Sample.Curses_Demo; with Sample.Form_Demo; with Sample.Menu_Demo; with Sample.Text_IO_Demo; with GNAT.OS_Lib; package body Sample is type User_Data is record Data : Integer; end record; type User_Access is access User_Data; package Ud is new Terminal_Interface.Curses.Menus.Menu_User_Data (User_Data, User_Access); package Id is new Terminal_Interface.Curses.Menus.Item_User_Data (User_Data, User_Access); procedure Whow is procedure Main_Menu; procedure Main_Menu is function My_Driver (M : Menu; K : Key_Code; Pan : Panel) return Boolean; package Mh is new Sample.Menu_Demo.Handler (My_Driver); I : Item_Array_Access := new Item_Array' (New_Item ("Curses Core Demo"), New_Item ("Menu Demo"), New_Item ("Form Demo"), New_Item ("Text IO Demo"), Null_Item); M : Menu := New_Menu (I); D1, D2 : User_Access; I1, I2 : User_Access; function My_Driver (M : Menu; K : Key_Code; Pan : Panel) return Boolean is Idx : constant Positive := Get_Index (Current (M)); begin if K in User_Key_Code'Range then if K = QUIT then return True; elsif K = SELECT_ITEM then if Idx in 1 .. 4 then Hide (Pan); Update_Panels; end if; case Idx is when 1 => Sample.Curses_Demo.Demo; when 2 => Sample.Menu_Demo.Demo; when 3 => Sample.Form_Demo.Demo; when 4 => Sample.Text_IO_Demo.Demo; when others => null; end case; if Idx in 1 .. 4 then Top (Pan); Show (Pan); Update_Panels; Update_Screen; end if; end if; end if; return False; end My_Driver; begin if (1 + Item_Count (M)) /= I'Length then raise Constraint_Error; end if; D1 := new User_Data'(Data => 4711); Ud.Set_User_Data (M, D1); I1 := new User_Data'(Data => 1174); Id.Set_User_Data (I (1), I1); Set_Spacing (Men => M, Row => 2); Default_Labels; Notepad ("MAINPAD"); Mh.Drive_Me (M, " Demo "); Ud.Get_User_Data (M, D2); pragma Assert (D1 = D2); pragma Assert (D1.Data = D2.Data); Id.Get_User_Data (I (1), I2); pragma Assert (I1 = I2); pragma Assert (I1.Data = I2.Data); Delete (M); Free (I, True); end Main_Menu; begin Initialize (PC_Style_With_Index); Init_Header_Handler; Init_Screen; if Has_Colors then Start_Color; Init_Pair (Pair => Default_Colors, Fore => Black, Back => White); Init_Pair (Pair => Menu_Back_Color, Fore => Black, Back => Cyan); Init_Pair (Pair => Menu_Fore_Color, Fore => Red, Back => Cyan); Init_Pair (Pair => Menu_Grey_Color, Fore => White, Back => Cyan); Init_Pair (Pair => Notepad_Color, Fore => Black, Back => Yellow); Init_Pair (Pair => Help_Color, Fore => Blue, Back => Cyan); Init_Pair (Pair => Form_Back_Color, Fore => Black, Back => Cyan); Init_Pair (Pair => Form_Fore_Color, Fore => Red, Back => Cyan); Init_Pair (Pair => Header_Color, Fore => Black, Back => Green); Set_Background (Ch => (Color => Default_Colors, Attr => Normal_Video, Ch => ' ')); Set_Character_Attributes (Attr => Normal_Video, Color => Default_Colors); Erase; Set_Soft_Label_Key_Attributes (Color => Header_Color); -- This propagates the attributes to the label window Clear_Soft_Label_Keys; Restore_Soft_Label_Keys; end if; Init_Keyboard_Handler; Set_Echo_Mode (False); Set_Raw_Mode; Set_Meta_Mode; Set_KeyPad_Mode; -- Initialize the Function Key Environment -- We have some fixed key throughout this sample Main_Menu; End_Windows; exception when Event : others => Terminal_Interface.Curses.End_Windows; Text_IO.Put ("Exception: "); Text_IO.Put (Exception_Name (Event)); Text_IO.New_Line; GNAT.OS_Lib.OS_Exit (1); end Whow; end Sample;
vikasbidhuri1995/DW1000
Ada
2,574
adb
------------------------------------------------------------------------------- -- Copyright (c) 2016 Daniel King -- -- Permission is hereby granted, free of charge, to any person obtaining a -- copy of this software and associated documentation files (the "Software"), -- to deal in the Software without restriction, including without limitation -- the rights to use, copy, modify, merge, publish, distribute, sublicense, -- and/or sell copies of the Software, and to permit persons to whom the -- Software is furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- with DW1000.Register_Driver; package body DW1000.Generic_RO_Register_Driver is subtype Register_Byte_Array is DW1000.Types.Byte_Array (1 .. Register_Type'Size / 8); ------------------- -- Deserialize -- ------------------- procedure Deserialize (Source : in Register_Byte_Array; Target : out Register_Type) with Inline, Depends => (Target => Source), SPARK_Mode => On; procedure Deserialize (Source : in Register_Byte_Array; Target : out Register_Type) with SPARK_Mode => Off is -- Overlay a byte array onto the target register value. Target_Bytes : Register_Byte_Array with Import, Convention => Ada, Address => Target'Address; begin Target_Bytes := Source; end Deserialize; ------------ -- Read -- ------------ procedure Read (Reg : out Register_Type) is Reg_Bytes : Register_Byte_Array; begin DW1000.Register_Driver.Read_Register (Register_ID, Sub_Register, Reg_Bytes); Deserialize (Source => Reg_Bytes, Target => Reg); end Read; end DW1000.Generic_RO_Register_Driver;
tum-ei-rcs/StratoX
Ada
1,309
ads
with Generic_Sensor; with Units; with Units.Navigation; use Units.Navigation; with Interfaces; use Interfaces; with ublox8.Driver; package GPS with SPARK_Mode, Abstract_State => State is subtype GPS_Data_Type is GPS_Loacation_Type; subtype GPS_DateTime is ublox8.Driver.GPS_DateTime_Type; package GPS_Sensor is new Generic_Sensor(GPS_Data_Type); use GPS_Sensor; type GPS_Tag is new GPS_Sensor.Sensor_Tag with record Protocol_UBX : Boolean; end record; --overriding procedure initialize (Self : in out GPS_Tag); --with Global => (Output => GPS_Sensor.Sensor_State); --overriding procedure read_Measurement(Self : in out GPS_Tag); --with Global => (In_Out => GPS_Sensor.Sensor_State); function get_Position(Self : GPS_Tag) return GPS_Data_Type; function get_GPS_Fix(Self : GPS_Tag) return GPS_Fix_Type; function get_Num_Sats(Self : GPS_Tag) return Unsigned_8; function get_Pos_Accuracy(Self : GPS_Tag) return Units.Length_Type; function get_Speed(Self : GPS_Tag) return Units.Linear_Velocity_Type; function get_Time(Self : GPS_Tag) return GPS_DateTime; -- function get_Angular_Velocity (Self : GPS_Tag) function Image (tm : GPS_DateTime) return String with Post => Image'Result'Length <= 60; Sensor : GPS_Tag; end GPS;
zhmu/ananas
Ada
3,371
ads
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- System.Atomic_Operations.Test_And_Set -- -- -- -- S p e c -- -- -- -- Copyright (C) 2019-2022, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- -- apply solely to the contents of the part following the private keyword. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package System.Atomic_Operations.Test_And_Set with Pure is type Test_And_Set_Flag is mod 2 ** 8 with Atomic, Default_Value => 0, Size => 8; function Atomic_Test_And_Set (Item : aliased in out Test_And_Set_Flag) return Boolean with Convention => Intrinsic; procedure Atomic_Clear (Item : aliased in out Test_And_Set_Flag) with Convention => Intrinsic; function Is_Lock_Free (Item : aliased Test_And_Set_Flag) return Boolean with Convention => Intrinsic; private pragma Inline_Always (Atomic_Test_And_Set); pragma Inline_Always (Atomic_Clear); pragma Inline_Always (Is_Lock_Free); end System.Atomic_Operations.Test_And_Set;
AdaCore/Ada_Drivers_Library
Ada
58,398
ads
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2015, AdaCore -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of STMicroelectronics nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- -- -- -- This file is based on: -- -- -- -- @file stm32f4xx_hal_tim.h -- -- @author MCD Application Team -- -- @version V1.1.0 -- -- @date 19-June-2014 -- -- @brief Header file of timers HAL module. -- -- -- -- COPYRIGHT(c) 2014 STMicroelectronics -- ------------------------------------------------------------------------------ -- This file provides definitions for the timers on the STM32F4 (ARM Cortex -- M4F) microcontrollers from ST Microelectronics. pragma Restrictions (No_Elaboration_Code); with System; use System; with STM32_SVD; package STM32.Timers is type Timer is limited private; procedure Enable (This : in out Timer) with Post => Enabled (This); procedure Disable (This : in out Timer) with Post => (if No_Outputs_Enabled (This) then not Enabled (This)); function Enabled (This : Timer) return Boolean; -- The Configure routines are overloaded for the sake of -- additional timer-class specific parameters. procedure Configure (This : in out Timer; Prescaler : UInt16; Period : UInt32) with Pre => (if Period > UInt32 (UInt16'Last) then Has_32bit_Counter (This)), Post => Current_Prescaler (This) = Prescaler and Current_Autoreload (This) = Period; procedure Set_Counter (This : in out Timer; Value : UInt16) with Post => Current_Counter (This) = UInt32 (Value); procedure Set_Counter (This : in out Timer; Value : UInt32) with Pre => Has_32bit_Counter (This), Post => Current_Counter (This) = Value; function Current_Counter (This : Timer) return UInt32; -- For those timers that actually have a 32-bit counter this function will -- return the full word value. For the other timers, the upper half-word of -- the result will be all zeros so in effect the result will be a half-word -- value. procedure Set_Autoreload (This : in out Timer; Value : UInt32) with Pre => (if Value > UInt32 (UInt16'Last) then Has_32bit_Counter (This)), Post => Current_Autoreload (This) = Value; function Current_Autoreload (This : Timer) return UInt32; -- Returns the value of the timer's Auto Reload Register (ARR) type Timer_Clock_Divisor is (Div1, Div2, Div4); procedure Set_Clock_Division (This : in out Timer; Value : Timer_Clock_Divisor) with Pre => not Basic_Timer (This), Post => Current_Clock_Division (This) = Value; function Current_Clock_Division (This : Timer) return Timer_Clock_Divisor; type Timer_Counter_Alignment_Mode is (Up, Down, Center_Aligned1, Center_Aligned2, Center_Aligned3); -- We combine the up-down direction and the center-aligned mode selection -- into a single type because the two are interdependent and we don't want -- the user to have to remember to set the direction when not using one -- of the center-aligned choices. The discontiguous binary values used to -- represent the enumerals reflect the combination of the adjacent fields -- within the timer representation. for Timer_Counter_Alignment_Mode use (Up => 2#000#, Down => 2#001#, Center_Aligned1 => 2#010#, Center_Aligned2 => 2#100#, Center_Aligned3 => 2#110#); procedure Set_Counter_Mode (This : in out Timer; Value : Timer_Counter_Alignment_Mode) with Post => Current_Counter_Mode (This) = Value; function Current_Counter_Mode (This : Timer) return Timer_Counter_Alignment_Mode; -- Note that the basic timers only count up. procedure Configure (This : in out Timer; Prescaler : UInt16; Period : UInt32; Clock_Divisor : Timer_Clock_Divisor; Counter_Mode : Timer_Counter_Alignment_Mode) with Pre => not Basic_Timer (This) and (if Period > UInt32 (UInt16'Last) then Has_32bit_Counter (This)), Post => Current_Prescaler (This) = Prescaler and Current_Clock_Division (This) = Clock_Divisor and Current_Counter_Mode (This) = Counter_Mode and Current_Autoreload (This) = Period; type Timer_Prescaler_Reload_Mode is (Update, Immediate); procedure Configure_Prescaler (This : in out Timer; Prescaler : UInt16; Reload_Mode : Timer_Prescaler_Reload_Mode) with Post => Current_Prescaler (This) = Prescaler; function Current_Prescaler (This : Timer) return UInt16; procedure Set_UpdateDisable (This : in out Timer; To : Boolean); type Timer_Update_Source is (Global, Regular); procedure Set_UpdateRequest (This : in out Timer; Source : Timer_Update_Source); procedure Set_Autoreload_Preload (This : in out Timer; To : Boolean); type Timer_One_Pulse_Mode is (Repetitive, Single); procedure Select_One_Pulse_Mode (This : in out Timer; Mode : Timer_One_Pulse_Mode) with Post => (if Mode = Single then not Enabled (This)); ---------------------------------------------------------------------------- -- Interrupts, DMA, Flags Management -------------------------------------- ---------------------------------------------------------------------------- type Timer_Interrupt is (Timer_Update_Interrupt, Timer_CC1_Interrupt, Timer_CC2_Interrupt, Timer_CC3_Interrupt, Timer_CC4_Interrupt, Timer_COM_Interrupt, Timer_Trigger_Interrupt, Timer_Break_Interrupt); for Timer_Interrupt use (Timer_Update_Interrupt => 2#00000001#, Timer_CC1_Interrupt => 2#00000010#, Timer_CC2_Interrupt => 2#00000100#, Timer_CC3_Interrupt => 2#00001000#, Timer_CC4_Interrupt => 2#00010000#, Timer_COM_Interrupt => 2#00100000#, Timer_Trigger_Interrupt => 2#01000000#, Timer_Break_Interrupt => 2#10000000#); procedure Enable_Interrupt (This : in out Timer; Source : Timer_Interrupt) with Pre => (if Basic_Timer (This) then Source = Timer_Update_Interrupt) and (if Source in Timer_COM_Interrupt | Timer_Break_Interrupt then Advanced_Timer (This)), Post => Interrupt_Enabled (This, Source); type Timer_Interrupt_List is array (Positive range <>) of Timer_Interrupt; procedure Enable_Interrupt (This : in out Timer; Sources : Timer_Interrupt_List) with Pre => (for all Source of Sources => (if Basic_Timer (This) then Source = Timer_Update_Interrupt) and (if Source in Timer_COM_Interrupt | Timer_Break_Interrupt then Advanced_Timer (This))), Post => (for all Source of Sources => Interrupt_Enabled (This, Source)); procedure Disable_Interrupt (This : in out Timer; Source : Timer_Interrupt) with Pre => (if Basic_Timer (This) then Source = Timer_Update_Interrupt) and (if Source in Timer_COM_Interrupt | Timer_Break_Interrupt then Advanced_Timer (This)), Post => not Interrupt_Enabled (This, Source); procedure Clear_Pending_Interrupt (This : in out Timer; Source : Timer_Interrupt) with Pre => (if Basic_Timer (This) then Source = Timer_Update_Interrupt) and (if Source in Timer_COM_Interrupt | Timer_Break_Interrupt then Advanced_Timer (This)); function Interrupt_Enabled (This : Timer; Source : Timer_Interrupt) return Boolean with Pre => (if Basic_Timer (This) then Source = Timer_Update_Interrupt) and (if Source in Timer_COM_Interrupt | Timer_Break_Interrupt then Advanced_Timer (This)); type Timer_Event_Source is (Event_Source_Update, Event_Source_CC1, Event_Source_CC2, Event_Source_CC3, Event_Source_CC4, Event_Source_COM, Event_Source_Trigger, Event_Source_Break); for Timer_Event_Source use (Event_Source_Update => 16#0001#, Event_Source_CC1 => 16#0002#, Event_Source_CC2 => 16#0004#, Event_Source_CC3 => 16#0008#, Event_Source_CC4 => 16#0010#, Event_Source_COM => 16#0020#, Event_Source_Trigger => 16#0040#, Event_Source_Break => 16#0080#); -- TODO: consider alternative to bit-masks procedure Generate_Event (This : in out Timer; Source : Timer_Event_Source) with Pre => (if Basic_Timer (This) then Source = Event_Source_Update) and (if Source in Event_Source_COM | Event_Source_Break then Advanced_Timer (This)); type Timer_Status_Flag is (Timer_Update_Indicated, Timer_CC1_Indicated, Timer_CC2_Indicated, Timer_CC3_Indicated, Timer_CC4_Indicated, Timer_COM_Indicated, Timer_Trigger_Indicated, Timer_Break_Indicated, Timer_CC1OF_Indicated, Timer_CC2OF_Indicated, Timer_CC3OF_Indicated, Timer_CC4OF_Indicated); for Timer_Status_Flag use (Timer_Update_Indicated => 2#000000000001#, Timer_CC1_Indicated => 2#000000000010#, Timer_CC2_Indicated => 2#000000000100#, Timer_CC3_Indicated => 2#000000001000#, Timer_CC4_Indicated => 2#000000010000#, Timer_COM_Indicated => 2#000000100000#, Timer_Trigger_Indicated => 2#000001000000#, Timer_Break_Indicated => 2#000010000000#, Timer_CC1OF_Indicated => 2#000100000000#, Timer_CC2OF_Indicated => 2#001000000000#, Timer_CC3OF_Indicated => 2#010000000000#, Timer_CC4OF_Indicated => 2#100000000000#); function Status (This : Timer; Flag : Timer_Status_Flag) return Boolean with Pre => (if Basic_Timer (This) then Flag = Timer_Update_Indicated) and (if Flag in Timer_COM_Indicated | Timer_Break_Indicated then Advanced_Timer (This)); procedure Clear_Status (This : in out Timer; Flag : Timer_Status_Flag) with Pre => (if Basic_Timer (This) then Flag = Timer_Update_Indicated) and (if Flag in Timer_COM_Indicated | Timer_Break_Indicated then Advanced_Timer (This)), Post => not Status (This, Flag); type Timer_DMA_Source is (Timer_DMA_Update, Timer_DMA_CC1, Timer_DMA_CC2, Timer_DMA_CC3, Timer_DMA_CC4, Timer_DMA_COM, Timer_DMA_Trigger); for Timer_DMA_Source use (Timer_DMA_Update => 2#00000001_00000000#, Timer_DMA_CC1 => 2#00000010_00000000#, Timer_DMA_CC2 => 2#00000100_00000000#, Timer_DMA_CC3 => 2#00001000_00000000#, Timer_DMA_CC4 => 2#00010000_00000000#, Timer_DMA_COM => 2#00100000_00000000#, Timer_DMA_Trigger => 2#01000000_00000000#); -- TODO: consider using a packed array of booleans in the SR representation -- instead of bit-patterns, thereby obviating this rep clause procedure Enable_DMA_Source (This : in out Timer; Source : Timer_DMA_Source) with Pre => ((if Basic_Timer (This) then Source = Timer_DMA_Update) and (if Source in Timer_DMA_COM | Timer_DMA_Trigger then Advanced_Timer (This))) or else DMA_Supported (This), Post => DMA_Source_Enabled (This, Source); procedure Disable_DMA_Source (This : in out Timer; Source : Timer_DMA_Source) with Pre => ((if Basic_Timer (This) then Source = Timer_DMA_Update) and (if Source in Timer_DMA_COM | Timer_DMA_Trigger then Advanced_Timer (This))) or else DMA_Supported (This), Post => not DMA_Source_Enabled (This, Source); function DMA_Source_Enabled (This : Timer; Source : Timer_DMA_Source) return Boolean with Pre => ((if Basic_Timer (This) then Source = Timer_DMA_Update) and (if Source in Timer_DMA_COM | Timer_DMA_Trigger then Advanced_Timer (This))) or else DMA_Supported (This); type Timer_DMA_Burst_Length is (DMA_Burst_Length_1, DMA_Burst_Length_2, DMA_Burst_Length_3, DMA_Burst_Length_4, DMA_Burst_Length_5, DMA_Burst_Length_6, DMA_Burst_Length_7, DMA_Burst_Length_8, DMA_Burst_Length_9, DMA_Burst_Length_10, DMA_Burst_Length_11, DMA_Burst_Length_12, DMA_Burst_Length_13, DMA_Burst_Length_14, DMA_Burst_Length_15, DMA_Burst_Length_16, DMA_Burst_Length_17, DMA_Burst_Length_18); type Timer_DMA_Base_Address is (DMA_Base_CR1, DMA_Base_CR2, DMA_Base_SMCR, DMA_Base_DIER, DMA_Base_SR, DMA_Base_EGR, DMA_Base_CCMR1, DMA_Base_CCMR2, DMA_Base_CCER, DMA_Base_CNT, DMA_Base_PSC, DMA_Base_ARR, DMA_Base_RCR, DMA_Base_CCR1, DMA_Base_CCR2, DMA_Base_CCR3, DMA_Base_CCR4, DMA_Base_BDTR, DMA_Base_DCR, DMA_Base_OR); procedure Configure_DMA (This : in out Timer; Base_Address : Timer_DMA_Base_Address; Burst_Length : Timer_DMA_Burst_Length); procedure Enable_Capture_Compare_DMA (This : in out Timer); procedure Disable_Capture_Compare_DMA (This : in out Timer); ---------------------------------------------------------------------------- -- Output Compare Management ---------------------------------------------- ---------------------------------------------------------------------------- type Timer_Channel is (Channel_1, Channel_2, Channel_3, Channel_4); procedure Enable_Channel (This : in out Timer; Channel : Timer_Channel) with Pre => not Basic_Timer (This), Post => Channel_Enabled (This, Channel); procedure Disable_Channel (This : in out Timer; Channel : Timer_Channel) with Pre => not Basic_Timer (This), Post => not Channel_Enabled (This, Channel); function Channel_Enabled (This : Timer; Channel : Timer_Channel) return Boolean; procedure Enable_Complementary_Channel (This : in out Timer; Channel : Timer_Channel) with Pre => Complementary_Outputs_Supported (This, Channel), Post => Complementary_Channel_Enabled (This, Channel); procedure Disable_Complementary_Channel (This : in out Timer; Channel : Timer_Channel) with Pre => Complementary_Outputs_Supported (This, Channel), Post => not Complementary_Channel_Enabled (This, Channel); function Complementary_Channel_Enabled (This : Timer; Channel : Timer_Channel) return Boolean with Pre => Complementary_Outputs_Supported (This, Channel); Timer_Channel_Access_Error : exception; -- Raised when accessing a given channel configuration with the wrong view: -- as an input when it is set to be an output, and vice versa type Timer_Output_Compare_And_PWM_Mode is (Frozen, Active, Inactive, Toggle, Force_Inactive, Force_Active, PWM1, PWM2); -- See RM pg 560 for the effects of these values type Timer_Capture_Compare_State is (Disable, Enable); type Timer_Output_Compare_Polarity is (High, Low); procedure Configure_Channel_Output (This : in out Timer; Channel : Timer_Channel; Mode : Timer_Output_Compare_And_PWM_Mode; State : Timer_Capture_Compare_State; Pulse : UInt32; Polarity : Timer_Output_Compare_Polarity) with Pre => (CC_Channel_Exists (This, Channel) and Specific_Channel_Output_Supported (This, Channel)) and (if not Has_32bit_CC_Values (This) then Pulse <= 16#FFFF#), Post => (if State = Enable then Channel_Enabled (This, Channel) else not Channel_Enabled (This, Channel)); procedure Set_Compare_Value (This : in out Timer; Channel : Timer_Channel; Word_Value : UInt32) with Pre => Has_32bit_CC_Values (This), Post => Current_Capture_Value (This, Channel) = Word_Value; procedure Set_Compare_Value (This : in out Timer; Channel : Timer_Channel; Value : UInt16) with Pre => CC_Channel_Exists (This, Channel), Post => Current_Capture_Value (This, Channel) = Value; type Timer_Capture_Compare_Modes is (Output, Direct_TI, Indirect_TI, TRC); function Current_Capture_Compare_Mode (This : Timer; Channel : Timer_Channel) return Timer_Capture_Compare_Modes; -- A convenience routine that sets the capture/compare selection to be that -- of a single channel output and assigns all the controls of that output, -- as an alternative to calling the individual routines. Does not raise the -- access error exception because it explicitly sets the mode to Output. procedure Set_Single_Output (This : in out Timer; Channel : Timer_Channel; Mode : Timer_Output_Compare_And_PWM_Mode; OC_Clear_Enabled : Boolean; Preload_Enabled : Boolean; Fast_Enabled : Boolean) with Pre => CC_Channel_Exists (This, Channel), Post => Current_Capture_Compare_Mode (This, Channel) = Output; procedure Set_Output_Compare_Mode (This : in out Timer; Channel : Timer_Channel; Mode : Timer_Output_Compare_And_PWM_Mode) with Pre => (not Basic_Timer (This)) and (if Current_Capture_Compare_Mode (This, Channel) /= Output then raise Timer_Channel_Access_Error); procedure Set_Output_Preload_Enable (This : in out Timer; Channel : Timer_Channel; Enabled : Boolean) with Pre => CC_Channel_Exists (This, Channel) and (if Current_Capture_Compare_Mode (This, Channel) /= Output then raise Timer_Channel_Access_Error); procedure Set_Output_Fast_Enable (This : in out Timer; Channel : Timer_Channel; Enabled : Boolean) with Pre => CC_Channel_Exists (This, Channel) and (if Current_Capture_Compare_Mode (This, Channel) /= Output then raise Timer_Channel_Access_Error); procedure Set_Clear_Control (This : in out Timer; Channel : Timer_Channel; Enabled : Boolean) with Pre => CC_Channel_Exists (This, Channel) and (if Current_Capture_Compare_Mode (This, Channel) /= Output then raise Timer_Channel_Access_Error); procedure Set_Output_Forced_Action (This : in out Timer; Channel : Timer_Channel; Active : Boolean) with Pre => CC_Channel_Exists (This, Channel) and (if Current_Capture_Compare_Mode (This, Channel) /= Output then raise Timer_Channel_Access_Error); procedure Set_Output_Polarity (This : in out Timer; Channel : Timer_Channel; Polarity : Timer_Output_Compare_Polarity) with Pre => not Basic_Timer (This); procedure Set_Output_Complementary_Polarity (This : in out Timer; Channel : Timer_Channel; Polarity : Timer_Output_Compare_Polarity) with Pre => Advanced_Timer (This); -- Indicates whether all outputs are disabled for all channels of the given -- timer. function No_Outputs_Enabled (This : Timer) return Boolean; ---------------------------------------------------------------------------- -- Input Capture Management ----------------------------------------------- ---------------------------------------------------------------------------- type Timer_Input_Capture_Filter is mod 16; type Timer_Input_Capture_Polarity is (Rising, Falling, Both_Edges); subtype Timer_Input_Capture_Selection is Timer_Capture_Compare_Modes range Direct_TI .. TRC; type Timer_Input_Capture_Prescaler is (Div1, -- Capture performed each time an edge is detected on input Div2, -- Capture performed once every 2 events Div4, -- Capture performed once every 4 events Div8); -- Capture performed once every 8 events procedure Configure_Channel_Input (This : in out Timer; Channel : Timer_Channel; Polarity : Timer_Input_Capture_Polarity; Selection : Timer_Input_Capture_Selection; Prescaler : Timer_Input_Capture_Prescaler; Filter : Timer_Input_Capture_Filter) with Pre => CC_Channel_Exists (This, Channel) and (if Filter > 7 then Advanced_Timer (This)), Post => Channel_Enabled (This, Channel) and Current_Capture_Compare_Mode (This, Channel) = Selection; procedure Configure_Channel_Input_PWM (This : in out Timer; Channel : Timer_Channel; Selection : Timer_Input_Capture_Selection; Polarity : Timer_Input_Capture_Polarity; Prescaler : Timer_Input_Capture_Prescaler; Filter : Timer_Input_Capture_Filter) with Pre => Has_At_Least_2_CC_Channels (This) and Channel in Channel_1 | Channel_2, Post => Channel_Enabled (This, Channel) and Current_Capture_Compare_Mode (This, Channel) = Selection and Current_Input_Prescaler (This, Channel) = Prescaler; procedure Set_Input_Prescaler (This : in out Timer; Channel : Timer_Channel; Value : Timer_Input_Capture_Prescaler) with Pre => not Basic_Timer (This) and Current_Capture_Compare_Mode (This, Channel) /= Output, Post => Current_Input_Prescaler (This, Channel) = Value; function Current_Input_Prescaler (This : Timer; Channel : Timer_Channel) return Timer_Input_Capture_Prescaler; function Current_Capture_Value (This : Timer; Channel : Timer_Channel) return UInt32; -- Reading the upper reserved area of the CCR register does no harm when -- the timer does not support 32-bit CC registers so we do not protect -- this function with a precondition. function Current_Capture_Value (This : Timer; Channel : Timer_Channel) return UInt16; ---------------------------------------------------------------------------- -- Advanced control timers ------------------------------------------------ ---------------------------------------------------------------------------- procedure Enable_Main_Output (This : in out Timer) with Pre => Advanced_Timer (This), Post => Main_Output_Enabled (This); procedure Disable_Main_Output (This : in out Timer) with Pre => Advanced_Timer (This), Post => (if No_Outputs_Enabled (This) then not Main_Output_Enabled (This)); function Main_Output_Enabled (This : Timer) return Boolean; procedure Configure (This : in out Timer; Prescaler : UInt16; Period : UInt32; Clock_Divisor : Timer_Clock_Divisor; Counter_Mode : Timer_Counter_Alignment_Mode; Repetitions : UInt8) with Pre => Advanced_Timer (This) and (if Period > UInt32 (UInt16'Last) then Has_32bit_Counter (This)), Post => Current_Prescaler (This) = Prescaler and Current_Autoreload (This) = Period; procedure Configure_Channel_Output (This : in out Timer; Channel : Timer_Channel; Mode : Timer_Output_Compare_And_PWM_Mode; State : Timer_Capture_Compare_State; Pulse : UInt32; Polarity : Timer_Output_Compare_Polarity; Idle_State : Timer_Capture_Compare_State; Complementary_Polarity : Timer_Output_Compare_Polarity; Complementary_Idle_State : Timer_Capture_Compare_State) with Pre => Advanced_Timer (This) and (if not Has_32bit_CC_Values (This) then Pulse <= 16#FFFF#), Post => (if State = Enable then Channel_Enabled (This, Channel) else not Channel_Enabled (This, Channel)); procedure Enable_CC_Preload_Control (This : in out Timer) with Pre => Advanced_Timer (This); procedure Disable_CC_Preload_Control (This : in out Timer) with Pre => Advanced_Timer (This); procedure Select_Commutation (This : in out Timer) with Pre => Advanced_Timer (This); procedure Deselect_Commutation (This : in out Timer) with Pre => Advanced_Timer (This); type Timer_Break_Polarity is (Low, High); type Timer_Lock_Level is (Off, Level_1, Level_2, Level_3); procedure Configure_BDTR (This : in out Timer; Automatic_Output_Enabled : Boolean; Break_Polarity : Timer_Break_Polarity; Break_Enabled : Boolean; Off_State_Selection_Run_Mode : Bit; Off_State_Selection_Idle_Mode : Bit; Lock_Configuration : Timer_Lock_Level; Deadtime_Generator : UInt8) with Pre => Advanced_Timer (This); ---------------------------------------------------------------------------- -- Synchronization Management --------------------------------------------- ---------------------------------------------------------------------------- type Timer_Trigger_Input_Source is (Internal_Trigger_0, -- ITR0 Internal_Trigger_1, -- ITR1 Internal_Trigger_2, -- ITR2 Internal_Trigger_3, -- ITR3 TI1_Edge_Detector, -- TI1F_ED Filtered_Timer_Input_1, -- TI1FP1 Filtered_Timer_Input_2, -- TI2FP2 External_Trigger_Input); -- ETRF procedure Select_Input_Trigger (This : in out Timer; Source : Timer_Trigger_Input_Source) with Pre => not Basic_Timer (This); type Timer_Trigger_Output_Source is (Reset, Enable, Update, OC1, OC1Ref, OC2Ref, OC3Ref, OC4Ref); procedure Select_Output_Trigger (This : in out Timer; Source : Timer_Trigger_Output_Source) with Pre => Trigger_Output_Selectable (This); -- any of Timer 1 .. 8 type Timer_Slave_Mode is (Disabled, -- counter counts up/down on TI1 edge Encoder_Mode_TI1, -- counter counts up/down on TI2 edge Encoder_Mode_TI2, -- counter counts up/down on both TI1 & TI2 edges Encoder_Mode_TI1_TI2, Reset, Gated, Trigger, External_1); procedure Select_Slave_Mode (This : in out Timer; Mode : Timer_Slave_Mode) with Pre => Slave_Mode_Supported (This); procedure Enable_Master_Slave_Mode (This : in out Timer) with Pre => Slave_Mode_Supported (This); procedure Disable_Master_Slave_Mode (This : in out Timer) with Pre => Slave_Mode_Supported (This); type Timer_External_Trigger_Polarity is (Inverted, Noninverted); type Timer_External_Trigger_Prescaler is (Off, Div2, Div4, Div8); type Timer_External_Trigger_Filter is mod 16; procedure Configure_External_Trigger (This : in out Timer; Polarity : Timer_External_Trigger_Polarity; Prescaler : Timer_External_Trigger_Prescaler; Filter : Timer_External_Trigger_Filter) with Pre => External_Trigger_Supported (This); ---------------------------------------------------------------------------- -- Clocks Management ------------------------------------------------------ ---------------------------------------------------------------------------- procedure Select_Internal_Clock (This : in out Timer) renames Disable_Master_Slave_Mode; subtype Timer_Internal_Trigger_Source is Timer_Trigger_Input_Source range Internal_Trigger_0 .. Internal_Trigger_3; procedure Configure_As_External_Clock (This : in out Timer; Source : Timer_Internal_Trigger_Source) with Pre => Clock_Management_Supported (This); subtype Timer_External_Clock_Source is Timer_Trigger_Input_Source range TI1_Edge_Detector .. Filtered_Timer_Input_2; procedure Configure_As_External_Clock (This : in out Timer; Source : Timer_External_Clock_Source; Polarity : Timer_Input_Capture_Polarity; Filter : Timer_Input_Capture_Filter) with Pre => not Basic_Timer (This); procedure Configure_External_Clock_Mode1 (This : in out Timer; Polarity : Timer_External_Trigger_Polarity; Prescaler : Timer_External_Trigger_Prescaler; Filter : Timer_External_Trigger_Filter) with Pre => External_Trigger_Supported (This); procedure Configure_External_Clock_Mode2 (This : in out Timer; Polarity : Timer_External_Trigger_Polarity; Prescaler : Timer_External_Trigger_Prescaler; Filter : Timer_External_Trigger_Filter) with Pre => External_Trigger_Supported (This); ---------------------------------------------------------------------------- -- Misc functions --------------------------------------------------------- ---------------------------------------------------------------------------- subtype Timer_Encoder_Mode is Timer_Slave_Mode range Encoder_Mode_TI1 .. Encoder_Mode_TI1_TI2; procedure Configure_Encoder_Interface (This : in out Timer; Mode : Timer_Encoder_Mode; IC1_Polarity : Timer_Input_Capture_Polarity; IC2_Polarity : Timer_Input_Capture_Polarity) with Pre => Has_At_Least_2_CC_Channels (This); procedure Enable_Hall_Sensor (This : in out Timer) with Pre => Hall_Sensor_Supported (This); procedure Disable_Hall_Sensor (This : in out Timer) with Pre => Hall_Sensor_Supported (This); type Timer_2_Remapping_Options is -- see RM pg 632 (TIM2_TIM8_TRGO, TIM2_ETH_PTP, TIM2_USBFS_SOF, TIM2_USBHS_SOF); procedure Configure_Timer_2_Remapping (This : in out Timer; Option : Timer_2_Remapping_Options) with Pre => This'Address = STM32_SVD.TIM2_Base; type Timer_5_Remapping_Options is -- see RM pg 633 (TIM5_GPIO, TIM5_LSI, TIM5_LSE, TIM5_RTC); procedure Configure_Timer_5_Remapping (This : in out Timer; Option : Timer_5_Remapping_Options) with Pre => This'Address = STM32_SVD.TIM5_Base; type Timer_11_Remapping_Options is (TIM11_GPIO, TIM11_HSE); for Timer_11_Remapping_Options use -- per RM page 676 (TIM11_GPIO => 0, TIM11_HSE => 2); procedure Configure_Timer_11_Remapping (This : in out Timer; Option : Timer_11_Remapping_Options) with Pre => This'Address = STM32_SVD.TIM11_Base; ---------------------------------------------------------------------------- -- Classifier functions --------------------------------------------------- ---------------------------------------------------------------------------- -- Timers 6 and 7 function Basic_Timer (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM6_Base or This'Address = STM32_SVD.TIM7_Base); -- Timers 1 and 8 function Advanced_Timer (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM8_Base); -- Timers 2 and 5 function Has_32bit_Counter (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM2_Base or -- The RM register map for timers 2 through 5, pg 634, indicates that -- only timer 2 and timer 5 actually have the upper half of the counter -- available, and that the others must keep it reserved. This would -- appear to contradict the text in the introduction to those timers, -- but section 18.2 indicates the restriction explicitly. This'Address = STM32_SVD.TIM5_Base); -- Timers 2 and 5 function Has_32bit_CC_Values (This : Timer) return Boolean renames Has_32bit_Counter; -- Timers 1 .. 8 function Trigger_Output_Selectable (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM3_Base or This'Address = STM32_SVD.TIM4_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM6_Base or This'Address = STM32_SVD.TIM7_Base or This'Address = STM32_SVD.TIM8_Base); -- Timers 1 .. 5, 8, 9, 12 function Has_At_Least_2_CC_Channels (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM3_Base or This'Address = STM32_SVD.TIM4_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM8_Base or This'Address = STM32_SVD.TIM9_Base or This'Address = STM32_SVD.TIM12_Base); -- Timers 1 .. 5, 8 function Hall_Sensor_Supported (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM3_Base or This'Address = STM32_SVD.TIM4_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM8_Base); -- Timers 1 .. 5, 8, 9, 12 function Clock_Management_Supported (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM3_Base or This'Address = STM32_SVD.TIM4_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM8_Base or This'Address = STM32_SVD.TIM9_Base or This'Address = STM32_SVD.TIM12_Base); -- Timers 1 .. 5, 8 function Has_At_Least_3_CC_Channels (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM3_Base or This'Address = STM32_SVD.TIM4_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM8_Base); -- Timers 1 .. 5, 8 function Has_At_Least_4_CC_Channels (This : Timer) return Boolean renames Has_At_Least_3_CC_Channels; -- Not all timers have four channels available for capture/compare function CC_Channel_Exists (This : Timer; Channel : Timer_Channel) return Boolean is ((if Channel = Channel_1 then not Basic_Timer (This)) or (if Channel = Channel_2 then Has_At_Least_2_CC_Channels (This)) or (if Channel = Channel_3 then Has_At_Least_3_CC_Channels (This)) or (if Channel = Channel_4 then Has_At_Least_4_CC_Channels (This))); -- Timers 1 .. 5, 8 function Input_XOR_Supported (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM3_Base or This'Address = STM32_SVD.TIM4_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM8_Base); -- Timers 1 .. 8 function DMA_Supported (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM3_Base or This'Address = STM32_SVD.TIM4_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM6_Base or This'Address = STM32_SVD.TIM7_Base or This'Address = STM32_SVD.TIM8_Base); -- Timers 1 .. 5, 8, 9, 12 function Slave_Mode_Supported (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM3_Base or This'Address = STM32_SVD.TIM4_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM8_Base or This'Address = STM32_SVD.TIM9_Base or This'Address = STM32_SVD.TIM12_Base); -- Timers 1 .. 5, 8 function External_Trigger_Supported (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM3_Base or This'Address = STM32_SVD.TIM4_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM8_Base); -- Timers 2, 5, 11 function Remapping_Capability_Supported (This : Timer) return Boolean is (This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM11_Base); -- Not all timers support output on all channels function Specific_Channel_Output_Supported (This : Timer; Channel : Timer_Channel) return Boolean is (This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM2_Base or This'Address = STM32_SVD.TIM3_Base or This'Address = STM32_SVD.TIM4_Base or This'Address = STM32_SVD.TIM5_Base or This'Address = STM32_SVD.TIM8_Base -- all the above can be with any of the four channels or (This'Address = STM32_SVD.TIM9_Base and Channel in Channel_1 | Channel_2) or (This'Address = STM32_SVD.TIM10_Base and Channel = Channel_1) or (This'Address = STM32_SVD.TIM11_Base and Channel = Channel_1) or (This'Address = STM32_SVD.TIM12_Base and Channel in Channel_1 | Channel_2) or (This'Address = STM32_SVD.TIM13_Base and Channel = Channel_1) or (This'Address = STM32_SVD.TIM14_Base and Channel = Channel_1)); -- Timers 1 and 8, channels 1 .. 3 function Complementary_Outputs_Supported (This : Timer; Channel : Timer_Channel) return Boolean is ((This'Address = STM32_SVD.TIM1_Base or This'Address = STM32_SVD.TIM8_Base) and Channel in Channel_1 | Channel_2 | Channel_3); private type TIMx_CR1 is record Reserved : UInt6; Clock_Division : Timer_Clock_Divisor; ARPE : Boolean; -- Auto-reload preload enable Mode_And_Dir : Timer_Counter_Alignment_Mode; One_Pulse_Mode : Timer_One_Pulse_Mode; Update_Request_Source : Boolean; Update_Disable : Boolean; Timer_Enabled : Boolean; end record with Volatile_Full_Access, Size => 32; for TIMx_CR1 use record Reserved at 0 range 10 .. 15; Clock_Division at 0 range 8 .. 9; ARPE at 0 range 7 .. 7; Mode_And_Dir at 0 range 4 .. 6; One_Pulse_Mode at 0 range 3 .. 3; Update_Request_Source at 0 range 2 .. 2; Update_Disable at 0 range 1 .. 1; Timer_Enabled at 0 range 0 .. 0; end record; ------------------------ representation for CR2 -------------------------- type TIMx_CR2 is record Reserved0 : UInt16; Reserved1 : Bit; Channel_4_Output_Idle_State : Timer_Capture_Compare_State; Channel_3_Complementary_Output_Idle_State : Timer_Capture_Compare_State; Channel_3_Output_Idle_State : Timer_Capture_Compare_State; Channel_2_Complementary_Output_Idle_State : Timer_Capture_Compare_State; Channel_2_Output_Idle_State : Timer_Capture_Compare_State; Channel_1_Complementary_Output_Idle_State : Timer_Capture_Compare_State; Channel_1_Output_Idle_State : Timer_Capture_Compare_State; TI1_Selection : Boolean; Master_Mode_Selection : Timer_Trigger_Output_Source; Capture_Compare_DMA_Selection : Boolean; Capture_Compare_Control_Update_Selection : Boolean; Reserved2 : Bit; Capture_Compare_Preloaded_Control : Boolean; end record with Volatile_Full_Access, Size => 32; for TIMx_CR2 use record Reserved0 at 0 range 16 .. 31; Reserved1 at 0 range 15 .. 15; Channel_4_Output_Idle_State at 0 range 14 .. 14; Channel_3_Complementary_Output_Idle_State at 0 range 13 .. 13; Channel_3_Output_Idle_State at 0 range 12 .. 12; Channel_2_Complementary_Output_Idle_State at 0 range 11 .. 11; Channel_2_Output_Idle_State at 0 range 10 .. 10; Channel_1_Complementary_Output_Idle_State at 0 range 9 .. 9; Channel_1_Output_Idle_State at 0 range 8 .. 8; TI1_Selection at 0 range 7 .. 7; Master_Mode_Selection at 0 range 4 .. 6; Capture_Compare_DMA_Selection at 0 range 3 .. 3; Capture_Compare_Control_Update_Selection at 0 range 2 .. 2; Reserved2 at 0 range 1 .. 1; Capture_Compare_Preloaded_Control at 0 range 0 .. 0; end record; ------------ representation for slave mode control register -------------- type TIMx_SMCR is record Reserved0 : UInt16; External_Trigger_Polarity : Timer_External_Trigger_Polarity; External_Clock_Enable : Boolean; External_Trigger_Prescaler : Timer_External_Trigger_Prescaler; External_Trigger_Filter : Timer_External_Trigger_Filter; Master_Slave_Mode : Boolean; Trigger_Selection : Timer_Trigger_Input_Source; Reserved1 : Bit; Slave_Mode_Selection : Timer_Slave_Mode; end record with Volatile_Full_Access, Size => 32; for TIMx_SMCR use record Reserved0 at 0 range 16 .. 31; External_Trigger_Polarity at 0 range 15 .. 15; External_Clock_Enable at 0 range 14 .. 14; External_Trigger_Prescaler at 0 range 12 .. 13; External_Trigger_Filter at 0 range 8 .. 11; Master_Slave_Mode at 0 range 7 .. 7; Trigger_Selection at 0 range 4 .. 6; Reserved1 at 0 range 3 .. 3; Slave_Mode_Selection at 0 range 0 .. 2; end record; ------------ representation for CCMR1 and CCMR2 -------------------------- -- Per the ST Reference Manual, there are two words (registers) -- allocated within a timer to describe the capture-compare input/output -- configurations for the four channels. These are CCMR1 and CCMR2. Both -- currently only use the lower half of the word, with the upper half -- reserved. -- Each description is either that of a single input or a single output -- for the given channel. Both kinds of description require eight -- bits, therefore there are two channel descriptions in each word. -- Although both the input and output descriptions are the same size in -- terms of bits (six bits each), they do not have the same logical fields. -- We use two distinct types to represent individual input and output -- descriptions. type Channel_Output_Descriptor is record OCxFast_Enable : Boolean; OCxPreload_Enable : Boolean; OCxMode : Timer_Output_Compare_And_PWM_Mode; OCxClear_Enable : Boolean; end record with Size => 6; for Channel_Output_Descriptor use record OCxFast_Enable at 0 range 0 .. 0; OCxPreload_Enable at 0 range 1 .. 1; OCxMode at 0 range 2 .. 4; OCxClear_Enable at 0 range 5 .. 5; end record; type Channel_Input_Descriptor is record ICxFilter : Timer_Input_Capture_Filter; ICxPrescaler : Timer_Input_Capture_Prescaler; end record with Size => 6; for Channel_Input_Descriptor use record ICxFilter at 0 range 2 .. 5; ICxPrescaler at 0 range 0 .. 1; end record; -- So any given eight-bit description uses six bits for the specific fields -- describing the input or output configuration. The other two bits are -- taken by a field selecting the kind of description, i.e., either an -- input or an output description. In the RM register definitions this -- is "CCxS" (where 'x' is a place-holder for a channel number). Although -- there is one kind of output, there are in fact three kinds of inputs. -- Thus any given channel description is an eight-bit quantity that -- both indicates the kind and contains another set of dependent fields -- representing that kind. The dependent fields are logically mutually -- exclusive, i.e., if the CCxS selection field indicates an input then -- the output fields are not present, and vice versa. This logical layout -- is naturally represented in Ada as a discriminated type, where the -- discriminant is the CCxS "Selection" indicator. -- Note that the discriminant default value "Output" matches the default -- value of the hardware register bits when the device is powered up. -- Therefore we don't strictly speaking need pragma Import on the -- declarations of Timer objects, but it won't hurt. type IO_Descriptor (CCxSelection : Timer_Capture_Compare_Modes := Output) is record case CCxSelection is when Direct_TI .. TRC => Capture : Channel_Input_Descriptor; when Output => Compare : Channel_Output_Descriptor; end case; end record with Size => 8; -- Per the RM, the input fields and the output fields are in the same -- locations in memory, that is, they overlay, coming after the common -- CCxS field. for IO_Descriptor use record CCxSelection at 0 range 0 .. 1; Capture at 0 range 2 .. 7; Compare at 0 range 2 .. 7; end record; -- Thus we have a means of describing any single channel's configuration -- as either an input or an output. But how to get to them? As mentioned -- above, there are four channels so there are four I/O descriptions, -- spread across the two words of CCMR1 and CCMR2 in the timer -- representation. Specifically, the descriptions for channels 1 and 2 are -- in CCMR1, and the descriptions for channels 3 and 4 are in CCMR2. Rather -- than determine which register to use by having a dedicated routine -- for each channel, we use an array of descriptions allocated across the -- memory for the two registers and compute the description to use within -- the array for that channel. -- -- The remaining difficulty is the reserved upper halves of each of the -- two registers in memory. We cannot simply allocate four components in -- our array because we must skip the reserved areas, but we don't have -- non-contiguous arrays in Ada (nor should we). As a result we must -- either declare two arrays, each with two descriptions, thus requiring -- additional types to specify the reserved areas, or we declare one -- array of eight descriptions and only access the four "real" ones. If we -- take the latter approach the other four descriptions would occupy the -- reserved areas and would never be accessed. As long as the reserved -- areas remain at their reset values (all zeroes) all should be well... -- except that we also have the requirement to access the memory for the -- two registers as either half-words or words, so any simplicity gained -- from declaring an array larger than required would be lost when -- processing it. Hence the following takes the first approach, not -- mapping anything to the reserved upper halves of the two words. subtype Lower_Half_Index is Integer range 1 .. 2; type TIMx_CCMRx_Lower_Half is array (Lower_Half_Index) of IO_Descriptor with Volatile_Components, Component_Size => 8, Size => 16; type TIMx_CCMRx is record Descriptors : TIMx_CCMRx_Lower_Half; Reserved : UInt16; end record with Volatile_Full_Access, Size => 32; for TIMx_CCMRx use record Descriptors at 0 range 0 .. 15; Reserved at 0 range 16 .. 31; end record; -- Then we can define the array of this final record type TIMx_CCMRx, -- taking the space of the two CCMR1 and CCMR2 register words in memory. subtype CCMRx_Index is Integer range 1 .. 2; type TIMx_CCMR_Pair is array (CCMRx_Index) of TIMx_CCMRx with Component_Size => 32, Size => 64; -- Is this better than using bit masks? There's certainly a good bit more -- required for the declarations of the data structure! But the access code -- is pretty small and we would argue that the compile-time checking, and -- the readability, imply greater robustness and maintainability. (That -- said, the existing C libraries are very stable and mature.) This part -- of the hardware is definitely complicated in itself, and overlaying the -- input and output descriptions in memory didn't help. Performance should -- be reasonable, although not as good as bit-masking would be. Nowadays -- that's not necessarily where the money is, so we go with this approach -- for now... procedure Write_Channel_Input_Description (This : in out Timer; Channel : Timer_Channel; Kind : Timer_Input_Capture_Selection; Description : Channel_Input_Descriptor) with Pre => not Channel_Enabled (This, Channel); ------------ representation for the CCER --------------------------------- -- The CCER register is composed of a logical grouping of four sets of -- bits, one per channel. The type Single_CCE describe these four bits. -- Channels 1 through 3 have all four bits, but channel 4 does not have -- the complementary state and polarity bits. We pretend that it does for -- the type declaration and then treat it accordingly in the accessing -- subprograms. type Single_CCE is record CCxE : Timer_Capture_Compare_State; CCxP : Bit; CCxNE : Timer_Capture_Compare_State; CCxNP : Bit; end record with Size => 4; for Single_CCE use record CCxE at 0 range 0 .. 0; CCxP at 0 range 1 .. 1; CCxNE at 0 range 2 .. 2; CCxNP at 0 range 3 .. 3; end record; type TIMx_CCER is array (Timer_Channel) of Single_CCE with Volatile_Full_Access, Component_Size => 4, Size => 16; -------- representation for CCR1 through CCR4 ---------------------------- -- Instead of declaring four individual record components, one per channel, -- each one a word in size, we just declare an array component representing -- all four values, indexed by the channel. Timers 2 and 5 actually use all -- 32 bits of each, the other timers only use the lower half. type Capture_Compare_Registers is array (Timer_Channel) of UInt32 with Volatile_Components, Component_Size => 32, Size => 128; ---------- representation for the Break and Dead Time Register - ---------- type TIMx_BDTR is record Reserved : UInt16; Main_Output_Enabled : Boolean; Automatic_Output_Enabled : Boolean; Break_Polarity : Timer_Break_Polarity; Break_Enable : Boolean; Off_State_Selection_Run_Mode : Bit; Off_State_Selection_Idle_Mode : Bit; Lock : Timer_Lock_Level; Deadtime_Generator : UInt8; end record with Volatile_Full_Access, Size => 32; for TIMx_BDTR use record Reserved at 0 range 16 .. 31; Main_Output_Enabled at 0 range 15 .. 15; Automatic_Output_Enabled at 0 range 14 .. 14; Break_Polarity at 0 range 13 .. 13; Break_Enable at 0 range 12 .. 12; Off_State_Selection_Run_Mode at 0 range 11 .. 11; Off_State_Selection_Idle_Mode at 0 range 10 .. 10; Lock at 0 range 8 .. 9; Deadtime_Generator at 0 range 0 .. 7; end record; ----------- representation for the DMA Control Register type ------------- type TIMx_DCR is record Reserved0 : UInt16; Reserved1 : UInt3; Burst_Length : Timer_DMA_Burst_Length; Reserved2 : UInt3; Base_Address : Timer_DMA_Base_Address; end record with Volatile_Full_Access, Size => 32; for TIMx_DCR use record Reserved0 at 0 range 16 .. 31; Reserved1 at 0 range 13 .. 15; Burst_Length at 0 range 8 .. 12; Reserved2 at 0 range 5 .. 7; Base_Address at 0 range 0 .. 4; end record; ------- representation for Timer 2, 5, and 11 remapping options ---------- type TIMx_OR is record Reserved0 : UInt16; Reserved1 : UInt4; ITR1_RMP : Timer_2_Remapping_Options; Reserved2 : UInt2; TI4_RMP : Timer_5_Remapping_Options; -- timer 5, pg 633 Reserved3 : UInt4; TI1_RMP : Timer_11_Remapping_Options; -- timer 11, pg 676 end record with Volatile_Full_Access, Size => 32; -- TODO: ensure the gaps are kept at reserved value in the routines' -- generated code for TIMx_OR use record Reserved0 at 0 range 16 .. 31; Reserved1 at 0 range 12 .. 15; ITR1_RMP at 0 range 10 .. 11; Reserved2 at 0 range 8 .. 9; TI4_RMP at 0 range 6 .. 7; Reserved3 at 0 range 2 .. 5; TI1_RMP at 0 range 0 .. 1; end record; ---------------- representation for the whole Timer type ----------------- type Timer is limited record CR1 : TIMx_CR1; CR2 : TIMx_CR2; SMCR : TIMx_SMCR; DIER : UInt32; SR : UInt32; EGR : UInt32; CCMR1_2 : TIMx_CCMR_Pair; CCER : TIMx_CCER; Reserved_CCER : UInt16; Counter : UInt32 with Atomic; -- a full word for timers 2 and 5 only Prescaler : UInt16; Reserved_Prescaler : UInt16; ARR : UInt32; RCR : UInt32; CCR1_4 : Capture_Compare_Registers; BDTR : TIMx_BDTR; DCR : TIMx_DCR; DMAR : UInt32; Options : TIMx_OR; end record with Volatile, Size => 21 * 32; for Timer use record CR1 at 16#00# range 0 .. 31; CR2 at 16#04# range 0 .. 31; SMCR at 16#08# range 0 .. 31; DIER at 16#0C# range 0 .. 31; SR at 16#10# range 0 .. 31; EGR at 16#14# range 0 .. 31; CCMR1_2 at 16#18# range 0 .. 63; CCER at 16#20# range 0 .. 15; Reserved_CCER at 16#20# range 16 .. 31; Counter at 16#24# range 0 .. 31; Prescaler at 16#28# range 0 .. 15; Reserved_Prescaler at 16#28# range 16 .. 31; ARR at 16#2C# range 0 .. 31; RCR at 16#30# range 0 .. 31; CCR1_4 at 16#34# range 0 .. 127; -- ie, 4 words BDTR at 16#44# range 0 .. 31; DCR at 16#48# range 0 .. 31; DMAR at 16#4C# range 0 .. 31; Options at 16#50# range 0 .. 31; end record; end STM32.Timers;
reznikmm/matreshka
Ada
4,664
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Visitors; with ODF.DOM.Chart_Grid_Elements; package Matreshka.ODF_Chart.Grid_Elements is type Chart_Grid_Element_Node is new Matreshka.ODF_Chart.Abstract_Chart_Element_Node and ODF.DOM.Chart_Grid_Elements.ODF_Chart_Grid with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Elements.Element_L2_Parameters) return Chart_Grid_Element_Node; overriding function Get_Local_Name (Self : not null access constant Chart_Grid_Element_Node) return League.Strings.Universal_String; overriding procedure Enter_Node (Self : not null access Chart_Grid_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Leave_Node (Self : not null access Chart_Grid_Element_Node; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); overriding procedure Visit_Node (Self : not null access Chart_Grid_Element_Node; Iterator : in out XML.DOM.Visitors.Abstract_Iterator'Class; Visitor : in out XML.DOM.Visitors.Abstract_Visitor'Class; Control : in out XML.DOM.Visitors.Traverse_Control); end Matreshka.ODF_Chart.Grid_Elements;
reznikmm/matreshka
Ada
5,163
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.UML.Read_Link_Actions.Collections is pragma Preelaborate; package UML_Read_Link_Action_Collections is new AMF.Generic_Collections (UML_Read_Link_Action, UML_Read_Link_Action_Access); type Set_Of_UML_Read_Link_Action is new UML_Read_Link_Action_Collections.Set with null record; Empty_Set_Of_UML_Read_Link_Action : constant Set_Of_UML_Read_Link_Action; type Ordered_Set_Of_UML_Read_Link_Action is new UML_Read_Link_Action_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Read_Link_Action : constant Ordered_Set_Of_UML_Read_Link_Action; type Bag_Of_UML_Read_Link_Action is new UML_Read_Link_Action_Collections.Bag with null record; Empty_Bag_Of_UML_Read_Link_Action : constant Bag_Of_UML_Read_Link_Action; type Sequence_Of_UML_Read_Link_Action is new UML_Read_Link_Action_Collections.Sequence with null record; Empty_Sequence_Of_UML_Read_Link_Action : constant Sequence_Of_UML_Read_Link_Action; private Empty_Set_Of_UML_Read_Link_Action : constant Set_Of_UML_Read_Link_Action := (UML_Read_Link_Action_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Read_Link_Action : constant Ordered_Set_Of_UML_Read_Link_Action := (UML_Read_Link_Action_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Read_Link_Action : constant Bag_Of_UML_Read_Link_Action := (UML_Read_Link_Action_Collections.Bag with null record); Empty_Sequence_Of_UML_Read_Link_Action : constant Sequence_Of_UML_Read_Link_Action := (UML_Read_Link_Action_Collections.Sequence with null record); end AMF.UML.Read_Link_Actions.Collections;
AdaCore/Ada_Drivers_Library
Ada
8,373
adb
------------------------------------------------------------------------------ -- -- -- Copyright (C) 2017-2018, AdaCore and other contributors -- -- -- -- See github.com/AdaCore/Ada_Drivers_Library/graphs/contributors -- -- for more information -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions are -- -- met: -- -- 1. Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- 2. Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in -- -- the documentation and/or other materials provided with the -- -- distribution. -- -- 3. Neither the name of the copyright holder nor the names of its -- -- contributors may be used to endorse or promote products derived -- -- from this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -- -- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -- -- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -- -- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ with FE310.Time; use FE310.Time; with FE310_SVD.OTP_Mem; use FE310_SVD.OTP_Mem; with FE310_SVD.PRIC; use FE310_SVD.PRIC; with FE310_SVD.SPI; use FE310_SVD.SPI; package body FE310 is Crystal_Frequency : constant := 16_000_000; HFROSC_Frequency : constant := 72_000_000; -- High frequency internal oscillator ------------------- -- CPU_Frequency -- ------------------- function CPU_Frequency return UInt32 is Freq : UInt32; begin if PRIC_Periph.PLLCFG.SEL = Internal then Freq := HFROSC_Frequency / (UInt32 (PRIC_Periph.HFROSCCFG.DIV) + 1); else if PRIC_Periph.PLLCFG.REFSEL = Crystal then Freq := Crystal_Frequency; else Freq := HFROSC_Frequency; end if; if PRIC_Periph.PLLCFG.BYPASS = False then Freq := Freq / (UInt32 (PRIC_Periph.PLLCFG.R) + 1) * (2 * (UInt32 (PRIC_Periph.PLLCFG.F) + 1)) / (2**(Natural (PRIC_Periph.PLLCFG.Q))); end if; if PRIC_Periph.PLLOUTDIV.DIV_BY_1 = False then Freq := Freq / (2 * (UInt32 (PRIC_Periph.PLLOUTDIV.DIV) + 1)); end if; end if; return Freq; end CPU_Frequency; ----------------------------------------- -- Load_Internal_Oscilator_Calibration -- ----------------------------------------- procedure Load_Internal_Oscilator_Calibration is begin PRIC_Periph.HFROSCCFG.TRIM := OTP_Mem_Periph.HFROSC_TRIM.VALUE - 1; end Load_Internal_Oscilator_Calibration; ---------------------------- -- Use_Crystal_Oscillator -- ---------------------------- procedure Use_Crystal_Oscillator (Divider : PLL_Output_Divider := 1) is begin -- Use internal oscillator during switch PRIC_Periph.HFROSCCFG.DIV := 4; -- Divide by 5, Freq = 14.4 MHz PRIC_Periph.HFROSCCFG.ENABLE := True; loop exit when PRIC_Periph.HFROSCCFG.READY; end loop; PRIC_Periph.PLLCFG.SEL := Internal; -- Start the crystal oscillator PRIC_Periph.HFXOSCCFG.ENABLE := True; loop exit when PRIC_Periph.HFXOSCCFG.READY; end loop; -- Configure the final divider if Divider = 1 then PRIC_Periph.PLLOUTDIV.DIV_BY_1 := True; else PRIC_Periph.PLLOUTDIV.DIV_BY_1 := False; PRIC_Periph.PLLOUTDIV.DIV := PLLOUTDIV_DIV_Field ((Divider / 2) - 1); end if; -- Switch to crystal oscillator PRIC_Periph.PLLCFG.REFSEL := Crystal; PRIC_Periph.PLLCFG.BYPASS := True; PRIC_Periph.PLLCFG.SEL := Pll; -- Disable internal oscillator PRIC_Periph.HFROSCCFG.ENABLE := False; end Use_Crystal_Oscillator; ----------------------------- -- Use_Internal_Oscillator -- ----------------------------- procedure Use_Internal_Oscillator (Divider : Internal_Oscillator_Divider := 5) is begin PRIC_Periph.HFROSCCFG.DIV := HFROSCCFG_DIV_Field (Divider - 1); PRIC_Periph.HFROSCCFG.ENABLE := True; loop exit when PRIC_Periph.HFROSCCFG.READY; end loop; PRIC_Periph.PLLCFG.SEL := Internal; -- Disable crystal oscillator and PLL PRIC_Periph.HFXOSCCFG.ENABLE := False; PRIC_Periph.PLLCFG.BYPASS := True; end Use_Internal_Oscillator; ------------ -- Use_PLL-- ------------ procedure Use_PLL (Reference : PLL_Reference; Internal_Osc_Div : Internal_Oscillator_Divider := 5; R_Div : PLL_R; F_Mul : PLL_F; Q_Div : PLL_Q; Output_Div : PLL_Output_Divider) is begin -- Use internal oscillator during switch PRIC_Periph.HFROSCCFG.DIV := HFROSCCFG_DIV_Field (Internal_Osc_Div - 1); PRIC_Periph.HFROSCCFG.ENABLE := True; loop exit when PRIC_Periph.HFROSCCFG.READY; end loop; PRIC_Periph.PLLCFG.SEL := Internal; if Reference = Crystal then -- Start the crystal oscillator PRIC_Periph.HFXOSCCFG.ENABLE := True; loop exit when PRIC_Periph.HFXOSCCFG.READY; end loop; else PRIC_Periph.HFXOSCCFG.ENABLE := False; end if; -- Configure the PLL PRIC_Periph.PLLCFG.REFSEL := PLLCFG_REFSEL_Field (Reference); PRIC_Periph.PLLCFG.R := PLLCFG_R_Field (R_Div - 1); PRIC_Periph.PLLCFG.F := PLLCFG_F_Field ((F_Mul / 2) - 1); PRIC_Periph.PLLCFG.Q := PLLCFG_Q_Field (PLL_Q'Enum_Rep (Q_Div)); -- Configure the final divider if Output_Div = 1 then PRIC_Periph.PLLOUTDIV.DIV_BY_1 := True; else PRIC_Periph.PLLOUTDIV.DIV_BY_1 := False; PRIC_Periph.PLLOUTDIV.DIV := PLLOUTDIV_DIV_Field ((Output_Div / 2) - 1); end if; -- Start the PLL PRIC_Periph.PLLCFG.BYPASS := False; Delay_Us (150); loop exit when PRIC_Periph.PLLCFG.LOCK; end loop; -- Switch to PLL PRIC_Periph.PLLCFG.SEL := Pll; -- Disable internal oscillator if the crystal reference is used if Reference = Crystal then PRIC_Periph.HFROSCCFG.ENABLE := False; end if; end Use_PLL; --------------------------------- -- Set_SPI_Flash_Clock_Divider -- --------------------------------- procedure Set_SPI_Flash_Clock_Divider (Divider : SPI_Clock_Divider) is begin QSPI0_Periph.SCKDIV.SCALE := (UInt12 (Divider) / 2) - 1; end Set_SPI_Flash_Clock_Divider; ----------------------------- -- SPI_Flash_Clock_Divider -- ----------------------------- function SPI_Flash_Clock_Divider return SPI_Clock_Divider is begin return 2 * (Integer (QSPI0_Periph.SCKDIV.SCALE) + 1); end SPI_Flash_Clock_Divider; end FE310;
zhmu/ananas
Ada
4,040
adb
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME COMPONENTS -- -- -- -- A D A . S T R I N G S . W I D E _ W I D E _ B O U N D E D -- -- -- -- B o d y -- -- -- -- Copyright (C) 1992-2022, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- -- or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- As a special exception under Section 7 of GPL version 3, you are granted -- -- additional permissions described in the GCC Runtime Library Exception, -- -- version 3.1, as published by the Free Software Foundation. -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- <http://www.gnu.org/licenses/>. -- -- -- -- GNAT was originally developed by the GNAT team at New York University. -- -- Extensive contributions were provided by Ada Core Technologies Inc. -- -- -- ------------------------------------------------------------------------------ package body Ada.Strings.Wide_Wide_Bounded is package body Generic_Bounded_Length is --------- -- "*" -- --------- function "*" (Left : Natural; Right : Wide_Wide_Character) return Bounded_Wide_Wide_String is begin return Times (Left, Right, Max_Length); end "*"; function "*" (Left : Natural; Right : Wide_Wide_String) return Bounded_Wide_Wide_String is begin return Times (Left, Right, Max_Length); end "*"; --------------- -- Replicate -- --------------- function Replicate (Count : Natural; Item : Wide_Wide_Character; Drop : Strings.Truncation := Strings.Error) return Bounded_Wide_Wide_String is begin return Super_Replicate (Count, Item, Drop, Max_Length); end Replicate; function Replicate (Count : Natural; Item : Wide_Wide_String; Drop : Strings.Truncation := Strings.Error) return Bounded_Wide_Wide_String is begin return Super_Replicate (Count, Item, Drop, Max_Length); end Replicate; --------------------------------- -- To_Bounded_Wide_Wide_String -- --------------------------------- function To_Bounded_Wide_Wide_String (Source : Wide_Wide_String; Drop : Strings.Truncation := Strings.Error) return Bounded_Wide_Wide_String is begin return To_Super_String (Source, Max_Length, Drop); end To_Bounded_Wide_Wide_String; end Generic_Bounded_Length; end Ada.Strings.Wide_Wide_Bounded;
reznikmm/matreshka
Ada
7,121
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.Internals.Tables.CMOF_Attributes; with AMF.Internals.Tables.CMOF_Element_Table; with AMF.Internals.Element_Collections; with AMF.Internals.Extents; with AMF.Internals.Helpers; with AMF.Internals.Tables.CMOF_Reflection; package body AMF.Internals.CMOF_Elements is use AMF.Internals.Tables.CMOF_Attributes; ------------ -- Extent -- ------------ overriding function Extent (Self : not null access constant CMOF_Element_Proxy) return AMF.Extents.Extent_Access is begin return AMF.Internals.Extents.Proxy (AMF.Internals.Tables.CMOF_Element_Table.Table (Self.Element).Extent); end Extent; --------- -- Get -- --------- overriding function Get (Self : not null access constant CMOF_Element_Proxy; Property : not null AMF.CMOF.Properties.CMOF_Property_Access) return League.Holders.Holder is begin return AMF.Internals.Tables.CMOF_Reflection.Get (Self.Element, CMOF_Element_Proxy'Class (Property.all).Element); end Get; -------------------- -- Get_Meta_Class -- -------------------- overriding function Get_Meta_Class (Self : not null access constant CMOF_Element_Proxy) return AMF.CMOF.Classes.CMOF_Class_Access is begin return AMF.CMOF.Classes.CMOF_Class_Access (AMF.Internals.Helpers.To_Element (AMF.Internals.Tables.CMOF_Reflection.Get_Meta_Class (Self.Element))); end Get_Meta_Class; ----------------------- -- Get_Owned_Comment -- ----------------------- overriding function Get_Owned_Comment (Self : not null access constant CMOF_Element_Proxy) return AMF.CMOF.Comments.Collections.Set_Of_CMOF_Comment is begin return AMF.CMOF.Comments.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (Internal_Get_Owned_Comment (Self.Element))); end Get_Owned_Comment; ----------------------- -- Get_Owned_Element -- ----------------------- overriding function Get_Owned_Element (Self : not null access constant CMOF_Element_Proxy) return AMF.CMOF.Elements.Collections.Set_Of_CMOF_Element is begin return AMF.CMOF.Elements.Collections.Wrap (AMF.Internals.Element_Collections.Wrap (Internal_Get_Owned_Element (Self.Element))); end Get_Owned_Element; --------------- -- Get_Owner -- --------------- overriding function Get_Owner (Self : not null access constant CMOF_Element_Proxy) return AMF.CMOF.Elements.CMOF_Element_Access is begin return AMF.CMOF.Elements.CMOF_Element_Access (AMF.Internals.Helpers.To_Element (Internal_Get_Owner (Self.Element))); end Get_Owner; ------------------- -- Must_Be_Owned -- ------------------- overriding function Must_Be_Owned (Self : not null access constant CMOF_Element_Proxy) return Boolean is pragma Unreferenced (Self); -- [UML241] 7.3.14 Element (from Kernel) -- -- The query mustBeOwned() indicates whether elements of this type must -- have an owner. Subclasses of Element that do not require an owner -- must override this operation. -- -- Element::mustBeOwned() : Boolean; -- mustBeOwned = true begin return True; end Must_Be_Owned; --------- -- Set -- --------- overriding procedure Set (Self : not null access CMOF_Element_Proxy; Property : not null AMF.CMOF.Properties.CMOF_Property_Access; Value : League.Holders.Holder) is begin AMF.Internals.Tables.CMOF_Reflection.Set (Self.Element, CMOF_Element_Proxy'Class (Property.all).Element, Value); end Set; end AMF.Internals.CMOF_Elements;
BrickBot/Bound-T-H8-300
Ada
3,494
ads
-- Flow.Computation.Show (decl) -- -- Textual output of computation models. -- -- A component of the Bound-T Worst-Case Execution Time Tool. -- ------------------------------------------------------------------------------- -- Copyright (c) 1999 .. 2015 Tidorum Ltd -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- 1. Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- 2. Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- -- This software is provided by the copyright holders and contributors "as is" and -- any express or implied warranties, including, but not limited to, the implied -- warranties of merchantability and fitness for a particular purpose are -- disclaimed. In no event shall the copyright owner or contributors be liable for -- any direct, indirect, incidental, special, exemplary, or consequential damages -- (including, but not limited to, procurement of substitute goods or services; -- loss of use, data, or profits; or business interruption) however caused and -- on any theory of liability, whether in contract, strict liability, or tort -- (including negligence or otherwise) arising in any way out of the use of this -- software, even if advised of the possibility of such damage. -- -- Other modules (files) of this software composition should contain their -- own copyright statements, which may have different copyright and usage -- conditions. The above conditions apply to this file. ------------------------------------------------------------------------------- -- -- $Revision: 1.4 $ -- $Date: 2015/10/24 19:36:48 $ -- -- $Log: flow-computation-show.ads,v $ -- Revision 1.4 2015/10/24 19:36:48 niklas -- Moved to free licence. -- -- Revision 1.3 2007-10-11 11:58:47 niklas -- Added Report_Unresolved_Flow, as in Flow.Show. -- -- Revision 1.2 2005/04/18 10:50:43 niklas -- Added Report_Unresolved_Data. -- -- Revision 1.1 2005/02/16 21:11:42 niklas -- BT-CH-0002. -- with Symbols; package Flow.Computation.Show is Feasible_Mark : constant array (Boolean) of Character := ( False => '-', True => '+'); -- -- A mark that can be used to show whether some part of a flow-graph -- is feasible or infeasible under a computation model. -- -- A '+' means feasible, a '-' means infeasible. procedure Show (Model : in Model_T); -- -- Displays the computation Model, taking the current Col position -- as the left margin for each line (some lines may be more indented). procedure Show (Model : in Model_Ref); -- -- Same as Show above, but for a Model_Ref. procedure Report_Unresolved_Data ( Model : in Model_Ref; Source : in Symbols.Symbol_Table_T); -- -- Reports any remaining (unresolved) dynamic data references in -- the computation Model, as Warnings. procedure Report_Unresolved_Flow ( Model : in Model_Ref; Source : in Symbols.Symbol_Table_T); -- -- Reports the state of the remaining feasible dynamic edges. -- An Unresolved feasible edge is reported as an Error. -- A Stable or Growing feasible edge is reported as a Note. end Flow.Computation.Show;
AaronC98/PlaneSystem
Ada
3,320
ads
------------------------------------------------------------------------------ -- Ada Web Server -- -- -- -- Copyright (C) 2005-2012, 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/>. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ------------------------------------------------------------------------------ -- Link two dispatchers together with AWS.Dispatchers; with AWS.Response; with AWS.Status; package AWS.Services.Dispatchers.Linker is type Handler is new AWS.Dispatchers.Handler with private; procedure Register (Dispatcher : in out Handler; First, Second : AWS.Dispatchers.Handler'Class); -- Set the dispatcher first and second handler. The First handler will be -- looked for before the second. private overriding procedure Initialize (Dispatcher : in out Handler); overriding procedure Finalize (Dispatcher : in out Handler); overriding function Dispatch (Dispatcher : Handler; Request : Status.Data) return Response.Data; -- Dispatch to the first dispatcher, if the resources is not found (status -- code 404 returned) there try on the second one. overriding function Clone (Dispatcher : Handler) return Handler; -- Returns a deep copy of the dispatcher type Handler is new AWS.Dispatchers.Handler with record First, Second : AWS.Dispatchers.Handler_Class_Access; end record; end AWS.Services.Dispatchers.Linker;
reznikmm/matreshka
Ada
4,081
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Text_Separation_Character_Attributes; package Matreshka.ODF_Text.Separation_Character_Attributes is type Text_Separation_Character_Attribute_Node is new Matreshka.ODF_Text.Abstract_Text_Attribute_Node and ODF.DOM.Text_Separation_Character_Attributes.ODF_Text_Separation_Character_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Text_Separation_Character_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Text_Separation_Character_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Text.Separation_Character_Attributes;
reznikmm/matreshka
Ada
4,051
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Table_Range_Usable_As_Attributes; package Matreshka.ODF_Table.Range_Usable_As_Attributes is type Table_Range_Usable_As_Attribute_Node is new Matreshka.ODF_Table.Abstract_Table_Attribute_Node and ODF.DOM.Table_Range_Usable_As_Attributes.ODF_Table_Range_Usable_As_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Table_Range_Usable_As_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Table_Range_Usable_As_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Table.Range_Usable_As_Attributes;
AdaCore/Ada_Drivers_Library
Ada
8,834
adb
------------------------------------------------------------------------------ -- -- -- 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. -- -- -- ------------------------------------------------------------------------------ with Bitmap_Color_Conversion; use Bitmap_Color_Conversion; package body Bitmapped_Drawing is --------------- -- Draw_Char -- --------------- procedure Draw_Char (Buffer : in out Bitmap_Buffer'Class; Start : Point; Char : Character; Font : BMP_Font; Foreground : UInt32; Background : UInt32) is begin for H in 0 .. Char_Height (Font) - 1 loop for W in 0 .. Char_Width (Font) - 1 loop if (Data (Font, Char, H) and Mask (Font, W)) /= 0 then Buffer.Set_Source (Word_To_Bitmap_Color (Buffer.Color_Mode, Foreground)); Buffer.Set_Pixel ((Start.X + W, Start.Y + H)); else Buffer.Set_Source (Word_To_Bitmap_Color (Buffer.Color_Mode, Background)); Buffer.Set_Pixel ((Start.X + W, Start.Y + H)); end if; end loop; end loop; end Draw_Char; ----------------- -- Draw_String -- ----------------- procedure Draw_String (Buffer : in out Bitmap_Buffer'Class; Start : Point; Msg : String; Font : BMP_Font; Foreground : Bitmap_Color; Background : Bitmap_Color) is Count : Natural := 0; FG : constant UInt32 := Bitmap_Color_To_Word (Buffer.Color_Mode, Foreground); BG : constant UInt32 := Bitmap_Color_To_Word (Buffer.Color_Mode, Background); begin for C of Msg loop exit when Start.X + Count * Char_Width (Font) > Buffer.Width; Draw_Char (Buffer, (Start.X + Count * Char_Width (Font), Start.Y), C, Font, FG, BG); Count := Count + 1; end loop; end Draw_String; ----------------- -- Draw_String -- ----------------- procedure Draw_String (Buffer : in out Bitmap_Buffer'Class; Start : Point; Msg : String; Font : Hershey_Font; Height : Natural; Bold : Boolean; Foreground : Bitmap_Color; Fast : Boolean := True) is procedure Internal_Draw_Line (X0, Y0, X1, Y1 : Natural; Width : Positive); procedure Internal_Draw_Line (X0, Y0, X1, Y1 : Natural; Width : Positive) is begin Draw_Line (Buffer, (X0, Y0), (X1, Y1), Width, Fast => Fast); end Internal_Draw_Line; procedure Draw_Glyph is new Hershey_Fonts.Draw_Glyph (Internal_Draw_Line); Current : Point := Start; begin Buffer.Set_Source (Foreground); for C of Msg loop exit when Current.X > Buffer.Width; Draw_Glyph (Fnt => Font, C => C, X => Current.X, Y => Current.Y, Height => Height, Bold => Bold); end loop; end Draw_String; ----------------- -- Draw_String -- ----------------- procedure Draw_String (Buffer : in out Bitmap_Buffer'Class; Area : Rect; Msg : String; Font : Hershey_Font; Bold : Boolean; Outline : Boolean; Foreground : Bitmap_Color; Fast : Boolean := True) is Length : constant Natural := Hershey_Fonts.Strlen (Msg, Font, Area.Height); Ratio : Float; Current : Point := (0, 0); Prev : UInt32; FG : constant UInt32 := Bitmap_Color_To_Word (Buffer.Color_Mode, Foreground); Blk : constant UInt32 := Bitmap_Color_To_Word (Buffer.Color_Mode, Black); procedure Internal_Draw_Line (X0, Y0, X1, Y1 : Natural; Width : Positive); procedure Internal_Draw_Line (X0, Y0, X1, Y1 : Natural; Width : Positive) is begin Draw_Line (Buffer, (Area.Position.X + Natural (Float (X0) * Ratio), Area.Position.Y + Y0), (Area.Position.X + Natural (Float (X1) * Ratio), Area.Position.Y + Y1), Width, Fast); end Internal_Draw_Line; procedure Draw_Glyph is new Hershey_Fonts.Draw_Glyph (Internal_Draw_Line); begin if Length > Area.Width then Ratio := Float (Area.Width) / Float (Length); else Ratio := 1.0; Current.X := (Area.Width - Length) / 2; end if; Buffer.Set_Source (Foreground); for C of Msg loop Draw_Glyph (Fnt => Font, C => C, X => Current.X, Y => Current.Y, Height => Area.Height, Bold => Bold); end loop; if Outline and then Area.Height > 40 then for Y in Area.Position.Y + 1 .. Area.Position.Y + Area.Height loop Prev := Buffer.Pixel ((Area.Position.X, Y)); if Prev = FG then Buffer.Set_Pixel ((Area.Position.X, Y), Black); end if; for X in Area.Position.X + 1 .. Area.Position.X + Area.Width loop declare Col : constant UInt32 := Buffer.Pixel ((X, Y)); Top : constant UInt32 := Buffer.Pixel ((X, Y - 1)); begin if Prev /= FG and then Col = FG then Buffer.Set_Pixel ((X, Y), Blk); elsif Prev = FG and then Col /= FG then Buffer.Set_Pixel ((X - 1, Y), Blk); elsif Top /= FG and then Top /= Blk and then Col = FG then Buffer.Set_Pixel ((X, Y), Blk); elsif Top = FG and then Col /= FG then Buffer.Set_Pixel ((X, Y - 1), Blk); end if; Prev := Col; end; end loop; end loop; end if; end Draw_String; end Bitmapped_Drawing;
reznikmm/matreshka
Ada
5,130
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Ada Modeling Framework -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2011-2012, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ -- This file is generated, don't edit it. ------------------------------------------------------------------------------ with AMF.Generic_Collections; package AMF.UML.Extension_Points.Collections is pragma Preelaborate; package UML_Extension_Point_Collections is new AMF.Generic_Collections (UML_Extension_Point, UML_Extension_Point_Access); type Set_Of_UML_Extension_Point is new UML_Extension_Point_Collections.Set with null record; Empty_Set_Of_UML_Extension_Point : constant Set_Of_UML_Extension_Point; type Ordered_Set_Of_UML_Extension_Point is new UML_Extension_Point_Collections.Ordered_Set with null record; Empty_Ordered_Set_Of_UML_Extension_Point : constant Ordered_Set_Of_UML_Extension_Point; type Bag_Of_UML_Extension_Point is new UML_Extension_Point_Collections.Bag with null record; Empty_Bag_Of_UML_Extension_Point : constant Bag_Of_UML_Extension_Point; type Sequence_Of_UML_Extension_Point is new UML_Extension_Point_Collections.Sequence with null record; Empty_Sequence_Of_UML_Extension_Point : constant Sequence_Of_UML_Extension_Point; private Empty_Set_Of_UML_Extension_Point : constant Set_Of_UML_Extension_Point := (UML_Extension_Point_Collections.Set with null record); Empty_Ordered_Set_Of_UML_Extension_Point : constant Ordered_Set_Of_UML_Extension_Point := (UML_Extension_Point_Collections.Ordered_Set with null record); Empty_Bag_Of_UML_Extension_Point : constant Bag_Of_UML_Extension_Point := (UML_Extension_Point_Collections.Bag with null record); Empty_Sequence_Of_UML_Extension_Point : constant Sequence_Of_UML_Extension_Point := (UML_Extension_Point_Collections.Sequence with null record); end AMF.UML.Extension_Points.Collections;
kjseefried/coreland-cgbc
Ada
925
adb
with Ada.Strings; with CGBC.Bounded_Wide_Strings; with Test; procedure T_WBstr_Append_RB01 is package BS renames CGBC.Bounded_Wide_Strings; TC : Test.Context_t; S1 : BS.Bounded_String (8); S : constant Wide_String := " 012345678 "; begin Test.Initialize (Test_Context => TC, Program => "t_wbstr_append_rb01", Test_DB => "TEST_DB", Test_Results => "TEST_RESULTS"); BS.Append (S1, "ABCD"); -- As Append_RB01 but with unusual bounds on New_Item. pragma Assert (S (5 .. 13) = "012345678"); BS.Append (Source => S1, New_Item => S (5 .. 13), -- "012345678" Drop => Ada.Strings.Right); Test.Check (TC, 1292, BS.Length (S1) = 8, "BS.Length (S1) = 8"); Test.Check (TC, 1293, BS.Maximum_Length (S1) = 8, "BS.Maximum_Length (S1) = 8"); Test.Check (TC, 1294, BS.To_String (S1) = "ABCD0123", "BS.To_String (S1) = ""ABCD0123"""); end T_WBstr_Append_RB01;
sungyeon/drake
Ada
11,559
ads
pragma License (Unrestricted); -- implementation unit with Ada.Exceptions; with System.Native_Tasks; with System.Storage_Elements; with System.Synchronous_Objects; private with System.Unwind.Mapping; package System.Tasks is pragma Preelaborate; -- same as somethings of Tasking subtype Master_Level is Integer; Foreign_Task_Level : constant Master_Level := 0; Environment_Task_Level : constant Master_Level := 1; Independent_Task_Level : constant Master_Level := 2; Library_Task_Level : constant Master_Level := 3; subtype Task_Entry_Index is Integer range 0 .. Integer'Last; type Activation_Chain is limited private; type Activation_Chain_Access is access all Activation_Chain; for Activation_Chain_Access'Storage_Size use 0; pragma No_Strict_Aliasing (Activation_Chain_Access); procedure Raise_Abort_Signal; pragma No_Return (Raise_Abort_Signal); -- this shold be called when Standard'Abort_Signal procedure When_Abort_Signal; pragma Inline (When_Abort_Signal); type Task_Record (<>) is limited private; type Task_Id is access all Task_Record; function Current_Task_Id return Task_Id with Export, Convention => Ada, External_Name => "__drake_current_task"; function Environment_Task_Id return Task_Id; pragma Pure_Function (Environment_Task_Id); type Master_Record is limited private; type Master_Access is access all Master_Record; type Boolean_Access is access all Boolean; for Boolean_Access'Storage_Size use 0; procedure Create ( T : out Task_Id; Params : Address; Process : not null access procedure (Params : Address); -- name Name : String := ""; -- activation Chain : Activation_Chain_Access := null; Elaborated : Boolean_Access := null; -- completion Master : Master_Access := null; -- rendezvous Entry_Last_Index : Task_Entry_Index := 0); procedure Wait (T : in out Task_Id; Aborted : out Boolean); procedure Detach (T : in out Task_Id); function Terminated (T : Task_Id) return Boolean; function Activated (T : Task_Id) return Boolean; type Free_Mode is (Wait, Detach); pragma Discard_Names (Free_Mode); function Preferred_Free_Mode (T : not null Task_Id) return Free_Mode; procedure Set_Preferred_Free_Mode ( T : not null Task_Id; Mode : Free_Mode); pragma Inline (Preferred_Free_Mode); procedure Get_Stack ( T : not null Task_Id; Addr : out Address; Size : out Storage_Elements.Storage_Count); -- name function Name (T : not null Task_Id) return not null access constant String; -- abort procedure Send_Abort (T : not null Task_Id); procedure Enable_Abort; procedure Disable_Abort (Aborted : Boolean); -- check and disable procedure Lock_Abort; procedure Unlock_Abort; function Is_Aborted return Boolean; function Abort_Event return access Synchronous_Objects.Event; -- for manual activation (Chain /= null) function Elaborated (T : not null Task_Id) return Boolean; procedure Accept_Activation (Aborted : out Boolean); procedure Activate ( Chain : not null Activation_Chain_Access; Aborted : out Boolean); -- activate all task procedure Activate (T : not null Task_Id); -- activate single task procedure Move ( From, To : not null Activation_Chain_Access; New_Master : Master_Access); -- for manual completion (Master /= null) function Parent (T : not null Task_Id) return Task_Id; function Master_Level_Of (T : not null Task_Id) return Master_Level; function Master_Within return Master_Level; procedure Enter_Master; procedure Leave_Master; procedure Leave_All_Masters; -- for System.Tasking.Stages.Complete_Task function Master_Of_Parent (Level : Master_Level) return Master_Access; pragma Inline (Master_Level_Of); -- for rendezvous procedure Cancel_Calls; -- for System.Tasking.Stages.Complete_Task procedure Call ( T : not null Task_Id; Item : not null Synchronous_Objects.Queue_Node_Access); procedure Uncall ( T : not null Task_Id; Item : not null Synchronous_Objects.Queue_Node_Access; Already_Taken : out Boolean); procedure Accept_Call ( Item : out Synchronous_Objects.Queue_Node_Access; Params : Address; Filter : Synchronous_Objects.Queue_Filter; Aborted : out Boolean); function Call_Count ( T : not null Task_Id; Params : Address; Filter : Synchronous_Objects.Queue_Filter) return Natural; function Callable (T : not null Task_Id) return Boolean; type Cancel_Call_Handler is access procedure ( X : in out Synchronous_Objects.Queue_Node_Access); pragma Favor_Top_Level (Cancel_Call_Handler); Cancel_Call_Hook : Cancel_Call_Handler := null; -- attribute for Ada.Task_Attributes type Attribute_Index is limited private; procedure Allocate (Index : in out Attribute_Index); procedure Free (Index : in out Attribute_Index); procedure Query ( T : not null Task_Id; Index : aliased in out Attribute_Index; Process : not null access procedure (Item : Address)); procedure Set ( T : not null Task_Id; Index : aliased in out Attribute_Index; New_Item : not null access function return Address; Finalize : not null access procedure (Item : Address)); procedure Reference ( T : not null Task_Id; Index : aliased in out Attribute_Index; New_Item : not null access function return Address; Finalize : not null access procedure (Item : Address); Result : out Address); procedure Clear ( T : not null Task_Id; Index : aliased in out Attribute_Index); -- termination handler for Task_Termination type Cause_Of_Termination is (Normal, Abnormal, Unhandled_Exception); -- same as Ada.Task_Termination.Cause_Of_Termination pragma Discard_Names (Cause_Of_Termination); type Termination_Handler is access protected procedure ( Cause : Cause_Of_Termination; T : Task_Id; X : Ada.Exceptions.Exception_Occurrence); -- same as Ada.Task_Termination.Termination_Handler procedure Set_Dependents_Fallback_Handler ( T : Task_Id; Handler : Termination_Handler); function Dependents_Fallback_Handler (T : Task_Id) return Termination_Handler; pragma Inline (Dependents_Fallback_Handler); procedure Set_Specific_Handler ( T : Task_Id; Handler : Termination_Handler); function Specific_Handler (T : Task_Id) return Termination_Handler; pragma Inline (Specific_Handler); private type String_Access is access String; type Counter is mod 2 ** 32; for Counter'Size use 32; type Activation_Error is (None, Any_Exception, Elaboration_Error); pragma Discard_Names (Activation_Error); type Activation_Chain_Data; type Activation_Chain is access all Activation_Chain_Data; for Activation_Chain'Size use Standard'Address_Size; type Activation_Chain_Data is limited record List : Task_Id; Task_Count : Counter; Activated_Count : aliased Counter; Release_Count : aliased Counter; Mutex : Synchronous_Objects.Mutex; Condition_Variable : Synchronous_Objects.Condition_Variable; Error : Activation_Error; Merged : Activation_Chain; Self : Activation_Chain_Access; end record; pragma Suppress_Initialization (Activation_Chain_Data); type Task_Kind is (Environment, Sub); pragma Discard_Names (Task_Kind); type Finalize_Handler is access procedure (Params : Address); type Attribute is record Index : access Attribute_Index; Item : Address; Finalize : Finalize_Handler; Previous : Task_Id; Next : Task_Id; end record; pragma Suppress_Initialization (Attribute); type Fixed_Attribute_Array is array (Natural) of Attribute; pragma Suppress_Initialization (Fixed_Attribute_Array); type Attribute_Array_Access is access all Fixed_Attribute_Array; type Activation_State is range 0 .. 4; for Activation_State'Size use 8; pragma Atomic (Activation_State); AS_Suspended : constant Activation_State := 0; AS_Created : constant Activation_State := 1; AS_Active_Before_Activation : Activation_State := 2; AS_Active : constant Activation_State := 3; AS_Error : constant Activation_State := 4; type Termination_State is range 0 .. 2; for Termination_State'Size use 8; pragma Atomic (Termination_State); TS_Active : constant Termination_State := 0; TS_Detached : constant Termination_State := 1; TS_Terminated : constant Termination_State := 2; type Rendezvous_Record is limited record Mutex : aliased Synchronous_Objects.Mutex; Calling : aliased Synchronous_Objects.Queue; end record; pragma Suppress_Initialization (Rendezvous_Record); type Rendezvous_Access is access Rendezvous_Record; type Abort_Handler is access procedure (T : Task_Id); pragma Favor_Top_Level (Abort_Handler); type Process_Handler is access procedure (Params : Address); type Task_Record (Kind : Task_Kind) is limited record Handle : aliased Native_Tasks.Handle_Type; Aborted : Boolean; pragma Atomic (Aborted); Abort_Handler : Tasks.Abort_Handler; Abort_Locking : Natural; Abort_Event : aliased Synchronous_Objects.Event; Attributes : Attribute_Array_Access; Attributes_Length : Natural; -- activation / completion Activation_State : aliased Tasks.Activation_State; Termination_State : aliased Tasks.Termination_State; Master_Level : Tasks.Master_Level; -- level of self Master_Top : Master_Access; -- stack -- termination handler Dependents_Fallback_Handler : Termination_Handler; -- for sub task case Kind is when Environment => null; when Sub => Params : Address; Process : not null Process_Handler; -- free mode Preferred_Free_Mode : Free_Mode; -- name Name : String_Access; -- manual activation Activation_Chain : Tasks.Activation_Chain; Next_Of_Activation_Chain : Task_Id; Activation_Chain_Living : Boolean; Elaborated : Boolean_Access; -- manual completion Master_Of_Parent : Master_Access; Previous_At_Same_Level : Task_Id; Next_At_Same_Level : Task_Id; Auto_Detach : Boolean; -- rendezvous Rendezvous : Rendezvous_Access; -- termination handler Specific_Handler : Termination_Handler; -- signal alt stack Signal_Stack : aliased Unwind.Mapping.Signal_Stack_Type; end case; end record; pragma Suppress_Initialization (Task_Record); type Master_Record is limited record Previous : Master_Access; -- previous item in stack Parent : Task_Id; Within : Master_Level; -- level of stack List : Task_Id; -- ringed list Mutex : aliased Synchronous_Objects.Mutex; end record; pragma Suppress_Initialization (Master_Record); -- type TLS_Index is new C.pthread.pthread_key_t; type Attribute_Index is limited record Index : Integer range -1 .. Integer'Last; List : aliased Task_Id; Mutex : aliased Synchronous_Objects.Mutex; end record; pragma Suppress_Initialization (Attribute_Index); end System.Tasks;
tum-ei-rcs/StratoX
Ada
1,706
adb
-- Institution: Technische Universitaet Muenchen -- Department: Realtime Computer Systems (RCS) -- Project: StratoX -- Author: Emanuel Regnath ([email protected]) with Config.Software; with HIL.UART; with HIL.Devices; -- @summary Command Line Interface for user interactions package body Console with SPARK_Mode => On is procedure read_Command( cmd : out User_Command_Type ) is data_rx : HIL.UART.Data_Type (1 .. 1) := (others => 0); n_read : Natural; begin cmd := NONE; if Config.Software.DEBUG_MODE_IS_ACTIVE then HIL.UART.read (HIL.Devices.Console, data_rx, n_read); if n_read > 0 then case (Character'Val (data_rx (1))) is when 's' => cmd := STATUS; when 't' => cmd := TEST; when 'p' => cmd := PROFILE; when 'r' => cmd := RESTART; when 'a' => cmd := ARM; when 'd' => cmd := DISARM; when '2' => cmd := INC_ELE; when '1' => cmd := DEC_ELE; when others => cmd := NONE; end case; end if; end if; end read_Command; procedure write_Line (message : String) is --LF : Character := Character'Val(10); CR : constant Character := Character'Val (13); -- ASCII begin if message'Last < Natural'Last then HIL.UART.write (HIL.Devices.Console, HIL.UART.toData_Type (message & CR)); else HIL.UART.write (HIL.Devices.Console, HIL.UART.toData_Type (message)); end if; end write_Line; end Console;
Heziode/lsystem-editor
Ada
14,580
adb
------------------------------------------------------------------------------- -- LSE -- L-System Editor -- Author: Heziode -- -- License: -- MIT License -- -- Copyright (c) 2018 Quentin Dauprat (Heziode) <[email protected]> -- -- Permission is hereby granted, free of charge, to any person obtaining a -- copy of this software and associated documentation files (the "Software"), -- to deal in the Software without restriction, including without limitation -- the rights to use, copy, modify, merge, publish, distribute, sublicense, -- and/or sell copies of the Software, and to permit persons to whom the -- Software is furnished to do so, subject to the following conditions: -- -- The above copyright notice and this permission notice shall be included in -- all copies or substantial portions of the Software. -- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -- DEALINGS IN THE SOFTWARE. ------------------------------------------------------------------------------- with Ada.Float_Text_IO; with Ada.Numerics; with Ada.Numerics.Elementary_Functions; with Ada.Text_IO; with LSE.Utils.Coordinate_2D; with LSE.Utils.Coordinate_2D_Ptr; with LSE.Utils.Utils; package body LSE.Model.IO.Turtle is function Initialize return Instance is This : Instance; begin return This; end Initialize; procedure Set_Width (This : out Instance; Value : Positive) is begin This.Width := Value; end Set_Width; procedure Set_Height (This : out Instance; Value : Positive) is begin This.Height := Value; end Set_Height; procedure Set_Background_Color (This : out Instance; Value : String) is begin This.Background_Color := To_Unbounded_String (Value); end Set_Background_Color; procedure Set_Foreground_Color (This : out Instance; Value : String) is begin This.Foreground_Color := To_Unbounded_String (Value); end Set_Foreground_Color; procedure Set_Angle (This : out Instance; Value : LSE.Utils.Angle.Angle) is begin This.Angle := Value; end Set_Angle; function Get_Width (This : Instance) return Positive is begin return This.Width; end Get_Width; function Get_Height (This : Instance) return Positive is begin return This.Height; end Get_Height; function Get_Background_Color (This : Instance) return String is begin return To_String (This.Background_Color); end Get_Background_Color; function Get_Foreground_Color (This : Instance) return String is begin return To_String (This.Foreground_Color); end Get_Foreground_Color; function Get_Offset_X (This : Instance) return Float is begin return This.Offset_X; end Get_Offset_X; function Get_Offset_Y (This : Instance) return Float is begin return This.Offset_Y; end Get_Offset_Y; function Get_Max_X (This : Instance) return Float is begin return This.Max_X; end Get_Max_X; function Get_Max_Y (This : Instance) return Float is begin return This.Max_Y; end Get_Max_Y; function Get_Min_X (This : Instance) return Float is begin return This.Min_X; end Get_Min_X; function Get_Min_Y (This : Instance) return Float is begin return This.Min_Y; end Get_Min_Y; procedure Set_Max_X (This : out Instance; Value : Float) is begin This.Max_X := Value; end Set_Max_X; procedure Set_Max_Y (This : out Instance; Value : Float) is begin This.Max_Y := Value; end Set_Max_Y; procedure Set_Min_X (This : out Instance; Value : Float) is begin This.Min_X := Value; end Set_Min_X; procedure Set_Min_Y (This : out Instance; Value : Float) is begin This.Min_Y := Value; end Set_Min_Y; function Get_Margin_Top (This : Instance) return Float is begin return This.Margin_Top; end Get_Margin_Top; function Get_Margin_Right (This : Instance) return Float is begin return This.Margin_Right; end Get_Margin_Right; function Get_Margin_Bottom (This : Instance) return Float is begin return This.Margin_Bottom; end Get_Margin_Bottom; function Get_Margin_Left (This : Instance) return Float is begin return This.Margin_Left; end Get_Margin_Left; function Get_Medium (This : Instance) return LSE.Model.IO.Drawing_Area.Drawing_Area_Ptr.Holder is begin return This.Medium; end Get_Medium; procedure Set_Margin_Top (This : out Instance; Value : Natural) is begin This.Margin_Top := Float (Value); end Set_Margin_Top; procedure Set_Margin_Right (This : out Instance; Value : Natural) is begin This.Margin_Right := Float (Value); end Set_Margin_Right; procedure Set_Margin_Bottom (This : out Instance; Value : Natural) is begin This.Margin_Bottom := Float (Value); end Set_Margin_Bottom; procedure Set_Margin_Left (This : out Instance; Value : Natural) is begin This.Margin_Left := Float (Value); end Set_Margin_Left; procedure Set_Margin (This : out Instance; Value : Natural) is begin This.Margin_Top := Float (Value); This.Margin_Right := Float (Value); This.Margin_Bottom := Float (Value); This.Margin_Left := Float (Value); end Set_Margin; procedure Set_Medium (This : out Instance; Value : LSE.Model.IO.Drawing_Area.Drawing_Area_Ptr.Holder) is begin This.Medium := Value; end Set_Medium; procedure Set_Dry_Run (This : out Instance; Value : Boolean) is begin This.Dry_Run := Value; end Set_Dry_Run; procedure Put (This : Instance) is use Ada.Text_IO; use Ada.Float_Text_IO; begin Put_Line ("Turtle:"); Put_Line (" Width :" & Positive'Image (This.Width)); Put_Line (" Height :" & Positive'Image (This.Height)); Put_Line (" Background_Color : " & To_String (This.Background_Color)); Put_Line (" Foreground_Color : " & To_String (This.Foreground_Color)); Put (" Line_Size : "); Put (Item => This.Line_Size, Aft => 2, Exp => 0); New_Line; Put (" Angle :"); Put (Item => Float (This.Angle), Aft => 2, Exp => 0); New_Line; Put (" Max_X :"); Put (Item => This.Max_X, Aft => 2, Exp => 0); New_Line; Put (" Max_Y :"); Put (Item => This.Max_Y, Aft => 2, Exp => 0); New_Line; Put (" Min_X :"); Put (Item => This.Min_X, Aft => 2, Exp => 0); New_Line; Put (" Min_Y :"); Put (Item => This.Min_Y, Aft => 2, Exp => 0); New_Line; Put (" Ratio :"); Put (Item => This.Ratio, Aft => 2, Exp => 0); New_Line; Put (" Offset_X :"); Put (Item => This.Offset_X, Aft => 2, Exp => 0); New_Line; Put (" Offset_Y :"); Put (Item => This.Offset_Y, Aft => 2, Exp => 0); New_Line; Put (" Margin_Top :"); Put (Item => This.Margin_Top, Aft => 2, Exp => 0); New_Line; Put (" Margin_Right :"); Put (Item => This.Margin_Right, Aft => 2, Exp => 0); New_Line; Put (" Margin_Bottom :"); Put (Item => This.Margin_Bottom, Aft => 2, Exp => 0); New_Line; Put (" Margin_Left :"); Put (Item => This.Margin_Left, Aft => 2, Exp => 0); New_Line; end Put; procedure Make_Offset (This : in out Instance) is Boxed_Width : constant Float := Float (This.Width) - This.Margin_Right - This.Margin_Left; Boxed_Height : constant Float := Float (This.Height) - This.Margin_Top - This.Margin_Bottom; begin if (This.Max_X - This.Min_X) = 0.0 or (This.Max_Y - This.Min_Y) = 0.0 then raise Divide_By_Zero; end if; if Boxed_Width / (This.Max_X - This.Min_X) <= Boxed_Height / (This.Max_Y - This.Min_Y) then -- X has the smallest delta This.Ratio := Boxed_Width / (This.Max_X - This.Min_X); else -- Y has the smallest delta This.Ratio := Boxed_Height / (This.Max_Y - This.Min_Y); end if; This.Offset_X := (Boxed_Width / 2.0) - (((This.Ratio * This.Max_X - This.Ratio * This.Min_X) / 2.0) + This.Ratio * This.Min_X); This.Offset_Y := (Boxed_Height / 2.0) - (((This.Ratio * This.Max_Y - This.Ratio * This.Min_Y) / 2.0) + This.Ratio * This.Min_Y); end Make_Offset; procedure Configure (This : in out Instance) is begin if not This.Dry_Run then This.Make_Offset; end if; This.Stack_Angle.Clear; This.Stack_Coordinate.Clear; if This.Dry_Run then This.Max_X := 0.0; This.Max_Y := 0.0; This.Min_X := 0.0; This.Min_Y := 0.0; else -- Configure the medium This.Medium.Reference.Configure (This); end if; This.Stack_Angle.Append (LSE.Utils.Angle.To_Angle (90.0)); This.Stack_Coordinate.Append ( LSE.Utils.Coordinate_2D_Ptr.To_Holder ( LSE.Utils.Coordinate_2D.Initialize)); end Configure; procedure Draw (This : in out Instance) is begin if not This.Dry_Run then This.Medium.Reference.Draw; end if; end Draw; procedure Forward (This : in out Instance; Trace : Boolean := False) is use Ada.Numerics.Elementary_Functions; ------------------------ -- Methods prototype -- ------------------------ -- Callback of Update_Element of Stack_Coordinate procedure Update (Item : in out LSE.Utils.Coordinate_2D_Ptr.Holder); -- Update all corners of the L-System edges procedure Update_Corners (This : in out Instance); ----------------------------- -- Declaration of methods -- ----------------------------- procedure Update (Item : in out LSE.Utils.Coordinate_2D_Ptr.Holder) is Copy : LSE.Utils.Coordinate_2D_Ptr.Holder := Item; X : constant Float := This.Ratio * This.Line_Size * Cos (This.Stack_Angle.Last_Element, Degrees_Cycle); Y : constant Float := This.Ratio * This.Line_Size * Sin (This.Stack_Angle.Last_Element, Degrees_Cycle); begin Copy.Reference.Set_X (X); Copy.Reference.Set_Y (Y); Item.Move (Copy); end Update; procedure Update_Corners (This : in out Instance) is X, Y : Float := 0.0; begin for H of reverse This.Stack_Coordinate loop X := X + H.Reference.Get_X; Y := Y + H.Reference.Get_Y; end loop; if X < This.Min_X then This.Min_X := X; elsif X > This.Max_X then This.Max_X := X; end if; if Y < This.Min_Y then This.Min_Y := Y; elsif Y > This.Max_Y then This.Max_Y := Y; end if; end Update_Corners; --------------- -- Variables -- --------------- Copy : LSE.Utils.Coordinate_2D_Ptr.Holder := This.Stack_Coordinate.Last_Element.Copy; begin This.Stack_Coordinate.Update_Element (Index => This.Stack_Coordinate.Last_Index, Process => Update'Access); if not This.Dry_Run then This.Medium.Reference.Forward (This.Stack_Coordinate.Last_Element.Element, Trace); end if; Copy.Reference.Set_X (This.Stack_Coordinate.Last_Element.Element.Get_X + Copy.Reference.Get_X); Copy.Reference.Set_Y (This.Stack_Coordinate.Last_Element.Element.Get_Y + Copy.Reference.Get_Y); This.Stack_Coordinate.Delete_Last; This.Stack_Coordinate.Append (Copy); if This.Dry_Run then Update_Corners (This); end if; end Forward; procedure Rotate_Clockwise (This : in out Instance) is begin This.Stack_Angle.Replace_Element (This.Stack_Angle.Last, To_Angle (This.Stack_Angle.Last_Element - This.Angle)); if not This.Dry_Run then This.Medium.Reference.Rotate_Clockwise; end if; end Rotate_Clockwise; procedure Rotate_Anticlockwise (This : in out Instance) is begin This.Stack_Angle.Replace_Element (This.Stack_Angle.Last, To_Angle (This.Stack_Angle.Last_Element + This.Angle)); if not This.Dry_Run then This.Medium.Reference.Rotate_Anticlockwise; end if; end Rotate_Anticlockwise; procedure UTurn (This : in out Instance) is begin This.Stack_Angle.Replace_Element (This.Stack_Angle.Last, To_Angle (This.Stack_Angle.Last_Element + 180.0)); if not This.Dry_Run then This.Medium.Reference.UTurn; end if; end UTurn; procedure Position_Save (This : in out Instance) is begin This.Stack_Coordinate.Append (LSE.Utils.Coordinate_2D_Ptr.To_Holder ( LSE.Utils.Coordinate_2D.Initialize)); This.Stack_Angle.Append (LSE.Utils.Angle.To_Angle ( This.Stack_Angle.Last_Element)); if not This.Dry_Run then This.Medium.Reference.Position_Save; end if; end Position_Save; procedure Position_Restore (This : in out Instance) is use LSE.Utils.Utils; Item : LSE.Utils.Coordinate_2D_Ptr.Holder; X : Fixed_Point; Y : Fixed_Point; begin Item := This.Stack_Coordinate.Last_Element; X := -Fixed_Point (Item.Element.Get_X); Y := -Fixed_Point (Item.Element.Get_Y); This.Stack_Angle.Delete_Last; This.Stack_Coordinate.Delete_Last; if not This.Dry_Run then This.Medium.Reference.Position_Restore (X, Y); end if; end Position_Restore; end LSE.Model.IO.Turtle;
tj800x/SPARKNaCl
Ada
371
adb
separate (SPARKNaCl) procedure Sanitize_GF_PA (R : out GF_PA) is begin R := GF_PA'(others => 0); pragma Inspection_Point (R); -- See RM H3.2 (9) -- Add target-dependent code here to -- 1. flush and invalidate data cache, -- 2. wait until writes have committed (e.g. a memory-fence instruction) -- 3. whatever else is required. end Sanitize_GF_PA;
Componolit/libsparkcrypto
Ada
22,917
ads
------------------------------------------------------------------------------- -- This file is part of libsparkcrypto. -- -- Copyright (C) 2010, Alexander Senier -- Copyright (C) 2010, secunet Security Networks AG -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, -- this list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- -- * Neither the name of the nor the names of its contributors may be used -- to endorse or promote products derived from this software without -- specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS -- BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -- POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with LSC.Internal.Types; with LSC.Internal.SHA1; with LSC.Internal.SHA256; with LSC.Internal.SHA512; with LSC.Internal.RIPEMD160; with LSC.Internal.AES; with LSC.Internal.HMAC_SHA256; with LSC.Internal.HMAC_SHA384; with LSC.Internal.HMAC_SHA512; with LSC.Internal.Bignum; with Interfaces.C; with System; use type LSC.Internal.Types.Word32; use type LSC.Internal.Types.Word64; ------------------------------------------------------------------------------- -- ATTENTION: This is *NOT* a proper OpenSSL binding. It is very hacky and -- e.g. relies on facts like GNAT being used, that 'access all' is equivalent -- to a C pointer, and much more. It is bad style and only intended for -- benchmarking LSC - do not use it for anything but that. You've been warned! ------------------------------------------------------------------------------- package OpenSSL is type SHA1_Context_Type is private; type SHA256_Context_Type is private; type SHA384_Context_Type is private; type SHA512_Context_Type is private; type RIPEMD160_Context_Type is private; type AES_Enc_Context_Type is private; type AES_Dec_Context_Type is private; ---------------------------------------------------------------------------- -- AES function Create_AES128_Enc_Context (Key : LSC.Internal.AES.AES128_Key_Type) return AES_Enc_Context_Type; function Create_AES192_Enc_Context (Key : LSC.Internal.AES.AES192_Key_Type) return AES_Enc_Context_Type; function Create_AES256_Enc_Context (Key : LSC.Internal.AES.AES256_Key_Type) return AES_Enc_Context_Type; function Encrypt (Context : AES_Enc_Context_Type; Plaintext : LSC.Internal.AES.Block_Type) return LSC.Internal.AES.Block_Type; pragma Inline (Encrypt); procedure CBC_Encrypt (Plaintext : in LSC.Internal.AES.Message_Type; Ciphertext : out LSC.Internal.AES.Message_Type; Context : in AES_Enc_Context_Type; IV : in LSC.Internal.AES.Block_Type); pragma Inline (CBC_Encrypt); function Create_AES128_Dec_Context (Key : LSC.Internal.AES.AES128_Key_Type) return AES_Dec_Context_Type; function Create_AES192_Dec_Context (Key : LSC.Internal.AES.AES192_Key_Type) return AES_Dec_Context_Type; function Create_AES256_Dec_Context (Key : LSC.Internal.AES.AES256_Key_Type) return AES_Dec_Context_Type; function Decrypt (Context : AES_Dec_Context_Type; Ciphertext : LSC.Internal.AES.Block_Type) return LSC.Internal.AES.Block_Type; pragma Inline (Decrypt); procedure CBC_Decrypt (Ciphertext : in LSC.Internal.AES.Message_Type; Plaintext : out LSC.Internal.AES.Message_Type; Context : in AES_Dec_Context_Type; IV : in LSC.Internal.AES.Block_Type); pragma Inline (CBC_Decrypt); ---------------------------------------------------------------------------- -- SHA-1 procedure SHA1_Context_Init (Context : out SHA1_Context_Type); procedure SHA1_Context_Update (Context : in out SHA1_Context_Type; Block : in LSC.Internal.SHA1.Block_Type); procedure SHA1_Context_Finalize (Context : in out SHA1_Context_Type; Block : in LSC.Internal.SHA1.Block_Type; Length : in LSC.Internal.SHA1.Block_Length_Type); pragma Inline (SHA1_Context_Update, SHA1_Context_Finalize); function SHA1_Get_Hash (Context : in SHA1_Context_Type) return LSC.Internal.SHA1.Hash_Type; ---------------------------------------------------------------------------- -- SHA-256 procedure SHA256_Context_Init (Context : out SHA256_Context_Type); procedure SHA256_Context_Update (Context : in out SHA256_Context_Type; Block : in LSC.Internal.SHA256.Block_Type); procedure SHA256_Context_Finalize (Context : in out SHA256_Context_Type; Block : in LSC.Internal.SHA256.Block_Type; Length : in LSC.Internal.SHA256.Block_Length_Type); pragma Inline (SHA256_Context_Update, SHA256_Context_Finalize); function SHA256_Get_Hash (Context : in SHA256_Context_Type) return LSC.Internal.SHA256.SHA256_Hash_Type; ---------------------------------------------------------------------------- -- SHA-384 procedure SHA384_Context_Init (Context : out SHA384_Context_Type); procedure SHA384_Context_Update (Context : in out SHA384_Context_Type; Block : in LSC.Internal.SHA512.Block_Type); procedure SHA384_Context_Finalize (Context : in out SHA384_Context_Type; Block : in LSC.Internal.SHA512.Block_Type; Length : in LSC.Internal.SHA512.Block_Length_Type); pragma Inline (SHA384_Context_Update, SHA384_Context_Finalize); function SHA384_Get_Hash (Context : in SHA384_Context_Type) return LSC.Internal.SHA512.SHA384_Hash_Type; ---------------------------------------------------------------------------- -- SHA-512 procedure SHA512_Context_Init (Context : out SHA512_Context_Type); procedure SHA512_Context_Update (Context : in out SHA512_Context_Type; Block : in LSC.Internal.SHA512.Block_Type); procedure SHA512_Context_Finalize (Context : in out SHA512_Context_Type; Block : in LSC.Internal.SHA512.Block_Type; Length : in LSC.Internal.SHA512.Block_Length_Type); pragma Inline (SHA512_Context_Update, SHA512_Context_Finalize); function SHA512_Get_Hash (Context : in SHA512_Context_Type) return LSC.Internal.SHA512.SHA512_Hash_Type; ---------------------------------------------------------------------------- -- RIPEMD-160 procedure RIPEMD160_Context_Init (Context : out RIPEMD160_Context_Type); procedure RIPEMD160_Context_Update (Context : in out RIPEMD160_Context_Type; Block : in LSC.Internal.RIPEMD160.Block_Type); procedure RIPEMD160_Context_Finalize (Context : in out RIPEMD160_Context_Type; Block : in LSC.Internal.RIPEMD160.Block_Type; Length : in LSC.Internal.RIPEMD160.Block_Length_Type); pragma Inline (RIPEMD160_Context_Update, RIPEMD160_Context_Finalize); function RIPEMD160_Get_Hash (Context : in RIPEMD160_Context_Type) return LSC.Internal.RIPEMD160.Hash_Type; ---------------------------------------------------------------------------- -- HMAC_SHA1 subtype SHA1_Message_Index is LSC.Internal.Types.Word64 range 1 .. 100; subtype SHA1_Message_Type is LSC.Internal.SHA1.Message_Type (SHA1_Message_Index); function Authenticate_SHA1 (Key : LSC.Internal.SHA1.Block_Type; Message : SHA1_Message_Type; Length : LSC.Internal.Types.Word64) return LSC.Internal.SHA1.Hash_Type; pragma Inline (Authenticate_SHA1); ---------------------------------------------------------------------------- -- HMAC_SHA256 subtype SHA256_Message_Index is LSC.Internal.SHA256.Message_Index range 1 .. 100; subtype SHA256_Message_Type is LSC.Internal.SHA256.Message_Type (SHA256_Message_Index); function Authenticate_SHA256 (Key : LSC.Internal.SHA256.Block_Type; Message : SHA256_Message_Type; Length : LSC.Internal.Types.Word64) return LSC.Internal.HMAC_SHA256.Auth_Type; pragma Inline (Authenticate_SHA256); ---------------------------------------------------------------------------- subtype SHA512_Message_Index is LSC.Internal.SHA512.Message_Index range 1 .. 100; subtype SHA512_Message_Type is LSC.Internal.SHA512.Message_Type (SHA512_Message_Index); -- HMAC_SHA384 function Authenticate_SHA384 (Key : LSC.Internal.SHA512.Block_Type; Message : SHA512_Message_Type; Length : LSC.Internal.Types.Word64) return LSC.Internal.HMAC_SHA384.Auth_Type; pragma Inline (Authenticate_SHA384); ---------------------------------------------------------------------------- -- HMAC_SHA512 function Authenticate_SHA512 (Key : LSC.Internal.SHA512.Block_Type; Message : SHA512_Message_Type; Length : LSC.Internal.Types.Word64) return LSC.Internal.HMAC_SHA512.Auth_Type; pragma Inline (Authenticate_SHA512); ---------------------------------------------------------------------------- -- HMAC_RMD160 subtype RMD160_Message_Index is LSC.Internal.Types.Word64 range 1 .. 100; subtype RMD160_Message_Type is LSC.Internal.RIPEMD160.Message_Type (RMD160_Message_Index); function Authenticate_RMD160 (Key : LSC.Internal.RIPEMD160.Block_Type; Message : RMD160_Message_Type; Length : LSC.Internal.Types.Word64) return LSC.Internal.RIPEMD160.Hash_Type; pragma Inline (Authenticate_RMD160); ---------------------------------------------------------------------------- -- RSA procedure RSA_Public_Encrypt (M : in LSC.Internal.Bignum.Big_Int; E : in LSC.Internal.Bignum.Big_Int; P : in LSC.Internal.Bignum.Big_Int; C : out LSC.Internal.Bignum.Big_Int; Success : out Boolean); procedure RSA_Private_Decrypt (M : in LSC.Internal.Bignum.Big_Int; E : in LSC.Internal.Bignum.Big_Int; D : in LSC.Internal.Bignum.Big_Int; C : in LSC.Internal.Bignum.Big_Int; P : out LSC.Internal.Bignum.Big_Int; Success : out Boolean); private pragma Linker_Options ("-lcrypto"); type SHA512_Block_Type_Ptr is access all LSC.Internal.SHA512.Block_Type; pragma Convention (C, SHA512_Block_Type_Ptr); type SHA256_Block_Type_Ptr is access all LSC.Internal.SHA256.Block_Type; pragma Convention (C, SHA256_Block_Type_Ptr); type SHA1_Block_Type_Ptr is access all LSC.Internal.SHA1.Block_Type; pragma Convention (C, SHA1_Block_Type_Ptr); type SHA512_Hash_Type_Ptr is access all LSC.Internal.SHA512.SHA512_Hash_Type; pragma Convention (C, SHA512_Hash_Type_Ptr); type SHA256_Hash_Type_Ptr is access all LSC.Internal.SHA256.SHA256_Hash_Type; pragma Convention (C, SHA256_Hash_Type_Ptr); type SHA1_Hash_Type_Ptr is access all LSC.Internal.SHA1.Hash_Type; pragma Convention (C, SHA1_Hash_Type_Ptr); type C_Context_Type is array (1 .. 512) of Character; pragma Convention (C, C_Context_Type); type C_Context_Ptr is access all C_Context_Type; pragma Convention (C, C_Context_Ptr); ---------------------------------------------------------------------------- -- SHA-1 C binding procedure C_SHA1_Init (Context : C_Context_Ptr); pragma Import (C, C_SHA1_Init, "SHA1_Init"); procedure C_SHA1_Update (Context : C_Context_Ptr; Data : SHA1_Block_Type_Ptr; Length : Interfaces.C.size_t); pragma Import (C, C_SHA1_Update, "SHA1_Update"); procedure C_SHA1_Final (MD : SHA1_Hash_Type_Ptr; Context : C_Context_Ptr); pragma Import (C, C_SHA1_Final, "SHA1_Final"); ---------------------------------------------------------------------------- -- SHA-256 C binding procedure C_SHA256_Init (Context : C_Context_Ptr); pragma Import (C, C_SHA256_Init, "SHA256_Init"); procedure C_SHA256_Update (Context : C_Context_Ptr; Data : SHA256_Block_Type_Ptr; Length : Interfaces.C.size_t); pragma Import (C, C_SHA256_Update, "SHA256_Update"); procedure C_SHA256_Final (MD : SHA256_Hash_Type_Ptr; Context : C_Context_Ptr); pragma Import (C, C_SHA256_Final, "SHA256_Final"); ---------------------------------------------------------------------------- -- SHA-384 C binding procedure C_SHA384_Init (Context : C_Context_Ptr); pragma Import (C, C_SHA384_Init, "SHA384_Init"); procedure C_SHA384_Update (Context : C_Context_Ptr; Data : SHA512_Block_Type_Ptr; Length : Interfaces.C.size_t); pragma Import (C, C_SHA384_Update, "SHA384_Update"); procedure C_SHA384_Final (MD : SHA512_Hash_Type_Ptr; Context : C_Context_Ptr); pragma Import (C, C_SHA384_Final, "SHA384_Final"); ---------------------------------------------------------------------------- -- SHA-512 C binding procedure C_SHA512_Init (Context : C_Context_Ptr); pragma Import (C, C_SHA512_Init, "SHA512_Init"); procedure C_SHA512_Update (Context : C_Context_Ptr; Data : SHA512_Block_Type_Ptr; Length : Interfaces.C.size_t); pragma Import (C, C_SHA512_Update, "SHA512_Update"); procedure C_SHA512_Final (MD : SHA512_Hash_Type_Ptr; Context : C_Context_Ptr); pragma Import (C, C_SHA512_Final, "SHA512_Final"); ---------------------------------------------------------------------------- -- RIPEMD C binding type RIPEMD160_Block_Type_Ptr is access all LSC.Internal.RIPEMD160.Block_Type; pragma Convention (C, RIPEMD160_Block_Type_Ptr); type RIPEMD160_Hash_Type_Ptr is access all LSC.Internal.RIPEMD160.Hash_Type; pragma Convention (C, RIPEMD160_Hash_Type_Ptr); procedure C_RIPEMD160_Init (Context : C_Context_Ptr); pragma Import (C, C_RIPEMD160_Init, "RIPEMD160_Init"); procedure C_RIPEMD160_Update (Context : C_Context_Ptr; Data : RIPEMD160_Block_Type_Ptr; Length : Interfaces.C.size_t); pragma Import (C, C_RIPEMD160_Update, "RIPEMD160_Update"); procedure C_RIPEMD160_Final (MD : RIPEMD160_Hash_Type_Ptr; Context : C_Context_Ptr); pragma Import (C, C_RIPEMD160_Final, "RIPEMD160_Final"); ---------------------------------------------------------------------------- -- AES C binding type Key_Ptr is access all LSC.Internal.AES.AES256_Key_Type; pragma Convention (C, Key_Ptr); type Block_Ptr is access all LSC.Internal.AES.Block_Type; pragma Convention (C, Block_Ptr); procedure C_AES_set_encrypt_key (UserKey : Key_Ptr; Bits : Interfaces.C.int; AESKey : C_Context_Ptr); pragma Import (C, C_AES_set_encrypt_key, "AES_set_encrypt_key"); procedure C_AES_encrypt (In_Block : Block_Ptr; Out_Block : Block_Ptr; AESKey : C_Context_Ptr); pragma Import (C, C_AES_encrypt, "AES_encrypt"); procedure C_AES_CBC_Encrypt (Input : System.Address; Output : System.Address; Length : LSC.Internal.Types.Word32; AESKey : C_Context_Ptr; IV : Block_Ptr; Enc : Interfaces.Unsigned_16); pragma Import (C, C_AES_CBC_Encrypt, "AES_cbc_encrypt"); procedure C_AES_set_decrypt_key (UserKey : Key_Ptr; Bits : Interfaces.C.int; AESKey : C_Context_Ptr); pragma Import (C, C_AES_set_decrypt_key, "AES_set_decrypt_key"); procedure C_AES_decrypt (In_Block : Block_Ptr; Out_Block : Block_Ptr; AESKey : C_Context_Ptr); pragma Import (C, C_AES_decrypt, "AES_decrypt"); ---------------------------------------------------------------------------- -- libglue/HMAC_SHA1 C binding type HMAC_SHA1_Key_Ptr is access all LSC.Internal.SHA1.Block_Type; pragma Convention (C, HMAC_SHA1_Key_Ptr); type HMAC_SHA1_Msg_Ptr is access all SHA1_Message_Type; pragma Convention (C, HMAC_SHA1_Msg_Ptr); type HMAC_SHA1_Auth_Ptr is access all LSC.Internal.SHA1.Hash_Type; pragma Convention (C, HMAC_SHA1_Auth_Ptr); procedure C_Authenticate_SHA1 (Key : HMAC_SHA1_Key_Ptr; Message : HMAC_SHA1_Msg_Ptr; Length : LSC.Internal.Types.Word64; Digest : HMAC_SHA1_Auth_Ptr); pragma Import (C, C_Authenticate_SHA1, "Authenticate_SHA1"); ---------------------------------------------------------------------------- -- libglue/HMAC_SHA256 C binding type HMAC_SHA256_Key_Ptr is access all LSC.Internal.SHA256.Block_Type; pragma Convention (C, HMAC_SHA256_Key_Ptr); type HMAC_SHA256_Msg_Ptr is access all SHA256_Message_Type; pragma Convention (C, HMAC_SHA256_Msg_Ptr); type HMAC_SHA256_Auth_Ptr is access all LSC.Internal.HMAC_SHA256.Auth_Type; pragma Convention (C, HMAC_SHA256_Auth_Ptr); procedure C_Authenticate_SHA256 (Key : HMAC_SHA256_Key_Ptr; Message : HMAC_SHA256_Msg_Ptr; Length : LSC.Internal.Types.Word64; Digest : HMAC_SHA256_Auth_Ptr); pragma Import (C, C_Authenticate_SHA256, "Authenticate_SHA256"); ---------------------------------------------------------------------------- type HMAC_SHA512_Key_Ptr is access all LSC.Internal.SHA512.Block_Type; pragma Convention (C, HMAC_SHA512_Key_Ptr); type HMAC_SHA512_Msg_Ptr is access all SHA512_Message_Type; pragma Convention (C, HMAC_SHA512_Msg_Ptr); -- libglue/HMAC_SHA384 C binding type HMAC_SHA384_Auth_Ptr is access all LSC.Internal.HMAC_SHA384.Auth_Type; pragma Convention (C, HMAC_SHA384_Auth_Ptr); procedure C_Authenticate_SHA384 (Key : HMAC_SHA512_Key_Ptr; Message : HMAC_SHA512_Msg_Ptr; Length : LSC.Internal.Types.Word64; Digest : HMAC_SHA384_Auth_Ptr); pragma Import (C, C_Authenticate_SHA384, "Authenticate_SHA384"); ---------------------------------------------------------------------------- -- libglue/HMAC_SHA512 C binding type HMAC_SHA512_Auth_Ptr is access all LSC.Internal.HMAC_SHA512.Auth_Type; pragma Convention (C, HMAC_SHA512_Auth_Ptr); procedure C_Authenticate_SHA512 (Key : HMAC_SHA512_Key_Ptr; Message : HMAC_SHA512_Msg_Ptr; Length : LSC.Internal.Types.Word64; Digest : HMAC_SHA512_Auth_Ptr); pragma Import (C, C_Authenticate_SHA512, "Authenticate_SHA512"); ---------------------------------------------------------------------------- -- libglue/HMAC_RMD160 C binding type HMAC_RMD160_Key_Ptr is access all LSC.Internal.RIPEMD160.Block_Type; pragma Convention (C, HMAC_RMD160_Key_Ptr); type HMAC_RMD160_Msg_Ptr is access all RMD160_Message_Type; pragma Convention (C, HMAC_RMD160_Msg_Ptr); type HMAC_RMD160_Auth_Ptr is access all LSC.Internal.RIPEMD160.Hash_Type; pragma Convention (C, HMAC_RMD160_Auth_Ptr); procedure C_Authenticate_RMD160 (Key : HMAC_RMD160_Key_Ptr; Message : HMAC_RMD160_Msg_Ptr; Length : LSC.Internal.Types.Word64; Digest : HMAC_RMD160_Auth_Ptr); pragma Import (C, C_Authenticate_RMD160, "Authenticate_RMD160"); ---------------------------------------------------------------------------- type AES_Enc_Context_Type is record C_Context : C_Context_Type; end record; type AES_Dec_Context_Type is record C_Context : C_Context_Type; end record; type SHA1_Context_Type is record C_Context : C_Context_Type; Hash : LSC.Internal.SHA1.Hash_Type; end record; type SHA256_Context_Type is record C_Context : C_Context_Type; Hash : LSC.Internal.SHA256.SHA256_Hash_Type; end record; type SHA384_Context_Type is record C_Context : C_Context_Type; Hash : LSC.Internal.SHA512.SHA384_Hash_Type; end record; type SHA512_Context_Type is record C_Context : C_Context_Type; Hash : LSC.Internal.SHA512.SHA512_Hash_Type; end record; type RIPEMD160_Context_Type is record C_Context : C_Context_Type; Hash : LSC.Internal.RIPEMD160.Hash_Type; end record; ---------------------------------------------------------------------------- -- RSA procedure C_RSA_Public_Encrypt (M : in System.Address; M_Length : in LSC.Internal.Types.Word64; E : in System.Address; E_Length : in LSC.Internal.Types.Word64; P : in System.Address; C : in System.Address; Result : in System.Address); pragma Import (C, C_RSA_Public_Encrypt, "c_rsa_public_encrypt"); procedure C_RSA_Private_Decrypt (M : in System.Address; M_Length : in LSC.Internal.Types.Word64; E : in System.Address; E_Length : in LSC.Internal.Types.Word64; D : in System.Address; D_Length : in LSC.Internal.Types.Word64; C : in System.Address; P : in System.Address; Result : in System.Address); pragma Import (C, C_RSA_Private_Decrypt, "c_rsa_private_decrypt"); end OpenSSL;
reznikmm/matreshka
Ada
3,734
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with XML.DOM.Attributes; package ODF.DOM.Table_Sql_Statement_Attributes is pragma Preelaborate; type ODF_Table_Sql_Statement_Attribute is limited interface and XML.DOM.Attributes.DOM_Attribute; type ODF_Table_Sql_Statement_Attribute_Access is access all ODF_Table_Sql_Statement_Attribute'Class with Storage_Size => 0; end ODF.DOM.Table_Sql_Statement_Attributes;
reznikmm/matreshka
Ada
4,067
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Style_Base_Cell_Address_Attributes; package Matreshka.ODF_Style.Base_Cell_Address_Attributes is type Style_Base_Cell_Address_Attribute_Node is new Matreshka.ODF_Style.Abstract_Style_Attribute_Node and ODF.DOM.Style_Base_Cell_Address_Attributes.ODF_Style_Base_Cell_Address_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Style_Base_Cell_Address_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Style_Base_Cell_Address_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Style.Base_Cell_Address_Attributes;
AdaCore/gpr
Ada
730
ads
-- -- Copyright (C) 2019-2023, AdaCore -- -- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -- with Gpr_Parser_AdaSAT.Formulas; -- Provide various helpers for using the Gpr_Parser_AdaSAT library package Gpr_Parser_AdaSAT.Helpers is use Gpr_Parser_AdaSAT.Formulas; function DPLL_Solve (F : Formula; M : in out Model; Min_Vars : Variable_Or_Null := 0) return Boolean; -- Solve the given Formula and provide a model for its variables. -- It is assumed that this is a pure SAT problem. This simply invokes -- the `Solve` function on an instantiation of the `Gpr_Parser_AdaSAT.DPLL` package -- with a theory that always returns True. end Gpr_Parser_AdaSAT.Helpers;
heharkon/cmd_ada
Ada
3,455
adb
pragma Ada_2012; with Ada.Text_IO; use Ada.Text_IO; with GNAT.OS_Lib; use GNAT.OS_Lib; package body Cmd_ada is ---------------------- -- Register_Command -- ---------------------- procedure Register_Command (Command_String : String; Command_Cb : Proc_Callback; Description : String) is begin Commands.Append ((To_Unbounded_String (Command_String), Command_Cb, To_Unbounded_String (Description))); end Register_Command; ---------------------- -- Set_Exit_Command -- ---------------------- procedure Set_Exit_Command (Exit_Cmd : String) is begin Exit_Command := To_Unbounded_String (Exit_Cmd); end Set_Exit_Command; ---------------------- -- Set_Help_Command -- ---------------------- procedure Set_Help_Command (Help_Cmd : String) is begin Help_Command := To_Unbounded_String (Help_Cmd); end Set_Help_Command; ---------------- -- Set_Prompt -- ---------------- procedure Set_Prompt (Prompt_Str : String) is begin Prompt := To_Unbounded_String (Prompt_Str); end Set_Prompt; ----------------------- -- Set_Help_Preamble -- ----------------------- procedure Set_Help_Preamble (Preamble_Str : String) is begin Help_Preamble := To_Unbounded_String (Preamble_Str); end Set_Help_Preamble; --------------- -- Main_Loop -- --------------- procedure Main_Loop is Input_Params : Cb_Parameters.Vector; begin Master_Loop : loop New_Line; Put (To_String (Prompt)); declare Input : constant String := Get_Line; Args : Argument_List_Access; Command : Unbounded_String; begin Args := Argument_String_To_List (Input); if Args'Length > 0 then -- take the command Command := To_Unbounded_String (Args (Args'First).all); -- take parameters for X in Args'First + 1 .. Args'Last loop Input_Params.Append (To_Unbounded_String (Args (X).all)); end loop; Free (Args); -- find command if Command = Exit_Command then exit Master_Loop; elsif Command = Help_Command then Print_Help; end if; Cmd_Loop : for Item of Commands loop if Item.Command_String = Command then Put_Line (To_String (Item.Description)); Item.Command_Cb (Input_Params); exit Cmd_Loop; end if; end loop Cmd_Loop; else Free (Args); end if; end; end loop Master_Loop; end Main_Loop; ---------------- -- Print_Help -- ---------------- procedure Print_Help is begin New_Line; Put_Line (To_String (Help_Preamble)); New_Line; Put (To_String (Help_Command)); Set_Col (30); Put ("Help"); New_Line; Put (To_String (Exit_Command)); Set_Col (30); Put ("Exit"); New_Line; New_Line; for Item of Commands loop Put (To_String (Item.Command_String)); Set_Col (30); Put (To_String (Item.Description)); New_Line; end loop; New_Line; end Print_Help; end Cmd_ada;
charlie5/lace
Ada
329
adb
with ada.unchecked_Deallocation; package body physics.Shape is procedure free (Self : in out View) is procedure deallocate is new ada.unchecked_Deallocation (Item'Class, View); begin if Self /= null then Self.destruct; end if; deallocate (Self); end free; end physics.Shape;
stcarrez/ada-asf
Ada
1,908
ads
----------------------------------------------------------------------- -- asf-beans-params -- Bean giving access to the request parameters -- 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 Util.Beans.Basic; with Util.Beans.Objects; package ASF.Beans.Params is -- Context variable giving access to the request parameters. PARAM_ATTRIBUTE_NAME : constant String := "param"; -- ------------------------------ -- Request Parameter Bean -- ------------------------------ -- The <b>Param_Bean</b> gives access to the request parameter. -- The bean instance is global to the application. type Param_Bean is new Util.Beans.Basic.Readonly_Bean with private; -- Get the request parameter identified by the given name. -- Returns Null_Object if the request does not define such parameter. overriding function Get_Value (Bean : in Param_Bean; Name : in String) return Util.Beans.Objects.Object; -- Return the Param_Bean instance. function Instance return Util.Beans.Objects.Object; private type Param_Bean is new Util.Beans.Basic.Readonly_Bean with null record; end ASF.Beans.Params;
AdaCore/libadalang
Ada
654
ads
package Valid is Int_Succ : constant Integer := Integer'Succ (1); --% node.f_default_expr.p_eval_as_int Int_Pred : constant Integer := Integer'Pred (1); --% node.f_default_expr.p_eval_as_int type Enum_Type is (A, B, C); Enum_Succ_1 : constant Enum_Type := Enum_Type'Succ (A); --% node.f_default_expr.p_eval_as_int Enum_Succ_2 : constant Enum_Type := Enum_Type'Succ (B); --% node.f_default_expr.p_eval_as_int Enum_Pred_1 : constant Enum_Type := Enum_Type'Pred (B); --% node.f_default_expr.p_eval_as_int Enum_Pred_2 : constant Enum_Type := Enum_Type'Pred (C); --% node.f_default_expr.p_eval_as_int end Valid;
AdaCore/libadalang
Ada
91,392
adb
------------------------------------------------------------------------------ -- -- -- GPR TECHNOLOGY -- -- -- -- Copyright (C) 2004-2017, AdaCore -- -- -- -- This is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- -- ware Foundation; either version 3, or (at your option) any later ver- -- -- sion. This software is distributed in the hope that it will be useful, -- -- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- -- -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -- -- License for more details. You should have received a copy of the GNU -- -- General Public License distributed with GNAT; see file COPYING. If not, -- -- see <http://www.gnu.org/licenses/>. -- -- -- ------------------------------------------------------------------------------ with Ada.Text_IO; use Ada.Text_IO; with Ada.Unchecked_Deallocation; with GNAT.Case_Util; use GNAT.Case_Util; with GNAT.Directory_Operations; use GNAT.Directory_Operations; with GNAT.HTable; with GNAT.Regexp; use GNAT.Regexp; with GPR.Opt; use GPR.Opt; with GPR.Osint; use GPR.Osint; with GPR.Com; with GPR.Debug; with GPR.Err; use GPR.Err; with GPR.Erroutc; use GPR.Erroutc; with GPR.Ext; with GPR.Names; use GPR.Names; with GPR.Output; use GPR.Output; with GPR.Tempdir; with GPR.Util; use GPR.Util; package body Gpr_Build_Util is use Stamps; use ALI; function File_Not_A_Source_Of (Project_Tree : Project_Tree_Ref; Uname : Name_Id; Sfile : File_Name_Type) return Boolean; -- Check that file name Sfile is one of the source of unit Uname. Returns -- True if the unit is in one of the project file, but the file name is not -- one of its source. Returns False otherwise. procedure Verbose_Msg (N1 : Name_Id; S1 : String; N2 : Name_Id := No_Name; S2 : String := ""; Prefix : String := " -> "; Minimum_Verbosity : Opt.Verbosity_Level_Type := Opt.Low); -- If the verbose flag (Verbose_Mode) is set and the verbosity level is at -- least equal to Minimum_Verbosity, then print Prefix to standard output -- followed by N1 and S1. If N2 /= No_Name then N2 is printed after S1. S2 -- is printed last. Both N1 and N2 are printed in quotation marks. The two -- forms differ only in taking Name_Id or File_name_Type arguments. --------- -- Add -- --------- procedure Add (Option : String_Access; To : in out String_List_Access; Last : in out Natural) is begin if Last = To'Last then declare New_Options : constant String_List_Access := new String_List (1 .. To'Last * 2); begin New_Options (To'Range) := To.all; -- Set all elements of the original options to null to avoid -- deallocation of copies. To.all := (others => null); Free (To); To := New_Options; end; end if; Last := Last + 1; To (Last) := Option; end Add; procedure Add (Option : String; To : in out String_List_Access; Last : in out Natural) is begin Add (Option => new String'(Option), To => To, Last => Last); end Add; ---------------------------- -- Aggregate_Libraries_In -- ---------------------------- function Aggregate_Libraries_In (Tree : Project_Tree_Ref) return Boolean is List : Project_List; begin List := Tree.Projects; while List /= null loop if List.Project.Qualifier = Aggregate_Library then return True; end if; List := List.Next; end loop; return False; end Aggregate_Libraries_In; ------------------------- -- Base_Name_Index_For -- ------------------------- function Base_Name_Index_For (Main : String; Main_Index : Int; Index_Separator : Character) return File_Name_Type is Result : File_Name_Type; begin Name_Len := 0; Add_Str_To_Name_Buffer (Base_Name (Main)); -- Remove the extension, if any, that is the last part of the base name -- starting with a dot and following some characters. for J in reverse 2 .. Name_Len loop if Name_Buffer (J) = '.' then Name_Len := J - 1; exit; end if; end loop; -- Add the index info, if index is different from 0 if Main_Index > 0 then Add_Char_To_Name_Buffer (Index_Separator); declare Img : constant String := Main_Index'Img; begin Add_Str_To_Name_Buffer (Img (2 .. Img'Last)); end; end if; Result := Name_Find; return Result; end Base_Name_Index_For; ------------------------------ -- Check_Source_Info_In_ALI -- ------------------------------ function Check_Source_Info_In_ALI (The_ALI : ALI.ALI_Id; Tree : Project_Tree_Ref) return Name_Id is Result : Name_Id := No_Name; Unit_Name : Name_Id; begin -- Loop through units for U in ALIs.Table (The_ALI).First_Unit .. ALIs.Table (The_ALI).Last_Unit loop -- Check if the file name is one of the source of the unit Get_Name_String (Units.Table (U).Uname); Name_Len := Name_Len - 2; Unit_Name := Name_Find; if File_Not_A_Source_Of (Tree, Unit_Name, Units.Table (U).Sfile) then return No_Name; end if; if Result = No_Name then Result := Unit_Name; end if; -- Loop to do same check for each of the withed units for W in Units.Table (U).First_With .. Units.Table (U).Last_With loop declare WR : ALI.With_Record renames Withs.Table (W); begin if WR.Sfile /= No_File then Get_Name_String (WR.Uname); Name_Len := Name_Len - 2; Unit_Name := Name_Find; if File_Not_A_Source_Of (Tree, Unit_Name, WR.Sfile) then return No_Name; end if; end if; end; end loop; end loop; -- Loop to check subunits and replaced sources for D in ALIs.Table (The_ALI).First_Sdep .. ALIs.Table (The_ALI).Last_Sdep loop declare SD : Sdep_Record renames Sdep.Table (D); begin Unit_Name := SD.Subunit_Name; if Unit_Name = No_Name then -- Check if this source file has been replaced by a source with -- a different file name. if Tree /= null and then Tree.Replaced_Source_Number > 0 then declare Replacement : constant File_Name_Type := Replaced_Source_HTable.Get (Tree.Replaced_Sources, SD.Sfile); begin if Replacement /= No_File then if Opt.Verbosity_Level > Opt.Low then Put_Line ("source file" & Get_Name_String (SD.Sfile) & " has been replaced by " & Get_Name_String (Replacement)); end if; return No_Name; end if; end; end if; -- Check that a dependent source for a unit that is from a -- project is indeed a source of this unit. Unit_Name := SD.Unit_Name; if Unit_Name /= No_Name -- and then not Fname.Is_Internal_File_Name (SD.Sfile) and then File_Not_A_Source_Of (Tree, Unit_Name, SD.Sfile) then return No_Name; end if; else -- For separates, the file is no longer associated with the -- unit ("proc-sep.adb" is not associated with unit "proc.sep") -- so we need to check whether the source file still exists in -- the source tree: it will if it matches the naming scheme -- (and then will be for the same unit). if GPR.Find_Source (In_Tree => Tree, Project => No_Project, Base_Name => SD.Sfile) = No_Source then Get_Name_String (SD.Sfile); if Name_Len < 3 or else Name_Buffer (2) /= '-' or else (Name_Buffer (1) /= 'a' and then Name_Buffer (1) /= 'g' and then Name_Buffer (1) /= 'i' and then Name_Buffer (1) /= 's') then if Opt.Verbosity_Level > Opt.Low then Put_Line ("While parsing ALI file, file " & Get_Name_String (SD.Sfile) & " is indicated as containing subunit " & Get_Name_String (Unit_Name) & " but this does not match what was found while" & " parsing the project. Will recompile"); end if; return No_Name; end if; end if; end if; end; end loop; return Result; end Check_Source_Info_In_ALI; -------------------------------- -- Create_Binder_Mapping_File -- -------------------------------- function Create_Binder_Mapping_File (Project_Tree : Project_Tree_Ref) return Path_Name_Type is Mapping_Path : Path_Name_Type := No_Path; Mapping_FD : File_Descriptor := Invalid_FD; -- A File Descriptor for an eventual mapping file ALI_Unit : Unit_Name_Type := No_Unit_Name; -- The unit name of an ALI file ALI_Name : File_Name_Type := No_File; -- The file name of the ALI file ALI_Project : Project_Id := No_Project; -- The project of the ALI file Bytes : Integer; OK : Boolean := False; Unit : Unit_Index; Status : Boolean; -- For call to Close Iter : Source_Iterator := For_Each_Source (In_Tree => Project_Tree, Language => Name_Ada, Encapsulated_Libs => False, Locally_Removed => False); Source : GPR.Source_Id; begin Tempdir.Create_Temp_File (Mapping_FD, Mapping_Path); Record_Temp_File (Project_Tree.Shared, Mapping_Path); if Mapping_FD /= Invalid_FD then OK := True; loop Source := Element (Iter); exit when Source = No_Source; Unit := Source.Unit; if Source.Replaced_By /= No_Source or else Unit = No_Unit_Index or else Unit.Name = No_Name then ALI_Name := No_File; -- If this is a body, put it in the mapping elsif Source.Kind = Impl and then Unit.File_Names (Impl) /= No_Source and then Unit.File_Names (Impl).Project /= No_Project then Get_Name_String (Unit.Name); Add_Str_To_Name_Buffer ("%b"); ALI_Unit := Name_Find; ALI_Name := Lib_File_Name (Unit.File_Names (Impl).Display_File); ALI_Project := Unit.File_Names (Impl).Project; -- Otherwise, if this is a spec and there is no body, put it in -- the mapping. elsif Source.Kind = Spec and then Unit.File_Names (Impl) = No_Source and then Unit.File_Names (Spec) /= No_Source and then Unit.File_Names (Spec).Project /= No_Project then Get_Name_String (Unit.Name); Add_Str_To_Name_Buffer ("%s"); ALI_Unit := Name_Find; ALI_Name := Lib_File_Name (Unit.File_Names (Spec).Display_File); ALI_Project := Unit.File_Names (Spec).Project; else ALI_Name := No_File; end if; -- If we have something to put in the mapping then do it now. If -- the project is extended, look for the ALI file in the project, -- then in the extending projects in order, and use the last one -- found. if ALI_Name /= No_File then -- Look in the project and the projects that are extending it -- to find the real ALI file. declare ALI : constant String := Get_Name_String (ALI_Name); ALI_Path : Name_Id := No_Name; begin loop -- For library projects, use the library ALI directory, -- for other projects, use the object directory. if ALI_Project.Library then Get_Name_String (ALI_Project.Library_ALI_Dir.Display_Name); else Get_Name_String (ALI_Project.Object_Directory.Display_Name); end if; Add_Str_To_Name_Buffer (ALI); if Is_Regular_File (Name_Buffer (1 .. Name_Len)) then ALI_Path := Name_Find; end if; ALI_Project := ALI_Project.Extended_By; exit when ALI_Project = No_Project; end loop; if ALI_Path /= No_Name then -- First line is the unit name Get_Name_String (ALI_Unit); Add_Char_To_Name_Buffer (ASCII.LF); Bytes := Write (Mapping_FD, Name_Buffer (1)'Address, Name_Len); OK := Bytes = Name_Len; exit when not OK; -- Second line is the ALI file name Get_Name_String (ALI_Name); Add_Char_To_Name_Buffer (ASCII.LF); Bytes := Write (Mapping_FD, Name_Buffer (1)'Address, Name_Len); OK := (Bytes = Name_Len); exit when not OK; -- Third line is the ALI path name Get_Name_String (ALI_Path); Add_Char_To_Name_Buffer (ASCII.LF); Bytes := Write (Mapping_FD, Name_Buffer (1)'Address, Name_Len); OK := (Bytes = Name_Len); -- If OK is False, it means we were unable to write a -- line. No point in continuing with the other units. exit when not OK; end if; end; end if; Next (Iter); end loop; Close (Mapping_FD, Status); OK := OK and Status; end if; -- If the creation of the mapping file was successful, we add the switch -- to the arguments of gnatbind. if OK then return Mapping_Path; else return No_Path; end if; end Create_Binder_Mapping_File; -------------------------- -- File_Not_A_Source_Of -- -------------------------- function File_Not_A_Source_Of (Project_Tree : Project_Tree_Ref; Uname : Name_Id; Sfile : File_Name_Type) return Boolean is Unit : constant Unit_Index := Units_Htable.Get (Project_Tree.Units_HT, Uname); At_Least_One_File : Boolean := False; begin if Unit /= No_Unit_Index then for F in Unit.File_Names'Range loop if Unit.File_Names (F) /= null then At_Least_One_File := True; if Unit.File_Names (F).File = Sfile then return False; end if; end if; end loop; if not At_Least_One_File then -- The unit was probably created initially for a separate unit -- (which are initially created as IMPL when both suffixes are the -- same). Later on, Override_Kind changed the type of the file, -- and the unit is no longer valid in fact. return False; end if; Verbose_Msg (Uname, "sources do not include ", Name_Id (Sfile)); return True; end if; return False; end File_Not_A_Source_Of; --------------------- -- Get_Directories -- --------------------- procedure Get_Directories (Project_Tree : Project_Tree_Ref; For_Project : Project_Id; Activity : Activity_Type; Languages : Name_Ids) is procedure Recursive_Add (Project : Project_Id; Tree : Project_Tree_Ref; Extended : in out Boolean); -- Add all the source directories of a project to the path only if -- this project has not been visited. Calls itself recursively for -- projects being extended, and imported projects. procedure Add_Dir (Value : Path_Name_Type); -- Add directory Value in table Directories, if it is defined and not -- already there. ------------- -- Add_Dir -- ------------- procedure Add_Dir (Value : Path_Name_Type) is Add_It : Boolean := True; begin if Value /= No_Path and then Is_Directory (Get_Name_String (Value)) then for Index in 1 .. Directories.Last loop if Directories.Table (Index) = Value then Add_It := False; exit; end if; end loop; if Add_It then Directories.Increment_Last; Directories.Table (Directories.Last) := Value; end if; end if; end Add_Dir; ------------------- -- Recursive_Add -- ------------------- procedure Recursive_Add (Project : Project_Id; Tree : Project_Tree_Ref; Extended : in out Boolean) is Current : String_List_Id; Dir : String_Element; OK : Boolean := False; Lang_Proc : Language_Ptr := Project.Languages; begin -- Add to path all directories of this project if Activity = Compilation then Lang_Loop : while Lang_Proc /= No_Language_Index loop for J in Languages'Range loop OK := Lang_Proc.Name = Languages (J); exit Lang_Loop when OK; end loop; Lang_Proc := Lang_Proc.Next; end loop Lang_Loop; if OK then Current := Project.Source_Dirs; while Current /= Nil_String loop Dir := Tree.Shared.String_Elements.Table (Current); Add_Dir (Path_Name_Type (Dir.Value)); Current := Dir.Next; end loop; end if; elsif Project.Library then if Activity = SAL_Binding and then Extended then Add_Dir (Project.Object_Directory.Display_Name); else Add_Dir (Project.Library_ALI_Dir.Display_Name); end if; else Add_Dir (Project.Object_Directory.Display_Name); end if; if Project.Extends = No_Project then Extended := False; end if; end Recursive_Add; procedure For_All_Projects is new For_Every_Project_Imported (Boolean, Recursive_Add); Extended : Boolean := True; -- Start of processing for Get_Directories begin Directories.Init; For_All_Projects (For_Project, Project_Tree, Extended); end Get_Directories; ------------ -- Inform -- ------------ procedure Inform (N : File_Name_Type; Msg : String) is begin Inform (Name_Id (N), Msg); end Inform; procedure Inform (N : Name_Id := No_Name; Msg : String) is begin Write_Program_Name; if N /= No_Name then Write_Char ('"'); declare Name : constant String := Get_Name_String (N); begin if Debug.Debug_Flag_F and then Is_Absolute_Path (Name) then Write_Str (File_Name (Name)); else Write_Str (Name); end if; end; Write_Str (""" "); end if; Write_Line (Msg); end Inform; ---------------------------- -- Is_External_Assignment -- ---------------------------- function Is_External_Assignment (Env : GPR.Tree.Environment; Argv : String) return Boolean is Start : Positive := 3; Finish : Natural := Argv'Last; pragma Assert (Argv'First = 1); pragma Assert (Argv (1 .. 2) = "-X"); begin if Argv'Last < 5 then return False; elsif Argv (3) = '"' then if Argv (Argv'Last) /= '"' or else Argv'Last < 7 then return False; else Start := 4; Finish := Argv'Last - 1; end if; end if; return GPR.Ext.Check (Self => Env.External, Declaration => Argv (Start .. Finish)); end Is_External_Assignment; ------------------- -- Lib_File_Name -- ------------------- function Lib_File_Name (Source_File : File_Name_Type; Munit_Index : Nat := 0) return File_Name_Type is begin Get_Name_String (Source_File); for J in reverse 2 .. Name_Len loop if Name_Buffer (J) = '.' then Name_Len := J - 1; exit; end if; end loop; if Munit_Index /= 0 then Add_Char_To_Name_Buffer (Multi_Unit_Index_Character); Add_Nat_To_Name_Buffer (Munit_Index); end if; Add_Str_To_Name_Buffer (".ali"); return Name_Find; end Lib_File_Name; ----------- -- Mains -- ----------- package body Mains is package Names is new GNAT.Table (Table_Component_Type => Main_Info, Table_Index_Type => Integer, Table_Low_Bound => 1, Table_Initial => 10, Table_Increment => 100); -- The table that stores the mains Current : Natural := 0; -- The index of the last main retrieved from the table Count_Of_Mains_With_No_Tree : Natural := 0; -- Number of main units for which we do not know the project tree -------------- -- Add_Main -- -------------- procedure Add_Main (Name : String; Index : Int := 0; Location : Source_Ptr := No_Location; Project : Project_Id := No_Project; Tree : Project_Tree_Ref := null) is Canonical_Name : File_Name_Type; begin Name_Len := 0; Add_Str_To_Name_Buffer (Name); Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len)); Canonical_Name := Name_Find; -- Check if this main is already in table Names. If it is, do not -- put it again, to avoid binding and linking the same main several -- times in parallel when -jnn is used, as this does not work on all -- platforms. for J in 1 .. Names.Last loop if Canonical_Name = Names.Table (J).File and then Index = Names.Table (J).Index and then Project = Names.Table (J).Project then return; end if; end loop; if Current_Verbosity = High then Debug_Output ("Add_Main """ & Name & """ " & Index'Img & " with_tree? " & Boolean'Image (Tree /= null)); end if; Name_Len := 0; Add_Str_To_Name_Buffer (Name); Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len)); Names.Increment_Last; Names.Table (Names.Last) := (Name_Find, Index, Location, No_Source, Project, Tree); if Tree /= null then Builder_Data (Tree).Number_Of_Mains := Builder_Data (Tree).Number_Of_Mains + 1; else Mains.Count_Of_Mains_With_No_Tree := Mains.Count_Of_Mains_With_No_Tree + 1; end if; end Add_Main; -------------------- -- Complete_Mains -- -------------------- procedure Complete_Mains (Flags : Processing_Flags; Root_Project : Project_Id; Project_Tree : Project_Tree_Ref; Unique_Compile : Boolean := False) is procedure Do_Complete (Project : Project_Id; Tree : Project_Tree_Ref); -- Check the mains for this specific project procedure Complete_All is new For_Project_And_Aggregated (Do_Complete); procedure Add_Multi_Unit_Sources (Tree : Project_Tree_Ref; Source : GPR.Source_Id); -- Add all units from the same file as the multi-unit Source function Find_File_Add_Extension (Tree : Project_Tree_Ref; Base_Main : String) return GPR.Source_Id; -- Search for Main in the project, adding body or spec extensions ---------------------------- -- Add_Multi_Unit_Sources -- ---------------------------- procedure Add_Multi_Unit_Sources (Tree : Project_Tree_Ref; Source : GPR.Source_Id) is Iter : Source_Iterator; Src : GPR.Source_Id; begin Debug_Output ("found multi-unit source file in project", Source.Project.Name); Iter := For_Each_Source (In_Tree => Tree, Project => Source.Project); while Element (Iter) /= No_Source loop Src := Element (Iter); if Src.File = Source.File and then Src.Index /= Source.Index then if Src.File = Source.File then Debug_Output ("add main in project, index=" & Src.Index'Img); end if; Names.Increment_Last; Names.Table (Names.Last) := (File => Src.File, Index => Src.Index, Location => No_Location, Source => Src, Project => Src.Project, Tree => Tree); Builder_Data (Tree).Number_Of_Mains := Builder_Data (Tree).Number_Of_Mains + 1; end if; Next (Iter); end loop; end Add_Multi_Unit_Sources; ----------------------------- -- Find_File_Add_Extension -- ----------------------------- function Find_File_Add_Extension (Tree : Project_Tree_Ref; Base_Main : String) return GPR.Source_Id is Spec_Source : GPR.Source_Id := No_Source; Source : GPR.Source_Id; Iter : Source_Iterator; Suffix : File_Name_Type; begin Source := No_Source; Iter := For_Each_Source (Tree); -- In all projects loop Source := GPR.Element (Iter); exit when Source = No_Source; if Source.Kind = Impl then Get_Name_String (Source.File); if Name_Len > Base_Main'Length and then Name_Buffer (1 .. Base_Main'Length) = Base_Main then Suffix := Source.Language.Config.Naming_Data.Body_Suffix; if Suffix /= No_File then declare Suffix_Str : String := Get_Name_String (Suffix); begin Canonical_Case_File_Name (Suffix_Str); exit when Name_Buffer (Base_Main'Length + 1 .. Name_Len) = Suffix_Str; end; end if; end if; elsif Source.Kind = Spec and then Source.Language.Config.Kind = Unit_Based then -- An Ada spec needs to be taken into account unless there -- is also a body. So we delay the decision for them. Get_Name_String (Source.File); if Name_Len > Base_Main'Length and then Name_Buffer (1 .. Base_Main'Length) = Base_Main then Suffix := Source.Language.Config.Naming_Data.Spec_Suffix; if Suffix /= No_File then declare Suffix_Str : String := Get_Name_String (Suffix); begin Canonical_Case_File_Name (Suffix_Str); if Name_Buffer (Base_Main'Length + 1 .. Name_Len) = Suffix_Str then Spec_Source := Source; end if; end; end if; end if; end if; Next (Iter); end loop; if Source = No_Source then Source := Spec_Source; end if; return Source; end Find_File_Add_Extension; ----------------- -- Do_Complete -- ----------------- procedure Do_Complete (Project : Project_Id; Tree : Project_Tree_Ref) is J : Integer; begin if Mains.Number_Of_Mains (Tree) > 0 or else Mains.Count_Of_Mains_With_No_Tree > 0 then -- Traverse in reverse order, since in the case of multi-unit -- files we will be adding extra files at the end, and there's -- no need to process them in turn. J := Names.Last; Main_Loop : loop declare File : Main_Info := Names.Table (J); Main_Id : File_Name_Type := File.File; Main : constant String := Get_Name_String (Main_Id); Base : constant String := Base_Name (Main); Source : GPR.Source_Id := No_Source; Is_Absolute : Boolean := False; begin if Base /= Main then Is_Absolute := True; if Is_Absolute_Path (Main) then Main_Id := Create_Name (Base); -- Not an absolute path else -- Always resolve links here, so that users can be -- specify any name on the command line. If the -- project itself uses links, the user will be -- using -eL anyway, and thus files are also stored -- with resolved names. declare Absolute : constant String := Normalize_Pathname (Name => Main, Directory => "", Resolve_Links => True, Case_Sensitive => False); begin File.File := Create_Name (Absolute); Main_Id := Create_Name (Base); end; end if; end if; -- If no project or tree was specified for the main, it -- came from the command line. -- Note that the assignments below will not modify inside -- the table itself. if File.Project = null then File.Project := Project; end if; if File.Tree = null then File.Tree := Tree; end if; if File.Source = null then if Current_Verbosity = High then Debug_Output ("search for main """ & Main & '"' & File.Index'Img & " in " & Get_Name_String (Debug_Name (File.Tree)) & ", project", Project.Name); end if; -- First, look for the main as specified. We need to -- search for the base name though, and if needed -- check later that we found the correct file. declare Sources : constant Source_Ids := Find_All_Sources (In_Tree => File.Tree, Project => File.Project, Base_Name => Main_Id, Index => File.Index, In_Imported_Only => True); begin if Is_Absolute then for J in Sources'Range loop if File_Name_Type (Sources (J).Path.Name) = File.File then Source := Sources (J); exit; end if; end loop; elsif Sources'Length > 1 then -- This is only allowed if the units are from -- the same multi-unit source file. Source := Sources (1); for J in 2 .. Sources'Last loop if Sources (J).Path /= Source.Path or else Sources (J).Index = Source.Index then Error_Msg_File_1 := Main_Id; GPR.Err.Error_Msg (Flags, "several main sources {", No_Location, File.Project); exit Main_Loop; end if; end loop; elsif Sources'Length = 1 then Source := Sources (Sources'First); end if; end; if Source = No_Source then Source := Find_File_Add_Extension (File.Tree, Get_Name_String (Main_Id)); end if; if Is_Absolute and then Source /= No_Source and then File_Name_Type (Source.Path.Name) /= File.File then Debug_Output ("Found a non-matching file", Name_Id (Source.Path.Display_Name)); Source := No_Source; end if; if Source /= No_Source then if not Is_Allowed_Language (Source.Language.Name) then -- Remove any main that is not in the list of -- restricted languages. Names.Table (J .. Names.Last - 1) := Names.Table (J + 1 .. Names.Last); Names.Set_Last (Names.Last - 1); else -- If we have found a multi-unit source file but -- did not specify an index initially, we'll -- need to compile all the units from the same -- source file. if Source.Index /= 0 and then File.Index = 0 then Add_Multi_Unit_Sources (File.Tree, Source); end if; -- A main cannot be a source of a library -- project. if (not Opt.Compile_Only or else Opt.Bind_Only) and then not Unique_Compile and then Source.Project.Library then Error_Msg_File_1 := Main_Id; GPR.Err.Error_Msg (Flags, "main cannot be a source" & " of a library project: {", No_Location, File.Project); else -- Now update the original Main, otherwise it -- will be reported as not found. Debug_Output ("found main in project", Source.Project.Name); Names.Table (J).File := Source.File; Names.Table (J).Project := Source.Project; if Names.Table (J).Tree = null then Names.Table (J).Tree := File.Tree; Builder_Data (File.Tree).Number_Of_Mains := Builder_Data (File.Tree).Number_Of_Mains + 1; Mains.Count_Of_Mains_With_No_Tree := Mains.Count_Of_Mains_With_No_Tree - 1; end if; Names.Table (J).Source := Source; Names.Table (J).Index := Source.Index; end if; end if; elsif File.Location /= No_Location then -- If the main is declared in package Builder of -- the main project, report an error. If the main -- is on the command line, it may be a main from -- another project, so do nothing: if the main does -- not exist in another project, an error will be -- reported later. Error_Msg_File_1 := Main_Id; Error_Msg_Name_1 := File.Project.Name; GPR.Err.Error_Msg (Flags, "{ is not a source of project %%", File.Location, File.Project); end if; end if; end; J := J - 1; exit Main_Loop when J < Names.First; end loop Main_Loop; end if; if Total_Errors_Detected > 0 then Fail_Program (Tree, "problems with main sources"); end if; end Do_Complete; -- Start of processing for Complete_Mains begin Complete_All (Root_Project, Project_Tree); if Mains.Count_Of_Mains_With_No_Tree > 0 then for J in Names.First .. Names.Last loop if Names.Table (J).Source = No_Source then Fail_Program (Project_Tree, '"' & Get_Name_String (Names.Table (J).File) & """ is not a source of any project"); end if; end loop; end if; end Complete_Mains; ------------ -- Delete -- ------------ procedure Delete is begin Names.Set_Last (0); Mains.Reset; end Delete; ----------------------- -- Fill_From_Project -- ----------------------- procedure Fill_From_Project (Root_Project : Project_Id; Project_Tree : Project_Tree_Ref) is procedure Add_Mains_From_Project (Project : Project_Id; Tree : Project_Tree_Ref); -- Add the main units from this project into Mains. -- This takes into account the aggregated projects ---------------------------- -- Add_Mains_From_Project -- ---------------------------- procedure Add_Mains_From_Project (Project : Project_Id; Tree : Project_Tree_Ref) is List : String_List_Id; Element : String_Element; begin if Number_Of_Mains (Tree) = 0 and then Mains.Count_Of_Mains_With_No_Tree = 0 then Debug_Output ("Add_Mains_From_Project", Project.Name); List := Project.Mains; if List /= GPR.Nil_String then -- The attribute Main is not an empty list. Get the mains in -- the list. while List /= GPR.Nil_String loop Element := Tree.Shared.String_Elements.Table (List); Debug_Output ("Add_Main", Element.Value); if Project.Library then Fail_Program (Tree, "cannot specify a main program " & "for a library project file"); end if; Add_Main (Name => Get_Name_String (Element.Value), Index => Element.Index, Location => Element.Location, Project => Project, Tree => Tree); List := Element.Next; end loop; end if; end if; if Total_Errors_Detected > 0 then Fail_Program (Tree, "problems with main sources"); end if; end Add_Mains_From_Project; procedure Fill_All is new For_Project_And_Aggregated (Add_Mains_From_Project); -- Start of processing for Fill_From_Project begin Fill_All (Root_Project, Project_Tree); end Fill_From_Project; --------------- -- Next_Main -- --------------- function Next_Main return String is Info : constant Main_Info := Next_Main; begin if Info = No_Main_Info then return ""; else return Get_Name_String (Info.File); end if; end Next_Main; function Next_Main return Main_Info is begin if Current >= Names.Last then return No_Main_Info; else Current := Current + 1; return Names.Table (Current); end if; end Next_Main; --------------------- -- Number_Of_Mains -- --------------------- function Number_Of_Mains (Tree : Project_Tree_Ref) return Natural is begin if Tree = null then return Names.Last; else return Builder_Data (Tree).Number_Of_Mains; end if; end Number_Of_Mains; ----------- -- Reset -- ----------- procedure Reset is begin Current := 0; end Reset; -------------------------- -- Set_Multi_Unit_Index -- -------------------------- procedure Set_Multi_Unit_Index (Project_Tree : Project_Tree_Ref := null; Index : Int := 0) is begin if Index /= 0 then if Names.Last = 0 then Fail_Program (Project_Tree, "cannot specify a multi-unit index but no main " & "on the command line"); elsif Names.Last > 1 then Fail_Program (Project_Tree, "cannot specify several mains with a multi-unit index"); else Names.Table (Names.Last).Index := Index; end if; end if; end Set_Multi_Unit_Index; end Mains; ----------------------- -- Path_Or_File_Name -- ----------------------- function Path_Or_File_Name (Path : Path_Name_Type) return String is Path_Name : constant String := Get_Name_String (Path); begin if Debug.Debug_Flag_F then return File_Name (Path_Name); else return Path_Name; end if; end Path_Or_File_Name; ----------------- -- Verbose_Msg -- ----------------- procedure Verbose_Msg (N1 : Name_Id; S1 : String; N2 : Name_Id := No_Name; S2 : String := ""; Prefix : String := " -> "; Minimum_Verbosity : Opt.Verbosity_Level_Type := Opt.Low) is begin if not Opt.Verbose_Mode or else Minimum_Verbosity > Opt.Verbosity_Level then return; end if; Put (Prefix); Put (""""); Put (Get_Name_String (N1)); Put (""" "); Put (S1); if N2 /= No_Name then Put (" """); Put (Get_Name_String (N2)); Put (""" "); end if; Put (S2); New_Line; end Verbose_Msg; ----------- -- Queue -- ----------- package body Queue is type Q_Record is record Info : Source_Info; Processed : Boolean; end record; package Q is new GNAT.Table (Table_Component_Type => Q_Record, Table_Index_Type => Natural, Table_Low_Bound => 1, Table_Initial => 1000, Table_Increment => 100); -- This is the actual Queue package Busy_Obj_Dirs is new GNAT.HTable.Simple_HTable (Header_Num => GPR.Header_Num, Element => Boolean, No_Element => False, Key => Path_Name_Type, Hash => Hash, Equal => "="); Q_Processed : Natural := 0; Q_Initialized : Boolean := False; Q_First : Natural := 1; -- Points to the first valid element in the queue One_Queue_Per_Obj_Dir : Boolean := False; -- See parameter to Initialize function Available_Obj_Dir (S : Source_Info) return Boolean; -- Whether the object directory for S is available for a build procedure Debug_Display (S : Source_Info); -- A debug display for S function Was_Processed (S : Source_Info) return Boolean; -- Whether S has already been processed. This marks the source as -- processed, if it hasn't already been processed. function Insert_No_Roots (Source : Source_Info) return Boolean; -- Insert Source, but do not look for its roots (see doc for Insert) ------------------- -- Was_Processed -- ------------------- function Was_Processed (S : Source_Info) return Boolean is begin return S.Id.In_The_Queue; end Was_Processed; ----------------------- -- Available_Obj_Dir -- ----------------------- function Available_Obj_Dir (S : Source_Info) return Boolean is begin return not Busy_Obj_Dirs.Get (S.Id.Project.Object_Directory.Name); end Available_Obj_Dir; ------------------- -- Debug_Display -- ------------------- procedure Debug_Display (S : Source_Info) is begin Put (Get_Name_String (S.Id.File)); if S.Id.Index /= 0 then Put (","); Put (S.Id.Index'Img); end if; end Debug_Display; ------------- -- Extract -- ------------- procedure Extract (Found : out Boolean; Source : out Source_Info) is begin Found := False; if One_Queue_Per_Obj_Dir then for J in Q_First .. Q.Last loop if not Q.Table (J).Processed and then Available_Obj_Dir (Q.Table (J).Info) then Found := True; Source := Q.Table (J).Info; Q.Table (J).Processed := True; if J = Q_First then while Q_First <= Q.Last and then Q.Table (Q_First).Processed loop Q_First := Q_First + 1; end loop; end if; exit; end if; end loop; elsif Q_First <= Q.Last then Source := Q.Table (Q_First).Info; Q.Table (Q_First).Processed := True; Q_First := Q_First + 1; Found := True; end if; if Found then Q_Processed := Q_Processed + 1; end if; if Found and then Debug.Debug_Flag_Q then Ada.Text_IO.Put (" Q := Q - [ "); Debug_Display (Source); Ada.Text_IO.Put (" ]"); New_Line; Ada.Text_IO.Put (" Q_First ="); Ada.Text_IO.Put (Q_First'Img); New_Line; Ada.Text_IO.Put (" Q.Last ="); Ada.Text_IO.Put (Q.Last'Img); New_Line; end if; end Extract; --------------- -- Processed -- --------------- function Processed return Natural is begin return Q_Processed; end Processed; ---------------- -- Initialize -- ---------------- procedure Initialize (Queue_Per_Obj_Dir : Boolean; Force : Boolean := False) is begin if Force or else not Q_Initialized then Q_Initialized := True; for J in 1 .. Q.Last loop Q.Table (J).Info.Id.In_The_Queue := False; end loop; Q.Init; Q_Processed := 0; Q_First := 1; One_Queue_Per_Obj_Dir := Queue_Per_Obj_Dir; end if; end Initialize; --------------------- -- Insert_No_Roots -- --------------------- function Insert_No_Roots (Source : Source_Info) return Boolean is begin pragma Assert (Source.Id /= No_Source); -- Only insert in the Q if it is not already done, to avoid -- simultaneous compilations if -jnnn is used. if Was_Processed (Source) then return False; end if; -- Check if a source has already been inserted in the queue from the -- same project in a different project tree. for J in 1 .. Q.Last loop if Source.Id.Path.Name = Q.Table (J).Info.Id.Path.Name and then Source.Id.Index = Q.Table (J).Info.Id.Index and then Ultimate_Extending_Project_Of (Source.Id.Project).Path.Name = Ultimate_Extending_Project_Of (Q.Table (J).Info.Id.Project). Path.Name then -- No need to insert this source in the queue, but still -- return True as we may need to insert its roots. return True; end if; end loop; if Current_Verbosity = High then Put ("Adding """); Debug_Display (Source); Put_Line (""" to the queue"); end if; Q.Append (New_Val => (Info => Source, Processed => False)); Source.Id.In_The_Queue := True; if Debug.Debug_Flag_Q then Ada.Text_IO.Put (" Q := Q + [ "); Debug_Display (Source); Ada.Text_IO.Put (" ] "); New_Line; Ada.Text_IO.Put (" Q_First ="); Ada.Text_IO.Put (Q_First'Img); New_Line; Ada.Text_IO.Put (" Q.Last ="); Ada.Text_IO.Put (Q.Last'Img); New_Line; end if; return True; end Insert_No_Roots; ------------ -- Insert -- ------------ function Insert (Source : Source_Info; With_Roots : Boolean := False) return Boolean is Root_Arr : Array_Element_Id; Roots : Variable_Value; List : String_List_Id; Elem : String_Element; Unit_Name : Name_Id; Pat_Root : Boolean; Root_Pattern : Regexp; Root_Found : Boolean; Roots_Found : Boolean; Root_Source : GPR.Source_Id; Iter : Source_Iterator; Dummy : Boolean; begin if not Insert_No_Roots (Source) then -- Was already in the queue return False; end if; if With_Roots then Debug_Output ("looking for roots of", Name_Id (Source.Id.File)); Root_Arr := GPR.Util.Value_Of (Name => Name_Roots, In_Arrays => Source.Id.Project.Decl.Arrays, Shared => Source.Tree.Shared); Roots := GPR.Util.Value_Of (Index => Name_Id (Source.Id.File), Src_Index => 0, In_Array => Root_Arr, Shared => Source.Tree.Shared); -- If there is no roots for the specific main, try the language if Roots = Nil_Variable_Value then Roots := GPR.Util.Value_Of (Index => Source.Id.Language.Name, Src_Index => 0, In_Array => Root_Arr, Shared => Source.Tree.Shared, Force_Lower_Case_Index => True); end if; -- Then try "*" if Roots = Nil_Variable_Value then Name_Len := 1; Name_Buffer (1) := '*'; Roots := GPR.Util.Value_Of (Index => Name_Find, Src_Index => 0, In_Array => Root_Arr, Shared => Source.Tree.Shared, Force_Lower_Case_Index => True); end if; if Roots = Nil_Variable_Value then Debug_Output (" -> no roots declared"); else List := Roots.Values; -- case of empty root list if List = Nil_String then Source.Id.Roots := new Source_Roots' (Root => No_Source, Next => null); end if; Pattern_Loop : while List /= Nil_String loop Elem := Source.Tree.Shared.String_Elements.Table (List); Get_Name_String (Elem.Value); To_Lower (Name_Buffer (1 .. Name_Len)); Unit_Name := Name_Find; -- Check if it is a unit name or a pattern Pat_Root := False; for J in 1 .. Name_Len loop if Name_Buffer (J) not in 'a' .. 'z' and then Name_Buffer (J) not in '0' .. '9' and then Name_Buffer (J) /= '_' and then Name_Buffer (J) /= '.' then Pat_Root := True; exit; end if; end loop; if Pat_Root then begin Root_Pattern := Compile (Pattern => Name_Buffer (1 .. Name_Len), Glob => True); exception when Error_In_Regexp => Error_Msg_Name_1 := Unit_Name; Error_Msg ("invalid pattern %", Roots.Location); exit Pattern_Loop; end; end if; Roots_Found := False; Iter := For_Each_Source (Source.Tree); Source_Loop : loop Root_Source := GPR.Element (Iter); exit Source_Loop when Root_Source = No_Source; Root_Found := False; if Pat_Root then Root_Found := Root_Source.Unit /= No_Unit_Index and then Match (Get_Name_String (Root_Source.Unit.Name), Root_Pattern); else Root_Found := Root_Source.Unit /= No_Unit_Index and then Root_Source.Unit.Name = Unit_Name; end if; if Root_Found then case Root_Source.Kind is when Impl => null; when Spec => Root_Found := Other_Part (Root_Source) = No_Source; when Sep => Root_Found := False; end case; end if; if Root_Found then Roots_Found := True; Debug_Output (" -> ", Name_Id (Root_Source.Display_File)); Dummy := Queue.Insert_No_Roots (Source => (Tree => Source.Tree, Id => Root_Source, Closure => False)); Initialize_Source_Record (Root_Source); if Other_Part (Root_Source) /= No_Source then Initialize_Source_Record (Other_Part (Root_Source)); end if; -- Save the root for the binder Source.Id.Roots := new Source_Roots' (Root => Root_Source, Next => Source.Id.Roots); exit Source_Loop when not Pat_Root; end if; Next (Iter); end loop Source_Loop; if not Roots_Found then if Pat_Root then if not Quiet_Output then Error_Msg_Name_1 := Unit_Name; Error_Msg ("?no unit matches pattern %", Roots.Location); end if; else Error_Msg ("Unit " & Get_Name_String (Unit_Name) & " does not exist", Roots.Location); end if; end if; List := Elem.Next; end loop Pattern_Loop; end if; end if; return True; end Insert; ------------ -- Insert -- ------------ procedure Insert (Source : Source_Info; With_Roots : Boolean := False) is Discard : Boolean; begin Discard := Insert (Source, With_Roots); end Insert; -------------- -- Is_Empty -- -------------- function Is_Empty return Boolean is begin return Q_Processed >= Q.Last; end Is_Empty; ------------------------ -- Is_Virtually_Empty -- ------------------------ function Is_Virtually_Empty return Boolean is begin if One_Queue_Per_Obj_Dir then for J in Q_First .. Q.Last loop if not Q.Table (J).Processed and then Available_Obj_Dir (Q.Table (J).Info) then return False; end if; end loop; return True; else return Is_Empty; end if; end Is_Virtually_Empty; ---------------------- -- Set_Obj_Dir_Busy -- ---------------------- procedure Set_Obj_Dir_Busy (Obj_Dir : Path_Name_Type) is begin if One_Queue_Per_Obj_Dir then Busy_Obj_Dirs.Set (Obj_Dir, True); end if; end Set_Obj_Dir_Busy; ---------------------- -- Set_Obj_Dir_Free -- ---------------------- procedure Set_Obj_Dir_Free (Obj_Dir : Path_Name_Type) is begin if One_Queue_Per_Obj_Dir then Busy_Obj_Dirs.Set (Obj_Dir, False); end if; end Set_Obj_Dir_Free; ---------- -- Size -- ---------- function Size return Natural is begin return Q.Last; end Size; ------------- -- Element -- ------------- function Element (Rank : Positive) return File_Name_Type is begin if Rank <= Q.Last then return Q.Table (Rank).Info.Id.File; else return No_File; end if; end Element; ---------------------------- -- Insert_Project_Sources -- ---------------------------- procedure Insert_Project_Sources (Project : Project_Id; Project_Tree : Project_Tree_Ref; All_Projects : Boolean; Unique_Compile : Boolean) is procedure Do_Insert (Project : Project_Id; Tree : Project_Tree_Ref; Context : Project_Context); -- Local procedures must be commented ??? --------------- -- Do_Insert -- --------------- procedure Do_Insert (Project : Project_Id; Tree : Project_Tree_Ref; Context : Project_Context) is Unit_Based : constant Boolean := Unique_Compile or else not Builder_Data (Tree).Closure_Needed; -- When Unit_Based is True, we enqueue all compilable sources -- including the unit based (Ada) one. When Unit_Based is False, -- put the Ada sources only when they are in a library project. Iter : Source_Iterator; Source : GPR.Source_Id; OK : Boolean; Closure : Boolean; Proj : Project_Id; begin -- Nothing to do when "-u" was specified and some files were -- specified on the command line if Unique_Compile and then Mains.Number_Of_Mains (Tree) > 0 then return; end if; Iter := For_Each_Source (Tree); loop Source := GPR.Element (Iter); exit when Source = No_Source; Proj := Ultimate_Extending_Project_Of (Source.Project); if Is_Allowed_Language (Source.Language.Name) and then Is_Compilable (Source) and then (All_Projects or else Is_Extending (Project, Source.Project)) and then not Source.Locally_Removed and then Source.Replaced_By = No_Source and then not Proj.Externally_Built and then Source.Kind /= Sep and then Source.Path /= No_Path_Information then if Source.Kind = Impl or else (Source.Unit /= No_Unit_Index and then Source.Kind = Spec and then (Other_Part (Source) = No_Source or else Other_Part (Source).Locally_Removed)) then if (Unit_Based or else Source.Unit = No_Unit_Index or else Source.Project.Library or else Context.In_Aggregate_Lib or else Project.Qualifier = Aggregate_Library) and then not Is_Subunit (Source) then OK := True; Closure := False; if Source.Unit /= No_Unit_Index and then (Source.Project.Library or else Project.Qualifier = Aggregate_Library or else Context.In_Aggregate_Lib) and then Source.Project.Standalone_Library /= No then -- Check if the unit is in the interface OK := False; declare List : String_List_Id; Element : String_Element; begin List := Source.Project.Lib_Interface_ALIs; while List /= Nil_String loop Element := Project_Tree.Shared.String_Elements.Table (List); if Element.Value = Name_Id (Source.Dep_Name) then OK := True; Closure := True; exit; end if; List := Element.Next; end loop; end; end if; if OK then Queue.Insert (Source => (Tree => Tree, Id => Source, Closure => Closure)); end if; end if; end if; end if; Next (Iter); end loop; end Do_Insert; procedure Insert_All is new For_Project_And_Aggregated_Context (Do_Insert); begin Insert_All (Project, Project_Tree); end Insert_Project_Sources; ------------------------------- -- Insert_Withed_Sources_For -- ------------------------------- procedure Insert_Withed_Sources_For (The_ALI : ALI.ALI_Id; Project_Tree : Project_Tree_Ref; Excluding_Shared_SALs : Boolean := False) is Sfile : File_Name_Type; Afile : File_Name_Type; Src_Id : GPR.Source_Id; begin -- Insert in the queue the unmarked source files (i.e. those which -- have never been inserted in the queue and hence never considered). for J in ALI.ALIs.Table (The_ALI).First_Unit .. ALI.ALIs.Table (The_ALI).Last_Unit loop for K in ALI.Units.Table (J).First_With .. ALI.Units.Table (J).Last_With loop Sfile := ALI.Withs.Table (K).Sfile; -- Skip generics if Sfile /= No_File then Afile := ALI.Withs.Table (K).Afile; Src_Id := Source_Files_Htable.Get (Project_Tree.Source_Files_HT, Sfile); while Src_Id /= No_Source loop Initialize_Source_Record (Src_Id); if Is_Compilable (Src_Id) and then Src_Id.Dep_Name = Afile then case Src_Id.Kind is when Spec => declare Bdy : constant GPR.Source_Id := Other_Part (Src_Id); begin if Bdy /= No_Source and then not Bdy.Locally_Removed then Src_Id := Other_Part (Src_Id); end if; end; when Impl => if Is_Subunit (Src_Id) then Src_Id := No_Source; end if; when Sep => Src_Id := No_Source; end case; exit; end if; Src_Id := Src_Id.Next_With_File_Name; end loop; -- If Excluding_Shared_SALs is True, do not insert in the -- queue the sources of a shared Stand-Alone Library. if Src_Id /= No_Source and then (not Excluding_Shared_SALs or else Src_Id.Project.Standalone_Library = No or else Src_Id.Project.Library_Kind = Static) then Queue.Insert (Source => (Tree => Project_Tree, Id => Src_Id, Closure => True)); end if; end if; end loop; end loop; end Insert_Withed_Sources_For; end Queue; ---------- -- Free -- ---------- procedure Free (Data : in out Builder_Project_Tree_Data) is procedure Unchecked_Free is new Ada.Unchecked_Deallocation (Binding_Data_Record, Binding_Data); TmpB, Binding : Binding_Data := Data.Binding; begin while Binding /= null loop TmpB := Binding.Next; Unchecked_Free (Binding); Binding := TmpB; end loop; end Free; ------------------ -- Builder_Data -- ------------------ function Builder_Data (Tree : Project_Tree_Ref) return Builder_Data_Access is begin if Tree.Appdata = null then Tree.Appdata := new Builder_Project_Tree_Data; end if; return Builder_Data_Access (Tree.Appdata); end Builder_Data; -------------------------------- -- Compute_Compilation_Phases -- -------------------------------- procedure Compute_Compilation_Phases (Tree : Project_Tree_Ref; Root_Project : Project_Id; Option_Unique_Compile : Boolean := False; -- Was "-u" specified ? Option_Compile_Only : Boolean := False; -- Was "-c" specified ? Option_Bind_Only : Boolean := False; Option_Link_Only : Boolean := False) is procedure Do_Compute (Project : Project_Id; Tree : Project_Tree_Ref); ---------------- -- Do_Compute -- ---------------- procedure Do_Compute (Project : Project_Id; Tree : Project_Tree_Ref) is Data : constant Builder_Data_Access := Builder_Data (Tree); All_Phases : constant Boolean := not Option_Compile_Only and then not Option_Bind_Only and then not Option_Link_Only; -- Whether the command line asked for all three phases. Depending on -- the project settings, we might still disable some of the phases. Has_Mains : constant Boolean := Data.Number_Of_Mains > 0; -- Whether there are some main units defined for this project tree -- (either from one of the projects, or from the command line) begin if Option_Unique_Compile then -- If -u or -U is specified on the command line, disregard any -c, -- -b or -l switch: only perform compilation. Data.Closure_Needed := False; Data.Need_Compilation := True; Data.Need_Binding := False; Data.Need_Linking := False; else Data.Closure_Needed := Has_Mains or else (Root_Project.Library and then Root_Project.Standalone_Library /= No); Data.Need_Compilation := All_Phases or Option_Compile_Only; Data.Need_Binding := All_Phases or Option_Bind_Only; Data.Need_Linking := (All_Phases or Option_Link_Only) and Has_Mains; end if; if Current_Verbosity = High then Debug_Output ("compilation phases: " & " compile=" & Data.Need_Compilation'Img & " bind=" & Data.Need_Binding'Img & " link=" & Data.Need_Linking'Img & " closure=" & Data.Closure_Needed'Img & " mains=" & Data.Number_Of_Mains'Img, Project.Name); end if; end Do_Compute; procedure Compute_All is new For_Project_And_Aggregated (Do_Compute); begin Compute_All (Root_Project, Tree); end Compute_Compilation_Phases; ------------------------------ -- Compute_Builder_Switches -- ------------------------------ procedure Compute_Builder_Switches (Project_Tree : Project_Tree_Ref; Env : in out GPR.Tree.Environment; Main_Project : Project_Id; Only_For_Lang : Name_Id := No_Name) is Builder_Package : constant Package_Id := Value_Of (Name_Builder, Main_Project.Decl.Packages, Project_Tree.Shared); Global_Compilation_Array : Array_Element_Id := No_Array_Element; Global_Compilation_Elem : Array_Element; Global_Compilation_Switches : Variable_Value; Default_Switches_Array : Array_Id; Builder_Switches_Lang : Name_Id := No_Name; List : String_List_Id; Element : String_Element; Index : Name_Id; Source : GPR.Source_Id; Lang : Name_Id := No_Name; -- language index for Switches Switches_For_Lang : Variable_Value := Nil_Variable_Value; -- Value of Builder'Default_Switches(lang) Name : Name_Id := No_Name; -- main file index for Switches Switches_For_Main : Variable_Value := Nil_Variable_Value; -- Switches for a specific main. When there are several mains, Name is -- set to No_Name, and Switches_For_Main might be left with an actual -- value (so that we can display a warning that it was ignored). Other_Switches : Variable_Value := Nil_Variable_Value; -- Value of Builder'Switches(others) Defaults : Variable_Value := Nil_Variable_Value; Switches : Variable_Value := Nil_Variable_Value; -- The computed builder switches Success : Boolean := False; begin if Builder_Package /= No_Package then Global_Compilation_Array := Value_Of (Name => Name_Global_Compilation_Switches, In_Arrays => Project_Tree.Shared.Packages.Table (Builder_Package).Decl.Arrays, Shared => Project_Tree.Shared); if Main_Project.Qualifier = Aggregate or else Main_Project.Qualifier = Aggregate_Library then Other_Switches := GPR.Util.Value_Of (Name => All_Other_Names, Index => 0, Attribute_Or_Array_Name => Name_Switches, In_Package => Builder_Package, Shared => Project_Tree.Shared); else Mains.Reset; -- If there is no main, and there is only one compilable language, -- use this language as the switches index. if Mains.Number_Of_Mains (Project_Tree) = 0 then if Only_For_Lang = No_Name then declare Language : Language_Ptr := Main_Project.Languages; begin while Language /= No_Language_Index loop if Language.Config.Compiler_Driver /= No_File and then Language.Config.Compiler_Driver /= Empty_File then if Lang /= No_Name then Lang := No_Name; exit; else Lang := Language.Name; end if; end if; Language := Language.Next; end loop; end; else Lang := Only_For_Lang; end if; else for Index in 1 .. Mains.Number_Of_Mains (Project_Tree) loop Source := Mains.Next_Main.Source; if Source /= No_Source then if Switches_For_Main = Nil_Variable_Value then Switches_For_Main := Value_Of (Name => Name_Id (Source.File), Attribute_Or_Array_Name => Name_Switches, In_Package => Builder_Package, Shared => Project_Tree.Shared, Force_Lower_Case_Index => False, Allow_Wildcards => True); -- If not found, try without extension. -- That's because gnatmake accepts truncated file -- names in Builder'Switches if Switches_For_Main = Nil_Variable_Value and then Source.Unit /= null then Switches_For_Main := Value_Of (Name => Source.Unit.Name, Attribute_Or_Array_Name => Name_Switches, In_Package => Builder_Package, Shared => Project_Tree.Shared, Force_Lower_Case_Index => False, Allow_Wildcards => True); end if; end if; if Index = 1 then Lang := Source.Language.Name; Name := Name_Id (Source.File); else Name := No_Name; -- Can't use main specific switches if Lang /= Source.Language.Name then Lang := No_Name; end if; end if; end if; end loop; end if; Default_Switches_Array := Project_Tree.Shared.Packages.Table (Builder_Package).Decl.Arrays; while Default_Switches_Array /= No_Array and then Project_Tree.Shared.Arrays.Table (Default_Switches_Array).Name /= Name_Default_Switches loop Default_Switches_Array := Project_Tree.Shared.Arrays.Table (Default_Switches_Array).Next; end loop; if Global_Compilation_Array /= No_Array_Element and then Default_Switches_Array /= No_Array then GPR.Err.Error_Msg (Env.Flags, "Default_Switches forbidden in presence of " & "Global_Compilation_Switches. Use Switches instead.", Project_Tree.Shared.Arrays.Table (Default_Switches_Array).Location); Fail_Program (Project_Tree, "*** illegal combination of Builder attributes"); end if; if Lang /= No_Name then Switches_For_Lang := GPR.Util.Value_Of (Name => Lang, Index => 0, Attribute_Or_Array_Name => Name_Switches, In_Package => Builder_Package, Shared => Project_Tree.Shared, Force_Lower_Case_Index => True); Defaults := GPR.Util.Value_Of (Name => Lang, Index => 0, Attribute_Or_Array_Name => Name_Default_Switches, In_Package => Builder_Package, Shared => Project_Tree.Shared, Force_Lower_Case_Index => True); end if; Other_Switches := GPR.Util.Value_Of (Name => All_Other_Names, Index => 0, Attribute_Or_Array_Name => Name_Switches, In_Package => Builder_Package, Shared => Project_Tree.Shared); if not Quiet_Output and then Mains.Number_Of_Mains (Project_Tree) > 1 and then Switches_For_Main /= Nil_Variable_Value then -- More than one main, but we had main-specific switches that -- are ignored. if Switches_For_Lang /= Nil_Variable_Value then Put_Line ("Warning: using Builder'Switches(""" & Get_Name_String (Lang) & """), as there are several mains"); elsif Other_Switches /= Nil_Variable_Value then Put_Line ("Warning: using Builder'Switches(others), " & "as there are several mains"); elsif Defaults /= Nil_Variable_Value then Put_Line ("Warning: using Builder'Default_Switches(""" & Get_Name_String (Lang) & """), as there are several mains"); else Put_Line ("Warning: using no switches from package " & "Builder, as there are several mains"); end if; end if; end if; Builder_Switches_Lang := Lang; if Name /= No_Name then -- Get the switches for the single main Switches := Switches_For_Main; end if; if Switches = Nil_Variable_Value or else Switches.Default then -- Get the switches for the common language of the mains Switches := Switches_For_Lang; end if; if Switches = Nil_Variable_Value or else Switches.Default then Switches := Other_Switches; end if; -- For backward compatibility with gnatmake, if no Switches -- are declared, check for Default_Switches (<language>). if Switches = Nil_Variable_Value or else Switches.Default then Switches := Defaults; end if; -- If switches have been found, scan them if Switches /= Nil_Variable_Value and then not Switches.Default then List := Switches.Values; while List /= Nil_String loop Element := Project_Tree.Shared.String_Elements.Table (List); Get_Name_String (Element.Value); if Name_Len /= 0 then declare -- Add_Switch might itself be using the name_buffer, so -- we make a temporary here. Switch : constant String := Name_Buffer (1 .. Name_Len); begin Success := Add_Switch (Switch => Switch, For_Lang => Builder_Switches_Lang, For_Builder => True, Has_Global_Compilation_Switches => Global_Compilation_Array /= No_Array_Element); end; if not Success then for J in reverse 1 .. Name_Len loop Name_Buffer (J + J) := Name_Buffer (J); Name_Buffer (J + J - 1) := '''; end loop; Name_Len := Name_Len + Name_Len; GPR.Err.Error_Msg (Env.Flags, '"' & Name_Buffer (1 .. Name_Len) & """ is not a builder switch. Consider moving " & "it to Global_Compilation_Switches.", Element.Location); Fail_Program (Project_Tree, "*** illegal switch """ & Get_Name_String (Element.Value) & '"'); end if; end if; List := Element.Next; end loop; end if; -- Reset the Builder Switches language Builder_Switches_Lang := No_Name; -- Take into account attributes Global_Compilation_Switches while Global_Compilation_Array /= No_Array_Element loop Global_Compilation_Elem := Project_Tree.Shared.Array_Elements.Table (Global_Compilation_Array); Get_Name_String (Global_Compilation_Elem.Index); To_Lower (Name_Buffer (1 .. Name_Len)); Index := Name_Find; if Only_For_Lang = No_Name or else Index = Only_For_Lang then Global_Compilation_Switches := Global_Compilation_Elem.Value; if Global_Compilation_Switches /= Nil_Variable_Value and then not Global_Compilation_Switches.Default then -- We have found an attribute -- Global_Compilation_Switches for a language: put the -- switches in the appropriate table. List := Global_Compilation_Switches.Values; while List /= Nil_String loop Element := Project_Tree.Shared.String_Elements.Table (List); if Element.Value /= No_Name then Success := Add_Switch (Switch => Get_Name_String (Element.Value), For_Lang => Index, For_Builder => False, Has_Global_Compilation_Switches => Global_Compilation_Array /= No_Array_Element); end if; List := Element.Next; end loop; end if; end if; Global_Compilation_Array := Global_Compilation_Elem.Next; end loop; end if; end Compute_Builder_Switches; -------------- -- Unescape -- -------------- function Unescape (Path : String) return String is Result : String (1 .. Path'Length); Last : Natural := 0; Index : Integer; begin if On_Windows then return Path; end if; Index := Path'First; while Index <= Path'Last loop if Path (Index) = '\' then if Index < Path'Last and Path (Index + 1) = '\' then Last := Last + 1; Result (Last) := '\'; Index := Index + 1; end if; else Last := Last + 1; Result (Last) := Path (Index); end if; Index := Index + 1; end loop; return Result (1 .. Last); end Unescape; --------------------- -- Write_Path_File -- --------------------- procedure Write_Path_File (FD : File_Descriptor) is Last : Natural; Status : Boolean; begin Name_Len := 0; for Index in Directories.First .. Directories.Last loop Add_Str_To_Name_Buffer (Get_Name_String (Directories.Table (Index))); Add_Char_To_Name_Buffer (ASCII.LF); end loop; Last := Write (FD, Name_Buffer (1)'Address, Name_Len); if Last = Name_Len then Close (FD, Status); else Status := False; end if; if not Status then GPR.Com.Fail ("could not write temporary file"); end if; end Write_Path_File; end Gpr_Build_Util;
GPUWorks/lumen2
Ada
1,141
ads
-- Lumen.Image.PPM -- Load and save netpbm's PPM image data -- -- Chip Richards, NiEstu, Phoenix AZ, Spring 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 Lumen.Binary.IO; package Lumen.Image.PPM is function From_File (File : in Binary.IO.File_Type; PPM_Format : in Character) return Descriptor; end Lumen.Image.PPM;
reznikmm/matreshka
Ada
3,961
ads
------------------------------------------------------------------------------ -- -- -- Matreshka Project -- -- -- -- Open Document Toolkit -- -- -- -- Runtime Library Component -- -- -- ------------------------------------------------------------------------------ -- -- -- Copyright © 2014, Vadim Godunko <[email protected]> -- -- All rights reserved. -- -- -- -- Redistribution and use in source and binary forms, with or without -- -- modification, are permitted provided that the following conditions -- -- are met: -- -- -- -- * Redistributions of source code must retain the above copyright -- -- notice, this list of conditions and the following disclaimer. -- -- -- -- * Redistributions in binary form must reproduce the above copyright -- -- notice, this list of conditions and the following disclaimer in the -- -- documentation and/or other materials provided with the distribution. -- -- -- -- * Neither the name of the Vadim Godunko, IE nor the names of its -- -- contributors may be used to endorse or promote products derived from -- -- this software without specific prior written permission. -- -- -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- -- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- -- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- -- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- -- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- -- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- -- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- -- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- -- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- -- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- -- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- -- ------------------------------------------------------------------------------ -- $Revision$ $Date$ ------------------------------------------------------------------------------ with ODF.DOM.Smil_Begin_Attributes; package Matreshka.ODF_Smil.Begin_Attributes is type Smil_Begin_Attribute_Node is new Matreshka.ODF_Smil.Abstract_Smil_Attribute_Node and ODF.DOM.Smil_Begin_Attributes.ODF_Smil_Begin_Attribute with null record; overriding function Create (Parameters : not null access Matreshka.DOM_Attributes.Attribute_L2_Parameters) return Smil_Begin_Attribute_Node; overriding function Get_Local_Name (Self : not null access constant Smil_Begin_Attribute_Node) return League.Strings.Universal_String; end Matreshka.ODF_Smil.Begin_Attributes;
andersliland/ttk4145-exercise
Ada
4,030
adb
with Ada.Text_IO, Ada.Integer_Text_IO, Ada.Numerics.Float_Random; use Ada.Text_IO, Ada.Integer_Text_IO, Ada.Numerics.Float_Random; procedure exercise7 is Count_Failed : exception; -- Exception to be raised when counting fails Gen : Generator; -- Random number generator protected type Transaction_Manager (N : Positive) is entry Finished; function Commit return Boolean; procedure Signal_Abort; private Finished_Gate_Open : Boolean := False; Aborted : Boolean := False; Should_Commit : Boolean := True; end Transaction_Manager; protected body Transaction_Manager is entry Finished when Finished_Gate_Open or Finished'Count = N is begin ------------------------------------------ -- PART 3: Complete the exit protocol here ------------------------------------------ if Finished'Count = N - 1 then Finished_Gate_Open := True; Should_Commit := True; end if; if Aborted then Should_Commit := False; end if; if Finished'Count = 0 then Finished_Gate_Open := False; Aborted := False; end if; end Finished; procedure Signal_Abort is begin Aborted := True; end Signal_Abort; function Commit return Boolean is begin return Should_Commit; end Commit; end Transaction_Manager; function Unreliable_Slow_Add (x : Integer) return Integer is Error_Rate : Constant := 0.15; -- (between 0 and 1) begin ------------------------------------------- -- PART 1: Create the transaction work here ------------------------------------------- Random_Num := Random(Gen); delay Duration(Random_Num * 4.0); if Random_Num > Error_Rate then return x + 10; else raise Count_Failed; end if; end Unreliable_Slow_Add; task type Transaction_Worker (Initial : Integer; Manager : access Transaction_Manager); task body Transaction_Worker is Num : Integer := Initial; Prev : Integer := Num; Round_Num : Integer := 0; begin Put_Line ("Worker" & Integer'Image(Initial) & " started"); loop Put_Line ("Worker" & Integer'Image(Initial) & " started round" & Integer'Image(Round_Num)); Round_Num := Round_Num + 1; --------------------------------------- -- PART 2: Do the transaction work here --------------------------------------- begin Num := Unreliable_Slow_Add( Num ); Manager.Finished; exception when Count_Failed => begin Put_Line( " Worker" & Integer'Image( Initial ) & " aborting" ); Manager.Signal_Abort; Manager.Finished; end; end; if Manager.Commit = True then Put_Line (" Worker" & Integer'Image(Initial) & " comitting" & Integer'Image(Num)); else Put_Line (" Worker" & Integer'Image(Initial) & " reverting from" & Integer'Image(Num) & " to" & Integer'Image(Prev)); ------------------------------------------- -- PART 2: Roll back to previous value here ------------------------------------------- end if; Prev := Num; delay 0.5; end loop; end Transaction_Worker; Manager : aliased Transaction_Manager (3); Worker_1 : Transaction_Worker (0, Manager'Access); Worker_2 : Transaction_Worker (1, Manager'Access); Worker_3 : Transaction_Worker (2, Manager'Access); begin Reset(Gen); -- Seed the random number generator end exercise7;
AdaCore/libadalang
Ada
243
adb
procedure Prim_Ret is package A is type Base is null record; function Create return Base is (null record); end A; type Derived is new A.Base; Inst : Derived; begin Inst := Create; end Prim_Ret; pragma Test_Block;
Fabien-Chouteau/Ada_Drivers_Library
Ada
4,689
ads
-- Copyright (c) 2013, Nordic Semiconductor ASA -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- -- * Redistributions of source code must retain the above copyright notice, this -- list of conditions and the following disclaimer. -- -- * Redistributions in binary form must reproduce the above copyright notice, -- this list of conditions and the following disclaimer in the documentation -- and/or other materials provided with the distribution. -- -- * Neither the name of Nordic Semiconductor ASA nor the names of its -- contributors may be used to endorse or promote products derived from -- this software without specific prior written permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- -- This spec has been automatically generated from nrf51.svd pragma Restrictions (No_Elaboration_Code); pragma Ada_2012; pragma Style_Checks (Off); with System; -- nRF51 reference description for radio MCU with ARM 32-bit Cortex-M0 -- Microcontroller at 16MHz CPU clock package NRF51_SVD is pragma Preelaborate; -------------------- -- Base addresses -- -------------------- POWER_Base : constant System.Address := System'To_Address (16#40000000#); CLOCK_Base : constant System.Address := System'To_Address (16#40000000#); MPU_Base : constant System.Address := System'To_Address (16#40000000#); AMLI_Base : constant System.Address := System'To_Address (16#40000000#); RADIO_Base : constant System.Address := System'To_Address (16#40001000#); UART0_Base : constant System.Address := System'To_Address (16#40002000#); SPI0_Base : constant System.Address := System'To_Address (16#40003000#); TWI0_Base : constant System.Address := System'To_Address (16#40003000#); SPI1_Base : constant System.Address := System'To_Address (16#40004000#); TWI1_Base : constant System.Address := System'To_Address (16#40004000#); SPIS1_Base : constant System.Address := System'To_Address (16#40004000#); SPIM1_Base : constant System.Address := System'To_Address (16#40004000#); GPIOTE_Base : constant System.Address := System'To_Address (16#40006000#); ADC_Base : constant System.Address := System'To_Address (16#40007000#); TIMER0_Base : constant System.Address := System'To_Address (16#40008000#); TIMER1_Base : constant System.Address := System'To_Address (16#40009000#); TIMER2_Base : constant System.Address := System'To_Address (16#4000A000#); RTC0_Base : constant System.Address := System'To_Address (16#4000B000#); TEMP_Base : constant System.Address := System'To_Address (16#4000C000#); RNG_Base : constant System.Address := System'To_Address (16#4000D000#); ECB_Base : constant System.Address := System'To_Address (16#4000E000#); AAR_Base : constant System.Address := System'To_Address (16#4000F000#); CCM_Base : constant System.Address := System'To_Address (16#4000F000#); WDT_Base : constant System.Address := System'To_Address (16#40010000#); RTC1_Base : constant System.Address := System'To_Address (16#40011000#); QDEC_Base : constant System.Address := System'To_Address (16#40012000#); LPCOMP_Base : constant System.Address := System'To_Address (16#40013000#); SWI_Base : constant System.Address := System'To_Address (16#40014000#); NVMC_Base : constant System.Address := System'To_Address (16#4001E000#); PPI_Base : constant System.Address := System'To_Address (16#4001F000#); FICR_Base : constant System.Address := System'To_Address (16#10000000#); UICR_Base : constant System.Address := System'To_Address (16#10001000#); GPIO_Base : constant System.Address := System'To_Address (16#50000000#); end NRF51_SVD;
tum-ei-rcs/StratoX
Ada
8,716
adb
------------------------------------------------------------------------------ -- -- -- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS -- -- -- -- S Y S T E M . T A S K I N G -- -- -- -- B o d y -- -- -- -- Copyright (C) 2001-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/>. -- -- -- -- GNARL was developed by the GNARL team at Florida State University. -- -- Extensive contributions were provided by Ada Core Technologies, Inc. -- -- -- ------------------------------------------------------------------------------ -- This is the Ravenscar/HI-E and Ravenscar/full version of this package pragma Restrictions (No_Elaboration_Code); -- For Ravenscar/HI-E, this restriction is simply an optimization. -- For Ravenscar/full, this restriction is required because the Initialize -- procedure is called by s-init before the elaboration. pragma Polling (Off); -- Turn off polling, we do not want ATC polling to take place during tasking -- operations. It causes infinite loops and other problems. with System.Task_Primitives.Operations; -- used for Self with System.Secondary_Stack; -- used for SS_Init -- Default_Secondary_Stack_Size package body System.Tasking is use System.Secondary_Stack; use System.Multiprocessors; ------------------------ -- Local Declarations -- ------------------------ Main_Priority : Integer := Unspecified_Priority; pragma Export (C, Main_Priority, "__gl_main_priority"); -- Priority associated with the environment task. By default, its value is -- undefined, and can be set by using pragma Priority in the main program. Main_CPU : Integer := Unspecified_CPU; pragma Export (C, Main_CPU, "__gl_main_cpu"); -- Affinity associated with the environment task. By default, its value is -- undefined, and can be set by using pragma CPU in the main program. -- Switching the environment task to the right CPU is left to the user. Environment_Task : aliased Ada_Task_Control_Block (Entry_Num => 0); -- ATCB for the environment task. The name of this array is -- 'Environment_Task', so that there is a nice display of the environment -- task in GDB (which uses the suffix of the symbol). ------------------- -- Get_Sec_Stack -- ------------------- function Get_Sec_Stack return Address is begin return Self.Common.Compiler_Data.Sec_Stack_Addr; end Get_Sec_Stack; --------------------- -- Initialize_ATCB -- --------------------- procedure Initialize_ATCB (Task_Entry_Point : Task_Procedure_Access; Task_Arg : System.Address; Base_Priority : Extended_Priority; Base_CPU : System.Multiprocessors.CPU_Range; Task_Info : System.Task_Info.Task_Info_Type; Stack_Address : System.Address; Stack_Size : System.Parameters.Size_Type; T : Task_Id; Success : out Boolean) is begin T.Common.State := Unactivated; -- Initialize T.Common.LL Task_Primitives.Operations.Initialize_TCB (T, Success); if not Success then return; end if; T.Common.Base_Priority := Base_Priority; T.Common.Base_CPU := Base_CPU; T.Common.Protected_Action_Nesting := 0; T.Common.Task_Arg := Task_Arg; T.Common.Task_Entry_Point := Task_Entry_Point; T.Common.Task_Info := Task_Info; T.Common.Compiler_Data.Pri_Stack_Info.Start_Address := Stack_Address; T.Common.Compiler_Data.Pri_Stack_Info.Size := Storage_Elements.Storage_Offset (Parameters.Adjust_Storage_Size (Stack_Size)); end Initialize_ATCB; ---------------- -- Initialize -- ---------------- Secondary_Stack : aliased Storage_Elements.Storage_Array (1 .. Storage_Elements.Storage_Offset (Default_Secondary_Stack_Size)); for Secondary_Stack'Alignment use Standard'Maximum_Alignment; pragma Warnings (Off, Secondary_Stack); -- Secondary stack of the environmental task Initialized : Boolean := False; -- Used to prevent multiple calls to Initialize procedure Initialize is Base_Priority : Any_Priority; Success : Boolean; pragma Warnings (Off, Success); begin if Initialized then return; end if; Initialized := True; -- Compute priority if Main_Priority = Unspecified_Priority then Base_Priority := Default_Priority; else Base_Priority := Main_Priority; end if; Initialize_ATCB (null, Null_Address, Base_Priority, CPU'First, Task_Info.Unspecified_Task_Info, Null_Address, 0, Environment_Task'Access, Success); Task_Primitives.Operations.Initialize (Environment_Task'Access); -- Note: we used to set the priority at this point, but it is already -- done in Enter_Task via s-taprop.Initialize. Environment_Task.Common.State := Runnable; Environment_Task.Entry_Call.Self := Environment_Task'Access; -- Initialize the secondary stack Environment_Task.Common.Compiler_Data.Sec_Stack_Addr := Secondary_Stack'Address; SS_Init (Secondary_Stack'Address, Default_Secondary_Stack_Size); -- No fall back handler by default Fall_Back_Handler := null; -- Legal values of CPU are the special Unspecified_CPU value, which is -- inserted by the compiler for tasks without CPU aspect, and those in -- the range of CPU_Range but no greater than Number_Of_CPUs. Otherwise -- the task is defined to have failed, and it becomes a completed task -- (RM D.16(14/3)). -- Only accept CPU'First for CPU value, starting on a slave CPU is not -- supported. if Main_CPU /= Unspecified_CPU and then Main_CPU /= Integer (CPU'First) then -- Invalid CPU, will raise Tasking_Error after the environment task -- is initialized (as exception propagation is supported in the full -- Ravenscar profile). raise Tasking_Error with "Main CPU is not the master one"; end if; end Initialize; ---------- -- Self -- ---------- function Self return Task_Id renames System.Task_Primitives.Operations.Self; ------------------- -- Set_Sec_Stack -- ------------------- procedure Set_Sec_Stack (Stk : Address) is begin Self.Common.Compiler_Data.Sec_Stack_Addr := Stk; end Set_Sec_Stack; ------------------ -- Storage_Size -- ------------------ function Storage_Size (T : Task_Id) return System.Parameters.Size_Type is begin return System.Parameters.Size_Type (T.Common.Compiler_Data.Pri_Stack_Info.Size); end Storage_Size; end System.Tasking;
reznikmm/matreshka
Ada
4,317
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.Elements.Internals; package body ODF.DOM.Elements.Style.Graphic_Properties.Internals is ------------ -- Create -- ------------ function Create (Node : Matreshka.ODF_Elements.Style.Graphic_Properties.Style_Graphic_Properties_Access) return ODF.DOM.Elements.Style.Graphic_Properties.ODF_Style_Graphic_Properties is begin return (XML.DOM.Elements.Internals.Create (Matreshka.DOM_Nodes.Element_Access (Node)) with null record); end Create; ---------- -- Wrap -- ---------- function Wrap (Node : Matreshka.ODF_Elements.Style.Graphic_Properties.Style_Graphic_Properties_Access) return ODF.DOM.Elements.Style.Graphic_Properties.ODF_Style_Graphic_Properties is begin return (XML.DOM.Elements.Internals.Wrap (Matreshka.DOM_Nodes.Element_Access (Node)) with null record); end Wrap; end ODF.DOM.Elements.Style.Graphic_Properties.Internals;
damaki/libkeccak
Ada
11,489
ads
------------------------------------------------------------------------------- -- Copyright (c) 2019, Daniel King -- All rights reserved. -- -- Redistribution and use in source and binary forms, with or without -- modification, are permitted provided that the following conditions are met: -- * Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- * Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in the -- documentation and/or other materials provided with the distribution. -- * The name of the copyright holder may not be used to endorse or promote -- Products derived from this software without specific prior written -- permission. -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY -- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -- THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- with Keccak.Types; -- @summary -- Implements an optimized Keccak-f permutation based on SIMD instruction sets -- such as SSE, NEON, and AVX. -- -- @description -- This package provides a basis for parallel implementations of Keccak -- for processing N separate permutations in parallel, where N is the number -- of vector components in the SIMD instruction set used. -- -- When instantiating this package, subprograms and types are provided as -- formal generic parameters which implement each of the required operations -- for the target instruction set. -- -- @group Parallel Keccak-f generic Lane_Size_Log : in Positive; -- The binary logarithm of the lane size. -- -- This determines the Keccak-f state size. Allowed values are: -- * Lane_Size_Log = 3 => 8-bit lanes, Keccak-f[200] -- * Lane_Size_Log = 4 => 16-bit lanes, Keccak-f[400] -- * Lane_Size_Log = 5 => 32-bit lanes, Keccak-f[800] -- * Lane_Size_Log = 6 => 64-bit lanes, Keccak-f[1600] type Lane_Type is mod <>; -- Lane type e.g. Unsigned_64. type VXXI_Index is range <>; -- Index type into the vector component. type VXXI is private; -- Vector type. type VXXI_View is array (VXXI_Index) of Lane_Type; -- A view of the vector type, permitting individual access to each vector -- component. Vector_Width : Positive; -- Number of vector to components to actually use. -- -- Usually, this would be set to the actual number of vector components -- (e.g. 4 for a 4x 32-bit vector). However, you may use a smaller number -- if you don't want to use the full vector width. For example, you could -- set Vector_Width to 2 with a 4x 32-bit vector type, to obtain 2x -- parallelism (the upper 2 vector components would not be used). with function Load (X : in VXXI_View) return VXXI; with function Store (X : in VXXI) return VXXI_View; with function "xor" (A, State_Size_Bits : in VXXI) return VXXI; -- Calculates A xor State_Size_Bits per vector component. with function Rotate_Left (A : in VXXI; Amount : in Natural) return VXXI; -- Calculates Rotate_Left(A) per vector component. with function And_Not (A, State_Size_Bits : in VXXI) return VXXI; -- Calculates State_Size_Bits and (not A) per vector component. with function Shift_Left (A : in Lane_Type; Amount : in Natural) return Lane_Type; with function Shift_Right (A : in Lane_Type; Amount : in Natural) return Lane_Type; package Keccak.Generic_Parallel_KeccakF is Lane_Size_Bits : constant Positive := 2**Lane_Size_Log; -- Lane size (in bits, i.e. 8, 16, 32, or 64) State_Size_Bits : constant Positive := Lane_Size_Bits * 25; -- Keccak-f state size (in bits). Num_Parallel_Instances : constant Positive := Vector_Width; pragma Assert (Lane_Size_Bits mod 8 = 0, "Generic_Parallel_KeccakF only supports Lane_Size_Log in 3 .. 6"); pragma Assert (Vector_Width in 1 .. VXXI_View'Length, "Vector_Width exceeds vector type's width"); type Parallel_State is private; Initialized_State : constant Parallel_State; type Round_Index is range 0 .. 23; subtype Round_Count is Positive range 1 .. 24; procedure Init (S : out Parallel_State) with Global => null; -- Initialise the Keccak state to all zeroes. generic First_Round : Round_Index := 0; Num_Rounds : Round_Count := 24; procedure Permute_All (S : in out Parallel_State) with Global => null; -- Applies the Keccak-f permutation function to all N parallel states. -- -- This generic function is a Keccak-p permutation which is -- instantiated, with the number rounds, into a Keccak-f instance. procedure XOR_Bits_Into_State_Separate (S : in out Parallel_State; Data : in Types.Byte_Array; Data_Offset : in Natural; Bit_Len : in Natural) with Global => null, Pre => (Data'Length / Vector_Width <= Natural'Last / 8 and then Data'Length mod Vector_Width = 0 and then Data_Offset <= (Data'Length / Vector_Width) and then Bit_Len <= ((Data'Length / Vector_Width) - Data_Offset) * 8 and then Bit_Len <= State_Size_Bits); -- XOR separate data into each parallel Keccak instance. -- -- The @Data@ array contains the data to be XORed into all parallel -- instances. The bytes in @Data@ are split into equal chunks depending on -- the number of parallel instances. For example, for Keccak-f[1600]�2 the -- @Data@ array is split into 2 chunks as shown below: -- -- . DO BL DO BL -- |--->|<---->| |--->|<---->| -- +-----------------------------------------+ -- | | | Data -- +-----------------------------------------+ -- . | | | | -- . | XOR | | XOR | -- . | v | | v | -- . +-----------+ +-----------+ -- . | state 0 | | state 1 | -- . +-----------+ +-----------+ -- -- Where DO = Data_Offset and BL = Bit_Len -- -- The @Data_Offset@ determines the offset within each chunk to start -- reading data. @Bit_Len@ determines the number of bits to read from each -- chunk. -- -- The data is always XORed starting at the beginning of the Keccak state. -- -- @param S The parallel Keccak state to where the bits are XORed. -- -- @param Data The array containing the data to XOR into the parallel state. -- The size of this array must be a multiple of the number of parallel -- instances. For Example, for Keccak-f[1600]�4 then Data'Length -- must be a multiple of 4. -- -- @param Data_Offset Offset of the first byte(s) to read from the @Data@ -- array. -- -- @param Bit_Len The number of bits to XOR into each state. procedure XOR_Bits_Into_State_All (S : in out Parallel_State; Data : in Types.Byte_Array; Bit_Len : in Natural) with Global => null, Depends => (S =>+ (Data, Bit_Len)), Pre => (Data'Length <= Natural'Last / 8 and then Bit_Len <= Data'Length * 8 and then Bit_Len <= State_Size_Bits); -- XOR the same data into all parallel Keccak instances. -- -- The @Data@ array contains the data to be XORed into all parallel -- instances. For example, for Keccak-f[1600]�2 this would be as follows: -- -- . BL -- . |<--------->| -- . +----------------+ -- . | | Data -- . +----------------+ -- . /\ -- . XOR / \ XOR -- . v / \ v -- +-----------+-----------+ -- | state 0 | state 1 | -- +-----------+-----------+ -- -- Where BL = Bit_Len -- -- The data is always XORed starting at the beginning of the Keccak state. -- -- @param S The parallel Keccak state to where the bits are XORed. -- -- @param Data The array containing the data to XOR into each parallel state. -- -- @param Bit_Len The length of the data, in bits. procedure Extract_Bytes (S : in Parallel_State; Data : out Types.Byte_Array; Data_Offset : in Natural; Byte_Len : in Natural) with Global => null, Pre => (Data'Length mod Vector_Width = 0 and then Data_Offset <= Data'Length / Vector_Width and then Byte_Len <= (Data'Length / Vector_Width) - Data_Offset and then Byte_Len <= State_Size_Bits / 8); -- Extract bytes from the Keccak state. -- -- The @Data@ array is split into N equal sized chunks, where N is the -- number of parallel instances. The bytes extracted from each Keccak -- state is then copied into the each chunk, offset by @Data_Offset@. -- An example is shown below for Keccak-f[1600]�2 (i.e. 2 parallel -- instances): -- -- . DO BL DO BL -- |--->|<---->| |--->|<---->| -- +-----------------------------------------+ -- | | | Data -- +-----------------------------------------+ -- . | ^ | | ^ | -- . | Read | | Read | -- . | | | | -- . +-----------+ +-----------+ -- . | state 0 | | state 1 | -- . +-----------+ +-----------+ -- -- The bytes are always read from the beginning of the Keccak state. -- -- @param S The Keccak state to read bytes from. -- -- @param Data Bytes extracted from the Keccak state are copied to this -- array, offset according to @Data_Offset@. -- -- @param Data_Offset The offset in the @Data@ array to mark the position -- of the first byte in each chunk. -- -- @param Byte_Len The number of bytes to read from each chunk. pragma Annotate (GNATprove, False_Positive, """Data"" might not be initialized", "Data is partially initialized in chunks of size 'Byte_Len'" & " at offset 'Data_Offset' in each chunk"); private type X_Coord is mod 5; type Y_Coord is mod 5; type Parallel_State is array (X_Coord, Y_Coord) of VXXI_View; Initialized_State : constant Parallel_State := (others => (others => (others => 0))); end Keccak.Generic_Parallel_KeccakF;
charlie5/lace
Ada
152
ads
package lace.Strings -- -- DSA friendly packages based on the 'ada.Strings' package family provided by FSF GCC. -- is pragma Pure; end lace.Strings;
DrenfongWong/tkm-rpc
Ada
393
ads
with Ada.Unchecked_Conversion; package Tkmrpc.Request.Ike.Tkm_Reset.Convert is function To_Request is new Ada.Unchecked_Conversion ( Source => Tkm_Reset.Request_Type, Target => Request.Data_Type); function From_Request is new Ada.Unchecked_Conversion ( Source => Request.Data_Type, Target => Tkm_Reset.Request_Type); end Tkmrpc.Request.Ike.Tkm_Reset.Convert;
sungyeon/drake
Ada
439
adb
package body System.Interrupt_Numbers is use type C.signed_int; function Is_Reserved (Interrupt : C.signed_int) return Boolean is begin return Interrupt not in First_Interrupt_Id .. Last_Interrupt_Id or else Interrupt = C.signal.SIGKILL or else Interrupt = C.signal.SIGSTOP or else Interrupt in 32 .. C.signal.SIGRTMIN - 1; -- reserved by glibc end Is_Reserved; end System.Interrupt_Numbers;
BrickBot/Bound-T-H8-300
Ada
2,791
ads
-- List_Filters (decl) -- -- Filtering a list of items to keep only those that have -- a desired value, as defined by a function item -> value. -- Generic on all types and (nested) on the valuation function. -- -- 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 19:36:50 $ -- -- $Log: list_filters.ads,v $ -- Revision 1.2 2015/10/24 19:36:50 niklas -- Moved to free licence. -- -- Revision 1.1 2000-07-14 20:34:14 holsti -- First version. -- generic type Item_Type is private; type List_Type is array (Positive range <>) of Item_Type; type Value_Type is private; with function "=" (Left, Right : Value_Type) return Boolean is <>; package List_Filters is generic with function Value (Item : Item_Type) return Value_Type; function Chosen (From : List_Type; Pick : Value_Type) return List_Type; -- -- Returns those items I of the given List for which Value(I) = Pick. -- The items are returned in the same order as in the given list. end List_Filters;
sparre/aYAML
Ada
160
adb
with YAML.Vector; pragma Unreferenced (YAML.Vector); with YAML.Object; pragma Unreferenced (YAML.Object); procedure YAML.Demo is begin null; end YAML.Demo;
jhumphry/auto_counters
Ada
6,985
adb
-- kvflyweights-refcounted_ptrs.adb -- A package of reference-counting generalised references which point to -- resources inside a KVFlyweight. Resources are associated with a key that can -- be used to create them if they have not already been created. -- Copyright (c) 2016-2023, James Humphry -- -- Permission to use, copy, modify, and/or distribute this software for any -- purpose with or without fee is hereby granted, provided that the above -- copyright notice and this permission notice appear in all copies. -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -- PERFORMANCE OF THIS SOFTWARE. pragma Profile (No_Implementation_Extensions); with Ada.Unchecked_Conversion; package body KVFlyweights.Refcounted_Ptrs is type Access_Value is access all Value; function Access_Value_To_Value_Access is new Ada.Unchecked_Conversion(Source => Access_Value, Target => Value_Access); subtype Hash_Type is Ada.Containers.Hash_Type; use type Ada.Containers.Hash_Type; -------------------------- -- Refcounted_Value_Ptr -- -------------------------- function P (P : Refcounted_Value_Ptr) return V_Ref is (V_Ref'(V => P.V)); function Get (P : Refcounted_Value_Ptr) return Value_Access is (P.V); function Make_Ref (P : Refcounted_Value_Ptr'Class) return Refcounted_Value_Ref is begin KVFlyweight_Hashtables.Increment(F => P.Containing_KVFlyweight.all, Bucket => P.Containing_Bucket, Key_Ptr => P.K); return Refcounted_Value_Ref'(Ada.Finalization.Controlled with V => P.V, K => P.K, Containing_KVFlyweight => P.Containing_KVFlyweight, Containing_Bucket => P.Containing_Bucket, Underlying_V => P.V); end Make_Ref; function Insert_Ptr (F : aliased in out KVFlyweight_Hashtables.KVFlyweight; K : in Key) return Refcounted_Value_Ptr is Bucket : Hash_Type; Key_Ptr : Key_Access; Value_Ptr : Value_Access; begin KVFlyweight_Hashtables.Insert (F => F, Bucket => Bucket, K => K, Key_Ptr => Key_Ptr, Value_Ptr => Value_Ptr); return Refcounted_Value_Ptr'(Ada.Finalization.Controlled with V => Value_Ptr, K => Key_Ptr, Containing_KVFlyweight => F'Unchecked_Access, Containing_Bucket => Bucket); end Insert_Ptr; overriding procedure Adjust (Object : in out Refcounted_Value_Ptr) is begin if Object.V /= null and Object.Containing_KVFlyweight /= null then KVFlyweight_Hashtables.Increment(F => Object.Containing_KVFlyweight.all, Bucket => Object.Containing_Bucket, Key_Ptr => Object.K); end if; end Adjust; overriding procedure Finalize (Object : in out Refcounted_Value_Ptr) is begin if Object.V /= null and Object.Containing_KVFlyweight /= null then KVFlyweight_Hashtables.Remove(F => Object.Containing_KVFlyweight.all, Bucket => Object.Containing_Bucket, Key_Ptr => Object.K); Object.Containing_KVFlyweight := null; end if; end Finalize; -------------------------- -- Refcounted_Value_Ref -- -------------------------- function Make_Ptr (R : Refcounted_Value_Ref'Class) return Refcounted_Value_Ptr is begin KVFlyweight_Hashtables.Increment(F => R.Containing_KVFlyweight.all, Bucket => R.Containing_Bucket, Key_Ptr => R.K); return Refcounted_Value_Ptr'(Ada.Finalization.Controlled with V => R.Underlying_V, K => R.K, Containing_KVFlyweight => R.Containing_KVFlyweight, Containing_Bucket => R.Containing_Bucket); end Make_Ptr; function Get (P : Refcounted_Value_Ref) return Value_Access is (P.Underlying_V); function Insert_Ref (F : aliased in out KVFlyweight_Hashtables.KVFlyweight; K : in Key) return Refcounted_Value_Ref is Bucket : Hash_Type; Key_Ptr : Key_Access; Value_Ptr : Value_Access; begin KVFlyweight_Hashtables.Insert (F => F, Bucket => Bucket, K => K, Key_Ptr => Key_Ptr, Value_Ptr => Value_Ptr); return Refcounted_Value_Ref'(Ada.Finalization.Controlled with V => Value_Ptr, K => Key_Ptr, Containing_KVFlyweight => F'Unchecked_Access, Containing_Bucket => Bucket, Underlying_V => Value_Ptr); end Insert_Ref; overriding procedure Initialize (Object : in out Refcounted_Value_Ref) is begin raise Program_Error with "Refcounted_Value_Ref should not be created outside the package"; end Initialize; overriding procedure Adjust (Object : in out Refcounted_Value_Ref) is begin if Object.Containing_KVFlyweight /= null then KVFlyweight_Hashtables.Increment(F => Object.Containing_KVFlyweight.all, Bucket => Object.Containing_Bucket, Key_Ptr => Object.K); end if; end Adjust; overriding procedure Finalize (Object : in out Refcounted_Value_Ref) is begin if Object.Containing_KVFlyweight /= null then KVFlyweight_Hashtables.Remove(F => Object.Containing_KVFlyweight.all, Bucket => Object.Containing_Bucket, Key_Ptr => Object.K); Object.Containing_KVFlyweight := null; end if; end Finalize; end KVFlyweights.Refcounted_Ptrs;
ZinebZaad/ENSEEIHT
Ada
515
ads
with Types; use Types; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; generic type T_Element is digits <>; package Module_IO is -- Lire l'intégralité du fichier. procedure Lire(Fichier: in Unbounded_String; PagesNum: out Integer; Liens: out LC_Integer_Integer.T_LC); -- Ecrire les PageRank et les Poids. procedure Ecrire(Fichier: in Unbounded_String; PagesNum: in Integer; MaxIterations: in Integer; Alpha: in T_Digits; Rangs: in Vecteur_Poids.T_Vecteur); end Module_IO;
onox/sdlada
Ada
13,014
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; with Ada.Unchecked_Conversion; with SDL.Error; package body SDL.Video.Textures is package C renames Interfaces.C; use type C.int; use type SDL.C_Pointers.Texture_Pointer; procedure Destroy (Self : in out Texture) is procedure SDL_Destroy_Texture (T : in SDL.C_Pointers.Texture_Pointer) with Import => True, Convention => C, External_Name => "SDL_DestroyTexture"; begin SDL_Destroy_Texture (Self.Internal); Self.Internal := null; end Destroy; function Get_Alpha (Self : in Texture) return SDL.Video.Palettes.Colour_Component is function SDL_Get_Texture_Alpha_Mod (T : in SDL.C_Pointers.Texture_Pointer; Alpha : out SDL.Video.Palettes.Colour_Component) return C.int with Import => True, Convention => C, External_Name => "SDL_GetTextureAlphaMod"; Data : SDL.Video.Palettes.Colour_Component; Result : C.int := SDL_Get_Texture_Alpha_Mod (Self.Internal, Data); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; return Data; end Get_Alpha; procedure Set_Alpha (Self : in out Texture; Alpha : in SDL.Video.Palettes.Colour_Component) is function SDL_Set_Texture_Alpha_Mod (T : in SDL.C_Pointers.Texture_Pointer; Alpha : in SDL.Video.Palettes.Colour_Component) return C.int with Import => True, Convention => C, External_Name => "SDL_SetTextureAlphaMod"; Result : C.int := SDL_Set_Texture_Alpha_Mod (Self.Internal, Alpha); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; end Set_Alpha; function Get_Blend_Mode (Self : in Texture) return Blend_Modes is function SDL_Get_Texture_Blend_Mode (T : in SDL.C_Pointers.Texture_Pointer; Blend : out Blend_Modes) return C.int with Import => True, Convention => C, External_Name => "SDL_GetTextureBlendMode"; Data : Blend_Modes; Result : C.int := SDL_Get_Texture_Blend_Mode (Self.Internal, Data); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; return Data; end Get_Blend_Mode; procedure Set_Blend_Mode (Self : in out Texture; Mode : in Blend_Modes) is function SDL_Set_Texture_Blend_Mode (T : in SDL.C_Pointers.Texture_Pointer; Mode : in Blend_Modes) return C.int with Import => True, Convention => C, External_Name => "SDL_SetTextureBlendMode"; Result : C.int := SDL_Set_Texture_Blend_Mode (Self.Internal, Mode); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; end Set_Blend_Mode; function Get_Modulate_Colour (Self : in Texture) return SDL.Video.Palettes.RGB_Colour is function SDL_Get_Texture_Color_Mod (T : in SDL.C_Pointers.Texture_Pointer; R, G, B : out SDL.Video.Palettes.Colour_Component) return C.int with Import => True, Convention => C, External_Name => "SDL_GetTextureColorMod"; Data : SDL.Video.Palettes.RGB_Colour; Result : C.int := SDL_Get_Texture_Color_Mod (Self.Internal, Data.Red, Data.Green, Data.Blue); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; return Data; end Get_Modulate_Colour; procedure Set_Modulate_Colour (Self : in out Texture; Colour : in SDL.Video.Palettes.RGB_Colour) is function SDL_Set_Texture_Color_Mod (T : in SDL.C_Pointers.Texture_Pointer; R, G, B : in SDL.Video.Palettes.Colour_Component) return C.int with Import => True, Convention => C, External_Name => "SDL_SetTextureColorMod"; Result : C.int := SDL_Set_Texture_Color_Mod (Self.Internal, Colour.Red, Colour.Green, Colour.Blue); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; end Set_Modulate_Colour; -- procedure Lock_Texture (Self : in out Texture; -- Pixels : out SDL.Video.Pixels.Pixel_ARGB_8888_Array_Access) is -- type Int_Ptr is access C.int with -- Convention => C; -- -- function SDL_Lock_Texture (T : in System.Address; -- Area : in System.Address; -- Pixels : out SDL.Video.Pixels.C_Pixel_Ptr; -- Pitch : out Int_Ptr) return C.int with -- Import => True, -- Convention => C, -- External_Name => "SDL_LockTexture"; -- -- C_Pixels : SDL.Video.Pixels.C_Pixel_Ptr := null; -- C_Pitch : Int_Ptr := null; -- Result : C.int := SDL_Lock_Texture (Self.Internal, System.Null_Address, C_Pixels, C_Pitch); -- begin -- if Result /= Success then -- raise Texture_Error with SDL.Error.Get; -- end if; -- -- Self.Locked := True; -- -- Pixels := SDL.Video.Pixels.Create (C_Pixels, C_Pitch.all, Self.Size); -- end Lock_Texture; procedure Lock (Self : in out Texture; Pixels : out Pixel_Pointer_Type) is function SDL_Lock_Texture (T : in SDL.C_Pointers.Texture_Pointer; Area : in System.Address; Pixels : out Pixel_Pointer_Type; Pitch : out SDL.Video.Pixels.Pitches) return C.int with Import => True, Convention => C, External_Name => "SDL_LockTexture"; -- Don't care about Pitch value. Dummy : SDL.Video.Pixels.Pitches := 0; Result : C.int := SDL_Lock_Texture (Self.Internal, System.Null_Address, Pixels, Dummy); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; Self.Locked := True; end Lock; procedure Lock_Area (Self : in out Texture; Area : in SDL.Video.Rectangles.Rectangle; Pixels : out Pixel_Pointer_Type; Pitch : out SDL.Video.Pixels.Pitches) is function SDL_Lock_Texture (T : in SDL.C_Pointers.Texture_Pointer; Area : in SDL.Video.Rectangles.Rectangle; Pixels : out Pixel_Pointer_Type; Pitch : out SDL.Video.Pixels.Pitches) return C.int with Import => True, Convention => C, External_Name => "SDL_LockTexture"; Result : C.int := SDL_Lock_Texture (Self.Internal, Area, Pixels, Pitch); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; Self.Locked := True; end Lock_Area; procedure Unlock (Self : in out Texture) is procedure SDL_Unlock_Texture (T : in SDL.C_Pointers.Texture_Pointer) with Import => True, Convention => C, External_Name => "SDL_UnlockTexture"; begin if Self.Locked then SDL_Unlock_Texture (Self.Internal); Self.Locked := False; end if; end Unlock; procedure Query (Self : in Texture; Pixel_Format_Name : out SDL.Video.Pixel_Formats.Pixel_Format_Names; Kind : out Kinds; Size : out SDL.Sizes) is function SDL_Query_Texture (T : in SDL.C_Pointers.Texture_Pointer; Pixel_Format_Name : out SDL.Video.Pixel_Formats.Pixel_Format_Names; Kind : out Kinds; Width : out SDL.Dimension; Height : out SDL.Dimension) return C.int with import => True, Convention => C, External_Name => "SDL_QueryTexture"; W : SDL.Dimension := 0; H : SDL.Dimension := 0; Result : C.int := SDL_Query_Texture (Self.Internal, Pixel_Format_Name, Kind, W, H); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; Size := SDL.Sizes'(W, H); end Query; function Get_Pixel_Format (Self : in Texture) return SDL.Video.Pixel_Formats.Pixel_Format_Names is function SDL_Query_Texture (T : in SDL.C_Pointers.Texture_Pointer; Pixel_Format_Name : out SDL.Video.Pixel_Formats.Pixel_Format_Names; Kind : in System.Address := System.Null_Address; Width : in System.Address := System.Null_Address; Height : in System.Address := System.Null_Address) return C.int with import => True, Convention => C, External_Name => "SDL_QueryTexture"; Format_Name : SDL.Video.Pixel_Formats.Pixel_Format_Names; Result : C.int := SDL_Query_Texture (T => Self.Internal, Pixel_Format_Name => Format_Name); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; return Format_Name; end Get_Pixel_Format; function Get_Kind (Self : in Texture) return Kinds is function SDL_Query_Texture (T : in SDL.C_Pointers.Texture_Pointer; Pixel_Format_Name : in System.Address := System.Null_Address; Kind : out Kinds; Width : in System.Address := System.Null_Address; Height : in System.Address := System.Null_Address) return C.int with import => True, Convention => C, External_Name => "SDL_QueryTexture"; Kind : Kinds; Result : C.int := SDL_Query_Texture (T => Self.Internal, Kind => Kind); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; return Kind; end Get_Kind; function Get_Size (Self : in Texture) return SDL.Sizes is function SDL_Query_Texture (T : in SDL.C_Pointers.Texture_Pointer; Pixel_Format_Name : in System.Address := System.Null_Address; Kind : in System.Address := System.Null_Address; Width : out SDL.Dimension; Height : out SDL.Dimension) return C.int with import => True, Convention => C, External_Name => "SDL_QueryTexture"; Size : SDL.Sizes := SDL.Zero_Size; Result : C.int := SDL_Query_Texture (T => Self.Internal, Width => Size.Width, Height => Size.Height); begin if Result /= Success then raise Texture_Error with SDL.Error.Get; end if; return Size; end Get_Size; overriding procedure Finalize (Self : in out Texture) is begin if Self.Internal /= null and then Self.Owns then Destroy (Self); end if; end Finalize; function Get_Internal_Texture (Self : in Texture) return SDL.C_Pointers.Texture_Pointer is begin return Self.Internal; end Get_Internal_Texture; end SDL.Video.Textures;
clairvoyant/anagram
Ada
2,370
adb
-- Copyright (c) 2010-2017 Maxim Reznik <[email protected]> -- -- SPDX-License-Identifier: MIT -- License-Filename: LICENSE ------------------------------------------------------------- package body Anagram.Grammars.LR_Parsers is type State_Array is array (Positive range <>) of State_Index; Stack_Length : constant := 256; ----------- -- Parse -- ----------- procedure Parse (Self : access Parser; Input : access Lexer; Root : out Node; Success : out Boolean) is type Stack is record Top : Natural; State : State_Array (1 .. Stack_Length); Node : Node_Array (1 .. Stack_Length); end record; procedure Push (Self : in out Stack; State : State_Index; Value : Node); ---------- -- Push -- ---------- procedure Push (Self : in out Stack; State : State_Index; Value : Node) is begin Self.Top := Self.Top + 1; Self.State (Self.Top) := State; Self.Node (Self.Top) := Value; end Push; S : Stack; Token : Grammars.Terminal_Count; Token_Node : Node; State : State_Index := 1; Next : Action; begin S.Top := 0; -- Clear stack Next_Token (Input, Token, Token_Node); loop Next_Action (State, Token, Next); case Next.Kind is when Shift => Push (S, State, Token_Node); Next_Token (Input, Token, Token_Node); State := Next.State; when Reduce => declare subtype First_Nodes is Node_Array (1 .. Next.Parts); begin S.Top := S.Top - Next.Parts + 1; On_Reduce (Self => Self, Prod => Next.Prod, Nodes => First_Nodes (S.Node (S.Top .. S.Top + Next.Parts - 1))); State := Go_To (S.State (S.Top), Next.NT); end; when Finish => Root := S.Node (S.Top); Success := True; exit; when Error => Success := False; exit; end case; end loop; end Parse; end Anagram.Grammars.LR_Parsers;
AdaCore/libadalang
Ada
184
adb
separate (Pr) protected body A is entry Foo when B > 0 is begin Boo := B; pragma Test_Statement; end Foo; end A; --% node.p_previous_part().p_next_part_for_decl()
AdaCore/libadalang
Ada
648
adb
procedure Pcase is type Week is (M, Tu, W, Th, F, Sa, Su); procedure P1 (D : Week) is begin case D is when --% list(node.f_choices.p_complete) end case; end P1; procedure P2 (D : Week) is begin case D is when T --% list(node.p_complete) end case; end P2; procedure P3 (D : Week) is begin case D is when M | --% list(node.p_complete) end case; end P3; procedure P4 (D : Week) is begin case D is when M .. --% list(node.f_choices.p_complete) end case; end P4; begin null; end Pcase;