hexsha
stringlengths 40
40
| size
int64 3
1.05M
| ext
stringclasses 163
values | lang
stringclasses 53
values | max_stars_repo_path
stringlengths 3
945
| max_stars_repo_name
stringlengths 4
112
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
sequencelengths 1
10
| max_stars_count
float64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
945
| max_issues_repo_name
stringlengths 4
113
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
sequencelengths 1
10
| max_issues_count
float64 1
116k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
945
| max_forks_repo_name
stringlengths 4
113
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
sequencelengths 1
10
| max_forks_count
float64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 3
1.05M
| avg_line_length
float64 1
966k
| max_line_length
int64 1
977k
| alphanum_fraction
float64 0
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
50ffcdb6fecbad2f3896558922bd70519ec59955 | 77,179 | ads | Ada | arch/ARM/STM32/svd/stm32f429x/stm32_svd-usb_otg_fs.ads | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 192 | 2016-06-01T18:32:04.000Z | 2022-03-26T22:52:31.000Z | arch/ARM/STM32/svd/stm32f429x/stm32_svd-usb_otg_fs.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 239 | 2016-05-26T20:02:01.000Z | 2022-03-31T09:46:56.000Z | arch/ARM/STM32/svd/stm32f429x/stm32_svd-usb_otg_fs.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 142 | 2016-06-05T08:12:20.000Z | 2022-03-24T17:37:17.000Z | -- This spec has been automatically generated from STM32F429x.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.USB_OTG_FS is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype FS_DCFG_DSPD_Field is HAL.UInt2;
subtype FS_DCFG_DAD_Field is HAL.UInt7;
subtype FS_DCFG_PFIVL_Field is HAL.UInt2;
-- OTG_FS device configuration register (OTG_FS_DCFG)
type FS_DCFG_Register is record
-- Device speed
DSPD : FS_DCFG_DSPD_Field := 16#0#;
-- Non-zero-length status OUT handshake
NZLSOHSK : Boolean := False;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- Device address
DAD : FS_DCFG_DAD_Field := 16#0#;
-- Periodic frame interval
PFIVL : FS_DCFG_PFIVL_Field := 16#0#;
-- unspecified
Reserved_13_31 : HAL.UInt19 := 16#1100#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DCFG_Register use record
DSPD at 0 range 0 .. 1;
NZLSOHSK at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
DAD at 0 range 4 .. 10;
PFIVL at 0 range 11 .. 12;
Reserved_13_31 at 0 range 13 .. 31;
end record;
subtype FS_DCTL_TCTL_Field is HAL.UInt3;
-- OTG_FS device control register (OTG_FS_DCTL)
type FS_DCTL_Register is record
-- Remote wakeup signaling
RWUSIG : Boolean := False;
-- Soft disconnect
SDIS : Boolean := False;
-- Read-only. Global IN NAK status
GINSTS : Boolean := False;
-- Read-only. Global OUT NAK status
GONSTS : Boolean := False;
-- Test control
TCTL : FS_DCTL_TCTL_Field := 16#0#;
-- Set global IN NAK
SGINAK : Boolean := False;
-- Clear global IN NAK
CGINAK : Boolean := False;
-- Set global OUT NAK
SGONAK : Boolean := False;
-- Clear global OUT NAK
CGONAK : Boolean := False;
-- Power-on programming done
POPRGDNE : Boolean := False;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DCTL_Register use record
RWUSIG at 0 range 0 .. 0;
SDIS at 0 range 1 .. 1;
GINSTS at 0 range 2 .. 2;
GONSTS at 0 range 3 .. 3;
TCTL at 0 range 4 .. 6;
SGINAK at 0 range 7 .. 7;
CGINAK at 0 range 8 .. 8;
SGONAK at 0 range 9 .. 9;
CGONAK at 0 range 10 .. 10;
POPRGDNE at 0 range 11 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype FS_DSTS_ENUMSPD_Field is HAL.UInt2;
subtype FS_DSTS_FNSOF_Field is HAL.UInt14;
-- OTG_FS device status register (OTG_FS_DSTS)
type FS_DSTS_Register is record
-- Read-only. Suspend status
SUSPSTS : Boolean;
-- Read-only. Enumerated speed
ENUMSPD : FS_DSTS_ENUMSPD_Field;
-- Read-only. Erratic error
EERR : Boolean;
-- unspecified
Reserved_4_7 : HAL.UInt4;
-- Read-only. Frame number of the received SOF
FNSOF : FS_DSTS_FNSOF_Field;
-- unspecified
Reserved_22_31 : HAL.UInt10;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DSTS_Register use record
SUSPSTS at 0 range 0 .. 0;
ENUMSPD at 0 range 1 .. 2;
EERR at 0 range 3 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
FNSOF at 0 range 8 .. 21;
Reserved_22_31 at 0 range 22 .. 31;
end record;
-- OTG_FS device IN endpoint common interrupt mask register
-- (OTG_FS_DIEPMSK)
type FS_DIEPMSK_Register is record
-- Transfer completed interrupt mask
XFRCM : Boolean := False;
-- Endpoint disabled interrupt mask
EPDM : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Timeout condition mask (Non-isochronous endpoints)
TOM : Boolean := False;
-- IN token received when TxFIFO empty mask
ITTXFEMSK : Boolean := False;
-- IN token received with EP mismatch mask
INEPNMM : Boolean := False;
-- IN endpoint NAK effective mask
INEPNEM : Boolean := False;
-- unspecified
Reserved_7_31 : HAL.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DIEPMSK_Register use record
XFRCM at 0 range 0 .. 0;
EPDM at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
TOM at 0 range 3 .. 3;
ITTXFEMSK at 0 range 4 .. 4;
INEPNMM at 0 range 5 .. 5;
INEPNEM at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
-- OTG_FS device OUT endpoint common interrupt mask register
-- (OTG_FS_DOEPMSK)
type FS_DOEPMSK_Register is record
-- Transfer completed interrupt mask
XFRCM : Boolean := False;
-- Endpoint disabled interrupt mask
EPDM : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- SETUP phase done mask
STUPM : Boolean := False;
-- OUT token received when endpoint disabled mask
OTEPDM : Boolean := False;
-- unspecified
Reserved_5_31 : HAL.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DOEPMSK_Register use record
XFRCM at 0 range 0 .. 0;
EPDM at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
STUPM at 0 range 3 .. 3;
OTEPDM at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
subtype FS_DAINT_IEPINT_Field is HAL.UInt16;
subtype FS_DAINT_OEPINT_Field is HAL.UInt16;
-- OTG_FS device all endpoints interrupt register (OTG_FS_DAINT)
type FS_DAINT_Register is record
-- Read-only. IN endpoint interrupt bits
IEPINT : FS_DAINT_IEPINT_Field;
-- Read-only. OUT endpoint interrupt bits
OEPINT : FS_DAINT_OEPINT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DAINT_Register use record
IEPINT at 0 range 0 .. 15;
OEPINT at 0 range 16 .. 31;
end record;
subtype FS_DAINTMSK_IEPM_Field is HAL.UInt16;
subtype FS_DAINTMSK_OEPM_Field is HAL.UInt16;
-- OTG_FS all endpoints interrupt mask register (OTG_FS_DAINTMSK)
type FS_DAINTMSK_Register is record
-- IN EP interrupt mask bits
IEPM : FS_DAINTMSK_IEPM_Field := 16#0#;
-- OUT EP interrupt mask bits
OEPM : FS_DAINTMSK_OEPM_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DAINTMSK_Register use record
IEPM at 0 range 0 .. 15;
OEPM at 0 range 16 .. 31;
end record;
subtype DVBUSDIS_VBUSDT_Field is HAL.UInt16;
-- OTG_FS device VBUS discharge time register
type DVBUSDIS_Register is record
-- Device VBUS discharge time
VBUSDT : DVBUSDIS_VBUSDT_Field := 16#17D7#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DVBUSDIS_Register use record
VBUSDT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DVBUSPULSE_DVBUSP_Field is HAL.UInt12;
-- OTG_FS device VBUS pulsing time register
type DVBUSPULSE_Register is record
-- Device VBUS pulsing time
DVBUSP : DVBUSPULSE_DVBUSP_Field := 16#5B8#;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DVBUSPULSE_Register use record
DVBUSP at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype DIEPEMPMSK_INEPTXFEM_Field is HAL.UInt16;
-- OTG_FS device IN endpoint FIFO empty interrupt mask register
type DIEPEMPMSK_Register is record
-- IN EP Tx FIFO empty interrupt mask bits
INEPTXFEM : DIEPEMPMSK_INEPTXFEM_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPEMPMSK_Register use record
INEPTXFEM at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype FS_DIEPCTL0_MPSIZ_Field is HAL.UInt2;
subtype FS_DIEPCTL0_EPTYP_Field is HAL.UInt2;
subtype FS_DIEPCTL0_TXFNUM_Field is HAL.UInt4;
-- OTG_FS device control IN endpoint 0 control register (OTG_FS_DIEPCTL0)
type FS_DIEPCTL0_Register is record
-- Maximum packet size
MPSIZ : FS_DIEPCTL0_MPSIZ_Field := 16#0#;
-- unspecified
Reserved_2_14 : HAL.UInt13 := 16#0#;
-- Read-only. USB active endpoint
USBAEP : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Read-only. NAK status
NAKSTS : Boolean := False;
-- Read-only. Endpoint type
EPTYP : FS_DIEPCTL0_EPTYP_Field := 16#0#;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- STALL handshake
STALL : Boolean := False;
-- TxFIFO number
TXFNUM : FS_DIEPCTL0_TXFNUM_Field := 16#0#;
-- Write-only. Clear NAK
CNAK : Boolean := False;
-- Write-only. Set NAK
SNAK : Boolean := False;
-- unspecified
Reserved_28_29 : HAL.UInt2 := 16#0#;
-- Read-only. Endpoint disable
EPDIS : Boolean := False;
-- Read-only. Endpoint enable
EPENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DIEPCTL0_Register use record
MPSIZ at 0 range 0 .. 1;
Reserved_2_14 at 0 range 2 .. 14;
USBAEP at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
NAKSTS at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
STALL at 0 range 21 .. 21;
TXFNUM at 0 range 22 .. 25;
CNAK at 0 range 26 .. 26;
SNAK at 0 range 27 .. 27;
Reserved_28_29 at 0 range 28 .. 29;
EPDIS at 0 range 30 .. 30;
EPENA at 0 range 31 .. 31;
end record;
-- device endpoint-x interrupt register
type DIEPINT_Register is record
-- XFRC
XFRC : Boolean := False;
-- EPDISD
EPDISD : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- TOC
TOC : Boolean := False;
-- ITTXFE
ITTXFE : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- INEPNE
INEPNE : Boolean := False;
-- Read-only. TXFE
TXFE : Boolean := True;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPINT_Register use record
XFRC at 0 range 0 .. 0;
EPDISD at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
TOC at 0 range 3 .. 3;
ITTXFE at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
INEPNE at 0 range 6 .. 6;
TXFE at 0 range 7 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DIEPTSIZ0_XFRSIZ_Field is HAL.UInt7;
subtype DIEPTSIZ0_PKTCNT_Field is HAL.UInt2;
-- device endpoint-0 transfer size register
type DIEPTSIZ0_Register is record
-- Transfer size
XFRSIZ : DIEPTSIZ0_XFRSIZ_Field := 16#0#;
-- unspecified
Reserved_7_18 : HAL.UInt12 := 16#0#;
-- Packet count
PKTCNT : DIEPTSIZ0_PKTCNT_Field := 16#0#;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPTSIZ0_Register use record
XFRSIZ at 0 range 0 .. 6;
Reserved_7_18 at 0 range 7 .. 18;
PKTCNT at 0 range 19 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
subtype DTXFSTS_INEPTFSAV_Field is HAL.UInt16;
-- OTG_FS device IN endpoint transmit FIFO status register
type DTXFSTS_Register is record
-- Read-only. IN endpoint TxFIFO space available
INEPTFSAV : DTXFSTS_INEPTFSAV_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DTXFSTS_Register use record
INEPTFSAV at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DIEPCTL1_MPSIZ_Field is HAL.UInt11;
subtype DIEPCTL1_EPTYP_Field is HAL.UInt2;
subtype DIEPCTL1_TXFNUM_Field is HAL.UInt4;
-- OTG device endpoint-1 control register
type DIEPCTL1_Register is record
-- MPSIZ
MPSIZ : DIEPCTL1_MPSIZ_Field := 16#0#;
-- unspecified
Reserved_11_14 : HAL.UInt4 := 16#0#;
-- USBAEP
USBAEP : Boolean := False;
-- Read-only. EONUM/DPID
EONUM_DPID : Boolean := False;
-- Read-only. NAKSTS
NAKSTS : Boolean := False;
-- EPTYP
EPTYP : DIEPCTL1_EPTYP_Field := 16#0#;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- Stall
Stall : Boolean := False;
-- TXFNUM
TXFNUM : DIEPCTL1_TXFNUM_Field := 16#0#;
-- Write-only. CNAK
CNAK : Boolean := False;
-- Write-only. SNAK
SNAK : Boolean := False;
-- Write-only. SD0PID/SEVNFRM
SD0PID_SEVNFRM : Boolean := False;
-- Write-only. SODDFRM/SD1PID
SODDFRM_SD1PID : Boolean := False;
-- EPDIS
EPDIS : Boolean := False;
-- EPENA
EPENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPCTL1_Register use record
MPSIZ at 0 range 0 .. 10;
Reserved_11_14 at 0 range 11 .. 14;
USBAEP at 0 range 15 .. 15;
EONUM_DPID at 0 range 16 .. 16;
NAKSTS at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
Stall at 0 range 21 .. 21;
TXFNUM at 0 range 22 .. 25;
CNAK at 0 range 26 .. 26;
SNAK at 0 range 27 .. 27;
SD0PID_SEVNFRM at 0 range 28 .. 28;
SODDFRM_SD1PID at 0 range 29 .. 29;
EPDIS at 0 range 30 .. 30;
EPENA at 0 range 31 .. 31;
end record;
subtype DIEPTSIZ_XFRSIZ_Field is HAL.UInt19;
subtype DIEPTSIZ_PKTCNT_Field is HAL.UInt10;
subtype DIEPTSIZ_MCNT_Field is HAL.UInt2;
-- device endpoint-1 transfer size register
type DIEPTSIZ_Register is record
-- Transfer size
XFRSIZ : DIEPTSIZ_XFRSIZ_Field := 16#0#;
-- Packet count
PKTCNT : DIEPTSIZ_PKTCNT_Field := 16#0#;
-- Multi count
MCNT : DIEPTSIZ_MCNT_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPTSIZ_Register use record
XFRSIZ at 0 range 0 .. 18;
PKTCNT at 0 range 19 .. 28;
MCNT at 0 range 29 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DIEPCTL_MPSIZ_Field is HAL.UInt11;
subtype DIEPCTL_EPTYP_Field is HAL.UInt2;
subtype DIEPCTL_TXFNUM_Field is HAL.UInt4;
-- OTG device endpoint-2 control register
type DIEPCTL_Register is record
-- MPSIZ
MPSIZ : DIEPCTL_MPSIZ_Field := 16#0#;
-- unspecified
Reserved_11_14 : HAL.UInt4 := 16#0#;
-- USBAEP
USBAEP : Boolean := False;
-- Read-only. EONUM/DPID
EONUM_DPID : Boolean := False;
-- Read-only. NAKSTS
NAKSTS : Boolean := False;
-- EPTYP
EPTYP : DIEPCTL_EPTYP_Field := 16#0#;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- Stall
Stall : Boolean := False;
-- TXFNUM
TXFNUM : DIEPCTL_TXFNUM_Field := 16#0#;
-- Write-only. CNAK
CNAK : Boolean := False;
-- Write-only. SNAK
SNAK : Boolean := False;
-- Write-only. SD0PID/SEVNFRM
SD0PID_SEVNFRM : Boolean := False;
-- Write-only. SODDFRM
SODDFRM : Boolean := False;
-- EPDIS
EPDIS : Boolean := False;
-- EPENA
EPENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DIEPCTL_Register use record
MPSIZ at 0 range 0 .. 10;
Reserved_11_14 at 0 range 11 .. 14;
USBAEP at 0 range 15 .. 15;
EONUM_DPID at 0 range 16 .. 16;
NAKSTS at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
Stall at 0 range 21 .. 21;
TXFNUM at 0 range 22 .. 25;
CNAK at 0 range 26 .. 26;
SNAK at 0 range 27 .. 27;
SD0PID_SEVNFRM at 0 range 28 .. 28;
SODDFRM at 0 range 29 .. 29;
EPDIS at 0 range 30 .. 30;
EPENA at 0 range 31 .. 31;
end record;
subtype DOEPCTL0_MPSIZ_Field is HAL.UInt2;
subtype DOEPCTL0_EPTYP_Field is HAL.UInt2;
-- device endpoint-0 control register
type DOEPCTL0_Register is record
-- Read-only. MPSIZ
MPSIZ : DOEPCTL0_MPSIZ_Field := 16#0#;
-- unspecified
Reserved_2_14 : HAL.UInt13 := 16#0#;
-- Read-only. USBAEP
USBAEP : Boolean := True;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Read-only. NAKSTS
NAKSTS : Boolean := False;
-- Read-only. EPTYP
EPTYP : DOEPCTL0_EPTYP_Field := 16#0#;
-- SNPM
SNPM : Boolean := False;
-- Stall
Stall : Boolean := False;
-- unspecified
Reserved_22_25 : HAL.UInt4 := 16#0#;
-- Write-only. CNAK
CNAK : Boolean := False;
-- Write-only. SNAK
SNAK : Boolean := False;
-- unspecified
Reserved_28_29 : HAL.UInt2 := 16#0#;
-- Read-only. EPDIS
EPDIS : Boolean := False;
-- Write-only. EPENA
EPENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOEPCTL0_Register use record
MPSIZ at 0 range 0 .. 1;
Reserved_2_14 at 0 range 2 .. 14;
USBAEP at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
NAKSTS at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
SNPM at 0 range 20 .. 20;
Stall at 0 range 21 .. 21;
Reserved_22_25 at 0 range 22 .. 25;
CNAK at 0 range 26 .. 26;
SNAK at 0 range 27 .. 27;
Reserved_28_29 at 0 range 28 .. 29;
EPDIS at 0 range 30 .. 30;
EPENA at 0 range 31 .. 31;
end record;
-- device endpoint-0 interrupt register
type DOEPINT_Register is record
-- XFRC
XFRC : Boolean := False;
-- EPDISD
EPDISD : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- STUP
STUP : Boolean := False;
-- OTEPDIS
OTEPDIS : Boolean := False;
-- unspecified
Reserved_5_5 : HAL.Bit := 16#0#;
-- B2BSTUP
B2BSTUP : Boolean := False;
-- unspecified
Reserved_7_31 : HAL.UInt25 := 16#1#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOEPINT_Register use record
XFRC at 0 range 0 .. 0;
EPDISD at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
STUP at 0 range 3 .. 3;
OTEPDIS at 0 range 4 .. 4;
Reserved_5_5 at 0 range 5 .. 5;
B2BSTUP at 0 range 6 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
subtype DOEPTSIZ0_XFRSIZ_Field is HAL.UInt7;
subtype DOEPTSIZ0_STUPCNT_Field is HAL.UInt2;
-- device OUT endpoint-0 transfer size register
type DOEPTSIZ0_Register is record
-- Transfer size
XFRSIZ : DOEPTSIZ0_XFRSIZ_Field := 16#0#;
-- unspecified
Reserved_7_18 : HAL.UInt12 := 16#0#;
-- Packet count
PKTCNT : Boolean := False;
-- unspecified
Reserved_20_28 : HAL.UInt9 := 16#0#;
-- SETUP packet count
STUPCNT : DOEPTSIZ0_STUPCNT_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOEPTSIZ0_Register use record
XFRSIZ at 0 range 0 .. 6;
Reserved_7_18 at 0 range 7 .. 18;
PKTCNT at 0 range 19 .. 19;
Reserved_20_28 at 0 range 20 .. 28;
STUPCNT at 0 range 29 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DOEPCTL_MPSIZ_Field is HAL.UInt11;
subtype DOEPCTL_EPTYP_Field is HAL.UInt2;
-- device endpoint-1 control register
type DOEPCTL_Register is record
-- MPSIZ
MPSIZ : DOEPCTL_MPSIZ_Field := 16#0#;
-- unspecified
Reserved_11_14 : HAL.UInt4 := 16#0#;
-- USBAEP
USBAEP : Boolean := False;
-- Read-only. EONUM/DPID
EONUM_DPID : Boolean := False;
-- Read-only. NAKSTS
NAKSTS : Boolean := False;
-- EPTYP
EPTYP : DOEPCTL_EPTYP_Field := 16#0#;
-- SNPM
SNPM : Boolean := False;
-- Stall
Stall : Boolean := False;
-- unspecified
Reserved_22_25 : HAL.UInt4 := 16#0#;
-- Write-only. CNAK
CNAK : Boolean := False;
-- Write-only. SNAK
SNAK : Boolean := False;
-- Write-only. SD0PID/SEVNFRM
SD0PID_SEVNFRM : Boolean := False;
-- Write-only. SODDFRM
SODDFRM : Boolean := False;
-- EPDIS
EPDIS : Boolean := False;
-- EPENA
EPENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOEPCTL_Register use record
MPSIZ at 0 range 0 .. 10;
Reserved_11_14 at 0 range 11 .. 14;
USBAEP at 0 range 15 .. 15;
EONUM_DPID at 0 range 16 .. 16;
NAKSTS at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
SNPM at 0 range 20 .. 20;
Stall at 0 range 21 .. 21;
Reserved_22_25 at 0 range 22 .. 25;
CNAK at 0 range 26 .. 26;
SNAK at 0 range 27 .. 27;
SD0PID_SEVNFRM at 0 range 28 .. 28;
SODDFRM at 0 range 29 .. 29;
EPDIS at 0 range 30 .. 30;
EPENA at 0 range 31 .. 31;
end record;
subtype DOEPTSIZ_XFRSIZ_Field is HAL.UInt19;
subtype DOEPTSIZ_PKTCNT_Field is HAL.UInt10;
subtype DOEPTSIZ_RXDPID_STUPCNT_Field is HAL.UInt2;
-- device OUT endpoint-1 transfer size register
type DOEPTSIZ_Register is record
-- Transfer size
XFRSIZ : DOEPTSIZ_XFRSIZ_Field := 16#0#;
-- Packet count
PKTCNT : DOEPTSIZ_PKTCNT_Field := 16#0#;
-- Received data PID/SETUP packet count
RXDPID_STUPCNT : DOEPTSIZ_RXDPID_STUPCNT_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DOEPTSIZ_Register use record
XFRSIZ at 0 range 0 .. 18;
PKTCNT at 0 range 19 .. 28;
RXDPID_STUPCNT at 0 range 29 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-- OTG_FS control and status register (OTG_FS_GOTGCTL)
type FS_GOTGCTL_Register is record
-- Read-only. Session request success
SRQSCS : Boolean := False;
-- Session request
SRQ : Boolean := False;
-- unspecified
Reserved_2_7 : HAL.UInt6 := 16#0#;
-- Read-only. Host negotiation success
HNGSCS : Boolean := False;
-- HNP request
HNPRQ : Boolean := False;
-- Host set HNP enable
HSHNPEN : Boolean := False;
-- Device HNP enabled
DHNPEN : Boolean := True;
-- unspecified
Reserved_12_15 : HAL.UInt4 := 16#0#;
-- Read-only. Connector ID status
CIDSTS : Boolean := False;
-- Read-only. Long/short debounce time
DBCT : Boolean := False;
-- Read-only. A-session valid
ASVLD : Boolean := False;
-- Read-only. B-session valid
BSVLD : Boolean := False;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GOTGCTL_Register use record
SRQSCS at 0 range 0 .. 0;
SRQ at 0 range 1 .. 1;
Reserved_2_7 at 0 range 2 .. 7;
HNGSCS at 0 range 8 .. 8;
HNPRQ at 0 range 9 .. 9;
HSHNPEN at 0 range 10 .. 10;
DHNPEN at 0 range 11 .. 11;
Reserved_12_15 at 0 range 12 .. 15;
CIDSTS at 0 range 16 .. 16;
DBCT at 0 range 17 .. 17;
ASVLD at 0 range 18 .. 18;
BSVLD at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- OTG_FS interrupt register (OTG_FS_GOTGINT)
type FS_GOTGINT_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Session end detected
SEDET : Boolean := False;
-- unspecified
Reserved_3_7 : HAL.UInt5 := 16#0#;
-- Session request success status change
SRSSCHG : Boolean := False;
-- Host negotiation success status change
HNSSCHG : Boolean := False;
-- unspecified
Reserved_10_16 : HAL.UInt7 := 16#0#;
-- Host negotiation detected
HNGDET : Boolean := False;
-- A-device timeout change
ADTOCHG : Boolean := False;
-- Debounce done
DBCDNE : Boolean := False;
-- unspecified
Reserved_20_31 : HAL.UInt12 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GOTGINT_Register use record
Reserved_0_1 at 0 range 0 .. 1;
SEDET at 0 range 2 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
SRSSCHG at 0 range 8 .. 8;
HNSSCHG at 0 range 9 .. 9;
Reserved_10_16 at 0 range 10 .. 16;
HNGDET at 0 range 17 .. 17;
ADTOCHG at 0 range 18 .. 18;
DBCDNE at 0 range 19 .. 19;
Reserved_20_31 at 0 range 20 .. 31;
end record;
-- OTG_FS AHB configuration register (OTG_FS_GAHBCFG)
type FS_GAHBCFG_Register is record
-- Global interrupt mask
GINT : Boolean := False;
-- unspecified
Reserved_1_6 : HAL.UInt6 := 16#0#;
-- TxFIFO empty level
TXFELVL : Boolean := False;
-- Periodic TxFIFO empty level
PTXFELVL : Boolean := False;
-- unspecified
Reserved_9_31 : HAL.UInt23 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GAHBCFG_Register use record
GINT at 0 range 0 .. 0;
Reserved_1_6 at 0 range 1 .. 6;
TXFELVL at 0 range 7 .. 7;
PTXFELVL at 0 range 8 .. 8;
Reserved_9_31 at 0 range 9 .. 31;
end record;
subtype FS_GUSBCFG_TOCAL_Field is HAL.UInt3;
subtype FS_GUSBCFG_TRDT_Field is HAL.UInt4;
-- OTG_FS USB configuration register (OTG_FS_GUSBCFG)
type FS_GUSBCFG_Register is record
-- FS timeout calibration
TOCAL : FS_GUSBCFG_TOCAL_Field := 16#0#;
-- unspecified
Reserved_3_5 : HAL.UInt3 := 16#0#;
-- Write-only. Full Speed serial transceiver select
PHYSEL : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- SRP-capable
SRPCAP : Boolean := False;
-- HNP-capable
HNPCAP : Boolean := True;
-- USB turnaround time
TRDT : FS_GUSBCFG_TRDT_Field := 16#2#;
-- unspecified
Reserved_14_28 : HAL.UInt15 := 16#0#;
-- Force host mode
FHMOD : Boolean := False;
-- Force device mode
FDMOD : Boolean := False;
-- Corrupt Tx packet
CTXPKT : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GUSBCFG_Register use record
TOCAL at 0 range 0 .. 2;
Reserved_3_5 at 0 range 3 .. 5;
PHYSEL at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
SRPCAP at 0 range 8 .. 8;
HNPCAP at 0 range 9 .. 9;
TRDT at 0 range 10 .. 13;
Reserved_14_28 at 0 range 14 .. 28;
FHMOD at 0 range 29 .. 29;
FDMOD at 0 range 30 .. 30;
CTXPKT at 0 range 31 .. 31;
end record;
subtype FS_GRSTCTL_TXFNUM_Field is HAL.UInt5;
-- OTG_FS reset register (OTG_FS_GRSTCTL)
type FS_GRSTCTL_Register is record
-- Core soft reset
CSRST : Boolean := False;
-- HCLK soft reset
HSRST : Boolean := False;
-- Host frame counter reset
FCRST : Boolean := False;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- RxFIFO flush
RXFFLSH : Boolean := False;
-- TxFIFO flush
TXFFLSH : Boolean := False;
-- TxFIFO number
TXFNUM : FS_GRSTCTL_TXFNUM_Field := 16#0#;
-- unspecified
Reserved_11_30 : HAL.UInt20 := 16#40000#;
-- Read-only. AHB master idle
AHBIDL : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GRSTCTL_Register use record
CSRST at 0 range 0 .. 0;
HSRST at 0 range 1 .. 1;
FCRST at 0 range 2 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RXFFLSH at 0 range 4 .. 4;
TXFFLSH at 0 range 5 .. 5;
TXFNUM at 0 range 6 .. 10;
Reserved_11_30 at 0 range 11 .. 30;
AHBIDL at 0 range 31 .. 31;
end record;
-- OTG_FS core interrupt register (OTG_FS_GINTSTS)
type FS_GINTSTS_Register is record
-- Read-only. Current mode of operation
CMOD : Boolean := False;
-- Mode mismatch interrupt
MMIS : Boolean := False;
-- Read-only. OTG interrupt
OTGINT : Boolean := False;
-- Start of frame
SOF : Boolean := False;
-- Read-only. RxFIFO non-empty
RXFLVL : Boolean := False;
-- Read-only. Non-periodic TxFIFO empty
NPTXFE : Boolean := True;
-- Read-only. Global IN non-periodic NAK effective
GINAKEFF : Boolean := False;
-- Read-only. Global OUT NAK effective
GOUTNAKEFF : Boolean := False;
-- unspecified
Reserved_8_9 : HAL.UInt2 := 16#0#;
-- Early suspend
ESUSP : Boolean := False;
-- USB suspend
USBSUSP : Boolean := False;
-- USB reset
USBRST : Boolean := False;
-- Enumeration done
ENUMDNE : Boolean := False;
-- Isochronous OUT packet dropped interrupt
ISOODRP : Boolean := False;
-- End of periodic frame interrupt
EOPF : Boolean := False;
-- unspecified
Reserved_16_17 : HAL.UInt2 := 16#0#;
-- Read-only. IN endpoint interrupt
IEPINT : Boolean := False;
-- Read-only. OUT endpoint interrupt
OEPINT : Boolean := False;
-- Incomplete isochronous IN transfer
IISOIXFR : Boolean := False;
-- Incomplete periodic transfer(Host mode)/Incomplete isochronous OUT
-- transfer(Device mode)
IPXFR_INCOMPISOOUT : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Read-only. Host port interrupt
HPRTINT : Boolean := False;
-- Read-only. Host channels interrupt
HCINT : Boolean := False;
-- Read-only. Periodic TxFIFO empty
PTXFE : Boolean := True;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Connector ID status change
CIDSCHG : Boolean := False;
-- Disconnect detected interrupt
DISCINT : Boolean := False;
-- Session request/new session detected interrupt
SRQINT : Boolean := False;
-- Resume/remote wakeup detected interrupt
WKUPINT : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GINTSTS_Register use record
CMOD at 0 range 0 .. 0;
MMIS at 0 range 1 .. 1;
OTGINT at 0 range 2 .. 2;
SOF at 0 range 3 .. 3;
RXFLVL at 0 range 4 .. 4;
NPTXFE at 0 range 5 .. 5;
GINAKEFF at 0 range 6 .. 6;
GOUTNAKEFF at 0 range 7 .. 7;
Reserved_8_9 at 0 range 8 .. 9;
ESUSP at 0 range 10 .. 10;
USBSUSP at 0 range 11 .. 11;
USBRST at 0 range 12 .. 12;
ENUMDNE at 0 range 13 .. 13;
ISOODRP at 0 range 14 .. 14;
EOPF at 0 range 15 .. 15;
Reserved_16_17 at 0 range 16 .. 17;
IEPINT at 0 range 18 .. 18;
OEPINT at 0 range 19 .. 19;
IISOIXFR at 0 range 20 .. 20;
IPXFR_INCOMPISOOUT at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
HPRTINT at 0 range 24 .. 24;
HCINT at 0 range 25 .. 25;
PTXFE at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
CIDSCHG at 0 range 28 .. 28;
DISCINT at 0 range 29 .. 29;
SRQINT at 0 range 30 .. 30;
WKUPINT at 0 range 31 .. 31;
end record;
-- OTG_FS interrupt mask register (OTG_FS_GINTMSK)
type FS_GINTMSK_Register is record
-- unspecified
Reserved_0_0 : HAL.Bit := 16#0#;
-- Mode mismatch interrupt mask
MMISM : Boolean := False;
-- OTG interrupt mask
OTGINT : Boolean := False;
-- Start of frame mask
SOFM : Boolean := False;
-- Receive FIFO non-empty mask
RXFLVLM : Boolean := False;
-- Non-periodic TxFIFO empty mask
NPTXFEM : Boolean := False;
-- Global non-periodic IN NAK effective mask
GINAKEFFM : Boolean := False;
-- Global OUT NAK effective mask
GONAKEFFM : Boolean := False;
-- unspecified
Reserved_8_9 : HAL.UInt2 := 16#0#;
-- Early suspend mask
ESUSPM : Boolean := False;
-- USB suspend mask
USBSUSPM : Boolean := False;
-- USB reset mask
USBRST : Boolean := False;
-- Enumeration done mask
ENUMDNEM : Boolean := False;
-- Isochronous OUT packet dropped interrupt mask
ISOODRPM : Boolean := False;
-- End of periodic frame interrupt mask
EOPFM : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Endpoint mismatch interrupt mask
EPMISM : Boolean := False;
-- IN endpoints interrupt mask
IEPINT : Boolean := False;
-- OUT endpoints interrupt mask
OEPINT : Boolean := False;
-- Incomplete isochronous IN transfer mask
IISOIXFRM : Boolean := False;
-- Incomplete periodic transfer mask(Host mode)/Incomplete isochronous
-- OUT transfer mask(Device mode)
IPXFRM_IISOOXFRM : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Read-only. Host port interrupt mask
PRTIM : Boolean := False;
-- Host channels interrupt mask
HCIM : Boolean := False;
-- Periodic TxFIFO empty mask
PTXFEM : Boolean := False;
-- unspecified
Reserved_27_27 : HAL.Bit := 16#0#;
-- Connector ID status change mask
CIDSCHGM : Boolean := False;
-- Disconnect detected interrupt mask
DISCINT : Boolean := False;
-- Session request/new session detected interrupt mask
SRQIM : Boolean := False;
-- Resume/remote wakeup detected interrupt mask
WUIM : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GINTMSK_Register use record
Reserved_0_0 at 0 range 0 .. 0;
MMISM at 0 range 1 .. 1;
OTGINT at 0 range 2 .. 2;
SOFM at 0 range 3 .. 3;
RXFLVLM at 0 range 4 .. 4;
NPTXFEM at 0 range 5 .. 5;
GINAKEFFM at 0 range 6 .. 6;
GONAKEFFM at 0 range 7 .. 7;
Reserved_8_9 at 0 range 8 .. 9;
ESUSPM at 0 range 10 .. 10;
USBSUSPM at 0 range 11 .. 11;
USBRST at 0 range 12 .. 12;
ENUMDNEM at 0 range 13 .. 13;
ISOODRPM at 0 range 14 .. 14;
EOPFM at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
EPMISM at 0 range 17 .. 17;
IEPINT at 0 range 18 .. 18;
OEPINT at 0 range 19 .. 19;
IISOIXFRM at 0 range 20 .. 20;
IPXFRM_IISOOXFRM at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
PRTIM at 0 range 24 .. 24;
HCIM at 0 range 25 .. 25;
PTXFEM at 0 range 26 .. 26;
Reserved_27_27 at 0 range 27 .. 27;
CIDSCHGM at 0 range 28 .. 28;
DISCINT at 0 range 29 .. 29;
SRQIM at 0 range 30 .. 30;
WUIM at 0 range 31 .. 31;
end record;
subtype FS_GRXSTSR_Device_EPNUM_Field is HAL.UInt4;
subtype FS_GRXSTSR_Device_BCNT_Field is HAL.UInt11;
subtype FS_GRXSTSR_Device_DPID_Field is HAL.UInt2;
subtype FS_GRXSTSR_Device_PKTSTS_Field is HAL.UInt4;
subtype FS_GRXSTSR_Device_FRMNUM_Field is HAL.UInt4;
-- OTG_FS Receive status debug read(Device mode)
type FS_GRXSTSR_Device_Register is record
-- Read-only. Endpoint number
EPNUM : FS_GRXSTSR_Device_EPNUM_Field;
-- Read-only. Byte count
BCNT : FS_GRXSTSR_Device_BCNT_Field;
-- Read-only. Data PID
DPID : FS_GRXSTSR_Device_DPID_Field;
-- Read-only. Packet status
PKTSTS : FS_GRXSTSR_Device_PKTSTS_Field;
-- Read-only. Frame number
FRMNUM : FS_GRXSTSR_Device_FRMNUM_Field;
-- unspecified
Reserved_25_31 : HAL.UInt7;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GRXSTSR_Device_Register use record
EPNUM at 0 range 0 .. 3;
BCNT at 0 range 4 .. 14;
DPID at 0 range 15 .. 16;
PKTSTS at 0 range 17 .. 20;
FRMNUM at 0 range 21 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
subtype FS_GRXSTSR_Host_EPNUM_Field is HAL.UInt4;
subtype FS_GRXSTSR_Host_BCNT_Field is HAL.UInt11;
subtype FS_GRXSTSR_Host_DPID_Field is HAL.UInt2;
subtype FS_GRXSTSR_Host_PKTSTS_Field is HAL.UInt4;
subtype FS_GRXSTSR_Host_FRMNUM_Field is HAL.UInt4;
-- OTG_FS Receive status debug read(Host mode)
type FS_GRXSTSR_Host_Register is record
-- Read-only. Endpoint number
EPNUM : FS_GRXSTSR_Host_EPNUM_Field;
-- Read-only. Byte count
BCNT : FS_GRXSTSR_Host_BCNT_Field;
-- Read-only. Data PID
DPID : FS_GRXSTSR_Host_DPID_Field;
-- Read-only. Packet status
PKTSTS : FS_GRXSTSR_Host_PKTSTS_Field;
-- Read-only. Frame number
FRMNUM : FS_GRXSTSR_Host_FRMNUM_Field;
-- unspecified
Reserved_25_31 : HAL.UInt7;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GRXSTSR_Host_Register use record
EPNUM at 0 range 0 .. 3;
BCNT at 0 range 4 .. 14;
DPID at 0 range 15 .. 16;
PKTSTS at 0 range 17 .. 20;
FRMNUM at 0 range 21 .. 24;
Reserved_25_31 at 0 range 25 .. 31;
end record;
subtype FS_GRXFSIZ_RXFD_Field is HAL.UInt16;
-- OTG_FS Receive FIFO size register (OTG_FS_GRXFSIZ)
type FS_GRXFSIZ_Register is record
-- RxFIFO depth
RXFD : FS_GRXFSIZ_RXFD_Field := 16#200#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GRXFSIZ_Register use record
RXFD at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype FS_GNPTXFSIZ_Device_TX0FSA_Field is HAL.UInt16;
subtype FS_GNPTXFSIZ_Device_TX0FD_Field is HAL.UInt16;
-- OTG_FS non-periodic transmit FIFO size register (Device mode)
type FS_GNPTXFSIZ_Device_Register is record
-- Endpoint 0 transmit RAM start address
TX0FSA : FS_GNPTXFSIZ_Device_TX0FSA_Field := 16#200#;
-- Endpoint 0 TxFIFO depth
TX0FD : FS_GNPTXFSIZ_Device_TX0FD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GNPTXFSIZ_Device_Register use record
TX0FSA at 0 range 0 .. 15;
TX0FD at 0 range 16 .. 31;
end record;
subtype FS_GNPTXFSIZ_Host_NPTXFSA_Field is HAL.UInt16;
subtype FS_GNPTXFSIZ_Host_NPTXFD_Field is HAL.UInt16;
-- OTG_FS non-periodic transmit FIFO size register (Host mode)
type FS_GNPTXFSIZ_Host_Register is record
-- Non-periodic transmit RAM start address
NPTXFSA : FS_GNPTXFSIZ_Host_NPTXFSA_Field := 16#200#;
-- Non-periodic TxFIFO depth
NPTXFD : FS_GNPTXFSIZ_Host_NPTXFD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GNPTXFSIZ_Host_Register use record
NPTXFSA at 0 range 0 .. 15;
NPTXFD at 0 range 16 .. 31;
end record;
subtype FS_GNPTXSTS_NPTXFSAV_Field is HAL.UInt16;
subtype FS_GNPTXSTS_NPTQXSAV_Field is HAL.UInt8;
subtype FS_GNPTXSTS_NPTXQTOP_Field is HAL.UInt7;
-- OTG_FS non-periodic transmit FIFO/queue status register
-- (OTG_FS_GNPTXSTS)
type FS_GNPTXSTS_Register is record
-- Read-only. Non-periodic TxFIFO space available
NPTXFSAV : FS_GNPTXSTS_NPTXFSAV_Field;
-- Read-only. Non-periodic transmit request queue space available
NPTQXSAV : FS_GNPTXSTS_NPTQXSAV_Field;
-- Read-only. Top of the non-periodic transmit request queue
NPTXQTOP : FS_GNPTXSTS_NPTXQTOP_Field;
-- unspecified
Reserved_31_31 : HAL.Bit;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GNPTXSTS_Register use record
NPTXFSAV at 0 range 0 .. 15;
NPTQXSAV at 0 range 16 .. 23;
NPTXQTOP at 0 range 24 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-- OTG_FS general core configuration register (OTG_FS_GCCFG)
type FS_GCCFG_Register is record
-- unspecified
Reserved_0_15 : HAL.UInt16 := 16#0#;
-- Power down
PWRDWN : Boolean := False;
-- unspecified
Reserved_17_17 : HAL.Bit := 16#0#;
-- Enable the VBUS sensing device
VBUSASEN : Boolean := False;
-- Enable the VBUS sensing device
VBUSBSEN : Boolean := False;
-- SOF output enable
SOFOUTEN : Boolean := False;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_GCCFG_Register use record
Reserved_0_15 at 0 range 0 .. 15;
PWRDWN at 0 range 16 .. 16;
Reserved_17_17 at 0 range 17 .. 17;
VBUSASEN at 0 range 18 .. 18;
VBUSBSEN at 0 range 19 .. 19;
SOFOUTEN at 0 range 20 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
subtype FS_HPTXFSIZ_PTXSA_Field is HAL.UInt16;
subtype FS_HPTXFSIZ_PTXFSIZ_Field is HAL.UInt16;
-- OTG_FS Host periodic transmit FIFO size register (OTG_FS_HPTXFSIZ)
type FS_HPTXFSIZ_Register is record
-- Host periodic TxFIFO start address
PTXSA : FS_HPTXFSIZ_PTXSA_Field := 16#600#;
-- Host periodic TxFIFO depth
PTXFSIZ : FS_HPTXFSIZ_PTXFSIZ_Field := 16#200#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HPTXFSIZ_Register use record
PTXSA at 0 range 0 .. 15;
PTXFSIZ at 0 range 16 .. 31;
end record;
subtype FS_DIEPTXF_INEPTXSA_Field is HAL.UInt16;
subtype FS_DIEPTXF_INEPTXFD_Field is HAL.UInt16;
-- OTG_FS device IN endpoint transmit FIFO size register (OTG_FS_DIEPTXF2)
type FS_DIEPTXF_Register is record
-- IN endpoint FIFO2 transmit RAM start address
INEPTXSA : FS_DIEPTXF_INEPTXSA_Field := 16#400#;
-- IN endpoint TxFIFO depth
INEPTXFD : FS_DIEPTXF_INEPTXFD_Field := 16#200#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_DIEPTXF_Register use record
INEPTXSA at 0 range 0 .. 15;
INEPTXFD at 0 range 16 .. 31;
end record;
subtype FS_HCFG_FSLSPCS_Field is HAL.UInt2;
-- OTG_FS host configuration register (OTG_FS_HCFG)
type FS_HCFG_Register is record
-- FS/LS PHY clock select
FSLSPCS : FS_HCFG_FSLSPCS_Field := 16#0#;
-- Read-only. FS- and LS-only support
FSLSS : Boolean := False;
-- unspecified
Reserved_3_31 : HAL.UInt29 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HCFG_Register use record
FSLSPCS at 0 range 0 .. 1;
FSLSS at 0 range 2 .. 2;
Reserved_3_31 at 0 range 3 .. 31;
end record;
subtype HFIR_FRIVL_Field is HAL.UInt16;
-- OTG_FS Host frame interval register
type HFIR_Register is record
-- Frame interval
FRIVL : HFIR_FRIVL_Field := 16#EA60#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for HFIR_Register use record
FRIVL at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype FS_HFNUM_FRNUM_Field is HAL.UInt16;
subtype FS_HFNUM_FTREM_Field is HAL.UInt16;
-- OTG_FS host frame number/frame time remaining register (OTG_FS_HFNUM)
type FS_HFNUM_Register is record
-- Read-only. Frame number
FRNUM : FS_HFNUM_FRNUM_Field;
-- Read-only. Frame time remaining
FTREM : FS_HFNUM_FTREM_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HFNUM_Register use record
FRNUM at 0 range 0 .. 15;
FTREM at 0 range 16 .. 31;
end record;
subtype FS_HPTXSTS_PTXFSAVL_Field is HAL.UInt16;
subtype FS_HPTXSTS_PTXQSAV_Field is HAL.UInt8;
subtype FS_HPTXSTS_PTXQTOP_Field is HAL.UInt8;
-- OTG_FS_Host periodic transmit FIFO/queue status register
-- (OTG_FS_HPTXSTS)
type FS_HPTXSTS_Register is record
-- Periodic transmit data FIFO space available
PTXFSAVL : FS_HPTXSTS_PTXFSAVL_Field := 16#100#;
-- Read-only. Periodic transmit request queue space available
PTXQSAV : FS_HPTXSTS_PTXQSAV_Field := 16#8#;
-- Read-only. Top of the periodic transmit request queue
PTXQTOP : FS_HPTXSTS_PTXQTOP_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HPTXSTS_Register use record
PTXFSAVL at 0 range 0 .. 15;
PTXQSAV at 0 range 16 .. 23;
PTXQTOP at 0 range 24 .. 31;
end record;
subtype HAINT_HAINT_Field is HAL.UInt16;
-- OTG_FS Host all channels interrupt register
type HAINT_Register is record
-- Read-only. Channel interrupts
HAINT : HAINT_HAINT_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for HAINT_Register use record
HAINT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype HAINTMSK_HAINTM_Field is HAL.UInt16;
-- OTG_FS host all channels interrupt mask register
type HAINTMSK_Register is record
-- Channel interrupt mask
HAINTM : HAINTMSK_HAINTM_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for HAINTMSK_Register use record
HAINTM at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype FS_HPRT_PLSTS_Field is HAL.UInt2;
subtype FS_HPRT_PTCTL_Field is HAL.UInt4;
subtype FS_HPRT_PSPD_Field is HAL.UInt2;
-- OTG_FS host port control and status register (OTG_FS_HPRT)
type FS_HPRT_Register is record
-- Read-only. Port connect status
PCSTS : Boolean := False;
-- Port connect detected
PCDET : Boolean := False;
-- Port enable
PENA : Boolean := False;
-- Port enable/disable change
PENCHNG : Boolean := False;
-- Read-only. Port overcurrent active
POCA : Boolean := False;
-- Port overcurrent change
POCCHNG : Boolean := False;
-- Port resume
PRES : Boolean := False;
-- Port suspend
PSUSP : Boolean := False;
-- Port reset
PRST : Boolean := False;
-- unspecified
Reserved_9_9 : HAL.Bit := 16#0#;
-- Read-only. Port line status
PLSTS : FS_HPRT_PLSTS_Field := 16#0#;
-- Port power
PPWR : Boolean := False;
-- Port test control
PTCTL : FS_HPRT_PTCTL_Field := 16#0#;
-- Read-only. Port speed
PSPD : FS_HPRT_PSPD_Field := 16#0#;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HPRT_Register use record
PCSTS at 0 range 0 .. 0;
PCDET at 0 range 1 .. 1;
PENA at 0 range 2 .. 2;
PENCHNG at 0 range 3 .. 3;
POCA at 0 range 4 .. 4;
POCCHNG at 0 range 5 .. 5;
PRES at 0 range 6 .. 6;
PSUSP at 0 range 7 .. 7;
PRST at 0 range 8 .. 8;
Reserved_9_9 at 0 range 9 .. 9;
PLSTS at 0 range 10 .. 11;
PPWR at 0 range 12 .. 12;
PTCTL at 0 range 13 .. 16;
PSPD at 0 range 17 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
subtype FS_HCCHAR_MPSIZ_Field is HAL.UInt11;
subtype FS_HCCHAR_EPNUM_Field is HAL.UInt4;
subtype FS_HCCHAR_EPTYP_Field is HAL.UInt2;
subtype FS_HCCHAR_MCNT_Field is HAL.UInt2;
subtype FS_HCCHAR_DAD_Field is HAL.UInt7;
-- OTG_FS host channel-0 characteristics register (OTG_FS_HCCHAR0)
type FS_HCCHAR_Register is record
-- Maximum packet size
MPSIZ : FS_HCCHAR_MPSIZ_Field := 16#0#;
-- Endpoint number
EPNUM : FS_HCCHAR_EPNUM_Field := 16#0#;
-- Endpoint direction
EPDIR : Boolean := False;
-- unspecified
Reserved_16_16 : HAL.Bit := 16#0#;
-- Low-speed device
LSDEV : Boolean := False;
-- Endpoint type
EPTYP : FS_HCCHAR_EPTYP_Field := 16#0#;
-- Multicount
MCNT : FS_HCCHAR_MCNT_Field := 16#0#;
-- Device address
DAD : FS_HCCHAR_DAD_Field := 16#0#;
-- Odd frame
ODDFRM : Boolean := False;
-- Channel disable
CHDIS : Boolean := False;
-- Channel enable
CHENA : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HCCHAR_Register use record
MPSIZ at 0 range 0 .. 10;
EPNUM at 0 range 11 .. 14;
EPDIR at 0 range 15 .. 15;
Reserved_16_16 at 0 range 16 .. 16;
LSDEV at 0 range 17 .. 17;
EPTYP at 0 range 18 .. 19;
MCNT at 0 range 20 .. 21;
DAD at 0 range 22 .. 28;
ODDFRM at 0 range 29 .. 29;
CHDIS at 0 range 30 .. 30;
CHENA at 0 range 31 .. 31;
end record;
-- OTG_FS host channel-0 interrupt register (OTG_FS_HCINT0)
type FS_HCINT_Register is record
-- Transfer completed
XFRC : Boolean := False;
-- Channel halted
CHH : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- STALL response received interrupt
STALL : Boolean := False;
-- NAK response received interrupt
NAK : Boolean := False;
-- ACK response received/transmitted interrupt
ACK : Boolean := False;
-- unspecified
Reserved_6_6 : HAL.Bit := 16#0#;
-- Transaction error
TXERR : Boolean := False;
-- Babble error
BBERR : Boolean := False;
-- Frame overrun
FRMOR : Boolean := False;
-- Data toggle error
DTERR : Boolean := False;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HCINT_Register use record
XFRC at 0 range 0 .. 0;
CHH at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
STALL at 0 range 3 .. 3;
NAK at 0 range 4 .. 4;
ACK at 0 range 5 .. 5;
Reserved_6_6 at 0 range 6 .. 6;
TXERR at 0 range 7 .. 7;
BBERR at 0 range 8 .. 8;
FRMOR at 0 range 9 .. 9;
DTERR at 0 range 10 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
-- OTG_FS host channel-0 mask register (OTG_FS_HCINTMSK0)
type FS_HCINTMSK_Register is record
-- Transfer completed mask
XFRCM : Boolean := False;
-- Channel halted mask
CHHM : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- STALL response received interrupt mask
STALLM : Boolean := False;
-- NAK response received interrupt mask
NAKM : Boolean := False;
-- ACK response received/transmitted interrupt mask
ACKM : Boolean := False;
-- response received interrupt mask
NYET : Boolean := False;
-- Transaction error mask
TXERRM : Boolean := False;
-- Babble error mask
BBERRM : Boolean := False;
-- Frame overrun mask
FRMORM : Boolean := False;
-- Data toggle error mask
DTERRM : Boolean := False;
-- unspecified
Reserved_11_31 : HAL.UInt21 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HCINTMSK_Register use record
XFRCM at 0 range 0 .. 0;
CHHM at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
STALLM at 0 range 3 .. 3;
NAKM at 0 range 4 .. 4;
ACKM at 0 range 5 .. 5;
NYET at 0 range 6 .. 6;
TXERRM at 0 range 7 .. 7;
BBERRM at 0 range 8 .. 8;
FRMORM at 0 range 9 .. 9;
DTERRM at 0 range 10 .. 10;
Reserved_11_31 at 0 range 11 .. 31;
end record;
subtype FS_HCTSIZ_XFRSIZ_Field is HAL.UInt19;
subtype FS_HCTSIZ_PKTCNT_Field is HAL.UInt10;
subtype FS_HCTSIZ_DPID_Field is HAL.UInt2;
-- OTG_FS host channel-0 transfer size register
type FS_HCTSIZ_Register is record
-- Transfer size
XFRSIZ : FS_HCTSIZ_XFRSIZ_Field := 16#0#;
-- Packet count
PKTCNT : FS_HCTSIZ_PKTCNT_Field := 16#0#;
-- Data PID
DPID : FS_HCTSIZ_DPID_Field := 16#0#;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_HCTSIZ_Register use record
XFRSIZ at 0 range 0 .. 18;
PKTCNT at 0 range 19 .. 28;
DPID at 0 range 29 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
-- OTG_FS power and clock gating control register (OTG_FS_PCGCCTL)
type FS_PCGCCTL_Register is record
-- Stop PHY clock
STPPCLK : Boolean := False;
-- Gate HCLK
GATEHCLK : Boolean := False;
-- unspecified
Reserved_2_3 : HAL.UInt2 := 16#0#;
-- PHY Suspended
PHYSUSP : Boolean := False;
-- unspecified
Reserved_5_31 : HAL.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for FS_PCGCCTL_Register use record
STPPCLK at 0 range 0 .. 0;
GATEHCLK at 0 range 1 .. 1;
Reserved_2_3 at 0 range 2 .. 3;
PHYSUSP at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- USB on the go full speed
type OTG_FS_DEVICE_Peripheral is record
-- OTG_FS device configuration register (OTG_FS_DCFG)
FS_DCFG : aliased FS_DCFG_Register;
-- OTG_FS device control register (OTG_FS_DCTL)
FS_DCTL : aliased FS_DCTL_Register;
-- OTG_FS device status register (OTG_FS_DSTS)
FS_DSTS : aliased FS_DSTS_Register;
-- OTG_FS device IN endpoint common interrupt mask register
-- (OTG_FS_DIEPMSK)
FS_DIEPMSK : aliased FS_DIEPMSK_Register;
-- OTG_FS device OUT endpoint common interrupt mask register
-- (OTG_FS_DOEPMSK)
FS_DOEPMSK : aliased FS_DOEPMSK_Register;
-- OTG_FS device all endpoints interrupt register (OTG_FS_DAINT)
FS_DAINT : aliased FS_DAINT_Register;
-- OTG_FS all endpoints interrupt mask register (OTG_FS_DAINTMSK)
FS_DAINTMSK : aliased FS_DAINTMSK_Register;
-- OTG_FS device VBUS discharge time register
DVBUSDIS : aliased DVBUSDIS_Register;
-- OTG_FS device VBUS pulsing time register
DVBUSPULSE : aliased DVBUSPULSE_Register;
-- OTG_FS device IN endpoint FIFO empty interrupt mask register
DIEPEMPMSK : aliased DIEPEMPMSK_Register;
-- OTG_FS device control IN endpoint 0 control register
-- (OTG_FS_DIEPCTL0)
FS_DIEPCTL0 : aliased FS_DIEPCTL0_Register;
-- device endpoint-x interrupt register
DIEPINT0 : aliased DIEPINT_Register;
-- device endpoint-0 transfer size register
DIEPTSIZ0 : aliased DIEPTSIZ0_Register;
-- OTG_FS device IN endpoint transmit FIFO status register
DTXFSTS0 : aliased DTXFSTS_Register;
-- OTG device endpoint-1 control register
DIEPCTL1 : aliased DIEPCTL1_Register;
-- device endpoint-1 interrupt register
DIEPINT1 : aliased DIEPINT_Register;
-- device endpoint-1 transfer size register
DIEPTSIZ1 : aliased DIEPTSIZ_Register;
-- OTG_FS device IN endpoint transmit FIFO status register
DTXFSTS1 : aliased DTXFSTS_Register;
-- OTG device endpoint-2 control register
DIEPCTL2 : aliased DIEPCTL_Register;
-- device endpoint-2 interrupt register
DIEPINT2 : aliased DIEPINT_Register;
-- device endpoint-2 transfer size register
DIEPTSIZ2 : aliased DIEPTSIZ_Register;
-- OTG_FS device IN endpoint transmit FIFO status register
DTXFSTS2 : aliased DTXFSTS_Register;
-- OTG device endpoint-3 control register
DIEPCTL3 : aliased DIEPCTL_Register;
-- device endpoint-3 interrupt register
DIEPINT3 : aliased DIEPINT_Register;
-- device endpoint-3 transfer size register
DIEPTSIZ3 : aliased DIEPTSIZ_Register;
-- OTG_FS device IN endpoint transmit FIFO status register
DTXFSTS3 : aliased DTXFSTS_Register;
-- device endpoint-0 control register
DOEPCTL0 : aliased DOEPCTL0_Register;
-- device endpoint-0 interrupt register
DOEPINT0 : aliased DOEPINT_Register;
-- device OUT endpoint-0 transfer size register
DOEPTSIZ0 : aliased DOEPTSIZ0_Register;
-- device endpoint-1 control register
DOEPCTL1 : aliased DOEPCTL_Register;
-- device endpoint-1 interrupt register
DOEPINT1 : aliased DOEPINT_Register;
-- device OUT endpoint-1 transfer size register
DOEPTSIZ1 : aliased DOEPTSIZ_Register;
-- device endpoint-2 control register
DOEPCTL2 : aliased DOEPCTL_Register;
-- device endpoint-2 interrupt register
DOEPINT2 : aliased DOEPINT_Register;
-- device OUT endpoint-2 transfer size register
DOEPTSIZ2 : aliased DOEPTSIZ_Register;
-- device endpoint-3 control register
DOEPCTL3 : aliased DOEPCTL_Register;
-- device endpoint-3 interrupt register
DOEPINT3 : aliased DOEPINT_Register;
-- device OUT endpoint-3 transfer size register
DOEPTSIZ3 : aliased DOEPTSIZ_Register;
end record
with Volatile;
for OTG_FS_DEVICE_Peripheral use record
FS_DCFG at 16#0# range 0 .. 31;
FS_DCTL at 16#4# range 0 .. 31;
FS_DSTS at 16#8# range 0 .. 31;
FS_DIEPMSK at 16#10# range 0 .. 31;
FS_DOEPMSK at 16#14# range 0 .. 31;
FS_DAINT at 16#18# range 0 .. 31;
FS_DAINTMSK at 16#1C# range 0 .. 31;
DVBUSDIS at 16#28# range 0 .. 31;
DVBUSPULSE at 16#2C# range 0 .. 31;
DIEPEMPMSK at 16#34# range 0 .. 31;
FS_DIEPCTL0 at 16#100# range 0 .. 31;
DIEPINT0 at 16#108# range 0 .. 31;
DIEPTSIZ0 at 16#110# range 0 .. 31;
DTXFSTS0 at 16#118# range 0 .. 31;
DIEPCTL1 at 16#120# range 0 .. 31;
DIEPINT1 at 16#128# range 0 .. 31;
DIEPTSIZ1 at 16#130# range 0 .. 31;
DTXFSTS1 at 16#138# range 0 .. 31;
DIEPCTL2 at 16#140# range 0 .. 31;
DIEPINT2 at 16#148# range 0 .. 31;
DIEPTSIZ2 at 16#150# range 0 .. 31;
DTXFSTS2 at 16#158# range 0 .. 31;
DIEPCTL3 at 16#160# range 0 .. 31;
DIEPINT3 at 16#168# range 0 .. 31;
DIEPTSIZ3 at 16#170# range 0 .. 31;
DTXFSTS3 at 16#178# range 0 .. 31;
DOEPCTL0 at 16#300# range 0 .. 31;
DOEPINT0 at 16#308# range 0 .. 31;
DOEPTSIZ0 at 16#310# range 0 .. 31;
DOEPCTL1 at 16#320# range 0 .. 31;
DOEPINT1 at 16#328# range 0 .. 31;
DOEPTSIZ1 at 16#330# range 0 .. 31;
DOEPCTL2 at 16#340# range 0 .. 31;
DOEPINT2 at 16#348# range 0 .. 31;
DOEPTSIZ2 at 16#350# range 0 .. 31;
DOEPCTL3 at 16#360# range 0 .. 31;
DOEPINT3 at 16#368# range 0 .. 31;
DOEPTSIZ3 at 16#370# range 0 .. 31;
end record;
-- USB on the go full speed
OTG_FS_DEVICE_Periph : aliased OTG_FS_DEVICE_Peripheral
with Import, Address => System'To_Address (16#50000800#);
type OTG_FS_GLOBAL_Disc is
(
Device,
Host);
-- USB on the go full speed
type OTG_FS_GLOBAL_Peripheral
(Discriminent : OTG_FS_GLOBAL_Disc := Device)
is record
-- OTG_FS control and status register (OTG_FS_GOTGCTL)
FS_GOTGCTL : aliased FS_GOTGCTL_Register;
-- OTG_FS interrupt register (OTG_FS_GOTGINT)
FS_GOTGINT : aliased FS_GOTGINT_Register;
-- OTG_FS AHB configuration register (OTG_FS_GAHBCFG)
FS_GAHBCFG : aliased FS_GAHBCFG_Register;
-- OTG_FS USB configuration register (OTG_FS_GUSBCFG)
FS_GUSBCFG : aliased FS_GUSBCFG_Register;
-- OTG_FS reset register (OTG_FS_GRSTCTL)
FS_GRSTCTL : aliased FS_GRSTCTL_Register;
-- OTG_FS core interrupt register (OTG_FS_GINTSTS)
FS_GINTSTS : aliased FS_GINTSTS_Register;
-- OTG_FS interrupt mask register (OTG_FS_GINTMSK)
FS_GINTMSK : aliased FS_GINTMSK_Register;
-- OTG_FS Receive FIFO size register (OTG_FS_GRXFSIZ)
FS_GRXFSIZ : aliased FS_GRXFSIZ_Register;
-- OTG_FS non-periodic transmit FIFO/queue status register
-- (OTG_FS_GNPTXSTS)
FS_GNPTXSTS : aliased FS_GNPTXSTS_Register;
-- OTG_FS general core configuration register (OTG_FS_GCCFG)
FS_GCCFG : aliased FS_GCCFG_Register;
-- core ID register
FS_CID : aliased HAL.UInt32;
-- OTG_FS Host periodic transmit FIFO size register (OTG_FS_HPTXFSIZ)
FS_HPTXFSIZ : aliased FS_HPTXFSIZ_Register;
-- OTG_FS device IN endpoint transmit FIFO size register
-- (OTG_FS_DIEPTXF2)
FS_DIEPTXF1 : aliased FS_DIEPTXF_Register;
-- OTG_FS device IN endpoint transmit FIFO size register
-- (OTG_FS_DIEPTXF3)
FS_DIEPTXF2 : aliased FS_DIEPTXF_Register;
-- OTG_FS device IN endpoint transmit FIFO size register
-- (OTG_FS_DIEPTXF4)
FS_DIEPTXF3 : aliased FS_DIEPTXF_Register;
case Discriminent is
when Device =>
-- OTG_FS Receive status debug read(Device mode)
FS_GRXSTSR_Device : aliased FS_GRXSTSR_Device_Register;
-- OTG_FS non-periodic transmit FIFO size register (Device mode)
FS_GNPTXFSIZ_Device : aliased FS_GNPTXFSIZ_Device_Register;
when Host =>
-- OTG_FS Receive status debug read(Host mode)
FS_GRXSTSR_Host : aliased FS_GRXSTSR_Host_Register;
-- OTG_FS non-periodic transmit FIFO size register (Host mode)
FS_GNPTXFSIZ_Host : aliased FS_GNPTXFSIZ_Host_Register;
end case;
end record
with Unchecked_Union, Volatile;
for OTG_FS_GLOBAL_Peripheral use record
FS_GOTGCTL at 16#0# range 0 .. 31;
FS_GOTGINT at 16#4# range 0 .. 31;
FS_GAHBCFG at 16#8# range 0 .. 31;
FS_GUSBCFG at 16#C# range 0 .. 31;
FS_GRSTCTL at 16#10# range 0 .. 31;
FS_GINTSTS at 16#14# range 0 .. 31;
FS_GINTMSK at 16#18# range 0 .. 31;
FS_GRXFSIZ at 16#24# range 0 .. 31;
FS_GNPTXSTS at 16#2C# range 0 .. 31;
FS_GCCFG at 16#38# range 0 .. 31;
FS_CID at 16#3C# range 0 .. 31;
FS_HPTXFSIZ at 16#100# range 0 .. 31;
FS_DIEPTXF1 at 16#104# range 0 .. 31;
FS_DIEPTXF2 at 16#108# range 0 .. 31;
FS_DIEPTXF3 at 16#10C# range 0 .. 31;
FS_GRXSTSR_Device at 16#1C# range 0 .. 31;
FS_GNPTXFSIZ_Device at 16#28# range 0 .. 31;
FS_GRXSTSR_Host at 16#1C# range 0 .. 31;
FS_GNPTXFSIZ_Host at 16#28# range 0 .. 31;
end record;
-- USB on the go full speed
OTG_FS_GLOBAL_Periph : aliased OTG_FS_GLOBAL_Peripheral
with Import, Address => System'To_Address (16#50000000#);
-- USB on the go full speed
type OTG_FS_HOST_Peripheral is record
-- OTG_FS host configuration register (OTG_FS_HCFG)
FS_HCFG : aliased FS_HCFG_Register;
-- OTG_FS Host frame interval register
HFIR : aliased HFIR_Register;
-- OTG_FS host frame number/frame time remaining register (OTG_FS_HFNUM)
FS_HFNUM : aliased FS_HFNUM_Register;
-- OTG_FS_Host periodic transmit FIFO/queue status register
-- (OTG_FS_HPTXSTS)
FS_HPTXSTS : aliased FS_HPTXSTS_Register;
-- OTG_FS Host all channels interrupt register
HAINT : aliased HAINT_Register;
-- OTG_FS host all channels interrupt mask register
HAINTMSK : aliased HAINTMSK_Register;
-- OTG_FS host port control and status register (OTG_FS_HPRT)
FS_HPRT : aliased FS_HPRT_Register;
-- OTG_FS host channel-0 characteristics register (OTG_FS_HCCHAR0)
FS_HCCHAR0 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-0 interrupt register (OTG_FS_HCINT0)
FS_HCINT0 : aliased FS_HCINT_Register;
-- OTG_FS host channel-0 mask register (OTG_FS_HCINTMSK0)
FS_HCINTMSK0 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-0 transfer size register
FS_HCTSIZ0 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-1 characteristics register (OTG_FS_HCCHAR1)
FS_HCCHAR1 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-1 interrupt register (OTG_FS_HCINT1)
FS_HCINT1 : aliased FS_HCINT_Register;
-- OTG_FS host channel-1 mask register (OTG_FS_HCINTMSK1)
FS_HCINTMSK1 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-1 transfer size register
FS_HCTSIZ1 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-2 characteristics register (OTG_FS_HCCHAR2)
FS_HCCHAR2 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-2 interrupt register (OTG_FS_HCINT2)
FS_HCINT2 : aliased FS_HCINT_Register;
-- OTG_FS host channel-2 mask register (OTG_FS_HCINTMSK2)
FS_HCINTMSK2 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-2 transfer size register
FS_HCTSIZ2 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-3 characteristics register (OTG_FS_HCCHAR3)
FS_HCCHAR3 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-3 interrupt register (OTG_FS_HCINT3)
FS_HCINT3 : aliased FS_HCINT_Register;
-- OTG_FS host channel-3 mask register (OTG_FS_HCINTMSK3)
FS_HCINTMSK3 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-3 transfer size register
FS_HCTSIZ3 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-4 characteristics register (OTG_FS_HCCHAR4)
FS_HCCHAR4 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-4 interrupt register (OTG_FS_HCINT4)
FS_HCINT4 : aliased FS_HCINT_Register;
-- OTG_FS host channel-4 mask register (OTG_FS_HCINTMSK4)
FS_HCINTMSK4 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-x transfer size register
FS_HCTSIZ4 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-5 characteristics register (OTG_FS_HCCHAR5)
FS_HCCHAR5 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-5 interrupt register (OTG_FS_HCINT5)
FS_HCINT5 : aliased FS_HCINT_Register;
-- OTG_FS host channel-5 mask register (OTG_FS_HCINTMSK5)
FS_HCINTMSK5 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-5 transfer size register
FS_HCTSIZ5 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-6 characteristics register (OTG_FS_HCCHAR6)
FS_HCCHAR6 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-6 interrupt register (OTG_FS_HCINT6)
FS_HCINT6 : aliased FS_HCINT_Register;
-- OTG_FS host channel-6 mask register (OTG_FS_HCINTMSK6)
FS_HCINTMSK6 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-6 transfer size register
FS_HCTSIZ6 : aliased FS_HCTSIZ_Register;
-- OTG_FS host channel-7 characteristics register (OTG_FS_HCCHAR7)
FS_HCCHAR7 : aliased FS_HCCHAR_Register;
-- OTG_FS host channel-7 interrupt register (OTG_FS_HCINT7)
FS_HCINT7 : aliased FS_HCINT_Register;
-- OTG_FS host channel-7 mask register (OTG_FS_HCINTMSK7)
FS_HCINTMSK7 : aliased FS_HCINTMSK_Register;
-- OTG_FS host channel-7 transfer size register
FS_HCTSIZ7 : aliased FS_HCTSIZ_Register;
end record
with Volatile;
for OTG_FS_HOST_Peripheral use record
FS_HCFG at 16#0# range 0 .. 31;
HFIR at 16#4# range 0 .. 31;
FS_HFNUM at 16#8# range 0 .. 31;
FS_HPTXSTS at 16#10# range 0 .. 31;
HAINT at 16#14# range 0 .. 31;
HAINTMSK at 16#18# range 0 .. 31;
FS_HPRT at 16#40# range 0 .. 31;
FS_HCCHAR0 at 16#100# range 0 .. 31;
FS_HCINT0 at 16#108# range 0 .. 31;
FS_HCINTMSK0 at 16#10C# range 0 .. 31;
FS_HCTSIZ0 at 16#110# range 0 .. 31;
FS_HCCHAR1 at 16#120# range 0 .. 31;
FS_HCINT1 at 16#128# range 0 .. 31;
FS_HCINTMSK1 at 16#12C# range 0 .. 31;
FS_HCTSIZ1 at 16#130# range 0 .. 31;
FS_HCCHAR2 at 16#140# range 0 .. 31;
FS_HCINT2 at 16#148# range 0 .. 31;
FS_HCINTMSK2 at 16#14C# range 0 .. 31;
FS_HCTSIZ2 at 16#150# range 0 .. 31;
FS_HCCHAR3 at 16#160# range 0 .. 31;
FS_HCINT3 at 16#168# range 0 .. 31;
FS_HCINTMSK3 at 16#16C# range 0 .. 31;
FS_HCTSIZ3 at 16#170# range 0 .. 31;
FS_HCCHAR4 at 16#180# range 0 .. 31;
FS_HCINT4 at 16#188# range 0 .. 31;
FS_HCINTMSK4 at 16#18C# range 0 .. 31;
FS_HCTSIZ4 at 16#190# range 0 .. 31;
FS_HCCHAR5 at 16#1A0# range 0 .. 31;
FS_HCINT5 at 16#1A8# range 0 .. 31;
FS_HCINTMSK5 at 16#1AC# range 0 .. 31;
FS_HCTSIZ5 at 16#1B0# range 0 .. 31;
FS_HCCHAR6 at 16#1C0# range 0 .. 31;
FS_HCINT6 at 16#1C8# range 0 .. 31;
FS_HCINTMSK6 at 16#1CC# range 0 .. 31;
FS_HCTSIZ6 at 16#1D0# range 0 .. 31;
FS_HCCHAR7 at 16#1E0# range 0 .. 31;
FS_HCINT7 at 16#1E8# range 0 .. 31;
FS_HCINTMSK7 at 16#1EC# range 0 .. 31;
FS_HCTSIZ7 at 16#1F0# range 0 .. 31;
end record;
-- USB on the go full speed
OTG_FS_HOST_Periph : aliased OTG_FS_HOST_Peripheral
with Import, Address => System'To_Address (16#50000400#);
-- USB on the go full speed
type OTG_FS_PWRCLK_Peripheral is record
-- OTG_FS power and clock gating control register (OTG_FS_PCGCCTL)
FS_PCGCCTL : aliased FS_PCGCCTL_Register;
end record
with Volatile;
for OTG_FS_PWRCLK_Peripheral use record
FS_PCGCCTL at 0 range 0 .. 31;
end record;
-- USB on the go full speed
OTG_FS_PWRCLK_Periph : aliased OTG_FS_PWRCLK_Peripheral
with Import, Address => System'To_Address (16#50000E00#);
end STM32_SVD.USB_OTG_FS;
| 37.374818 | 79 | 0.587116 |
41da745d917cd5e5b570855d282a5affdc2ba99d | 2,140 | adb | Ada | src/aco-utils-generic_alarms.adb | jonashaggstrom/ada-canopen | 8e0f32323a0f09b41e8b51ef7123738bbf29f194 | [
"Apache-2.0"
] | 6 | 2018-05-12T22:08:04.000Z | 2021-07-25T20:55:12.000Z | src/aco-utils-generic_alarms.adb | jonashaggstrom/ada-canopen | 8e0f32323a0f09b41e8b51ef7123738bbf29f194 | [
"Apache-2.0"
] | null | null | null | src/aco-utils-generic_alarms.adb | jonashaggstrom/ada-canopen | 8e0f32323a0f09b41e8b51ef7123738bbf29f194 | [
"Apache-2.0"
] | 2 | 2021-06-15T11:56:46.000Z | 2021-06-21T13:56:01.000Z | package body ACO.Utils.Generic_Alarms is
function Get_Next_Up
(This : Alarm_Manager;
T_Now : Ada.Real_Time.Time)
return Alarm_Access
is
use type Ada.Real_Time.Time;
begin
if not This.Alarm_List.Is_Empty then
declare
Next : constant Alarm_Data := This.Alarm_List.First;
begin
if Next.Alarm_Ref /= No_Alarm and then
Next.Signal_Time <= T_Now
then
return Next.Alarm_Ref;
end if;
end;
end if;
return No_Alarm;
end Get_Next_Up;
procedure Process
(This : in out Alarm_Manager;
T_Now : in Ada.Real_Time.Time)
is
Next : Alarm_Access := This.Get_Next_Up (T_Now);
begin
while Next /= No_Alarm loop
This.Cancel (Next);
Next.Signal (T_Now);
Next := This.Get_Next_Up (T_Now);
end loop;
end Process;
procedure Set
(This : in out Alarm_Manager;
Alarm : in Alarm_Access;
Signal_Time : in Ada.Real_Time.Time)
is
begin
This.Alarm_List.Append ((Alarm, Signal_Time));
end Set;
function Is_Pending
(This : in out Alarm_Manager;
Alarm : in Alarm_Access)
return Boolean
is
begin
return This.Alarm_List.Location
((Alarm_Ref => Alarm,
Signal_Time => Ada.Real_Time.Time_Last)) /= Collection_Pack.No_Index;
end Is_Pending;
procedure Cancel
(This : in out Alarm_Manager;
Alarm : in Alarm_Access)
is
I : constant Natural := This.Alarm_List.Location
((Alarm_Ref => Alarm,
Signal_Time => Ada.Real_Time.Time_Last));
begin
if I /= Collection_Pack.No_Index then
This.Alarm_List.Remove (I);
end if;
end Cancel;
function "<" (Left, Right : Alarm_Data) return Boolean
is
use Ada.Real_Time;
begin
return Left.Signal_Time < Right.Signal_Time;
end "<";
function "=" (Left, Right : Alarm_Data) return Boolean
is
begin
return Left.Alarm_Ref = Right.Alarm_Ref;
end "=";
end ACO.Utils.Generic_Alarms;
| 25.176471 | 80 | 0.595794 |
3d627c8c13f16bb5c1146f4756c1c320e98fbfc9 | 82,242 | adb | Ada | gcc-gcc-7_3_0-release/gcc/ada/cstand.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/cstand.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/cstand.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- C S T A N D --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Csets; use Csets;
with Debug; use Debug;
with Einfo; use Einfo;
with Elists; use Elists;
with Layout; use Layout;
with Namet; use Namet;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Opt; use Opt;
with Output; use Output;
with Set_Targ; use Set_Targ;
with Targparm; use Targparm;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
with Scn;
with Sem_Mech; use Sem_Mech;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Uintp; use Uintp;
with Urealp; use Urealp;
package body CStand is
Stloc : constant Source_Ptr := Standard_Location;
Staloc : constant Source_Ptr := Standard_ASCII_Location;
-- Standard abbreviations used throughout this package
Back_End_Float_Types : Elist_Id := No_Elist;
-- List used for any floating point supported by the back end. This needs
-- to be at the library level, because the call back procedures retrieving
-- this information are at that level.
-----------------------
-- Local Subprograms --
-----------------------
procedure Build_Float_Type
(E : Entity_Id;
Siz : Int;
Rep : Float_Rep_Kind;
Digs : Int);
-- Procedure to build standard predefined float base type. The first
-- parameter is the entity for the type, and the second parameter is the
-- size in bits. The third parameter indicates the kind of representation
-- to be used. The fourth parameter is the digits value. Each type
-- is added to the list of predefined floating point types.
procedure Build_Signed_Integer_Type (E : Entity_Id; Siz : Nat);
-- Procedure to build standard predefined signed integer subtype. The
-- first parameter is the entity for the subtype. The second parameter
-- is the size in bits. The corresponding base type is not built by
-- this routine but instead must be built by the caller where needed.
procedure Build_Unsigned_Integer_Type
(Uns : Entity_Id;
Siz : Nat;
Nam : String);
-- Procedure to build standard predefined unsigned integer subtype. These
-- subtypes are not user visible, but they are used internally. The first
-- parameter is the entity for the subtype. The second parameter is the
-- size in bits. The third parameter is an identifying name.
procedure Copy_Float_Type (To : Entity_Id; From : Entity_Id);
-- Build a floating point type, copying representation details from From.
-- This is used to create predefined floating point types based on
-- available types in the back end.
procedure Create_Operators;
-- Make entries for each of the predefined operators in Standard
procedure Create_Unconstrained_Base_Type
(E : Entity_Id;
K : Entity_Kind);
-- The predefined signed integer types are constrained subtypes which
-- must have a corresponding unconstrained base type. This type is almost
-- useless. The only place it has semantics is Subtypes_Statically_Match.
-- Consequently, we arrange for it to be identical apart from the setting
-- of the constrained bit. This routine takes an entity E for the Type,
-- copies it to estabish the base type, then resets the Ekind of the
-- original entity to K (the Ekind for the subtype). The Etype field of
-- E is set by the call (to point to the created base type entity), and
-- also the Is_Constrained flag of E is set.
--
-- To understand the exact requirement for this, see RM 3.5.4(11) which
-- makes it clear that Integer, for example, is constrained, with the
-- constraint bounds matching the bounds of the (unconstrained) base
-- type. The point is that Integer and Integer'Base have identical
-- bounds, but do not statically match, since a subtype with constraints
-- never matches a subtype with no constraints.
function Find_Back_End_Float_Type (Name : String) return Entity_Id;
-- Return the first float type in Back_End_Float_Types with the given name.
-- Names of entities in back end types, are either type names of C
-- predefined types (all lower case), or mode names (upper case).
-- These are not generally valid identifier names.
function Identifier_For (S : Standard_Entity_Type) return Node_Id;
-- Returns an identifier node with the same name as the defining
-- identifier corresponding to the given Standard_Entity_Type value
procedure Make_Component
(Rec : Entity_Id;
Typ : Entity_Id;
Nam : String);
-- Build a record component with the given type and name, and append to
-- the list of components of Rec.
function Make_Formal
(Typ : Entity_Id;
Formal_Name : String) return Entity_Id;
-- Construct entity for subprogram formal with given name and type
function Make_Integer (V : Uint) return Node_Id;
-- Builds integer literal with given value
procedure Make_Name (Id : Entity_Id; Nam : String);
-- Make an entry in the names table for Nam, and set as Chars field of Id
function New_Operator (Op : Name_Id; Typ : Entity_Id) return Entity_Id;
-- Build entity for standard operator with given name and type
function New_Standard_Entity
(New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id;
-- Builds a new entity for Standard
function New_Standard_Entity (S : String) return Entity_Id;
-- Builds a new entity for Standard with Nkind = N_Defining_Identifier,
-- and Chars of this defining identifier set to the given string S.
procedure Print_Standard;
-- Print representation of package Standard if switch set
procedure Register_Float_Type
(Name : String;
Digs : Positive;
Float_Rep : Float_Rep_Kind;
Precision : Positive;
Size : Positive;
Alignment : Natural);
-- Registers a single back end floating-point type (from FPT_Mode_Table in
-- Set_Targ). This will create a predefined floating-point base type for
-- one of the floating point types reported by the back end, and add it
-- to the list of predefined float types. Name is the name of the type
-- as a normal format (non-null-terminated) string. Digs is the number of
-- digits, which is always non-zero, since non-floating-point types were
-- filtered out earlier. Float_Rep indicates the kind of floating-point
-- type, and Precision, Size and Alignment are the precision, size and
-- alignment in bits.
procedure Set_Integer_Bounds
(Id : Entity_Id;
Typ : Entity_Id;
Lb : Uint;
Hb : Uint);
-- Procedure to set bounds for integer type or subtype. Id is the entity
-- whose bounds and type are to be set. The Typ parameter is the Etype
-- value for the entity (which will be the same as Id for all predefined
-- integer base types. The third and fourth parameters are the bounds.
----------------------
-- Build_Float_Type --
----------------------
procedure Build_Float_Type
(E : Entity_Id;
Siz : Int;
Rep : Float_Rep_Kind;
Digs : Int)
is
begin
Set_Type_Definition (Parent (E),
Make_Floating_Point_Definition (Stloc,
Digits_Expression => Make_Integer (UI_From_Int (Digs))));
Set_Ekind (E, E_Floating_Point_Type);
Set_Etype (E, E);
Set_Float_Rep (E, Rep);
Init_Size (E, Siz);
Set_Elem_Alignment (E);
Init_Digits_Value (E, Digs);
Set_Float_Bounds (E);
Set_Is_Frozen (E);
Set_Is_Public (E);
Set_Size_Known_At_Compile_Time (E);
end Build_Float_Type;
------------------------------
-- Find_Back_End_Float_Type --
------------------------------
function Find_Back_End_Float_Type (Name : String) return Entity_Id is
N : Elmt_Id;
begin
N := First_Elmt (Back_End_Float_Types);
while Present (N) and then Get_Name_String (Chars (Node (N))) /= Name
loop
Next_Elmt (N);
end loop;
return Node (N);
end Find_Back_End_Float_Type;
-------------------------------
-- Build_Signed_Integer_Type --
-------------------------------
procedure Build_Signed_Integer_Type (E : Entity_Id; Siz : Nat) is
U2Siz1 : constant Uint := 2 ** (Siz - 1);
Lbound : constant Uint := -U2Siz1;
Ubound : constant Uint := U2Siz1 - 1;
begin
Set_Type_Definition (Parent (E),
Make_Signed_Integer_Type_Definition (Stloc,
Low_Bound => Make_Integer (Lbound),
High_Bound => Make_Integer (Ubound)));
Set_Ekind (E, E_Signed_Integer_Type);
Set_Etype (E, E);
Init_Size (E, Siz);
Set_Elem_Alignment (E);
Set_Integer_Bounds (E, E, Lbound, Ubound);
Set_Is_Frozen (E);
Set_Is_Public (E);
Set_Is_Known_Valid (E);
Set_Size_Known_At_Compile_Time (E);
end Build_Signed_Integer_Type;
---------------------------------
-- Build_Unsigned_Integer_Type --
---------------------------------
procedure Build_Unsigned_Integer_Type
(Uns : Entity_Id;
Siz : Nat;
Nam : String)
is
Decl : Node_Id;
R_Node : Node_Id;
begin
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Uns);
Make_Name (Uns, Nam);
Set_Ekind (Uns, E_Modular_Integer_Type);
Set_Scope (Uns, Standard_Standard);
Set_Etype (Uns, Uns);
Init_Size (Uns, Siz);
Set_Elem_Alignment (Uns);
Set_Modulus (Uns, Uint_2 ** Siz);
Set_Is_Unsigned_Type (Uns);
Set_Size_Known_At_Compile_Time (Uns);
Set_Is_Known_Valid (Uns, True);
R_Node := New_Node (N_Range, Stloc);
Set_Low_Bound (R_Node, Make_Integer (Uint_0));
Set_High_Bound (R_Node, Make_Integer (Modulus (Uns) - 1));
Set_Etype (Low_Bound (R_Node), Uns);
Set_Etype (High_Bound (R_Node), Uns);
Set_Scalar_Range (Uns, R_Node);
end Build_Unsigned_Integer_Type;
---------------------
-- Copy_Float_Type --
---------------------
procedure Copy_Float_Type (To : Entity_Id; From : Entity_Id) is
begin
Build_Float_Type (To, UI_To_Int (Esize (From)), Float_Rep (From),
UI_To_Int (Digits_Value (From)));
end Copy_Float_Type;
----------------------
-- Create_Operators --
----------------------
-- Each operator has an abbreviated signature. The formals have the names
-- LEFT and RIGHT. Their types are not actually used for resolution.
procedure Create_Operators is
Op_Node : Entity_Id;
-- The following tables define the binary and unary operators and their
-- corresponding result type.
Binary_Ops : constant array (S_Binary_Ops) of Name_Id :=
-- There is one entry here for each binary operator, except for the
-- case of concatenation, where there are three entries, one for a
-- String result, one for Wide_String, and one for Wide_Wide_String.
(Name_Op_Add,
Name_Op_And,
Name_Op_Concat,
Name_Op_Concat,
Name_Op_Concat,
Name_Op_Divide,
Name_Op_Eq,
Name_Op_Expon,
Name_Op_Ge,
Name_Op_Gt,
Name_Op_Le,
Name_Op_Lt,
Name_Op_Mod,
Name_Op_Multiply,
Name_Op_Ne,
Name_Op_Or,
Name_Op_Rem,
Name_Op_Subtract,
Name_Op_Xor);
Bin_Op_Types : constant array (S_Binary_Ops) of Entity_Id :=
-- This table has the corresponding result types. The entries are
-- ordered so they correspond to the Binary_Ops array above.
(Universal_Integer, -- Add
Standard_Boolean, -- And
Standard_String, -- Concat (String)
Standard_Wide_String, -- Concat (Wide_String)
Standard_Wide_Wide_String, -- Concat (Wide_Wide_String)
Universal_Integer, -- Divide
Standard_Boolean, -- Eq
Universal_Integer, -- Expon
Standard_Boolean, -- Ge
Standard_Boolean, -- Gt
Standard_Boolean, -- Le
Standard_Boolean, -- Lt
Universal_Integer, -- Mod
Universal_Integer, -- Multiply
Standard_Boolean, -- Ne
Standard_Boolean, -- Or
Universal_Integer, -- Rem
Universal_Integer, -- Subtract
Standard_Boolean); -- Xor
Unary_Ops : constant array (S_Unary_Ops) of Name_Id :=
-- There is one entry here for each unary operator
(Name_Op_Abs,
Name_Op_Subtract,
Name_Op_Not,
Name_Op_Add);
Unary_Op_Types : constant array (S_Unary_Ops) of Entity_Id :=
-- This table has the corresponding result types. The entries are
-- ordered so they correspond to the Unary_Ops array above.
(Universal_Integer, -- Abs
Universal_Integer, -- Subtract
Standard_Boolean, -- Not
Universal_Integer); -- Add
begin
for J in S_Binary_Ops loop
Op_Node := New_Operator (Binary_Ops (J), Bin_Op_Types (J));
SE (J) := Op_Node;
Append_Entity (Make_Formal (Any_Type, "LEFT"), Op_Node);
Append_Entity (Make_Formal (Any_Type, "RIGHT"), Op_Node);
end loop;
for J in S_Unary_Ops loop
Op_Node := New_Operator (Unary_Ops (J), Unary_Op_Types (J));
SE (J) := Op_Node;
Append_Entity (Make_Formal (Any_Type, "RIGHT"), Op_Node);
end loop;
-- For concatenation, we create a separate operator for each
-- array type. This simplifies the resolution of the component-
-- component concatenation operation. In Standard, we set the types
-- of the formals for string, wide [wide]_string, concatenations.
Set_Etype (First_Entity (Standard_Op_Concat), Standard_String);
Set_Etype (Last_Entity (Standard_Op_Concat), Standard_String);
Set_Etype (First_Entity (Standard_Op_Concatw), Standard_Wide_String);
Set_Etype (Last_Entity (Standard_Op_Concatw), Standard_Wide_String);
Set_Etype (First_Entity (Standard_Op_Concatww),
Standard_Wide_Wide_String);
Set_Etype (Last_Entity (Standard_Op_Concatww),
Standard_Wide_Wide_String);
end Create_Operators;
---------------------
-- Create_Standard --
---------------------
-- The tree for the package Standard is prefixed to all compilations.
-- Several entities required by semantic analysis are denoted by global
-- variables that are initialized to point to the corresponding occurrences
-- in Standard. The visible entities of Standard are created here. Special
-- entities maybe created here as well or may be created from the semantics
-- module. By not adding them to the Decls list of Standard they will not
-- be visible to Ada programs.
procedure Create_Standard is
Decl_S : constant List_Id := New_List;
-- List of declarations in Standard
Decl_A : constant List_Id := New_List;
-- List of declarations in ASCII
Decl : Node_Id;
Pspec : Node_Id;
Tdef_Node : Node_Id;
Ident_Node : Node_Id;
Ccode : Char_Code;
E_Id : Entity_Id;
R_Node : Node_Id;
B_Node : Node_Id;
procedure Build_Exception (S : Standard_Entity_Type);
-- Procedure to declare given entity as an exception
procedure Create_Back_End_Float_Types;
-- Initialize the Back_End_Float_Types list by having the back end
-- enumerate all available types and building type entities for them.
procedure Create_Float_Types;
-- Creates entities for all predefined floating point types, and
-- adds these to the Predefined_Float_Types list in package Standard.
procedure Make_Dummy_Index (E : Entity_Id);
-- Called to provide a dummy index field value for Any_Array/Any_String
procedure Pack_String_Type (String_Type : Entity_Id);
-- Generate proper tree for pragma Pack that applies to given type, and
-- mark type as having the pragma.
---------------------
-- Build_Exception --
---------------------
procedure Build_Exception (S : Standard_Entity_Type) is
begin
Set_Ekind (Standard_Entity (S), E_Exception);
Set_Etype (Standard_Entity (S), Standard_Exception_Type);
Set_Is_Public (Standard_Entity (S), True);
Decl :=
Make_Exception_Declaration (Stloc,
Defining_Identifier => Standard_Entity (S));
Append (Decl, Decl_S);
end Build_Exception;
---------------------------------
-- Create_Back_End_Float_Types --
---------------------------------
procedure Create_Back_End_Float_Types is
begin
for J in 1 .. Num_FPT_Modes loop
declare
E : FPT_Mode_Entry renames FPT_Mode_Table (J);
begin
Register_Float_Type
(E.NAME.all, E.DIGS, E.FLOAT_REP, E.PRECISION, E.SIZE,
E.ALIGNMENT);
end;
end loop;
end Create_Back_End_Float_Types;
------------------------
-- Create_Float_Types --
------------------------
procedure Create_Float_Types is
begin
-- Create type definition nodes for predefined float types
Copy_Float_Type
(Standard_Short_Float,
Find_Back_End_Float_Type (C_Type_For (S_Short_Float)));
Set_Is_Implementation_Defined (Standard_Short_Float);
Copy_Float_Type (Standard_Float, Standard_Short_Float);
Copy_Float_Type
(Standard_Long_Float,
Find_Back_End_Float_Type (C_Type_For (S_Long_Float)));
Copy_Float_Type
(Standard_Long_Long_Float,
Find_Back_End_Float_Type (C_Type_For (S_Long_Long_Float)));
Set_Is_Implementation_Defined (Standard_Long_Long_Float);
Predefined_Float_Types := New_Elmt_List;
Append_Elmt (Standard_Short_Float, Predefined_Float_Types);
Append_Elmt (Standard_Float, Predefined_Float_Types);
Append_Elmt (Standard_Long_Float, Predefined_Float_Types);
Append_Elmt (Standard_Long_Long_Float, Predefined_Float_Types);
-- Any other back end types are appended at the end of the list of
-- predefined float types, and will only be selected if the none of
-- the types in Standard is suitable, or if a specific named type is
-- requested through a pragma Import.
while not Is_Empty_Elmt_List (Back_End_Float_Types) loop
declare
E : constant Elmt_Id := First_Elmt (Back_End_Float_Types);
begin
Append_Elmt (Node (E), To => Predefined_Float_Types);
Remove_Elmt (Back_End_Float_Types, E);
end;
end loop;
end Create_Float_Types;
----------------------
-- Make_Dummy_Index --
----------------------
procedure Make_Dummy_Index (E : Entity_Id) is
Index : Node_Id;
Dummy : List_Id;
begin
Index :=
Make_Range (Sloc (E),
Low_Bound => Make_Integer (Uint_0),
High_Bound => Make_Integer (Uint_2 ** Standard_Integer_Size));
Set_Etype (Index, Standard_Integer);
Set_First_Index (E, Index);
-- Make sure Index is a list as required, so Next_Index is Empty
Dummy := New_List (Index);
end Make_Dummy_Index;
----------------------
-- Pack_String_Type --
----------------------
procedure Pack_String_Type (String_Type : Entity_Id) is
Prag : constant Node_Id :=
Make_Pragma (Stloc,
Chars => Name_Pack,
Pragma_Argument_Associations =>
New_List (
Make_Pragma_Argument_Association (Stloc,
Expression => New_Occurrence_Of (String_Type, Stloc))));
begin
Append (Prag, Decl_S);
Record_Rep_Item (String_Type, Prag);
Set_Has_Pragma_Pack (String_Type, True);
end Pack_String_Type;
-- Start of processing for Create_Standard
begin
-- Initialize scanner for internal scans of literals
Scn.Initialize_Scanner (No_Unit, Internal_Source_File);
-- First step is to create defining identifiers for each entity
for S in Standard_Entity_Type loop
declare
S_Name : constant String := Standard_Entity_Type'Image (S);
-- Name of entity (note we skip S_ at the start)
Ident_Node : Node_Id;
-- Defining identifier node
begin
Ident_Node := New_Standard_Entity;
Make_Name (Ident_Node, S_Name (3 .. S_Name'Length));
Standard_Entity (S) := Ident_Node;
end;
end loop;
-- Create package declaration node for package Standard
Standard_Package_Node := New_Node (N_Package_Declaration, Stloc);
Pspec := New_Node (N_Package_Specification, Stloc);
Set_Specification (Standard_Package_Node, Pspec);
Set_Defining_Unit_Name (Pspec, Standard_Standard);
Set_Visible_Declarations (Pspec, Decl_S);
Set_Ekind (Standard_Standard, E_Package);
Set_Is_Pure (Standard_Standard);
Set_Is_Compilation_Unit (Standard_Standard);
-- Create type/subtype declaration nodes for standard types
for S in S_Types loop
-- Subtype declaration case
if S = S_Natural or else S = S_Positive then
Decl := New_Node (N_Subtype_Declaration, Stloc);
Set_Subtype_Indication (Decl,
New_Occurrence_Of (Standard_Integer, Stloc));
-- Full type declaration case
else
Decl := New_Node (N_Full_Type_Declaration, Stloc);
end if;
Set_Is_Frozen (Standard_Entity (S));
Set_Is_Public (Standard_Entity (S));
Set_Defining_Identifier (Decl, Standard_Entity (S));
Append (Decl, Decl_S);
end loop;
Create_Back_End_Float_Types;
-- Create type definition node for type Boolean. The Size is set to
-- 1 as required by Ada 95 and current ARG interpretations for Ada/83.
-- Note: Object_Size of Boolean is 8. This means that we do NOT in
-- general know that Boolean variables have valid values, so we do
-- not set the Is_Known_Valid flag.
Tdef_Node := New_Node (N_Enumeration_Type_Definition, Stloc);
Set_Literals (Tdef_Node, New_List);
Append (Standard_False, Literals (Tdef_Node));
Append (Standard_True, Literals (Tdef_Node));
Set_Type_Definition (Parent (Standard_Boolean), Tdef_Node);
Set_Ekind (Standard_Boolean, E_Enumeration_Type);
Set_First_Literal (Standard_Boolean, Standard_False);
Set_Etype (Standard_Boolean, Standard_Boolean);
Init_Esize (Standard_Boolean, Standard_Character_Size);
Init_RM_Size (Standard_Boolean, 1);
Set_Elem_Alignment (Standard_Boolean);
Set_Is_Unsigned_Type (Standard_Boolean);
Set_Size_Known_At_Compile_Time (Standard_Boolean);
Set_Has_Pragma_Ordered (Standard_Boolean);
Set_Ekind (Standard_True, E_Enumeration_Literal);
Set_Etype (Standard_True, Standard_Boolean);
Set_Enumeration_Pos (Standard_True, Uint_1);
Set_Enumeration_Rep (Standard_True, Uint_1);
Set_Is_Known_Valid (Standard_True, True);
Set_Ekind (Standard_False, E_Enumeration_Literal);
Set_Etype (Standard_False, Standard_Boolean);
Set_Enumeration_Pos (Standard_False, Uint_0);
Set_Enumeration_Rep (Standard_False, Uint_0);
Set_Is_Known_Valid (Standard_False, True);
-- For the bounds of Boolean, we create a range node corresponding to
-- range False .. True
-- where the occurrences of the literals must point to the
-- corresponding definition.
R_Node := New_Node (N_Range, Stloc);
B_Node := New_Node (N_Identifier, Stloc);
Set_Chars (B_Node, Chars (Standard_False));
Set_Entity (B_Node, Standard_False);
Set_Etype (B_Node, Standard_Boolean);
Set_Is_Static_Expression (B_Node);
Set_Low_Bound (R_Node, B_Node);
B_Node := New_Node (N_Identifier, Stloc);
Set_Chars (B_Node, Chars (Standard_True));
Set_Entity (B_Node, Standard_True);
Set_Etype (B_Node, Standard_Boolean);
Set_Is_Static_Expression (B_Node);
Set_High_Bound (R_Node, B_Node);
Set_Scalar_Range (Standard_Boolean, R_Node);
Set_Etype (R_Node, Standard_Boolean);
Set_Parent (R_Node, Standard_Boolean);
-- Record entity identifiers for boolean literals in the
-- Boolean_Literals array, for easy reference during expansion.
Boolean_Literals := (False => Standard_False, True => Standard_True);
-- Create type definition nodes for predefined integer types
Build_Signed_Integer_Type
(Standard_Short_Short_Integer, Standard_Short_Short_Integer_Size);
Build_Signed_Integer_Type
(Standard_Short_Integer, Standard_Short_Integer_Size);
Set_Is_Implementation_Defined (Standard_Short_Integer);
Build_Signed_Integer_Type
(Standard_Integer, Standard_Integer_Size);
Build_Signed_Integer_Type
(Standard_Long_Integer, Standard_Long_Integer_Size);
Build_Signed_Integer_Type
(Standard_Long_Long_Integer, Standard_Long_Long_Integer_Size);
Set_Is_Implementation_Defined (Standard_Long_Long_Integer);
Create_Unconstrained_Base_Type
(Standard_Short_Short_Integer, E_Signed_Integer_Subtype);
Set_Is_Implementation_Defined (Standard_Short_Short_Integer);
Create_Unconstrained_Base_Type
(Standard_Short_Integer, E_Signed_Integer_Subtype);
Create_Unconstrained_Base_Type
(Standard_Integer, E_Signed_Integer_Subtype);
Create_Unconstrained_Base_Type
(Standard_Long_Integer, E_Signed_Integer_Subtype);
Create_Unconstrained_Base_Type
(Standard_Long_Long_Integer, E_Signed_Integer_Subtype);
Set_Is_Implementation_Defined (Standard_Short_Short_Integer);
Create_Float_Types;
-- Create type definition node for type Character. Note that we do not
-- set the Literals field, since type Character is handled with special
-- routine that do not need a literal list.
Tdef_Node := New_Node (N_Enumeration_Type_Definition, Stloc);
Set_Type_Definition (Parent (Standard_Character), Tdef_Node);
Set_Ekind (Standard_Character, E_Enumeration_Type);
Set_Etype (Standard_Character, Standard_Character);
Init_Esize (Standard_Character, Standard_Character_Size);
Init_RM_Size (Standard_Character, 8);
Set_Elem_Alignment (Standard_Character);
Set_Has_Pragma_Ordered (Standard_Character);
Set_Is_Unsigned_Type (Standard_Character);
Set_Is_Character_Type (Standard_Character);
Set_Is_Known_Valid (Standard_Character);
Set_Size_Known_At_Compile_Time (Standard_Character);
-- Create the bounds for type Character
R_Node := New_Node (N_Range, Stloc);
-- Low bound for type Character (Standard.Nul)
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name);
Set_Char_Literal_Value (B_Node, Uint_0);
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Character);
Set_Low_Bound (R_Node, B_Node);
-- High bound for type Character
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name);
Set_Char_Literal_Value (B_Node, UI_From_Int (16#FF#));
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Character);
Set_High_Bound (R_Node, B_Node);
Set_Scalar_Range (Standard_Character, R_Node);
Set_Etype (R_Node, Standard_Character);
Set_Parent (R_Node, Standard_Character);
-- Create type definition for type Wide_Character. Note that we do not
-- set the Literals field, since type Wide_Character is handled with
-- special routines that do not need a literal list.
Tdef_Node := New_Node (N_Enumeration_Type_Definition, Stloc);
Set_Type_Definition (Parent (Standard_Wide_Character), Tdef_Node);
Set_Ekind (Standard_Wide_Character, E_Enumeration_Type);
Set_Etype (Standard_Wide_Character, Standard_Wide_Character);
Init_Size (Standard_Wide_Character, Standard_Wide_Character_Size);
Set_Elem_Alignment (Standard_Wide_Character);
Set_Has_Pragma_Ordered (Standard_Wide_Character);
Set_Is_Unsigned_Type (Standard_Wide_Character);
Set_Is_Character_Type (Standard_Wide_Character);
Set_Is_Known_Valid (Standard_Wide_Character);
Set_Size_Known_At_Compile_Time (Standard_Wide_Character);
-- Create the bounds for type Wide_Character
R_Node := New_Node (N_Range, Stloc);
-- Low bound for type Wide_Character
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name); -- ???
Set_Char_Literal_Value (B_Node, Uint_0);
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Wide_Character);
Set_Low_Bound (R_Node, B_Node);
-- High bound for type Wide_Character
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name); -- ???
Set_Char_Literal_Value (B_Node, UI_From_Int (16#FFFF#));
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Wide_Character);
Set_High_Bound (R_Node, B_Node);
Set_Scalar_Range (Standard_Wide_Character, R_Node);
Set_Etype (R_Node, Standard_Wide_Character);
Set_Parent (R_Node, Standard_Wide_Character);
-- Create type definition for type Wide_Wide_Character. Note that we
-- do not set the Literals field, since type Wide_Wide_Character is
-- handled with special routines that do not need a literal list.
Tdef_Node := New_Node (N_Enumeration_Type_Definition, Stloc);
Set_Type_Definition (Parent (Standard_Wide_Wide_Character), Tdef_Node);
Set_Ekind (Standard_Wide_Wide_Character, E_Enumeration_Type);
Set_Etype (Standard_Wide_Wide_Character,
Standard_Wide_Wide_Character);
Init_Size (Standard_Wide_Wide_Character,
Standard_Wide_Wide_Character_Size);
Set_Elem_Alignment (Standard_Wide_Wide_Character);
Set_Has_Pragma_Ordered (Standard_Wide_Wide_Character);
Set_Is_Unsigned_Type (Standard_Wide_Wide_Character);
Set_Is_Character_Type (Standard_Wide_Wide_Character);
Set_Is_Known_Valid (Standard_Wide_Wide_Character);
Set_Size_Known_At_Compile_Time (Standard_Wide_Wide_Character);
Set_Is_Ada_2005_Only (Standard_Wide_Wide_Character);
-- Create the bounds for type Wide_Wide_Character
R_Node := New_Node (N_Range, Stloc);
-- Low bound for type Wide_Wide_Character
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name); -- ???
Set_Char_Literal_Value (B_Node, Uint_0);
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Wide_Wide_Character);
Set_Low_Bound (R_Node, B_Node);
-- High bound for type Wide_Wide_Character
B_Node := New_Node (N_Character_Literal, Stloc);
Set_Is_Static_Expression (B_Node);
Set_Chars (B_Node, No_Name); -- ???
Set_Char_Literal_Value (B_Node, UI_From_Int (16#7FFF_FFFF#));
Set_Entity (B_Node, Empty);
Set_Etype (B_Node, Standard_Wide_Wide_Character);
Set_High_Bound (R_Node, B_Node);
Set_Scalar_Range (Standard_Wide_Wide_Character, R_Node);
Set_Etype (R_Node, Standard_Wide_Wide_Character);
Set_Parent (R_Node, Standard_Wide_Wide_Character);
-- Create type definition node for type String
Tdef_Node := New_Node (N_Unconstrained_Array_Definition, Stloc);
declare
CompDef_Node : Node_Id;
begin
CompDef_Node := New_Node (N_Component_Definition, Stloc);
Set_Aliased_Present (CompDef_Node, False);
Set_Access_Definition (CompDef_Node, Empty);
Set_Subtype_Indication (CompDef_Node, Identifier_For (S_Character));
Set_Component_Definition (Tdef_Node, CompDef_Node);
end;
Set_Subtype_Marks (Tdef_Node, New_List);
Append (Identifier_For (S_Positive), Subtype_Marks (Tdef_Node));
Set_Type_Definition (Parent (Standard_String), Tdef_Node);
Set_Ekind (Standard_String, E_Array_Type);
Set_Etype (Standard_String, Standard_String);
Set_Component_Type (Standard_String, Standard_Character);
Set_Component_Size (Standard_String, Uint_8);
Init_Size_Align (Standard_String);
Set_Alignment (Standard_String, Uint_1);
Pack_String_Type (Standard_String);
-- On targets where a storage unit is larger than a byte (such as AAMP),
-- pragma Pack has a real effect on the representation of type String,
-- and the type must be marked as having a nonstandard representation.
if System_Storage_Unit > Uint_8 then
Set_Has_Non_Standard_Rep (Standard_String);
Set_Has_Pragma_Pack (Standard_String);
end if;
-- Set index type of String
E_Id :=
First (Subtype_Marks (Type_Definition (Parent (Standard_String))));
Set_First_Index (Standard_String, E_Id);
Set_Entity (E_Id, Standard_Positive);
Set_Etype (E_Id, Standard_Positive);
-- Create type definition node for type Wide_String
Tdef_Node := New_Node (N_Unconstrained_Array_Definition, Stloc);
declare
CompDef_Node : Node_Id;
begin
CompDef_Node := New_Node (N_Component_Definition, Stloc);
Set_Aliased_Present (CompDef_Node, False);
Set_Access_Definition (CompDef_Node, Empty);
Set_Subtype_Indication (CompDef_Node,
Identifier_For (S_Wide_Character));
Set_Component_Definition (Tdef_Node, CompDef_Node);
end;
Set_Subtype_Marks (Tdef_Node, New_List);
Append (Identifier_For (S_Positive), Subtype_Marks (Tdef_Node));
Set_Type_Definition (Parent (Standard_Wide_String), Tdef_Node);
Set_Ekind (Standard_Wide_String, E_Array_Type);
Set_Etype (Standard_Wide_String, Standard_Wide_String);
Set_Component_Type (Standard_Wide_String, Standard_Wide_Character);
Set_Component_Size (Standard_Wide_String, Uint_16);
Init_Size_Align (Standard_Wide_String);
Pack_String_Type (Standard_Wide_String);
-- Set index type of Wide_String
E_Id :=
First
(Subtype_Marks (Type_Definition (Parent (Standard_Wide_String))));
Set_First_Index (Standard_Wide_String, E_Id);
Set_Entity (E_Id, Standard_Positive);
Set_Etype (E_Id, Standard_Positive);
-- Create type definition node for type Wide_Wide_String
Tdef_Node := New_Node (N_Unconstrained_Array_Definition, Stloc);
declare
CompDef_Node : Node_Id;
begin
CompDef_Node := New_Node (N_Component_Definition, Stloc);
Set_Aliased_Present (CompDef_Node, False);
Set_Access_Definition (CompDef_Node, Empty);
Set_Subtype_Indication (CompDef_Node,
Identifier_For (S_Wide_Wide_Character));
Set_Component_Definition (Tdef_Node, CompDef_Node);
end;
Set_Subtype_Marks (Tdef_Node, New_List);
Append (Identifier_For (S_Positive), Subtype_Marks (Tdef_Node));
Set_Type_Definition (Parent (Standard_Wide_Wide_String), Tdef_Node);
Set_Ekind (Standard_Wide_Wide_String, E_Array_Type);
Set_Etype (Standard_Wide_Wide_String,
Standard_Wide_Wide_String);
Set_Component_Type (Standard_Wide_Wide_String,
Standard_Wide_Wide_Character);
Set_Component_Size (Standard_Wide_Wide_String, Uint_32);
Init_Size_Align (Standard_Wide_Wide_String);
Set_Is_Ada_2005_Only (Standard_Wide_Wide_String);
Pack_String_Type (Standard_Wide_Wide_String);
-- Set index type of Wide_Wide_String
E_Id :=
First
(Subtype_Marks
(Type_Definition (Parent (Standard_Wide_Wide_String))));
Set_First_Index (Standard_Wide_Wide_String, E_Id);
Set_Entity (E_Id, Standard_Positive);
Set_Etype (E_Id, Standard_Positive);
-- Setup entity for Natural
Set_Ekind (Standard_Natural, E_Signed_Integer_Subtype);
Set_Etype (Standard_Natural, Base_Type (Standard_Integer));
Init_Esize (Standard_Natural, Standard_Integer_Size);
Init_RM_Size (Standard_Natural, Standard_Integer_Size - 1);
Set_Elem_Alignment (Standard_Natural);
Set_Size_Known_At_Compile_Time
(Standard_Natural);
Set_Integer_Bounds (Standard_Natural,
Typ => Base_Type (Standard_Integer),
Lb => Uint_0,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Set_Is_Constrained (Standard_Natural);
-- Setup entity for Positive
Set_Ekind (Standard_Positive, E_Signed_Integer_Subtype);
Set_Etype (Standard_Positive, Base_Type (Standard_Integer));
Init_Esize (Standard_Positive, Standard_Integer_Size);
Init_RM_Size (Standard_Positive, Standard_Integer_Size - 1);
Set_Elem_Alignment (Standard_Positive);
Set_Size_Known_At_Compile_Time (Standard_Positive);
Set_Integer_Bounds (Standard_Positive,
Typ => Base_Type (Standard_Integer),
Lb => Uint_1,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Set_Is_Constrained (Standard_Positive);
-- Create declaration for package ASCII
Decl := New_Node (N_Package_Declaration, Stloc);
Append (Decl, Decl_S);
Pspec := New_Node (N_Package_Specification, Stloc);
Set_Specification (Decl, Pspec);
Set_Defining_Unit_Name (Pspec, Standard_Entity (S_ASCII));
Set_Ekind (Standard_Entity (S_ASCII), E_Package);
Set_Visible_Declarations (Pspec, Decl_A);
-- Create control character definitions in package ASCII. Note that
-- the character literal entries created here correspond to literal
-- values that are impossible in the source, but can be represented
-- internally with no difficulties.
Ccode := 16#00#;
for S in S_ASCII_Names loop
Decl := New_Node (N_Object_Declaration, Staloc);
Set_Constant_Present (Decl, True);
declare
A_Char : constant Entity_Id := Standard_Entity (S);
Expr_Decl : Node_Id;
begin
Set_Sloc (A_Char, Staloc);
Set_Ekind (A_Char, E_Constant);
Set_Never_Set_In_Source (A_Char, True);
Set_Is_True_Constant (A_Char, True);
Set_Etype (A_Char, Standard_Character);
Set_Scope (A_Char, Standard_Entity (S_ASCII));
Set_Is_Immediately_Visible (A_Char, False);
Set_Is_Public (A_Char, True);
Set_Is_Known_Valid (A_Char, True);
Append_Entity (A_Char, Standard_Entity (S_ASCII));
Set_Defining_Identifier (Decl, A_Char);
Set_Object_Definition (Decl, Identifier_For (S_Character));
Expr_Decl := New_Node (N_Character_Literal, Staloc);
Set_Expression (Decl, Expr_Decl);
Set_Is_Static_Expression (Expr_Decl);
Set_Chars (Expr_Decl, No_Name);
Set_Etype (Expr_Decl, Standard_Character);
Set_Char_Literal_Value (Expr_Decl, UI_From_Int (Int (Ccode)));
end;
Append (Decl, Decl_A);
-- Increment character code, dealing with non-contiguities
Ccode := Ccode + 1;
if Ccode = 16#20# then
Ccode := 16#21#;
elsif Ccode = 16#27# then
Ccode := 16#3A#;
elsif Ccode = 16#3C# then
Ccode := 16#3F#;
elsif Ccode = 16#41# then
Ccode := 16#5B#;
end if;
end loop;
-- Create semantic phase entities
Standard_Void_Type := New_Standard_Entity;
Set_Ekind (Standard_Void_Type, E_Void);
Set_Etype (Standard_Void_Type, Standard_Void_Type);
Set_Scope (Standard_Void_Type, Standard_Standard);
Make_Name (Standard_Void_Type, "_void_type");
-- The type field of packages is set to void
Set_Etype (Standard_Standard, Standard_Void_Type);
Set_Etype (Standard_ASCII, Standard_Void_Type);
-- Standard_A_String is actually used in generated code, so it has a
-- type name that is reasonable, but does not overlap any Ada name.
Standard_A_String := New_Standard_Entity;
Set_Ekind (Standard_A_String, E_Access_Type);
Set_Scope (Standard_A_String, Standard_Standard);
Set_Etype (Standard_A_String, Standard_A_String);
if Debug_Flag_6 then
Init_Size (Standard_A_String, System_Address_Size);
else
Init_Size (Standard_A_String, System_Address_Size * 2);
end if;
Init_Alignment (Standard_A_String);
Set_Directly_Designated_Type
(Standard_A_String, Standard_String);
Make_Name (Standard_A_String, "access_string");
Standard_A_Char := New_Standard_Entity;
Set_Ekind (Standard_A_Char, E_Access_Type);
Set_Scope (Standard_A_Char, Standard_Standard);
Set_Etype (Standard_A_Char, Standard_A_String);
Init_Size (Standard_A_Char, System_Address_Size);
Set_Elem_Alignment (Standard_A_Char);
Set_Directly_Designated_Type (Standard_A_Char, Standard_Character);
Make_Name (Standard_A_Char, "access_character");
-- Standard_Debug_Renaming_Type is used for the special objects created
-- to encode the names occurring in renaming declarations for use by the
-- debugger (see exp_dbug.adb). The type is a zero-sized subtype of
-- Standard.Integer.
Standard_Debug_Renaming_Type := New_Standard_Entity;
Set_Ekind (Standard_Debug_Renaming_Type, E_Signed_Integer_Subtype);
Set_Scope (Standard_Debug_Renaming_Type, Standard_Standard);
Set_Etype (Standard_Debug_Renaming_Type, Base_Type (Standard_Integer));
Init_Esize (Standard_Debug_Renaming_Type, 0);
Init_RM_Size (Standard_Debug_Renaming_Type, 0);
Set_Size_Known_At_Compile_Time (Standard_Debug_Renaming_Type);
Set_Integer_Bounds (Standard_Debug_Renaming_Type,
Typ => Base_Type (Standard_Debug_Renaming_Type),
Lb => Uint_1,
Hb => Uint_0);
Set_Is_Constrained (Standard_Debug_Renaming_Type);
Set_Has_Size_Clause (Standard_Debug_Renaming_Type);
Make_Name (Standard_Debug_Renaming_Type, "_renaming_type");
-- Note on type names. The type names for the following special types
-- are constructed so that they will look reasonable should they ever
-- appear in error messages etc, although in practice the use of the
-- special insertion character } for types results in special handling
-- of these type names in any case. The blanks in these names would
-- trouble in Gigi, but that's OK here, since none of these types
-- should ever get through to Gigi. Attributes of these types are
-- filled out to minimize problems with cascaded errors (for example,
-- Any_Integer is given reasonable and consistent type and size values)
Any_Type := New_Standard_Entity ("any type");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Any_Type);
Set_Scope (Any_Type, Standard_Standard);
Build_Signed_Integer_Type (Any_Type, Standard_Integer_Size);
Any_Id := New_Standard_Entity ("any id");
Set_Ekind (Any_Id, E_Variable);
Set_Scope (Any_Id, Standard_Standard);
Set_Etype (Any_Id, Any_Type);
Init_Esize (Any_Id);
Init_Alignment (Any_Id);
Any_Access := New_Standard_Entity ("an access type");
Set_Ekind (Any_Access, E_Access_Type);
Set_Scope (Any_Access, Standard_Standard);
Set_Etype (Any_Access, Any_Access);
Init_Size (Any_Access, System_Address_Size);
Set_Elem_Alignment (Any_Access);
Any_Character := New_Standard_Entity ("a character type");
Set_Ekind (Any_Character, E_Enumeration_Type);
Set_Scope (Any_Character, Standard_Standard);
Set_Etype (Any_Character, Any_Character);
Set_Is_Unsigned_Type (Any_Character);
Set_Is_Character_Type (Any_Character);
Init_Esize (Any_Character, Standard_Character_Size);
Init_RM_Size (Any_Character, 8);
Set_Elem_Alignment (Any_Character);
Set_Scalar_Range (Any_Character, Scalar_Range (Standard_Character));
Any_Array := New_Standard_Entity ("an array type");
Set_Ekind (Any_Array, E_Array_Type);
Set_Scope (Any_Array, Standard_Standard);
Set_Etype (Any_Array, Any_Array);
Set_Component_Type (Any_Array, Any_Character);
Init_Size_Align (Any_Array);
Make_Dummy_Index (Any_Array);
Any_Boolean := New_Standard_Entity ("a boolean type");
Set_Ekind (Any_Boolean, E_Enumeration_Type);
Set_Scope (Any_Boolean, Standard_Standard);
Set_Etype (Any_Boolean, Standard_Boolean);
Init_Esize (Any_Boolean, Standard_Character_Size);
Init_RM_Size (Any_Boolean, 1);
Set_Elem_Alignment (Any_Boolean);
Set_Is_Unsigned_Type (Any_Boolean);
Set_Scalar_Range (Any_Boolean, Scalar_Range (Standard_Boolean));
Any_Composite := New_Standard_Entity ("a composite type");
Set_Ekind (Any_Composite, E_Array_Type);
Set_Scope (Any_Composite, Standard_Standard);
Set_Etype (Any_Composite, Any_Composite);
Set_Component_Size (Any_Composite, Uint_0);
Set_Component_Type (Any_Composite, Standard_Integer);
Init_Size_Align (Any_Composite);
Any_Discrete := New_Standard_Entity ("a discrete type");
Set_Ekind (Any_Discrete, E_Signed_Integer_Type);
Set_Scope (Any_Discrete, Standard_Standard);
Set_Etype (Any_Discrete, Any_Discrete);
Init_Size (Any_Discrete, Standard_Integer_Size);
Set_Elem_Alignment (Any_Discrete);
Any_Fixed := New_Standard_Entity ("a fixed-point type");
Set_Ekind (Any_Fixed, E_Ordinary_Fixed_Point_Type);
Set_Scope (Any_Fixed, Standard_Standard);
Set_Etype (Any_Fixed, Any_Fixed);
Init_Size (Any_Fixed, Standard_Integer_Size);
Set_Elem_Alignment (Any_Fixed);
Any_Integer := New_Standard_Entity ("an integer type");
Set_Ekind (Any_Integer, E_Signed_Integer_Type);
Set_Scope (Any_Integer, Standard_Standard);
Set_Etype (Any_Integer, Standard_Long_Long_Integer);
Init_Size (Any_Integer, Standard_Long_Long_Integer_Size);
Set_Elem_Alignment (Any_Integer);
Set_Integer_Bounds
(Any_Integer,
Typ => Base_Type (Standard_Integer),
Lb => Uint_0,
Hb => Intval (High_Bound (Scalar_Range (Standard_Integer))));
Any_Modular := New_Standard_Entity ("a modular type");
Set_Ekind (Any_Modular, E_Modular_Integer_Type);
Set_Scope (Any_Modular, Standard_Standard);
Set_Etype (Any_Modular, Standard_Long_Long_Integer);
Init_Size (Any_Modular, Standard_Long_Long_Integer_Size);
Set_Elem_Alignment (Any_Modular);
Set_Is_Unsigned_Type (Any_Modular);
Any_Numeric := New_Standard_Entity ("a numeric type");
Set_Ekind (Any_Numeric, E_Signed_Integer_Type);
Set_Scope (Any_Numeric, Standard_Standard);
Set_Etype (Any_Numeric, Standard_Long_Long_Integer);
Init_Size (Any_Numeric, Standard_Long_Long_Integer_Size);
Set_Elem_Alignment (Any_Numeric);
Any_Real := New_Standard_Entity ("a real type");
Set_Ekind (Any_Real, E_Floating_Point_Type);
Set_Scope (Any_Real, Standard_Standard);
Set_Etype (Any_Real, Standard_Long_Long_Float);
Init_Size (Any_Real,
UI_To_Int (Esize (Standard_Long_Long_Float)));
Set_Elem_Alignment (Any_Real);
Any_Scalar := New_Standard_Entity ("a scalar type");
Set_Ekind (Any_Scalar, E_Signed_Integer_Type);
Set_Scope (Any_Scalar, Standard_Standard);
Set_Etype (Any_Scalar, Any_Scalar);
Init_Size (Any_Scalar, Standard_Integer_Size);
Set_Elem_Alignment (Any_Scalar);
Any_String := New_Standard_Entity ("a string type");
Set_Ekind (Any_String, E_Array_Type);
Set_Scope (Any_String, Standard_Standard);
Set_Etype (Any_String, Any_String);
Set_Component_Type (Any_String, Any_Character);
Init_Size_Align (Any_String);
Make_Dummy_Index (Any_String);
Raise_Type := New_Standard_Entity ("raise type");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Raise_Type);
Set_Scope (Raise_Type, Standard_Standard);
Build_Signed_Integer_Type (Raise_Type, Standard_Integer_Size);
Standard_Integer_8 := New_Standard_Entity ("integer_8");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Integer_8);
Set_Scope (Standard_Integer_8, Standard_Standard);
Build_Signed_Integer_Type (Standard_Integer_8, 8);
Standard_Integer_16 := New_Standard_Entity ("integer_16");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Integer_16);
Set_Scope (Standard_Integer_16, Standard_Standard);
Build_Signed_Integer_Type (Standard_Integer_16, 16);
Standard_Integer_32 := New_Standard_Entity ("integer_32");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Integer_32);
Set_Scope (Standard_Integer_32, Standard_Standard);
Build_Signed_Integer_Type (Standard_Integer_32, 32);
Standard_Integer_64 := New_Standard_Entity ("integer_64");
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Standard_Integer_64);
Set_Scope (Standard_Integer_64, Standard_Standard);
Build_Signed_Integer_Type (Standard_Integer_64, 64);
-- Standard_*_Unsigned subtypes are not user visible, but they are
-- used internally. They are unsigned types with the same length as
-- the correspondingly named signed integer types.
Standard_Short_Short_Unsigned := New_Standard_Entity;
Build_Unsigned_Integer_Type
(Standard_Short_Short_Unsigned,
Standard_Short_Short_Integer_Size,
"short_short_unsigned");
Standard_Short_Unsigned := New_Standard_Entity;
Build_Unsigned_Integer_Type
(Standard_Short_Unsigned,
Standard_Short_Integer_Size,
"short_unsigned");
Standard_Unsigned := New_Standard_Entity;
Build_Unsigned_Integer_Type
(Standard_Unsigned,
Standard_Integer_Size,
"unsigned");
Standard_Long_Unsigned := New_Standard_Entity;
Build_Unsigned_Integer_Type
(Standard_Long_Unsigned,
Standard_Long_Integer_Size,
"long_unsigned");
Standard_Long_Long_Unsigned := New_Standard_Entity;
Build_Unsigned_Integer_Type
(Standard_Long_Long_Unsigned,
Standard_Long_Long_Integer_Size,
"long_long_unsigned");
-- Standard_Unsigned_64 is not user visible, but is used internally. It
-- is an unsigned type mod 2**64, 64-bits unsigned, size is 64.
Standard_Unsigned_64 := New_Standard_Entity;
Build_Unsigned_Integer_Type (Standard_Unsigned_64, 64, "unsigned_64");
-- Note: universal integer and universal real are constructed as fully
-- formed signed numeric types, with parameters corresponding to the
-- longest runtime types (Long_Long_Integer and Long_Long_Float). This
-- allows Gigi to properly process references to universal types that
-- are not folded at compile time.
Universal_Integer := New_Standard_Entity;
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Universal_Integer);
Make_Name (Universal_Integer, "universal_integer");
Set_Scope (Universal_Integer, Standard_Standard);
Build_Signed_Integer_Type
(Universal_Integer, Standard_Long_Long_Integer_Size);
Universal_Real := New_Standard_Entity;
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Universal_Real);
Make_Name (Universal_Real, "universal_real");
Set_Scope (Universal_Real, Standard_Standard);
Copy_Float_Type (Universal_Real, Standard_Long_Long_Float);
-- Note: universal fixed, unlike universal integer and universal real,
-- is never used at runtime, so it does not need to have bounds set.
Universal_Fixed := New_Standard_Entity;
Decl := New_Node (N_Full_Type_Declaration, Stloc);
Set_Defining_Identifier (Decl, Universal_Fixed);
Make_Name (Universal_Fixed, "universal_fixed");
Set_Ekind (Universal_Fixed, E_Ordinary_Fixed_Point_Type);
Set_Etype (Universal_Fixed, Universal_Fixed);
Set_Scope (Universal_Fixed, Standard_Standard);
Init_Size (Universal_Fixed, Standard_Long_Long_Integer_Size);
Set_Elem_Alignment (Universal_Fixed);
Set_Size_Known_At_Compile_Time
(Universal_Fixed);
-- Create type declaration for Duration, using a 64-bit size. The
-- delta and size values depend on the mode set in system.ads.
Build_Duration : declare
Dlo : Uint;
Dhi : Uint;
Delta_Val : Ureal;
begin
-- In 32 bit mode, the size is 32 bits, and the delta and
-- small values are set to 20 milliseconds (20.0*(10.0**(-3)).
if Duration_32_Bits_On_Target then
Dlo := Intval (Type_Low_Bound (Standard_Integer_32));
Dhi := Intval (Type_High_Bound (Standard_Integer_32));
Delta_Val := UR_From_Components (UI_From_Int (20), Uint_3, 10);
-- In 64-bit mode, the size is 64-bits and the delta and
-- small values are set to nanoseconds (1.0*(10.0**(-9)).
else
Dlo := Intval (Type_Low_Bound (Standard_Integer_64));
Dhi := Intval (Type_High_Bound (Standard_Integer_64));
Delta_Val := UR_From_Components (Uint_1, Uint_9, 10);
end if;
Tdef_Node := Make_Ordinary_Fixed_Point_Definition (Stloc,
Delta_Expression => Make_Real_Literal (Stloc, Delta_Val),
Real_Range_Specification =>
Make_Real_Range_Specification (Stloc,
Low_Bound => Make_Real_Literal (Stloc,
Realval => Dlo * Delta_Val),
High_Bound => Make_Real_Literal (Stloc,
Realval => Dhi * Delta_Val)));
Set_Type_Definition (Parent (Standard_Duration), Tdef_Node);
Set_Ekind (Standard_Duration, E_Ordinary_Fixed_Point_Type);
Set_Etype (Standard_Duration, Standard_Duration);
if Duration_32_Bits_On_Target then
Init_Size (Standard_Duration, 32);
else
Init_Size (Standard_Duration, 64);
end if;
Set_Elem_Alignment (Standard_Duration);
Set_Delta_Value (Standard_Duration, Delta_Val);
Set_Small_Value (Standard_Duration, Delta_Val);
Set_Scalar_Range (Standard_Duration,
Real_Range_Specification
(Type_Definition (Parent (Standard_Duration))));
-- Normally it does not matter that nodes in package Standard are
-- not marked as analyzed. The Scalar_Range of the fixed-point type
-- Standard_Duration is an exception, because of the special test
-- made in Freeze.Freeze_Fixed_Point_Type.
Set_Analyzed (Scalar_Range (Standard_Duration));
Set_Etype (Type_High_Bound (Standard_Duration), Standard_Duration);
Set_Etype (Type_Low_Bound (Standard_Duration), Standard_Duration);
Set_Is_Static_Expression (Type_High_Bound (Standard_Duration));
Set_Is_Static_Expression (Type_Low_Bound (Standard_Duration));
Set_Corresponding_Integer_Value
(Type_High_Bound (Standard_Duration), Dhi);
Set_Corresponding_Integer_Value
(Type_Low_Bound (Standard_Duration), Dlo);
Set_Size_Known_At_Compile_Time (Standard_Duration);
end Build_Duration;
-- Build standard exception type. Note that the type name here is
-- actually used in the generated code, so it must be set correctly.
-- The type Standard_Exception_Type must be consistent with the type
-- System.Standard_Library.Exception_Data, as the latter is what is
-- known by the run-time. Components of the record are documented in
-- the declaration in System.Standard_Library.
Standard_Exception_Type := New_Standard_Entity;
Set_Ekind (Standard_Exception_Type, E_Record_Type);
Set_Etype (Standard_Exception_Type, Standard_Exception_Type);
Set_Scope (Standard_Exception_Type, Standard_Standard);
Set_Stored_Constraint
(Standard_Exception_Type, No_Elist);
Init_Size_Align (Standard_Exception_Type);
Set_Size_Known_At_Compile_Time
(Standard_Exception_Type, True);
Make_Name (Standard_Exception_Type, "exception");
Make_Component
(Standard_Exception_Type, Standard_Boolean, "Not_Handled_By_Others");
Make_Component
(Standard_Exception_Type, Standard_Character, "Lang");
Make_Component
(Standard_Exception_Type, Standard_Natural, "Name_Length");
Make_Component
(Standard_Exception_Type, Standard_A_Char, "Full_Name");
Make_Component
(Standard_Exception_Type, Standard_A_Char, "HTable_Ptr");
Make_Component
(Standard_Exception_Type, Standard_A_Char, "Foreign_Data");
Make_Component
(Standard_Exception_Type, Standard_A_Char, "Raise_Hook");
-- Build tree for record declaration, for use by the back-end
declare
Comp_List : List_Id;
Comp : Entity_Id;
begin
Comp := First_Entity (Standard_Exception_Type);
Comp_List := New_List;
while Present (Comp) loop
Append (
Make_Component_Declaration (Stloc,
Defining_Identifier => Comp,
Component_Definition =>
Make_Component_Definition (Stloc,
Aliased_Present => False,
Subtype_Indication => New_Occurrence_Of (Etype (Comp),
Stloc))),
Comp_List);
Next_Entity (Comp);
end loop;
Decl := Make_Full_Type_Declaration (Stloc,
Defining_Identifier => Standard_Exception_Type,
Type_Definition =>
Make_Record_Definition (Stloc,
End_Label => Empty,
Component_List =>
Make_Component_List (Stloc,
Component_Items => Comp_List)));
end;
Append (Decl, Decl_S);
Layout_Type (Standard_Exception_Type);
-- Create declarations of standard exceptions
Build_Exception (S_Constraint_Error);
Build_Exception (S_Program_Error);
Build_Exception (S_Storage_Error);
Build_Exception (S_Tasking_Error);
-- Numeric_Error is a normal exception in Ada 83, but in Ada 95
-- it is a renaming of Constraint_Error. Is this test too early???
if Ada_Version = Ada_83 then
Build_Exception (S_Numeric_Error);
else
Decl := New_Node (N_Exception_Renaming_Declaration, Stloc);
E_Id := Standard_Entity (S_Numeric_Error);
Set_Ekind (E_Id, E_Exception);
Set_Etype (E_Id, Standard_Exception_Type);
Set_Is_Public (E_Id);
Set_Renamed_Entity (E_Id, Standard_Entity (S_Constraint_Error));
Set_Defining_Identifier (Decl, E_Id);
Append (Decl, Decl_S);
Ident_Node := New_Node (N_Identifier, Stloc);
Set_Chars (Ident_Node, Chars (Standard_Entity (S_Constraint_Error)));
Set_Entity (Ident_Node, Standard_Entity (S_Constraint_Error));
Set_Name (Decl, Ident_Node);
end if;
-- Abort_Signal is an entity that does not get made visible
Abort_Signal := New_Standard_Entity;
Set_Chars (Abort_Signal, Name_uAbort_Signal);
Set_Ekind (Abort_Signal, E_Exception);
Set_Etype (Abort_Signal, Standard_Exception_Type);
Set_Scope (Abort_Signal, Standard_Standard);
Set_Is_Public (Abort_Signal, True);
Decl :=
Make_Exception_Declaration (Stloc,
Defining_Identifier => Abort_Signal);
-- Create defining identifiers for shift operator entities. Note
-- that these entities are used only for marking shift operators
-- generated internally, and hence need no structure, just a name
-- and a unique identity.
Standard_Op_Rotate_Left := New_Standard_Entity;
Set_Chars (Standard_Op_Rotate_Left, Name_Rotate_Left);
Set_Ekind (Standard_Op_Rotate_Left, E_Operator);
Standard_Op_Rotate_Right := New_Standard_Entity;
Set_Chars (Standard_Op_Rotate_Right, Name_Rotate_Right);
Set_Ekind (Standard_Op_Rotate_Right, E_Operator);
Standard_Op_Shift_Left := New_Standard_Entity;
Set_Chars (Standard_Op_Shift_Left, Name_Shift_Left);
Set_Ekind (Standard_Op_Shift_Left, E_Operator);
Standard_Op_Shift_Right := New_Standard_Entity;
Set_Chars (Standard_Op_Shift_Right, Name_Shift_Right);
Set_Ekind (Standard_Op_Shift_Right, E_Operator);
Standard_Op_Shift_Right_Arithmetic := New_Standard_Entity;
Set_Chars (Standard_Op_Shift_Right_Arithmetic,
Name_Shift_Right_Arithmetic);
Set_Ekind (Standard_Op_Shift_Right_Arithmetic,
E_Operator);
-- Create standard operator declarations
Create_Operators;
-- Initialize visibility table with entities in Standard
for E in Standard_Entity_Type loop
if Ekind (Standard_Entity (E)) /= E_Operator then
Set_Name_Entity_Id
(Chars (Standard_Entity (E)), Standard_Entity (E));
Set_Homonym (Standard_Entity (E), Empty);
end if;
if E not in S_ASCII_Names then
Set_Scope (Standard_Entity (E), Standard_Standard);
Set_Is_Immediately_Visible (Standard_Entity (E));
end if;
end loop;
-- The predefined package Standard itself does not have a scope;
-- it is the only entity in the system not to have one, and this
-- is what identifies the package to Gigi.
Set_Scope (Standard_Standard, Empty);
-- Set global variables indicating last Id values and version
Last_Standard_Node_Id := Last_Node_Id;
Last_Standard_List_Id := Last_List_Id;
-- The Error node has an Etype of Any_Type to help error recovery
Set_Etype (Error, Any_Type);
-- Print representation of standard if switch set
if Opt.Print_Standard then
Print_Standard;
end if;
end Create_Standard;
------------------------------------
-- Create_Unconstrained_Base_Type --
------------------------------------
procedure Create_Unconstrained_Base_Type
(E : Entity_Id;
K : Entity_Kind)
is
New_Ent : constant Entity_Id := New_Copy (E);
begin
Set_Ekind (E, K);
Set_Is_Constrained (E, True);
Set_Is_First_Subtype (E, True);
Set_Etype (E, New_Ent);
Append_Entity (New_Ent, Standard_Standard);
Set_Is_Constrained (New_Ent, False);
Set_Etype (New_Ent, New_Ent);
Set_Is_Known_Valid (New_Ent, True);
if K = E_Signed_Integer_Subtype then
Set_Etype (Low_Bound (Scalar_Range (E)), New_Ent);
Set_Etype (High_Bound (Scalar_Range (E)), New_Ent);
end if;
end Create_Unconstrained_Base_Type;
--------------------
-- Identifier_For --
--------------------
function Identifier_For (S : Standard_Entity_Type) return Node_Id is
Ident_Node : Node_Id;
begin
Ident_Node := New_Node (N_Identifier, Stloc);
Set_Chars (Ident_Node, Chars (Standard_Entity (S)));
Set_Entity (Ident_Node, Standard_Entity (S));
return Ident_Node;
end Identifier_For;
--------------------
-- Make_Component --
--------------------
procedure Make_Component
(Rec : Entity_Id;
Typ : Entity_Id;
Nam : String)
is
Id : constant Entity_Id := New_Standard_Entity;
begin
Set_Ekind (Id, E_Component);
Set_Etype (Id, Typ);
Set_Scope (Id, Rec);
Init_Component_Location (Id);
Set_Original_Record_Component (Id, Id);
Make_Name (Id, Nam);
Append_Entity (Id, Rec);
end Make_Component;
-----------------
-- Make_Formal --
-----------------
function Make_Formal
(Typ : Entity_Id;
Formal_Name : String) return Entity_Id
is
Formal : Entity_Id;
begin
Formal := New_Standard_Entity;
Set_Ekind (Formal, E_In_Parameter);
Set_Mechanism (Formal, Default_Mechanism);
Set_Scope (Formal, Standard_Standard);
Set_Etype (Formal, Typ);
Make_Name (Formal, Formal_Name);
return Formal;
end Make_Formal;
------------------
-- Make_Integer --
------------------
function Make_Integer (V : Uint) return Node_Id is
N : constant Node_Id := Make_Integer_Literal (Stloc, V);
begin
Set_Is_Static_Expression (N);
return N;
end Make_Integer;
---------------
-- Make_Name --
---------------
procedure Make_Name (Id : Entity_Id; Nam : String) is
begin
for J in 1 .. Nam'Length loop
Name_Buffer (J) := Fold_Lower (Nam (Nam'First + (J - 1)));
end loop;
Name_Len := Nam'Length;
Set_Chars (Id, Name_Find);
end Make_Name;
------------------
-- New_Operator --
------------------
function New_Operator (Op : Name_Id; Typ : Entity_Id) return Entity_Id is
Ident_Node : Entity_Id;
begin
Ident_Node := Make_Defining_Identifier (Stloc, Op);
Set_Is_Pure (Ident_Node, True);
Set_Ekind (Ident_Node, E_Operator);
Set_Etype (Ident_Node, Typ);
Set_Scope (Ident_Node, Standard_Standard);
Set_Homonym (Ident_Node, Get_Name_Entity_Id (Op));
Set_Convention (Ident_Node, Convention_Intrinsic);
Set_Is_Immediately_Visible (Ident_Node, True);
Set_Is_Intrinsic_Subprogram (Ident_Node, True);
Set_Name_Entity_Id (Op, Ident_Node);
Append_Entity (Ident_Node, Standard_Standard);
return Ident_Node;
end New_Operator;
-------------------------
-- New_Standard_Entity --
-------------------------
function New_Standard_Entity
(New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id
is
E : constant Entity_Id := New_Entity (New_Node_Kind, Stloc);
begin
-- All standard entities are Pure and Public
Set_Is_Pure (E);
Set_Is_Public (E);
-- All standard entity names are analyzed manually, and are thus
-- frozen as soon as they are created.
Set_Is_Frozen (E);
-- Set debug information required for all standard types
Set_Needs_Debug_Info (E);
-- All standard entities are built with fully qualified names, so
-- set the flag to prevent an abortive attempt at requalification.
Set_Has_Qualified_Name (E);
-- Return newly created entity to be completed by caller
return E;
end New_Standard_Entity;
function New_Standard_Entity (S : String) return Entity_Id is
Ent : constant Entity_Id := New_Standard_Entity;
begin
Make_Name (Ent, S);
return Ent;
end New_Standard_Entity;
--------------------
-- Print_Standard --
--------------------
procedure Print_Standard is
procedure P (Item : String) renames Output.Write_Line;
-- Short-hand, since we do a lot of line writes here
procedure P_Int_Range (Size : Pos);
-- Prints the range of an integer based on its Size
procedure P_Float_Range (Id : Entity_Id);
-- Prints the bounds range for the given float type entity
procedure P_Float_Type (Id : Entity_Id);
-- Prints the type declaration of the given float type entity
procedure P_Mixed_Name (Id : Name_Id);
-- Prints Id in mixed case
-------------------
-- P_Float_Range --
-------------------
procedure P_Float_Range (Id : Entity_Id) is
begin
Write_Str (" range ");
UR_Write (Realval (Type_Low_Bound (Id)));
Write_Str (" .. ");
UR_Write (Realval (Type_High_Bound (Id)));
Write_Str (";");
Write_Eol;
end P_Float_Range;
------------------
-- P_Float_Type --
------------------
procedure P_Float_Type (Id : Entity_Id) is
begin
Write_Str (" type ");
P_Mixed_Name (Chars (Id));
Write_Str (" is digits ");
Write_Int (UI_To_Int (Digits_Value (Id)));
Write_Eol;
P_Float_Range (Id);
Write_Str (" for ");
P_Mixed_Name (Chars (Id));
Write_Str ("'Size use ");
Write_Int (UI_To_Int (RM_Size (Id)));
Write_Line (";");
Write_Eol;
end P_Float_Type;
-----------------
-- P_Int_Range --
-----------------
procedure P_Int_Range (Size : Pos) is
begin
Write_Str (" is range -(2 **");
Write_Int (Size - 1);
Write_Str (")");
Write_Str (" .. +(2 **");
Write_Int (Size - 1);
Write_Str (" - 1);");
Write_Eol;
end P_Int_Range;
------------------
-- P_Mixed_Name --
------------------
procedure P_Mixed_Name (Id : Name_Id) is
begin
Get_Name_String (Id);
for J in 1 .. Name_Len loop
if J = 1 or else Name_Buffer (J - 1) = '_' then
Name_Buffer (J) := Fold_Upper (Name_Buffer (J));
end if;
end loop;
Write_Str (Name_Buffer (1 .. Name_Len));
end P_Mixed_Name;
-- Start of processing for Print_Standard
begin
P ("-- Representation of package Standard");
Write_Eol;
P ("-- This is not accurate Ada, since new base types cannot be ");
P ("-- created, but the listing shows the target dependent");
P ("-- characteristics of the Standard types for this compiler");
Write_Eol;
P ("package Standard is");
P ("pragma Pure (Standard);");
Write_Eol;
P (" type Boolean is (False, True);");
P (" for Boolean'Size use 1;");
P (" for Boolean use (False => 0, True => 1);");
Write_Eol;
-- Integer types
Write_Str (" type Integer");
P_Int_Range (Standard_Integer_Size);
Write_Str (" for Integer'Size use ");
Write_Int (Standard_Integer_Size);
P (";");
Write_Eol;
P (" subtype Natural is Integer range 0 .. Integer'Last;");
P (" subtype Positive is Integer range 1 .. Integer'Last;");
Write_Eol;
Write_Str (" type Short_Short_Integer");
P_Int_Range (Standard_Short_Short_Integer_Size);
Write_Str (" for Short_Short_Integer'Size use ");
Write_Int (Standard_Short_Short_Integer_Size);
P (";");
Write_Eol;
Write_Str (" type Short_Integer");
P_Int_Range (Standard_Short_Integer_Size);
Write_Str (" for Short_Integer'Size use ");
Write_Int (Standard_Short_Integer_Size);
P (";");
Write_Eol;
Write_Str (" type Long_Integer");
P_Int_Range (Standard_Long_Integer_Size);
Write_Str (" for Long_Integer'Size use ");
Write_Int (Standard_Long_Integer_Size);
P (";");
Write_Eol;
Write_Str (" type Long_Long_Integer");
P_Int_Range (Standard_Long_Long_Integer_Size);
Write_Str (" for Long_Long_Integer'Size use ");
Write_Int (Standard_Long_Long_Integer_Size);
P (";");
Write_Eol;
-- Floating point types
P_Float_Type (Standard_Short_Float);
P_Float_Type (Standard_Float);
P_Float_Type (Standard_Long_Float);
P_Float_Type (Standard_Long_Long_Float);
P (" type Character is (...)");
Write_Str (" for Character'Size use ");
Write_Int (Standard_Character_Size);
P (";");
P (" -- See RM A.1(35) for details of this type");
Write_Eol;
P (" type Wide_Character is (...)");
Write_Str (" for Wide_Character'Size use ");
Write_Int (Standard_Wide_Character_Size);
P (";");
P (" -- See RM A.1(36) for details of this type");
Write_Eol;
P (" type Wide_Wide_Character is (...)");
Write_Str (" for Wide_Wide_Character'Size use ");
Write_Int (Standard_Wide_Wide_Character_Size);
P (";");
P (" -- See RM A.1(36) for details of this type");
P (" type String is array (Positive range <>) of Character;");
P (" pragma Pack (String);");
Write_Eol;
P (" type Wide_String is array (Positive range <>)" &
" of Wide_Character;");
P (" pragma Pack (Wide_String);");
Write_Eol;
P (" type Wide_Wide_String is array (Positive range <>)" &
" of Wide_Wide_Character;");
P (" pragma Pack (Wide_Wide_String);");
Write_Eol;
-- We only have one representation each for 32-bit and 64-bit sizes,
-- so select the right one based on Duration_32_Bits_On_Target.
if Duration_32_Bits_On_Target then
P (" type Duration is delta 0.020");
P (" range -((2 ** 31) * 0.020) ..");
P (" +((2 ** 31 - 1) * 0.020);");
P (" for Duration'Small use 0.020;");
else
P (" type Duration is delta 0.000000001");
P (" range -((2 ** 63) * 0.000000001) ..");
P (" +((2 ** 63 - 1) * 0.000000001);");
P (" for Duration'Small use 0.000000001;");
end if;
Write_Eol;
P (" Constraint_Error : exception;");
P (" Program_Error : exception;");
P (" Storage_Error : exception;");
P (" Tasking_Error : exception;");
P (" Numeric_Error : exception renames Constraint_Error;");
Write_Eol;
P ("end Standard;");
end Print_Standard;
-------------------------
-- Register_Float_Type --
-------------------------
procedure Register_Float_Type
(Name : String;
Digs : Positive;
Float_Rep : Float_Rep_Kind;
Precision : Positive;
Size : Positive;
Alignment : Natural)
is
Ent : constant Entity_Id := New_Standard_Entity;
begin
Set_Defining_Identifier (New_Node (N_Full_Type_Declaration, Stloc), Ent);
Make_Name (Ent, Name);
Set_Scope (Ent, Standard_Standard);
Build_Float_Type (Ent, Int (Size), Float_Rep, Pos (Digs));
Set_RM_Size (Ent, UI_From_Int (Int (Precision)));
Set_Alignment (Ent, UI_From_Int (Int (Alignment / 8)));
if No (Back_End_Float_Types) then
Back_End_Float_Types := New_Elmt_List;
end if;
Append_Elmt (Ent, Back_End_Float_Types);
end Register_Float_Type;
----------------------
-- Set_Float_Bounds --
----------------------
procedure Set_Float_Bounds (Id : Entity_Id) is
L : Node_Id;
H : Node_Id;
-- Low and high bounds of literal value
R : Node_Id;
-- Range specification
Radix : constant Uint := Machine_Radix_Value (Id);
Mantissa : constant Uint := Machine_Mantissa_Value (Id);
Emax : constant Uint := Machine_Emax_Value (Id);
Significand : constant Uint := Radix ** Mantissa - 1;
Exponent : constant Uint := Emax - Mantissa;
begin
H := Make_Float_Literal (Stloc, Radix, Significand, Exponent);
L := Make_Float_Literal (Stloc, Radix, -Significand, Exponent);
Set_Etype (L, Id);
Set_Is_Static_Expression (L);
Set_Etype (H, Id);
Set_Is_Static_Expression (H);
R := New_Node (N_Range, Stloc);
Set_Low_Bound (R, L);
Set_High_Bound (R, H);
Set_Includes_Infinities (R, True);
Set_Scalar_Range (Id, R);
Set_Etype (R, Id);
Set_Parent (R, Id);
end Set_Float_Bounds;
------------------------
-- Set_Integer_Bounds --
------------------------
procedure Set_Integer_Bounds
(Id : Entity_Id;
Typ : Entity_Id;
Lb : Uint;
Hb : Uint)
is
L : Node_Id;
H : Node_Id;
-- Low and high bounds of literal value
R : Node_Id;
-- Range specification
begin
L := Make_Integer (Lb);
H := Make_Integer (Hb);
Set_Etype (L, Typ);
Set_Etype (H, Typ);
R := New_Node (N_Range, Stloc);
Set_Low_Bound (R, L);
Set_High_Bound (R, H);
Set_Scalar_Range (Id, R);
Set_Etype (R, Typ);
Set_Parent (R, Id);
Set_Is_Unsigned_Type (Id, Lb >= 0);
end Set_Integer_Bounds;
end CStand;
| 38.092635 | 79 | 0.62845 |
57f29a8d2603053dabbb53bac2545086a3903715 | 3,781 | ads | Ada | middleware/src/utils/logging_with_priority.ads | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 192 | 2016-06-01T18:32:04.000Z | 2022-03-26T22:52:31.000Z | middleware/src/utils/logging_with_priority.ads | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 239 | 2016-05-26T20:02:01.000Z | 2022-03-31T09:46:56.000Z | middleware/src/utils/logging_with_priority.ads | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 142 | 2016-06-05T08:12:20.000Z | 2022-03-24T17:37:17.000Z | ------------------------------------------------------------------------------
-- --
-- Copyright (C) 2017, AdaCore --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions are --
-- met: --
-- 1. Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- 2. Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in --
-- the documentation and/or other materials provided with the --
-- distribution. --
-- 3. Neither the name of the copyright holder nor the names of its --
-- contributors may be used to endorse or promote products derived --
-- from this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --
-- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --
-- DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --
-- THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --
-- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --
-- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
generic
type Priorities is (<>);
-- Logging priority type. Higher value means higher priority.
Maximum_Message_Length : Positive;
-- Maximum number of Characters in a message. Messages longer than this
-- limit will be rejected.
Maximum_Number_Of_Messages : Positive;
-- Maximum number of messages in the queue. When the queue is filled the
-- lower priority will be discared.
package Logging_With_Priority is
procedure Log_Line (Str : String; Prio : Priorities);
-- Add message in the logging queue. The messages are sorted with FIFO
-- within priorities.
--
-- The message will be rejected right away if:
-- - The message is longer than Maximum_Message_Length
-- - The queue if full of messages with higher or equal priority
--
-- The message might be reject later if the queue is full and a message
-- with higher priority is inserted.
procedure Pop (Str : out String;
Length : out Natural;
Prio : out Priorities)
with Pre => Str'Length = Maximum_Message_Length;
-- Remove the top priority message from the queue. Length will be zero when
-- there's no message in the queue.
function Full return Boolean;
-- Return True if the message queue is full
function Empty return Boolean;
-- Return True if the message queue is empty
end Logging_With_Priority;
| 53.253521 | 79 | 0.571013 |
2975a3c68c4b98f0d9c19e5c11d542f49f9ef7d0 | 7,552 | ads | Ada | awa/plugins/awa-storages/src/awa-storages-services.ads | fuzzysloth/ada-awa | f9b921eeea29841667a028f2fc4528e4385d247a | [
"Apache-2.0"
] | null | null | null | awa/plugins/awa-storages/src/awa-storages-services.ads | fuzzysloth/ada-awa | f9b921eeea29841667a028f2fc4528e4385d247a | [
"Apache-2.0"
] | null | null | null | awa/plugins/awa-storages/src/awa-storages-services.ads | fuzzysloth/ada-awa | f9b921eeea29841667a028f2fc4528e4385d247a | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- awa-storages-services -- Storage service
-- Copyright (C) 2012, 2016 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Calendar;
with Ada.Strings.Unbounded;
with Util.Concurrent.Counters;
with Security.Permissions;
with ADO;
with ASF.Parts;
with AWA.Modules;
with AWA.Modules.Lifecycles;
with AWA.Storages.Models;
with AWA.Storages.Stores;
with AWA.Storages.Stores.Databases;
-- == Storage Service ==
-- The <tt>Storage_Service</tt> provides the operations to access and use the persisent storage.
-- It controls the permissions that grant access to the service for users.
--
-- Other modules can be notified of storage changes by registering a listener
-- on the storage module.
--
-- @include awa-storages-stores.ads
package AWA.Storages.Services is
package ACL_Create_Storage is new Security.Permissions.Definition ("storage-create");
package ACL_Delete_Storage is new Security.Permissions.Definition ("storage-delete");
package ACL_Create_Folder is new Security.Permissions.Definition ("folder-create");
type Read_Mode is (READ, WRITE);
type Expire_Type is (ONE_HOUR, ONE_DAY, TWO_DAYS, ONE_WEEK, ONE_YEAR, NEVER);
package Storage_Lifecycle is
new AWA.Modules.Lifecycles (Element_Type => AWA.Storages.Models.Storage_Ref'Class);
subtype Listener is Storage_Lifecycle.Listener;
-- ------------------------------
-- Storage Service
-- ------------------------------
-- The <b>Storage_Service</b> defines a set of operations to store and retrieve
-- a data object from the persistent storage. The data object is treated as a raw
-- byte stream. The persistent storage can be implemented by a database, a file
-- system or a remote service such as Amazon AWS.
type Storage_Service is new AWA.Modules.Module_Manager with private;
type Storage_Service_Access is access all Storage_Service'Class;
-- Initializes the storage service.
overriding
procedure Initialize (Service : in out Storage_Service;
Module : in AWA.Modules.Module'Class);
-- Get the persistent store that manages the data store identified by <tt>Kind</tt>.
function Get_Store (Service : in Storage_Service;
Kind : in AWA.Storages.Models.Storage_Type)
return AWA.Storages.Stores.Store_Access;
-- Create or save the folder.
procedure Save_Folder (Service : in Storage_Service;
Folder : in out AWA.Storages.Models.Storage_Folder_Ref'Class);
-- Load the folder instance identified by the given identifier.
procedure Load_Folder (Service : in Storage_Service;
Folder : in out AWA.Storages.Models.Storage_Folder_Ref'Class;
Id : in ADO.Identifier);
-- Save the data object contained in the <b>Data</b> part element into the
-- target storage represented by <b>Into</b>.
procedure Save (Service : in Storage_Service;
Into : in out AWA.Storages.Models.Storage_Ref'Class;
Data : in ASF.Parts.Part'Class;
Storage : in AWA.Storages.Models.Storage_Type);
-- Save the file described <b>File</b> in the storage
-- object represented by <b>Into</b> and managed by the storage service.
procedure Save (Service : in Storage_Service;
Into : in out AWA.Storages.Models.Storage_Ref'Class;
File : in AWA.Storages.Storage_File;
Storage : in AWA.Storages.Models.Storage_Type);
-- Save the file pointed to by the <b>Path</b> string in the storage
-- object represented by <b>Into</b> and managed by the storage service.
procedure Save (Service : in Storage_Service;
Into : in out AWA.Storages.Models.Storage_Ref'Class;
Path : in String;
Storage : in AWA.Storages.Models.Storage_Type);
-- Load the storage instance identified by the given identifier.
procedure Load_Storage (Service : in Storage_Service;
Storage : in out AWA.Storages.Models.Storage_Ref'Class;
Id : in ADO.Identifier);
-- Load the storage instance stored in a folder and identified by a name.
procedure Load_Storage (Service : in Storage_Service;
Storage : in out AWA.Storages.Models.Storage_Ref'Class;
Folder : in ADO.Identifier;
Name : in String;
Found : out Boolean);
-- Load the storage content identified by <b>From</b> into the blob descriptor <b>Into</b>.
-- Raises the <b>NOT_FOUND</b> exception if there is no such storage.
procedure Load (Service : in Storage_Service;
From : in ADO.Identifier;
Name : out Ada.Strings.Unbounded.Unbounded_String;
Mime : out Ada.Strings.Unbounded.Unbounded_String;
Date : out Ada.Calendar.Time;
Into : out ADO.Blob_Ref);
-- Load the storage content into a file. If the data is not stored in a file, a temporary
-- file is created with the data content fetched from the store (ex: the database).
-- The `Mode` parameter indicates whether the file will be read or written.
-- The `Expire` parameter allows to control the expiration of the temporary file.
procedure Get_Local_File (Service : in Storage_Service;
From : in ADO.Identifier;
Mode : in Read_Mode := READ;
Into : in out Storage_File);
procedure Create_Local_File (Service : in out Storage_Service;
Into : in out AWA.Storages.Storage_File);
-- Deletes the storage instance.
procedure Delete (Service : in Storage_Service;
Storage : in out AWA.Storages.Models.Storage_Ref'Class);
-- Deletes the storage instance.
procedure Delete (Service : in Storage_Service;
Storage : in ADO.Identifier);
-- Publish or not the storage instance.
procedure Publish (Service : in Storage_Service;
Id : in ADO.Identifier;
State : in Boolean;
File : in out AWA.Storages.Models.Storage_Ref'Class);
private
type Store_Access_Array is
array (AWA.Storages.Models.Storage_Type) of AWA.Storages.Stores.Store_Access;
type Storage_Service is new AWA.Modules.Module_Manager with record
Stores : Store_Access_Array;
Database_Store : aliased AWA.Storages.Stores.Databases.Database_Store;
Temp_Id : Util.Concurrent.Counters.Counter;
end record;
end AWA.Storages.Services;
| 45.493976 | 97 | 0.637844 |
4178bbf6675ab2d8224d06eebe4830009f7dc1b7 | 1,829 | adb | Ada | src/nanomsg-pubsub.adb | landgraf/nanomsg-ada | 6abe8f517c53b2d4c030c4e2736f883371ef9270 | [
"MIT"
] | 2 | 2015-07-28T19:47:19.000Z | 2020-05-29T06:49:50.000Z | src/nanomsg-pubsub.adb | landgraf/nanomsg-ada | 6abe8f517c53b2d4c030c4e2736f883371ef9270 | [
"MIT"
] | 2 | 2015-11-28T14:02:13.000Z | 2017-10-05T09:21:35.000Z | src/nanomsg-pubsub.adb | landgraf/nanomsg-ada | 6abe8f517c53b2d4c030c4e2736f883371ef9270 | [
"MIT"
] | null | null | null | -- 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 Interfaces.C;
package body Nanomsg.Pubsub is
package C renames Interfaces.C;
procedure Subscribe (Socket : in out Nanomsg.Socket.Socket_T;
Topic : in String) is
begin
Nanomsg.Socket.Set_Option (Socket,
Level => Nanomsg.Sockopt.Option_Level_T (Nn_Sub),
Name => Nn_Sub_Subscribe,
Value => Topic);
end Subscribe;
procedure Unsubscribe (Socket : in out Nanomsg.Socket.Socket_T;
Topuc : in String) is
begin
null;
end Unsubscribe;
end Nanomsg.Pubsub;
| 40.644444 | 82 | 0.680153 |
06fb0a478ccc1af946dfb6e68756e245f84ffb73 | 16,955 | adb | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/comperr.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/comperr.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/comperr.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- C O M P E R R --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by AdaCore. --
-- --
------------------------------------------------------------------------------
-- This package contains routines called when a fatal internal compiler error
-- is detected. Calls to these routines cause termination of the current
-- compilation with appropriate error output.
with Atree; use Atree;
with Debug; use Debug;
with Errout; use Errout;
with Gnatvsn; use Gnatvsn;
with Lib; use Lib;
with Namet; use Namet;
with Opt; use Opt;
with Osint; use Osint;
with Output; use Output;
with Sinfo; use Sinfo;
with Sinput; use Sinput;
with Sprint; use Sprint;
with Sdefault; use Sdefault;
with Treepr; use Treepr;
with Types; use Types;
with Ada.Exceptions; use Ada.Exceptions;
with System.OS_Lib; use System.OS_Lib;
with System.Soft_Links; use System.Soft_Links;
package body Comperr is
----------------
-- Local Data --
----------------
Abort_In_Progress : Boolean := False;
-- Used to prevent runaway recursion if something segfaults
-- while processing a previous abort.
-----------------------
-- Local Subprograms --
-----------------------
procedure Repeat_Char (Char : Character; Col : Nat; After : Character);
-- Output Char until current column is at or past Col, and then output
-- the character given by After (if column is already past Col on entry,
-- then the effect is simply to output the After character).
--------------------
-- Compiler_Abort --
--------------------
procedure Compiler_Abort
(X : String;
Fallback_Loc : String := "";
From_GCC : Boolean := False)
is
-- The procedures below output a "bug box" with information about
-- the cause of the compiler abort and about the preferred method
-- of reporting bugs. The default is a bug box appropriate for
-- the FSF version of GNAT, but there are specializations for
-- the GNATPRO and Public releases by AdaCore.
XF : constant Positive := X'First;
-- Start index, usually 1, but we won't assume this
procedure End_Line;
-- Add blanks up to column 76, and then a final vertical bar
--------------
-- End_Line --
--------------
procedure End_Line is
begin
Repeat_Char (' ', 76, '|');
Write_Eol;
end End_Line;
Is_GPL_Version : constant Boolean := Gnatvsn.Build_Type = GPL;
Is_FSF_Version : constant Boolean := Gnatvsn.Build_Type = FSF;
-- Start of processing for Compiler_Abort
begin
Cancel_Special_Output;
-- Prevent recursion through Compiler_Abort, e.g. via SIGSEGV
if Abort_In_Progress then
Exit_Program (E_Abort);
end if;
Abort_In_Progress := True;
-- Generate a "standard" error message instead of a bug box in case
-- of CodePeer rather than generating a bug box, friendlier.
-- Note that the call to Error_Msg_N below sets Serious_Errors_Detected
-- to 1, so we use the regular mechanism below in order to display a
-- "compilation abandoned" message and exit, so we still know we have
-- this case (and -gnatdk can still be used to get the bug box).
if CodePeer_Mode
and then Serious_Errors_Detected = 0
and then not Debug_Flag_K
and then Sloc (Current_Error_Node) > No_Location
then
Error_Msg_N ("cannot generate 'S'C'I'L", Current_Error_Node);
end if;
-- If we are in CodePeer mode, we must also delete SCIL files
if CodePeer_Mode then
Delete_SCIL_Files;
end if;
-- If any errors have already occurred, then we guess that the abort
-- may well be caused by previous errors, and we don't make too much
-- fuss about it, since we want to let programmer fix the errors first.
-- Debug flag K disables this behavior (useful for debugging)
if Serious_Errors_Detected /= 0 and then not Debug_Flag_K then
Errout.Finalize (Last_Call => True);
Errout.Output_Messages;
Set_Standard_Error;
Write_Str ("compilation abandoned due to previous error");
Write_Eol;
Set_Standard_Output;
Source_Dump;
Tree_Dump;
Exit_Program (E_Errors);
-- Otherwise give message with details of the abort
else
Set_Standard_Error;
-- Generate header for bug box
Write_Char ('+');
Repeat_Char ('=', 29, 'G');
Write_Str ("NAT BUG DETECTED");
Repeat_Char ('=', 76, '+');
Write_Eol;
-- Output GNAT version identification
Write_Str ("| ");
Write_Str (Gnat_Version_String);
Write_Str (" (");
-- Output target name, deleting junk final reverse slash
if Target_Name.all (Target_Name.all'Last) = '\'
or else Target_Name.all (Target_Name.all'Last) = '/'
then
Write_Str (Target_Name.all (1 .. Target_Name.all'Last - 1));
else
Write_Str (Target_Name.all);
end if;
-- Output identification of error
Write_Str (") ");
if X'Length + Column > 76 then
if From_GCC then
Write_Str ("GCC error:");
end if;
End_Line;
Write_Str ("| ");
end if;
if X'Length > 70 then
declare
Last_Blank : Integer := 70;
begin
for P in 39 .. 68 loop
if X (XF + P) = ' ' then
Last_Blank := P;
end if;
end loop;
Write_Str (X (XF .. XF - 1 + Last_Blank));
End_Line;
Write_Str ("| ");
Write_Str (X (XF + Last_Blank .. X'Last));
end;
else
Write_Str (X);
end if;
if not From_GCC then
-- For exception case, get exception message from the TSD. Note
-- that it would be neater and cleaner to pass the exception
-- message (obtained from Exception_Message) as a parameter to
-- Compiler_Abort, but we can't do this quite yet since it would
-- cause bootstrap path problems for 3.10 to 3.11.
Write_Char (' ');
Write_Str (Exception_Message (Get_Current_Excep.all.all));
end if;
End_Line;
-- Output source location information
if Sloc (Current_Error_Node) <= No_Location then
if Fallback_Loc'Length > 0 then
Write_Str ("| Error detected around ");
Write_Str (Fallback_Loc);
else
Write_Str ("| No source file position information available");
end if;
End_Line;
else
Write_Str ("| Error detected at ");
Write_Location (Sloc (Current_Error_Node));
End_Line;
end if;
-- There are two cases now. If the file gnat_bug.box exists,
-- we use the contents of this file at this point.
declare
FD : File_Descriptor;
Lo : Source_Ptr;
Hi : Source_Ptr;
Src : Source_Buffer_Ptr;
begin
Namet.Unlock;
Name_Buffer (1 .. 12) := "gnat_bug.box";
Name_Len := 12;
Read_Source_File (Name_Enter, 0, Hi, Src, FD);
-- If we get a Src file, we use it
if not Null_Source_Buffer_Ptr (Src) then
Lo := 0;
Outer : while Lo < Hi loop
Write_Str ("| ");
Inner : loop
exit Inner when Src (Lo) = ASCII.CR
or else Src (Lo) = ASCII.LF;
Write_Char (Src (Lo));
Lo := Lo + 1;
end loop Inner;
End_Line;
while Lo <= Hi
and then (Src (Lo) = ASCII.CR
or else Src (Lo) = ASCII.LF)
loop
Lo := Lo + 1;
end loop;
end loop Outer;
-- Otherwise we use the standard fixed text
else
if Is_FSF_Version then
Write_Str
("| Please submit a bug report; see" &
" https://gcc.gnu.org/bugs/ .");
End_Line;
elsif Is_GPL_Version then
Write_Str
("| Please submit a bug report by email " &
"to [email protected].");
End_Line;
Write_Str
("| GAP members can alternatively use GNAT Tracker:");
End_Line;
Write_Str
("| https://www.adacore.com/login?mode=gap " &
"section 'Create New Ticket'.");
End_Line;
Write_Str
("| See gnatinfo.txt for full info on procedure " &
"for submitting bugs.");
End_Line;
else
Write_Str
("| Please submit a bug report using GNAT Tracker:");
End_Line;
Write_Str
("| https://www.adacore.com/login " &
"section 'Create New Ticket'.");
End_Line;
Write_Str
("| Or submit a bug report by email " &
"to [email protected]");
End_Line;
Write_Str
("| and include your customer number #nnn " &
"in the subject line.");
End_Line;
end if;
Write_Str
("| Use a subject line meaningful to you" &
" and us to track the bug.");
End_Line;
Write_Str
("| Include the entire contents of this bug " &
"box in the report.");
End_Line;
Write_Str
("| Include the exact command that you entered.");
End_Line;
Write_Str
("| Also include sources listed below.");
End_Line;
if not Is_FSF_Version then
Write_Str
("| Use plain ASCII or MIME attachment(s).");
End_Line;
end if;
end if;
end;
-- Complete output of bug box
Write_Char ('+');
Repeat_Char ('=', 76, '+');
Write_Eol;
if Debug_Flag_3 then
Write_Eol;
Write_Eol;
Print_Tree_Node (Current_Error_Node);
Write_Eol;
end if;
Write_Eol;
Write_Line ("Please include these source files with error report");
Write_Line ("Note that list may not be accurate in some cases, ");
Write_Line ("so please double check that the problem can still ");
Write_Line ("be reproduced with the set of files listed.");
Write_Line ("Consider also -gnatd.n switch (see debug.adb).");
Write_Eol;
begin
Dump_Source_File_Names;
-- If we blow up trying to print the list of file names, just output
-- informative msg and continue.
exception
when others =>
Write_Str ("list may be incomplete");
end;
Write_Eol;
Set_Standard_Output;
Tree_Dump;
Source_Dump;
raise Unrecoverable_Error;
end if;
end Compiler_Abort;
-----------------------
-- Delete_SCIL_Files --
-----------------------
procedure Delete_SCIL_Files is
Main : Node_Id;
Unit_Name : Node_Id;
Success : Boolean;
pragma Unreferenced (Success);
procedure Decode_Name_Buffer;
-- Replace "__" by "." in Name_Buffer, and adjust Name_Len accordingly
------------------------
-- Decode_Name_Buffer --
------------------------
procedure Decode_Name_Buffer is
J : Natural;
K : Natural;
begin
J := 1;
K := 0;
while J <= Name_Len loop
K := K + 1;
if J < Name_Len
and then Name_Buffer (J) = '_'
and then Name_Buffer (J + 1) = '_'
then
Name_Buffer (K) := '.';
J := J + 1;
else
Name_Buffer (K) := Name_Buffer (J);
end if;
J := J + 1;
end loop;
Name_Len := K;
end Decode_Name_Buffer;
-- Start of processing for Delete_SCIL_Files
begin
-- If parsing was not successful, no Main_Unit is available, so return
-- immediately.
if Main_Source_File <= No_Source_File then
return;
end if;
-- Retrieve unit name, and remove old versions of SCIL/<unit>.scil and
-- SCIL/<unit>__body.scil, ditto for .scilx files.
Main := Unit (Cunit (Main_Unit));
case Nkind (Main) is
when N_Package_Declaration
| N_Subprogram_Body
| N_Subprogram_Declaration
=>
Unit_Name := Defining_Unit_Name (Specification (Main));
when N_Package_Body =>
Unit_Name := Corresponding_Spec (Main);
when N_Package_Instantiation
| N_Package_Renaming_Declaration
=>
Unit_Name := Defining_Unit_Name (Main);
-- No SCIL file generated for generic package declarations
when N_Generic_Package_Declaration
| N_Generic_Package_Renaming_Declaration
=>
return;
-- Should never happen, but can be ignored in production
when others =>
pragma Assert (False);
return;
end case;
case Nkind (Unit_Name) is
when N_Defining_Identifier =>
Get_Name_String (Chars (Unit_Name));
when N_Defining_Program_Unit_Name =>
Get_Name_String (Chars (Defining_Identifier (Unit_Name)));
Decode_Name_Buffer;
-- Should never happen, but can be ignored in production
when others =>
pragma Assert (False);
return;
end case;
Delete_File
("SCIL/" & Name_Buffer (1 .. Name_Len) & ".scil", Success);
Delete_File
("SCIL/" & Name_Buffer (1 .. Name_Len) & ".scilx", Success);
Delete_File
("SCIL/" & Name_Buffer (1 .. Name_Len) & "__body.scil", Success);
Delete_File
("SCIL/" & Name_Buffer (1 .. Name_Len) & "__body.scilx", Success);
end Delete_SCIL_Files;
-----------------
-- Repeat_Char --
-----------------
procedure Repeat_Char (Char : Character; Col : Nat; After : Character) is
begin
while Column < Col loop
Write_Char (Char);
end loop;
Write_Char (After);
end Repeat_Char;
end Comperr;
| 31.51487 | 79 | 0.504984 |
2f81111af71fb34b150c9c282c0765cbddd981c6 | 12,433 | ads | Ada | source/asis/xasis/xasis-classes.ads | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | 4 | 2016-02-05T15:51:56.000Z | 2022-03-25T20:38:32.000Z | source/asis/xasis/xasis-classes.ads | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | null | null | null | source/asis/xasis/xasis-classes.ads | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- G E L A X A S I S --
-- ASIS implementation for Gela project, a portable Ada compiler --
-- http://gela.ada-ru.org --
-- - - - - - - - - - - - - - - - --
-- Read copyright and license at the end of this file --
------------------------------------------------------------------------------
-- $Revision: 209 $ $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $
-- Purpose:
-- Let you check if type is integer, scalar, string, etc
-- Be aware this unit dont get into account if type is private.
-- It always takes full view of the type.
with Asis;
package XASIS.Classes is
function Is_Elementary (Tipe : Asis.Declaration) return Boolean;
function Is_Scalar (Tipe : Asis.Declaration) return Boolean;
function Is_Discrete (Tipe : Asis.Declaration) return Boolean;
function Is_Enumeration (Tipe : Asis.Declaration) return Boolean;
function Is_Character (Tipe : Asis.Declaration) return Boolean;
function Is_Boolean (Tipe : Asis.Declaration) return Boolean;
function Is_Signed_Integer (Tipe : Asis.Declaration) return Boolean;
function Is_Modular_Integer (Tipe : Asis.Declaration) return Boolean;
function Is_Float_Point (Tipe : Asis.Declaration) return Boolean;
function Is_Ordinary_Fixed_Point (Tipe : Asis.Declaration) return Boolean;
function Is_Decimal_Fixed_Point (Tipe : Asis.Declaration) return Boolean;
function Is_Object_Access (Tipe : Asis.Declaration) return Boolean;
function Is_Subprogram_Access (Tipe : Asis.Declaration) return Boolean;
function Is_String (Tipe : Asis.Declaration) return Boolean;
function Is_Array (Tipe : Asis.Declaration) return Boolean;
function Is_Untagged_Record (Tipe : Asis.Declaration) return Boolean;
function Is_Tagged (Tipe : Asis.Declaration) return Boolean;
function Is_Task (Tipe : Asis.Declaration) return Boolean;
function Is_Protected (Tipe : Asis.Declaration) return Boolean;
function Is_Integer (Tipe : Asis.Declaration) return Boolean;
function Is_Real (Tipe : Asis.Declaration) return Boolean;
function Is_Fixed_Point (Tipe : Asis.Declaration) return Boolean;
function Is_Access (Tipe : Asis.Declaration) return Boolean;
function Is_Composite (Tipe : Asis.Declaration) return Boolean;
type Type_Info is private;
function Type_From_Declaration (Tipe : Asis.Declaration) return Type_Info;
function Type_From_Subtype_Mark (Mark : Asis.Expression) return Type_Info;
function Type_From_Indication (Ind : Asis.Definition) return Type_Info;
function Type_From_Discrete_Def (Def : Asis.Definition) return Type_Info;
function Type_Of_Declaration (Decl : Asis.Declaration) return Type_Info;
function Type_Of_Range (Lower, Upper : Asis.Expression) return Type_Info;
function Type_Of_Range (Lower, Upper : Type_Info) return Type_Info;
procedure Set_Class_Wide (Info : in out Type_Info);
function Is_Not_Type (Info : Type_Info) return Boolean;
function Is_Declaration (Info : Type_Info) return Boolean;
function Is_Definition (Info : Type_Info) return Boolean;
function Is_Class_Wide (Info : Type_Info) return Boolean;
function Is_Anonymous_Access (Info : Type_Info) return Boolean;
function Is_Elementary (Info : Type_Info) return Boolean;
function Is_Scalar (Info : Type_Info) return Boolean;
function Is_Discrete (Info : Type_Info) return Boolean;
function Is_Enumeration (Info : Type_Info) return Boolean;
function Is_Character (Info : Type_Info) return Boolean;
function Is_Boolean (Info : Type_Info) return Boolean;
function Is_Signed_Integer (Info : Type_Info) return Boolean;
function Is_Modular_Integer (Info : Type_Info) return Boolean;
function Is_Float_Point (Info : Type_Info) return Boolean;
function Is_Ordinary_Fixed_Point (Info : Type_Info) return Boolean;
function Is_Decimal_Fixed_Point (Info : Type_Info) return Boolean;
function Is_Constant_Access (Info : Type_Info) return Boolean;
function Is_Variable_Access (Info : Type_Info) return Boolean;
function Is_Object_Access (Info : Type_Info) return Boolean;
function Is_General_Access (Info : Type_Info) return Boolean;
function Is_Procedure_Access (Info : Type_Info) return Boolean;
function Is_Function_Access (Info : Type_Info) return Boolean;
function Is_Subprogram_Access (Info : Type_Info) return Boolean;
function Is_String (Info : Type_Info) return Boolean;
function Is_Array (Info : Type_Info) return Boolean;
function Is_Untagged_Record (Info : Type_Info) return Boolean;
function Is_Tagged (Info : Type_Info) return Boolean;
function Is_Task (Info : Type_Info) return Boolean;
function Is_Protected (Info : Type_Info) return Boolean;
function Is_Integer (Info : Type_Info) return Boolean;
function Is_Real (Info : Type_Info) return Boolean;
function Is_Fixed_Point (Info : Type_Info) return Boolean;
function Is_Numeric (Info : Type_Info) return Boolean;
function Is_Access (Info : Type_Info) return Boolean;
function Is_Composite (Info : Type_Info) return Boolean;
function Is_Universal (Info : Type_Info) return Boolean;
function Is_Incomplete (Info : Type_Info) return Boolean;
function Is_Array
(Info : Type_Info;
Length : Asis.List_Index) return Boolean;
function Get_Declaration (Info : Type_Info) return Asis.Declaration;
function Get_Definition (Info : Type_Info) return Asis.Definition;
-- Misc functions
function Is_Equal (Left, Right : Type_Info) return Boolean;
function Is_Covered
(Specific : Type_Info;
Class_Wide : Type_Info) return Boolean;
function Is_Expected_Type
(Specific : Type_Info;
Expected : Type_Info) return Boolean;
function Is_Subtype_Mark (Mark : Asis.Expression) return Boolean;
function Is_Type_Declaration (Decl : Asis.Declaration) return Boolean;
function Is_Constrained (Mark : Asis.Expression) return Boolean;
function Destination_Type (Info : Type_Info) return Type_Info;
function Debug_Image (Info : Type_Info) return Wide_String;
function Get_Array_Index_Type
(Info : Type_Info;
Index : Asis.List_Index := 1) return Type_Info;
function Get_Array_Element_Type (Tipe : Type_Info) return Type_Info;
Not_A_Type : constant Type_Info;
package T is
function Universal_Integer return Type_Info;
function Universal_Real return Type_Info;
function Universal_Fixed return Type_Info;
function Root_Integer return Type_Info;
function Root_Real return Type_Info;
function System_Address return Type_Info;
function System_Bit_Order return Type_Info;
function Integer return Type_Info;
function String return Type_Info;
function Wide_String return Type_Info;
function Boolean return Type_Info;
function Exception_Id return Type_Info;
function Task_Id return Type_Info;
function Root_Storage_Pool return Type_Info;
function Tag return Type_Info;
function Natural return Type_Info;
function Duration return Type_Info;
function Wide_Character return Type_Info;
function Character return Type_Info;
function Root_Stream_Type return Type_Info;
end T;
private
type Class_Kinds is
(A_Character,
A_Boolean,
An_Other_Enum,
An_Universal_Integer,
A_Signed_Integer,
A_Modular_Integer,
An_Universal_Real,
A_Float_Point,
An_Universal_Fixed,
A_Ordinary_Fixed_Point,
A_Decimal_Fixed_Point,
A_Constant_Access,
A_Variable_Access,
A_Pool_Access,
A_Procedure_Access,
A_Function_Access,
A_Universal_Access,
A_String,
An_Other_Array,
A_Untagged_Record,
A_Tagged,
A_Task,
A_Protected,
A_Private,
An_Incomplete);
subtype An_Elementary is Class_Kinds
range A_Character .. A_Universal_Access;
subtype A_Scalar is Class_Kinds
range A_Character .. A_Decimal_Fixed_Point;
subtype A_Discrete is Class_Kinds
range A_Character .. A_Modular_Integer;
subtype An_Enumeration is Class_Kinds
range A_Character .. An_Other_Enum;
subtype An_Integer is Class_Kinds
range An_Universal_Integer .. A_Modular_Integer;
subtype A_Real is Class_Kinds
range An_Universal_Real .. A_Decimal_Fixed_Point;
subtype A_Fixed_Point is Class_Kinds
range An_Universal_Fixed .. A_Decimal_Fixed_Point;
subtype A_Numeric is Class_Kinds
range An_Universal_Integer .. A_Decimal_Fixed_Point;
subtype An_Access is Class_Kinds
range A_Constant_Access .. A_Universal_Access;
subtype A_Subprogram_Access is Class_Kinds
range A_Procedure_Access .. A_Function_Access;
subtype An_Object_Access is Class_Kinds
range A_Constant_Access .. A_Pool_Access;
subtype A_General_Access is Class_Kinds
range A_Constant_Access .. A_Variable_Access;
subtype A_Composite is Class_Kinds
range A_String .. A_Private;
subtype An_Array is Class_Kinds
range A_String .. An_Other_Array;
function Type_Class (Tipe : Asis.Element) return Class_Kinds;
generic
Lower : Class_Kinds;
Upper : Class_Kinds;
With_Access : Boolean := False;
package Class_Range is
function Is_Class (Tipe : Asis.Declaration) return Boolean;
function Is_Class (Info : Type_Info) return Boolean;
end Class_Range;
type Type_Info is record
Element : Asis.Element;
Class_Kind : Class_Kinds;
Class_Wide : Boolean := False;
Definition : Boolean := False;
Is_Access : Boolean := False;
end record;
Not_A_Type : constant Type_Info :=
(Asis.Nil_Element, Class_Kinds'First, False, False, False);
end XASIS.Classes;
------------------------------------------------------------------------------
-- Copyright (c) 2006-2013, Maxim Reznik
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
-- modification, are permitted provided that the following conditions are met:
--
-- * Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
-- * Redistributions in binary form must reproduce the above copyright
-- notice, this list of conditions and the following disclaimer in the
-- documentation and/or other materials provided with the distribution.
-- * Neither the name of the Maxim Reznik, IE nor the names of its
-- contributors may be used to endorse or promote products derived from
-- this software without specific prior written permission.
--
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-- POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
| 45.210909 | 79 | 0.671519 |
41dc3447ef3b859c5774aadc8c922410a38aa91e | 1,480 | adb | Ada | tests/src/test_bindings.adb | onox/json-ada | 2800de3000500ac3815a593d58baded61bf462fa | [
"Apache-2.0"
] | 28 | 2016-07-30T23:00:19.000Z | 2021-09-24T01:48:18.000Z | tests/src/test_bindings.adb | onox/json-ada | 2800de3000500ac3815a593d58baded61bf462fa | [
"Apache-2.0"
] | 9 | 2018-01-14T15:18:34.000Z | 2021-09-23T14:37:22.000Z | tests/src/test_bindings.adb | onox/json-ada | 2800de3000500ac3815a593d58baded61bf462fa | [
"Apache-2.0"
] | 4 | 2018-11-11T03:11:01.000Z | 2021-09-23T02:17:03.000Z | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with AUnit.Reporter.Text;
with AUnit.Run;
with AUnit.Test_Suites;
with Test_Tokenizers;
with Test_Parsers;
with Test_Streams;
with Test_Images;
procedure Test_Bindings is
function Suite return AUnit.Test_Suites.Access_Test_Suite;
function Suite return AUnit.Test_Suites.Access_Test_Suite is
Result : constant AUnit.Test_Suites.Access_Test_Suite :=
AUnit.Test_Suites.New_Suite;
begin
Result.Add_Test (Test_Tokenizers.Suite);
Result.Add_Test (Test_Parsers.Suite);
Result.Add_Test (Test_Streams.Suite);
Result.Add_Test (Test_Images.Suite);
return Result;
end Suite;
procedure Runner is new AUnit.Run.Test_Runner (Suite);
Reporter : AUnit.Reporter.Text.Text_Reporter;
begin
Reporter.Set_Use_ANSI_Colors (True);
Runner (Reporter);
end Test_Bindings;
| 30.833333 | 76 | 0.743243 |
4194477c8dad9c71e98cf3bfb6043e8bbbf60469 | 885 | adb | Ada | stm32f0/stm32gd-clock-tree.adb | ekoeppen/STM32_Generic_Ada_Drivers | 4ff29c3026c4b24280baf22a5b81ea9969375466 | [
"MIT"
] | 1 | 2021-04-06T07:57:56.000Z | 2021-04-06T07:57:56.000Z | stm32f0/stm32gd-clock-tree.adb | ekoeppen/STM32_Generic_Ada_Drivers | 4ff29c3026c4b24280baf22a5b81ea9969375466 | [
"MIT"
] | null | null | null | stm32f0/stm32gd-clock-tree.adb | ekoeppen/STM32_Generic_Ada_Drivers | 4ff29c3026c4b24280baf22a5b81ea9969375466 | [
"MIT"
] | 2 | 2018-05-29T13:59:31.000Z | 2019-02-03T19:48:08.000Z | with STM32_SVD; use STM32_SVD;
with STM32_SVD.RCC; use STM32_SVD.RCC;
package body STM32GD.Clock.Tree is
function Frequency (Clock : Clock_Type) return Integer is
begin
case Clock is
when STM32GD.Clock.RTCCLK => return RTCCLK;
when STM32GD.Clock.SYSCLK => return SYSCLK;
when STM32GD.Clock.PCLK => return PCLK;
when STM32GD.Clock.HSI => return HSI_Value;
when STM32GD.Clock.LSI => return LSI_Value;
when STM32GD.Clock.LSE => return LSE_Value;
when STM32GD.Clock.PLLCLK => return PLL_Output_Value;
when STM32GD.Clock.HCLK => return HCLK;
end case;
end Frequency;
procedure Init is
begin
if LSI_Enabled then
RCC_Periph.CSR.LSION := 1;
while RCC_Periph.CSR.LSIRDY = 0 loop
null;
end loop;
end if;
end Init;
end STM32GD.Clock.Tree;
| 28.548387 | 62 | 0.641808 |
3d0f571dd4fd4733e12ce0d62bb6fc34587b2d93 | 14,792 | ads | Ada | arch/ARM/RP/svd/rp2040/rp_svd-rosc.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | arch/ARM/RP/svd/rp2040/rp_svd-rosc.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | arch/ARM/RP/svd/rp2040/rp_svd-rosc.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | -- Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
--
-- SPDX-License-Identifier: BSD-3-Clause
-- This spec has been automatically generated from rp2040.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package RP_SVD.ROSC is
pragma Preelaborate;
---------------
-- Registers --
---------------
-- Controls the number of delay stages in the ROSC ring\n LOW uses stages 0
-- to 7\n MEDIUM uses stages 0 to 5\n HIGH uses stages 0 to 3\n TOOHIGH
-- uses stages 0 to 1 and should not be used because its frequency exceeds
-- design specifications\n The clock output will not glitch when changing
-- the range up one step at a time\n The clock output will glitch when
-- changing the range down\n Note: the values here are gray coded which is
-- why HIGH comes before TOOHIGH
type CTRL_FREQ_RANGE_Field is
(-- Reset value for the field
Ctrl_Freq_Range_Field_Reset,
Low,
Medium,
Toohigh,
High)
with Size => 12;
for CTRL_FREQ_RANGE_Field use
(Ctrl_Freq_Range_Field_Reset => 2720,
Low => 4004,
Medium => 4005,
Toohigh => 4006,
High => 4007);
-- On power-up this field is initialised to ENABLE\n The system clock must
-- be switched to another source before setting this field to DISABLE
-- otherwise the chip will lock up\n The 12-bit code is intended to give
-- some protection against accidental writes. An invalid setting will
-- enable the oscillator.
type CTRL_ENABLE_Field is
(-- Reset value for the field
Ctrl_Enable_Field_Reset,
Disable,
Enable)
with Size => 12;
for CTRL_ENABLE_Field use
(Ctrl_Enable_Field_Reset => 0,
Disable => 3358,
Enable => 4011);
-- Ring Oscillator control
type CTRL_Register is record
-- Controls the number of delay stages in the ROSC ring\n LOW uses
-- stages 0 to 7\n MEDIUM uses stages 0 to 5\n HIGH uses stages 0 to 3\n
-- TOOHIGH uses stages 0 to 1 and should not be used because its
-- frequency exceeds design specifications\n The clock output will not
-- glitch when changing the range up one step at a time\n The clock
-- output will glitch when changing the range down\n Note: the values
-- here are gray coded which is why HIGH comes before TOOHIGH
FREQ_RANGE : CTRL_FREQ_RANGE_Field := Ctrl_Freq_Range_Field_Reset;
-- On power-up this field is initialised to ENABLE\n The system clock
-- must be switched to another source before setting this field to
-- DISABLE otherwise the chip will lock up\n The 12-bit code is intended
-- to give some protection against accidental writes. An invalid setting
-- will enable the oscillator.
ENABLE : CTRL_ENABLE_Field := Ctrl_Enable_Field_Reset;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for CTRL_Register use record
FREQ_RANGE at 0 range 0 .. 11;
ENABLE at 0 range 12 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype FREQA_DS0_Field is HAL.UInt3;
subtype FREQA_DS1_Field is HAL.UInt3;
subtype FREQA_DS2_Field is HAL.UInt3;
subtype FREQA_DS3_Field is HAL.UInt3;
-- Set to 0x9696 to apply the settings\n Any other value in this field will
-- set all drive strengths to 0
type FREQA_PASSWD_Field is
(-- Reset value for the field
Freqa_Passwd_Field_Reset,
Pass)
with Size => 16;
for FREQA_PASSWD_Field use
(Freqa_Passwd_Field_Reset => 0,
Pass => 38550);
-- The FREQA & FREQB registers control the frequency by controlling the
-- drive strength of each stage\n The drive strength has 4 levels
-- determined by the number of bits set\n Increasing the number of bits set
-- increases the drive strength and increases the oscillation frequency\n 0
-- bits set is the default drive strength\n 1 bit set doubles the drive
-- strength\n 2 bits set triples drive strength\n 3 bits set quadruples
-- drive strength
type FREQA_Register is record
-- Stage 0 drive strength
DS0 : FREQA_DS0_Field := 16#0#;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- Stage 1 drive strength
DS1 : FREQA_DS1_Field := 16#0#;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Stage 2 drive strength
DS2 : FREQA_DS2_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- Stage 3 drive strength
DS3 : FREQA_DS3_Field := 16#0#;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- Set to 0x9696 to apply the settings\n Any other value in this field
-- will set all drive strengths to 0
PASSWD : FREQA_PASSWD_Field := Freqa_Passwd_Field_Reset;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FREQA_Register use record
DS0 at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
DS1 at 0 range 4 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
DS2 at 0 range 8 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
DS3 at 0 range 12 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
PASSWD at 0 range 16 .. 31;
end record;
subtype FREQB_DS4_Field is HAL.UInt3;
subtype FREQB_DS5_Field is HAL.UInt3;
subtype FREQB_DS6_Field is HAL.UInt3;
subtype FREQB_DS7_Field is HAL.UInt3;
-- Set to 0x9696 to apply the settings\n Any other value in this field will
-- set all drive strengths to 0
type FREQB_PASSWD_Field is
(-- Reset value for the field
Freqb_Passwd_Field_Reset,
Pass)
with Size => 16;
for FREQB_PASSWD_Field use
(Freqb_Passwd_Field_Reset => 0,
Pass => 38550);
-- For a detailed description see freqa register
type FREQB_Register is record
-- Stage 4 drive strength
DS4 : FREQB_DS4_Field := 16#0#;
-- unspecified
Reserved_3_3 : HAL.Bit := 16#0#;
-- Stage 5 drive strength
DS5 : FREQB_DS5_Field := 16#0#;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Stage 6 drive strength
DS6 : FREQB_DS6_Field := 16#0#;
-- unspecified
Reserved_11_11 : HAL.Bit := 16#0#;
-- Stage 7 drive strength
DS7 : FREQB_DS7_Field := 16#0#;
-- unspecified
Reserved_15_15 : HAL.Bit := 16#0#;
-- Set to 0x9696 to apply the settings\n Any other value in this field
-- will set all drive strengths to 0
PASSWD : FREQB_PASSWD_Field := Freqb_Passwd_Field_Reset;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for FREQB_Register use record
DS4 at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
DS5 at 0 range 4 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
DS6 at 0 range 8 .. 10;
Reserved_11_11 at 0 range 11 .. 11;
DS7 at 0 range 12 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
PASSWD at 0 range 16 .. 31;
end record;
-- set to 0xaa0 + div where\n div = 0 divides by 32\n div = 1-31 divides by
-- div\n any other value sets div=0 and therefore divides by 32\n this
-- register resets to div=16
type DIV_DIV_Field is
(-- Reset value for the field
Div_Div_Field_Reset,
Pass)
with Size => 12;
for DIV_DIV_Field use
(Div_Div_Field_Reset => 0,
Pass => 2720);
-- Controls the output divider
type DIV_Register is record
-- set to 0xaa0 + div where\n div = 0 divides by 32\n div = 1-31 divides
-- by div\n any other value sets div=0 and therefore divides by 32\n
-- this register resets to div=16
DIV : DIV_DIV_Field := Div_Div_Field_Reset;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for DIV_Register use record
DIV at 0 range 0 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
subtype PHASE_SHIFT_Field is HAL.UInt2;
subtype PHASE_PASSWD_Field is HAL.UInt8;
-- Controls the phase shifted output
type PHASE_Register is record
-- phase shift the phase-shifted output by SHIFT input clocks\n this can
-- be changed on-the-fly\n must be set to 0 before setting div=1
SHIFT : PHASE_SHIFT_Field := 16#0#;
-- invert the phase-shifted output\n this is ignored when div=1
FLIP : Boolean := False;
-- enable the phase-shifted output\n this can be changed on-the-fly
ENABLE : Boolean := True;
-- set to 0xaa0\n any other value enables the output with shift=0
PASSWD : PHASE_PASSWD_Field := 16#0#;
-- unspecified
Reserved_12_31 : HAL.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for PHASE_Register use record
SHIFT at 0 range 0 .. 1;
FLIP at 0 range 2 .. 2;
ENABLE at 0 range 3 .. 3;
PASSWD at 0 range 4 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-- Ring Oscillator Status
type STATUS_Register is record
-- unspecified
Reserved_0_11 : HAL.UInt12 := 16#0#;
-- Read-only. Oscillator is enabled but not necessarily running and
-- stable\n this resets to 0 but transitions to 1 during chip startup
ENABLED : Boolean := False;
-- unspecified
Reserved_13_15 : HAL.UInt3 := 16#0#;
-- Read-only. post-divider is running\n this resets to 0 but transitions
-- to 1 during chip startup
DIV_RUNNING : Boolean := False;
-- unspecified
Reserved_17_23 : HAL.UInt7 := 16#0#;
-- Write data bit of one shall clear (set to zero) the corresponding bit
-- in the field. An invalid value has been written to CTRL_ENABLE or
-- CTRL_FREQ_RANGE or FRFEQA or FREQB or DORMANT
BADWRITE : Boolean := False;
-- unspecified
Reserved_25_30 : HAL.UInt6 := 16#0#;
-- Read-only. Oscillator is running and stable
STABLE : Boolean := False;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for STATUS_Register use record
Reserved_0_11 at 0 range 0 .. 11;
ENABLED at 0 range 12 .. 12;
Reserved_13_15 at 0 range 13 .. 15;
DIV_RUNNING at 0 range 16 .. 16;
Reserved_17_23 at 0 range 17 .. 23;
BADWRITE at 0 range 24 .. 24;
Reserved_25_30 at 0 range 25 .. 30;
STABLE at 0 range 31 .. 31;
end record;
-- This just reads the state of the oscillator output so randomness is
-- compromised if the ring oscillator is stopped or run at a harmonic of
-- the bus frequency
type RANDOMBIT_Register is record
-- Read-only.
RANDOMBIT : Boolean;
-- unspecified
Reserved_1_31 : HAL.UInt31;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for RANDOMBIT_Register use record
RANDOMBIT at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype COUNT_COUNT_Field is HAL.UInt8;
-- A down counter running at the ROSC frequency which counts to zero and
-- stops.\n To start the counter write a non-zero value.\n Can be used for
-- short software pauses when setting up time sensitive hardware.
type COUNT_Register is record
COUNT : COUNT_COUNT_Field := 16#0#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Object_Size => 32,
Bit_Order => System.Low_Order_First;
for COUNT_Register use record
COUNT at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
type ROSC_Peripheral is record
-- Ring Oscillator control
CTRL : aliased CTRL_Register;
-- The FREQA & FREQB registers control the frequency by controlling the
-- drive strength of each stage\n The drive strength has 4 levels
-- determined by the number of bits set\n Increasing the number of bits
-- set increases the drive strength and increases the oscillation
-- frequency\n 0 bits set is the default drive strength\n 1 bit set
-- doubles the drive strength\n 2 bits set triples drive strength\n 3
-- bits set quadruples drive strength
FREQA : aliased FREQA_Register;
-- For a detailed description see freqa register
FREQB : aliased FREQB_Register;
-- Ring Oscillator pause control\n This is used to save power by pausing
-- the ROSC\n On power-up this field is initialised to WAKE\n An invalid
-- write will also select WAKE\n Warning: setup the irq before selecting
-- dormant mode
DORMANT : aliased HAL.UInt32;
-- Controls the output divider
DIV : aliased DIV_Register;
-- Controls the phase shifted output
PHASE : aliased PHASE_Register;
-- Ring Oscillator Status
STATUS : aliased STATUS_Register;
-- This just reads the state of the oscillator output so randomness is
-- compromised if the ring oscillator is stopped or run at a harmonic of
-- the bus frequency
RANDOMBIT : aliased RANDOMBIT_Register;
-- A down counter running at the ROSC frequency which counts to zero and
-- stops.\n To start the counter write a non-zero value.\n Can be used
-- for short software pauses when setting up time sensitive hardware.
COUNT : aliased COUNT_Register;
end record
with Volatile;
for ROSC_Peripheral use record
CTRL at 16#0# range 0 .. 31;
FREQA at 16#4# range 0 .. 31;
FREQB at 16#8# range 0 .. 31;
DORMANT at 16#C# range 0 .. 31;
DIV at 16#10# range 0 .. 31;
PHASE at 16#14# range 0 .. 31;
STATUS at 16#18# range 0 .. 31;
RANDOMBIT at 16#1C# range 0 .. 31;
COUNT at 16#20# range 0 .. 31;
end record;
ROSC_Periph : aliased ROSC_Peripheral
with Import, Address => ROSC_Base;
end RP_SVD.ROSC;
| 38.62141 | 79 | 0.63122 |
df6aefc3fa26d557df4d64919592801e8bb8a2bb | 22,330 | adb | Ada | 3-mid/impact/source/3d/collision/dispatch/impact-d3-simulation_island_manager.adb | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 20 | 2015-11-04T09:23:59.000Z | 2022-01-14T10:21:42.000Z | 3-mid/impact/source/3d/collision/dispatch/impact-d3-simulation_island_manager.adb | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 2 | 2015-11-04T17:05:56.000Z | 2015-12-08T03:16:13.000Z | 3-mid/impact/source/3d/collision/dispatch/impact-d3-simulation_island_manager.adb | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 1 | 2015-12-07T12:53:52.000Z | 2015-12-07T12:53:52.000Z | with impact.d3.collision.overlapped_pair_Callback.cached;
with impact.d3.collision.Proxy;
-- #include "LinearMath/impact.d3.Scalar.h"
-- #include "impact.d3.simulation_island_Manager.h"
-- #include "BulletCollision/BroadphaseCollision/impact.d3.Dispatcher.h"
-- #include "BulletCollision/NarrowPhaseCollision/impact.d3.Manifold.h"
-- #include "BulletCollision/CollisionDispatch/impact.d3.Object.h"
-- #include "BulletCollision/CollisionDispatch/impact.d3.Space.h"
--
-- //#include <stdio.h>
-- #include "LinearMath/btQuickprof.h"
package body impact.d3.simulation_island_Manager
is
--- Forge
--
procedure destruct (Self : in out Item)
is
begin
null;
end destruct;
--- Attributes
--
procedure initUnionFind (Self : in out Item; n : in Integer)
is
begin
Self.m_unionFind.reset (n);
end initUnionFind;
function getUnionFind (Self : access Item) return impact.d3.union_Find.view
is
begin
return Self.m_unionFind'Access;
end getUnionFind;
procedure findUnions (Self : in out Item; dispatcher : access impact.d3.Dispatcher.item'Class;
colWorld : access impact.d3.Space.Item 'Class)
is
pragma Unreferenced (dispatcher);
use impact.d3.collision.overlapped_pair_Callback.cached, impact.d3.collision.overlapped_pair_Callback.cached.btBroadphasePair_Vectors;
pairCachePtr : constant access impact.d3.collision.overlapped_pair_Callback.cached.Item'Class := colWorld.getPairCache;
numOverlappingPairs : constant Integer := pairCachePtr.getNumOverlappingPairs;
pairPtr : btBroadphasePair_Vectors.Cursor; -- access impact.d3.collision.Proxy.btBroadphasePair;
begin
if numOverlappingPairs /= 0 then
pairPtr := pairCachePtr.getOverlappingPairArrayPtr;
for i in 1 .. numOverlappingPairs
loop
declare
use type impact.d3.Object.view;
collisionPair : impact.d3.collision.Proxy.btBroadphasePair renames Element (pairPtr).all; -- (i);
colObj0 : constant impact.d3.Object.view := impact.d3.Object.view (collisionPair.m_pProxy0.m_clientObject);
colObj1 : constant impact.d3.Object.view := impact.d3.Object.view (collisionPair.m_pProxy1.m_clientObject);
begin
if ( colObj0 /= null
and then (colObj0.mergesSimulationIslands))
and then ( colObj1 /= null
and then (colObj1.mergesSimulationIslands))
then
Self.m_unionFind.unite (colObj0.getIslandTag,
colObj1.getIslandTag);
end if;
end;
next (pairPtr);
end loop;
end if;
end findUnions;
procedure updateActivationState (Self : in out Item; colWorld : access impact.d3.Space.Item 'Class;
dispatcher : access impact.d3.Dispatcher.item'Class)
is
begin
if impact.d3.union_Find.STATIC_SIMULATION_ISLAND_OPTIMIZATION then
declare
index : Integer := 0; -- tbd: or 1 ?
collisionObject : access impact.d3.Object.item'Class;
begin
-- Put the index into m_controllers into m_tag.
--
for i in 1 .. Integer (colWorld.getCollisionObjectArray.Length)
loop
collisionObject := colWorld.getCollisionObjectArray.Element (i);
-- Adding filtering here
if not collisionObject.isStaticOrKinematicObject then
collisionObject.setIslandTag (index);
index := index + 1;
end if;
collisionObject.setCompanionId (-1);
collisionObject.setHitFraction (1.0);
end loop;
-- Do the union find.
--
Self.initUnionFind (index);
Self.findUnions (dispatcher, colWorld);
end;
else
raise Program_Error; -- tbd: (port this below, if really needed).
-- initUnionFind( int (colWorld->getCollisionObjectArray().size()));
--
-- // put the index into m_controllers into m_tag
-- {
--
-- int index = 0;
-- int i;
-- for (i=0;i<colWorld->getCollisionObjectArray().size(); i++)
-- {
-- impact.d3.Object* collisionObject= colWorld->getCollisionObjectArray()[i];
-- collisionObject->setIslandTag(index);
-- collisionObject->setCompanionId(-1);
-- collisionObject->setHitFraction(impact.d3.Scalar(1.));
-- index++;
--
-- }
-- }
-- // do the union find
--
-- findUnions(dispatcher,colWorld);
end if;
end updateActivationState;
procedure storeIslandActivationState (Self : in out Item; World : access impact.d3.Space.Item'Class)
is
begin
if impact.d3.union_Find.STATIC_SIMULATION_ISLAND_OPTIMIZATION then
-- put the islandId ('find' value) into m_tag
declare
index : Integer := 0; -- 1; -- island index
collisionObject : access impact.d3.Object.item'Class;
begin
for i in 1 .. Integer (World.getCollisionObjectArray.Length)
loop
collisionObject := World.getCollisionObjectArray.Element (i);
if not collisionObject.isStaticOrKinematicObject then
collisionObject.setIslandTag (Self.m_unionFind.find (index) - 0);
-- Set the correct object offset in Collision Object Array
--
Self.m_unionFind.getElement (index).m_sz := i - 1;
collisionObject.setCompanionId (-1);
index := index + 1;
else
collisionObject.setIslandTag (-1);
collisionObject.setCompanionId (-2);
end if;
end loop;
end;
else
raise Program_Error; -- tbd: (port this below, if really needed).
-- // put the islandId ('find' value) into m_tag
-- {
--
--
-- int index = 0;
-- int i;
-- for (i=0;i<colWorld->getCollisionObjectArray().size();i++)
-- {
-- impact.d3.Object* collisionObject= colWorld->getCollisionObjectArray()[i];
-- if (!collisionObject->isStaticOrKinematicObject())
-- {
-- collisionObject->setIslandTag( m_unionFind.find(index) );
-- collisionObject->setCompanionId(-1);
-- } else
-- {
-- collisionObject->setIslandTag(-1);
-- collisionObject->setCompanionId(-2);
-- }
-- index++;
-- }
-- }
end if;
end storeIslandActivationState;
function getSplitIslands (Self : in Item) return Boolean
is
begin
return Self.m_splitIslands;
end getSplitIslands;
procedure setSplitIslands (Self : in out Item; doSplitIslands : in Boolean)
is
begin
Self.m_splitIslands := doSplitIslands;
end setSplitIslands;
--- Operations
--
function getIslandId (lhs : in impact.d3.Manifold.view) return Integer
is
islandId : Integer;
rcolObj0 : constant impact.d3.Object.view := impact.d3.Object.view (lhs.getBody0);
rcolObj1 : constant impact.d3.Object.view := impact.d3.Object.view (lhs.getBody1);
begin
if rcolObj0.getIslandTag >= 0 then
islandId := rcolObj0.getIslandTag;
else
islandId := rcolObj1.getIslandTag;
end if;
return islandId;
end getIslandId;
-- /// function object that routes calls to operator<
-- class impact.d3.ManifoldSortPredicate
-- {
-- public:
--
-- SIMD_FORCE_INLINE bool operator() ( const impact.d3.Manifold* lhs, const impact.d3.Manifold* rhs )
-- {
-- return getIslandId(lhs) < getIslandId(rhs);
-- }
-- };
-- todo: this is random access, it can be walked 'cache friendly'!
procedure buildAndProcessIslands (Self : access Item; dispatcher : access impact.d3.Dispatcher.item'Class;
colWorld : access impact.d3.Space.Item 'Class;
callback : access IslandCallback 'Class)
is
collisionObjects : constant access impact.d3.Object.Vector := colWorld.getCollisionObjectArray;
endIslandIndex : Integer := 1; -- or 2 ?
startIslandIndex : Integer;
numElem : Integer;
begin
Self.buildIslands (dispatcher, colWorld);
numElem := Self.getUnionFind.getNumElements;
if not Self.m_splitIslands then
declare
manifold : constant access impact.d3.Manifold.Vector := dispatcher.getInternalManifoldPointer;
maxNumManifolds : Integer := dispatcher.getNumManifolds;
begin
callback.ProcessIsland (collisionObjects,
-- collisionObjects.Length,
manifold,
-- maxNumManifolds,
-1);
end;
else
declare
-- Sort manifolds, based on islands
-- Sort the vector using predicate and std::sort
-- std::sort(islandmanifold.begin(), islandmanifold.end(), impact.d3.ManifoldSortPredicate);
numManifolds : constant Integer := Integer (Self.m_islandmanifold.Length);
-- now process all active islands (sets of manifolds for now)
startManifoldIndex : Integer := 1;
endManifoldIndex : Integer := 2;
islandId : Integer;
islandSleeping : Boolean;
function "<" (L, R : in impact.d3.Manifold.View) return Boolean
is
begin
return getIslandId (l) < getIslandId (r);
end "<";
package Sorter is new impact.d3.Manifold.Vectors.generic_Sorting ("<");
begin
-- we should do radix sort, it it much faster (O(n) instead of O (n log2(n))
Sorter.sort (Self.m_islandmanifold);
-- traverse the simulation islands, and call the solver, unless all objects are sleeping/deactivated
startIslandIndex := 0; -- or 1 ?
while startIslandIndex < numElem -- for ( startIslandIndex=0; startIslandIndex<numElem; startIslandIndex = endIslandIndex)
loop
islandId := Self.getUnionFind.getElement (startIslandIndex).m_id;
islandSleeping := True;
endIslandIndex := startIslandIndex;
while endIslandIndex < numElem
and then Self.getUnionFind.getElement (endIslandIndex).m_id = islandId
-- for (endIslandIndex = startIslandIndex;
-- (endIslandIndex<numElem) && (getUnionFind().getElement(endIslandIndex).m_id == islandId);
-- endIslandIndex++)
loop
declare
i : constant Integer := Self.getUnionFind.getElement (endIslandIndex).m_sz;
colObj0 : constant impact.d3.Object.view := collisionObjects.Element (i + 1); -- or +0 ?
begin
Self.m_islandBodies.append (colObj0);
if colObj0.isActive then
islandSleeping := False;
end if;
end;
endIslandIndex := endIslandIndex + 1;
end loop;
-- Find the accompanying contact manifold for this islandId.
--
declare
numIslandManifolds : Integer := 0;
startManifold : impact.d3.Manifold.Vector; -- := 0;
curIslandId : Integer;
begin
if startManifoldIndex < numManifolds then
curIslandId := getIslandId (Self.m_islandmanifold.Element (startManifoldIndex));
if curIslandId = islandId then
-- startManifold := Self.m_islandmanifold (startManifoldIndex)'access;
endManifoldIndex := startManifoldIndex + 1;
while endManifoldIndex < numManifolds
and then islandId = getIslandId (Self.m_islandmanifold.Element (endManifoldIndex))
loop
endManifoldIndex := endManifoldIndex + 1;
end loop;
-- Process the actual simulation, only if not sleeping/deactivated
numIslandManifolds := endManifoldIndex - startManifoldIndex;
end if;
end if;
if not islandSleeping then
declare
the_Manifolds : aliased impact.d3.Manifold.Vector;
begin
if numManifolds > 0 then
for i in 1 .. numManifolds -- startManifoldIndex .. endManifoldIndex - 1 -- tbd: ?
loop
the_Manifolds.append (Self.m_islandmanifold.Element (i));
end loop;
end if;
callback.ProcessIsland (Self.m_islandBodies'Access,
-- Self.m_islandBodies.Length,
the_Manifolds'Access, -- startManifold,
-- numIslandManifolds,
islandId);
end;
end if;
if numIslandManifolds /= 0 then
startManifoldIndex := endManifoldIndex;
end if;
Self.m_islandBodies.reserve_Capacity (0); -- resize (0);
Self.m_islandBodies.clear;
startIslandIndex := endIslandIndex;
end;
end loop;
end;
end if;
end buildAndProcessIslands;
procedure buildIslands (Self : access Item; dispatcher : access impact.d3.Dispatcher.item'Class;
colWorld : access impact.d3.Space.Item 'Class)
is
use impact.d3.Manifold.Vectors;
collisionObjects : constant access impact.d3.Object.Vector := colWorld.getCollisionObjectArray;
numElem,
endIslandIndex,
startIslandIndex : Integer;
begin
Self.m_islandmanifold.reserve_Capacity (0); -- resize(0);
Self.m_islandmanifold.clear; -- resize(0);
-- we are going to sort the unionfind array, and store the element id in the size
-- afterwards, we clean unionfind, to make sure no-one uses it anymore
Self.getUnionFind.sortIslands;
numElem := Self.getUnionFind.getNumElements;
endIslandIndex := 1; -- or 2 ?
-- update the sleeping state for bodies, if all are sleeping
startIslandIndex := 0; -- or 1 ?
while startIslandIndex < numElem
loop
declare
islandId : constant Integer := Self.getUnionFind.getElement (startIslandIndex).m_id - 0;
allSleeping : Boolean := True;
begin
endIslandIndex := startIslandIndex + 1;
while endIslandIndex < numElem
and then Self.getUnionFind.getElement (endIslandIndex).m_id = islandId
loop
endIslandIndex := endIslandIndex + 1;
end loop;
-- int numSleeping = 0;
for idx in startIslandIndex .. endIslandIndex - 1
loop
declare
i : constant Integer := Self.getUnionFind.getElement (idx).m_sz;
colObj0 : constant impact.d3.Object.view := collisionObjects.Element (i + 1); -- or +0 ?
begin
if colObj0.getIslandTag /= islandId
and then colObj0.getIslandTag /= -1
then
raise Constraint_Error with "error in island management";
end if;
pragma Assert ( colObj0.getIslandTag = islandId
or else colObj0.getIslandTag = -1);
if colObj0.getIslandTag = islandId then
if colObj0.getActivationState = impact.d3.Object.ACTIVE_TAG then
allSleeping := False; -- tbd: add an 'exit' here for performance ?
end if;
if colObj0.getActivationState = impact.d3.Object.DISABLE_DEACTIVATION then
allSleeping := False; -- tbd: add an 'exit' here for performance ?
end if;
end if;
end;
end loop;
if allSleeping then
for idx in startIslandIndex .. endIslandIndex - 1
loop
declare
i : constant Integer := Self.getUnionFind.getElement (idx).m_sz;
colObj0 : constant impact.d3.Object.view := collisionObjects.Element (i + 1); -- or +0 ?
begin
if colObj0.getIslandTag /= islandId
and then colObj0.getIslandTag /= -1
then
raise Constraint_Error with "error in island management";
end if;
pragma Assert ( colObj0.getIslandTag = islandId
or else colObj0.getIslandTag = -1);
if colObj0.getIslandTag = islandId then
colObj0.setActivationState (impact.d3.Object.ISLAND_SLEEPING);
end if;
end;
end loop;
else
for idx in startIslandIndex .. endIslandIndex - 1
loop
declare
i : constant Integer := Self.getUnionFind.getElement (idx).m_sz;
colObj0 : constant impact.d3.Object.view := collisionObjects.Element (i + 1); -- or +0 ?
begin
if colObj0.getIslandTag /= islandId
and then colObj0.getIslandTag /= -1
then
raise Constraint_Error with "error in island management";
end if;
pragma Assert ( colObj0.getIslandTag = islandId
or else colObj0.getIslandTag = -1);
if colObj0.getIslandTag = islandId then
if colObj0.getActivationState = impact.d3.Object.ISLAND_SLEEPING then
colObj0.setActivationState (impact.d3.Object.WANTS_DEACTIVATION);
colObj0.setDeactivationTime (0.0);
end if;
end if;
end;
end loop;
end if;
startIslandIndex := endIslandIndex;
end;
end loop;
declare
maxNumManifolds : constant Integer := dispatcher.getNumManifolds;
begin
for i in 1 .. maxNumManifolds
loop
declare
use type impact.d3.Object.view;
manifold : constant impact.d3.Manifold.view := dispatcher.getManifoldByIndexInternal (i);
colObj0 : constant impact.d3.Object.view := impact.d3.Object.view (manifold.getBody0);
colObj1 : constant impact.d3.Object.view := impact.d3.Object.view (manifold.getBody1);
begin
-- @todo: check sleeping conditions!
if (colObj0 /= null and then colObj0.getActivationState /= impact.d3.Object.ISLAND_SLEEPING)
or else (colObj1 /= null and then colObj1.getActivationState /= impact.d3.Object.ISLAND_SLEEPING)
then
-- kinematic objects don't merge islands, but wake up all connected objects
--
if colObj0.isKinematicObject
and then colObj0.getActivationState /= impact.d3.Object.ISLAND_SLEEPING
then
colObj1.activate;
end if;
if colObj1.isKinematicObject
and then colObj1.getActivationState /= impact.d3.Object.ISLAND_SLEEPING
then
colObj0.activate;
end if;
if Self.m_splitIslands then
-- filtering for response
if dispatcher.needsResponse (colObj0, colObj1) then
Self.m_islandmanifold.append (manifold);
end if;
end if;
end if;
end;
end loop;
end;
end buildIslands;
end impact.d3.simulation_island_Manager;
| 34.091603 | 145 | 0.517062 |
578236509bfedb653a6bed2073758fb2efd72f00 | 7,623 | ads | Ada | tools/ayacc/src/command_line_interface.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | lib/ayacc/command_line_interface.ads | alvaromb/Compilemon | de5f88f084705868d38e301d95bb4a19a46a1156 | [
"MIT"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | lib/ayacc/command_line_interface.ads | alvaromb/Compilemon | de5f88f084705868d38e301d95bb4a19a46a1156 | [
"MIT"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | -- Copyright (c) 1990 Regents of the University of California.
-- All rights reserved.
--
-- The primary authors of ayacc were David Taback and Deepak Tolani.
-- Enhancements were made by Ronald J. Schmalz.
--
-- Send requests for ayacc information to [email protected]
-- Send bug reports for ayacc to [email protected]
--
-- Redistribution and use in source and binary forms are permitted
-- provided that the above copyright notice and this paragraph are
-- duplicated in all such forms and that any documentation,
-- advertising materials, and other materials related to such
-- distribution and use acknowledge that the software was developed
-- by the University of California, Irvine. The name of the
-- University may not be used to endorse or promote products derived
-- from this software without specific prior written permission.
-- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
-- IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
-- WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-- Module : command_line_interface_.ada
-- Component of : common_library
-- Version : 1.2
-- Date : 11/21/86 16:03:08
-- SCCS File : disk21~/rschm/hasee/sccs/common_library/sccs/sxcommand_line_interface_.ada
with String_Lists; use String_Lists;
with String_pkg; use String_pkg;
--------------------------------------------------------------------
Package command_line_interface is
--| Provides primitives for getting at the command line arguments.
--| Overview
--| This package provides a universal and portable interface to
--| the arguments typed on a command line when a program is invoked.
--| Each command line argument is either a Word (sequence of non-blank
--| characters) or a quoted string, with embedded quotes doubled.
--|
--| Both named and positional arguments may be given on the command
--| line. However, once a named parameter is used, all the subseqent
--| parameters on the command line must be named parameters. For example,
--| the commands
--|-
--| compile abc pqr xyz library => plib
--| compile abc,pqr,unit=>xyz,library=>plib
--|+
--| have one named argument and three positional arguments. This
--| package separates the named parameters from the positional
--| parameters, ignores spaces around the "bound to" (=>) symbol, and
--| allows parameters to be separated by either spaces or commas,
--| so these command lines are indistinguishable.
--|
--| At program elaboration time, the command line string is automatically
--| obtained from the host operating system and parsed into
--| individual arguments. The following operations may then be used:
--|-
--| Named_arg_count() Returns number of named arguments entered
--| Positional_arg_count() Returns number of positional arguments
--| Positional_arg_value(N) Returns the Nth positional argument
--| Named_arg_value(Name, Dflt) Returns value of a named argument
--| Arguments() Returns the entire command line
--|+
----------------------------------------------------------------
max_args: constant := 255;
--| Maximum number of command line arguments (arbitrary).
subtype Argument_count is integer range 0..max_args;
--| For number of arguments
subtype Argument_index is Argument_count range 1..Argument_count'last;
--| Used to number the command line arguments.
no_arg: exception;
--| Raised when request made for nonexistent argument
missing_positional_arg: exception;
--| Raised when command line is missing positional argument (A,,B)
invalid_named_association: exception;
--| Raised when command line is missing named argument value (output=> ,A,B)
unreferenced_named_arg: exception;
--| Raised when not all named parameters have been retrieved
invalid_parameter_order: exception;
--| Raised when a positional parameter occurs after a named parameter
-- in the command line
--Invalid_Aggregate : exception;
--| Raised when an aggregate does not begin and end with parentheses
-- in Parse_Aggregate.
Unbalanced_Parentheses : exception;
--| Raised when the number of left paren's does not match the number
--| of right paren's.
Invalid_Parameter : exception;
--| Raised when the conversion of a string to a parameter type is not
--| possible.
----------------------------------------------------------------
procedure Initialize (Tool_Name : in String);
--| Initializes command_line_interface
--| N/A: modifies, errors, raises
---------------------------------------------------------------------
function Named_arg_count --| Return number of named arguments
return Argument_count;
--| N/A: modifies, errors, raises
function Positional_arg_count --| Return number of positional arguments
return Argument_count;
--| N/A: modifies, errors, raises
----------------------------------------------------------------
function Positional_arg_value( --| Return an argument value
N: Argument_index --| Position of desired argument
) return string; --| Raises: no_arg
--| Effects: Return the Nth argument. If there is no argument at
--| position N, no_arg is raised.
--| N/A: modifies, errors
function Positional_arg_value( --| Return an argument value
N: Argument_index --| Position of desired argument
) return String_type; --| Raises: no_arg
--| Effects: Return the Nth argument. If there is no argument at
--| position N, no_arg is raised.
--| N/A: modifies, errors
--------------------------------------------------------------------
function Named_arg_value(--| Return a named argument value
Name: string;
Default: string
) return string;
--| Effects: Return the value associated with Name on the command
--| line. If there was none, return Default.
--| N/A: modifies, errors
function Named_arg_value(--| Return a named argument value
Name: string;
Default: string
) return String_Type;
--| Effects: Return the value associated with Name on the command
--| line. If there was none, return Default.
--| N/A: modifies, errors
function Named_arg_value(--| Return a named argument value
Name: string;
Default: String_type
) return String_type;
--| Effects: Return the value associated with Name on the command
--| line. If there was none, return Default.
--| N/A: modifies, errors
----------------------------------------------------------------
function Arguments --| Return the entire argument string
return string;
--| Effects: Return the entire command line, except for the name
--| of the command itself.
--| N/A: modifies, errors, raises
----------------------------------------------------------------
function Parse_Aggregate (Aggregate_Text : in String_Type)
return String_Lists.List;
function Parse_Aggregate (Aggregate_Text : in String)
return String_Lists.List;
--| Effects: Returns components of Aggregate_Text as a String_List.
--| Raises : Invalid_Aggregate
----------------------------------------------------------------
generic
type Parameter_Type is (<>);
Type_Name : in String;
function Convert (Parameter_Text : in String) return Parameter_Type;
--| Raises: Invalid_Parameter
----------------------------------------------------------------
procedure Finalize ; --| Raises: unrecognized parameters
--| Effects: If not all named parameters have been retrieved
--| unrecognized parameters is raised.
--| N/A: modifies, errors
end command_line_interface;
----------------------------------------------------------------
| 35.455814 | 92 | 0.658927 |
418ac3b6ea2d6f3a803519ff3781348b30f54b13 | 3,695 | ads | Ada | tools/scitools/conf/understand/ada/ada12/s-wwdwch.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | tools/scitools/conf/understand/ada/ada12/s-wwdwch.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | tools/scitools/conf/understand/ada/ada12/s-wwdwch.ads | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . W W D _ W C H A R --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2009 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains routines for [Wide_]Wide_Character'[Wide_]Wide_Width
package System.Wwd_WChar is
pragma Pure;
function Wide_Width_Wide_Character
(Lo, Hi : Wide_Character) return Natural;
-- Compute Wide_Width attribute for non-static type derived from
-- Wide_Character. The arguments are the low and high bounds for
-- the type. EM is the wide-character encoding method.
function Wide_Width_Wide_Wide_Character
(Lo, Hi : Wide_Wide_Character) return Natural;
-- Compute Wide_Width attribute for non-static type derived from
-- Wide_Wide_Character. The arguments are the low and high bounds for
-- the type. EM is the wide-character encoding method.
function Wide_Wide_Width_Wide_Character
(Lo, Hi : Wide_Character) return Natural;
-- Compute Wide_Wide_Width attribute for non-static type derived from
-- Wide_Character. The arguments are the low and high bounds for
-- the type. EM is the wide-character encoding method.
function Wide_Wide_Width_Wide_Wide_Char
(Lo, Hi : Wide_Wide_Character) return Natural;
-- Compute Wide_Wide_Width attribute for non-static type derived from
-- Wide_Wide_Character. The arguments are the low and high bounds for
-- the type. EM is the wide-character encoding method.
end System.Wwd_WChar;
| 59.596774 | 78 | 0.459269 |
3d67c88c03fcf5d43bda804c725df4e02976bfef | 4,572 | adb | Ada | thirdparty/adasdl/thin/adasdl/AdaSDL_mixer/playwave.adb | Lucretia/old_nehe_ada95 | d0378c3bfce202eb01bf00b57c128735dbe8582d | [
"BSD-3-Clause"
] | null | null | null | thirdparty/adasdl/thin/adasdl/AdaSDL_mixer/playwave.adb | Lucretia/old_nehe_ada95 | d0378c3bfce202eb01bf00b57c128735dbe8582d | [
"BSD-3-Clause"
] | null | null | null | thirdparty/adasdl/thin/adasdl/AdaSDL_mixer/playwave.adb | Lucretia/old_nehe_ada95 | d0378c3bfce202eb01bf00b57c128735dbe8582d | [
"BSD-3-Clause"
] | null | null | null |
--
-- PLAYWAVE: Port to the Ada programming language of a test application for the
-- the SDL mixer library.
--
-- The original code was written in C by Sam Lantinga http://www.libsdl.org.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
--
-- Ada code written by:
-- Antonio M. F. Vargas --
-- Ponta Delgada - Azores - Portugal --
-- E-mail: [email protected] --
-- http://www.adapower.net/~avargas --
with System.OS_Interface;
with Interfaces.C;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Command_Line;
with Ada.Characters.Handling;
with GNAT.OS_Lib;
with Lib_C;
with SDL.Audio;
with SDL.Types; use SDL.Types;
with SDL.Audio;
with SDL_Mixer;
with SDL.Quit;
with SDL.Timer;
with PlayWave_Sprogs; use PlayWave_Sprogs;
procedure PlayWave is
package CL renames Ada.Command_Line;
package CH renames Ada.Characters.Handling;
package C renames Interfaces.C;
use type C.int;
package A renames SDL.Audio;
use type A.Format_Flag;
package Mix renames SDL_Mixer;
use type Mix.Chunk_ptr;
package T renames SDL.Timer;
audio_rate : C.int;
audio_format : A.Format_Flag;
audio_channels : C.int;
loops : C.int := 0;
i : Integer;
begin
-- Initialize variables
audio_rate := 22050;
audio_format := A.AUDIO_S16;
audio_channels := 2;
-- Check command line usage
i := 1;
while (i <= CL.Argument_Count)
and then (CL.Argument (i) (1) = '-') loop
if CL.Argument (i) = "-r"
and then CL.Argument_Count >= i + 1
and then CH.Is_Digit (CL.Argument (i + 1) (1)) then
i := i + 1;
declare
package int_IO is new Ada.Text_IO.Integer_IO (C.int);
use int_IO;
last : Positive;
begin
Get (CL.Argument (i), audio_rate, last);
end;
elsif CL.Argument (i) = "-m" then
audio_channels := 1;
elsif CL.Argument (i) = "-l" then
loops := -1;
elsif CL.Argument (i) = "-8" then
audio_format := A.AUDIO_U8;
else
Usage (US.To_Unbounded_String (CL.Command_Name));
GNAT.OS_Lib.OS_Exit (1);
end if;
i := i + 1;
end loop;
if CL.Argument_Count < i then
Usage (US.To_Unbounded_String (CL.Command_Name));
GNAT.OS_Lib.OS_Exit (1);
end if;
-- Initialize the SDL library
if SDL.Init (SDL.INIT_AUDIO) < 0 then
Put_Line ("Couldn't initialize SDL: " & Mix.Get_Error);
GNAT.OS_Lib.OS_Exit (255);
end if;
SDL.Quit.atexit (CleanUp'Access);
Lib_C.Set_Signal (System.OS_Interface.SIGINT, the_exit'Access);
Lib_C.Set_Signal (System.OS_Interface.SIGTERM, the_exit'Access);
-- Open the audio device
if Mix.OpenAudio (audio_rate, audio_format, audio_channels, 4096) < 0 then
Put_Line ("Couldn't open audio: " & Mix.Get_Error);
GNAT.OS_Lib.OS_Exit (2);
else
Mix.Query_Spec (audio_rate, audio_format, audio_channels);
Put ("Opened audio at " & C.int'Image (audio_rate)
& " Hz " & A.Format_Flag'Image (audio_format and 16#FF#) & " bit ");
if audio_channels > 1 then
Put ("stereo, ");
else
Put ("mono, ");
end if;
if loops /= 0 then
Put_Line (" (looping)");
else
New_Line;
end if;
end if;
audio_open := True;
-- Load the requested wave file
wave := Mix.Load_WAV (CL.Argument (i));
if wave = Mix.null_Chunk_ptr then
Put_Line ("Couldn't load " & CL.Argument (i) & ": " & Mix.Get_Error);
GNAT.OS_Lib.OS_Exit (2);
end if;
-- Play and then exit
Mix.PlayChannel (0, wave, loops);
while Mix.Playing (0) /= 0 loop
T.SDL_Delay (100);
end loop;
GNAT.OS_Lib.OS_Exit (0);
end PlayWave;
| 30.278146 | 82 | 0.612861 |
2f70f3cb9fef72e2637b39f213d2ae4b1bdec9bc | 4,131 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce2103c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce2103c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/ce/ce2103c.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- CE2103C.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT IS_OPEN RETURNS THE PROPER VALUES FOR FILES OF
-- TYPE SEQUENTIAL_IO.
-- B) OPENED FILES
-- APPLICABILITY CRITERIA:
-- THIS TEST IS APPLICABLE ONLY TO IMPLEMENTATIONS WHICH SUPPORT
-- SEQUENTIAL FILES.
-- HISTORY:
-- SPW 08/10/87 CREATED ORIGINAL TEST.
WITH REPORT; USE REPORT;
WITH SEQUENTIAL_IO;
PROCEDURE CE2103C IS
PACKAGE SEQ_IO IS NEW SEQUENTIAL_IO(CHARACTER);
USE SEQ_IO;
INCOMPLETE : EXCEPTION;
TEST_FILE_ONE : SEQ_IO.FILE_TYPE;
VAL : BOOLEAN;
BEGIN
TEST ("CE2103C", "CHECK THAT IS_OPEN RETURNS THE PROPER " &
"VALUES FOR FILES OF TYPE SEQUENTIAL_IO");
-- FOLLOWING A CREATE
VAL := FALSE;
BEGIN
CREATE (TEST_FILE_ONE, OUT_FILE, LEGAL_FILE_NAME);
EXCEPTION
WHEN USE_ERROR =>
NOT_APPLICABLE ("USE_ERROR RAISED ON CREATE WITH " &
"OUT_FILE MODE");
RAISE INCOMPLETE;
WHEN NAME_ERROR =>
NOT_APPLICABLE ("NAME_ERROR RAISED ON CREATE WITH " &
"OUT_FILE MODE");
RAISE INCOMPLETE;
END;
VAL := IS_OPEN (TEST_FILE_ONE);
IF VAL = FALSE THEN
FAILED ("IS_OPEN RETURNS FALSE AFTER CREATE");
END IF;
-- FOLLOWING CLOSE
VAL := TRUE;
CLOSE (TEST_FILE_ONE);
VAL := IS_OPEN (TEST_FILE_ONE);
IF VAL = TRUE THEN
FAILED ("IS_OPEN RETURNS TRUE AFTER CLOSE");
END IF;
-- FOLLOWING OPEN
VAL := FALSE;
BEGIN
OPEN (TEST_FILE_ONE, IN_FILE, LEGAL_FILE_NAME);
EXCEPTION
WHEN USE_ERROR =>
IF IS_OPEN (TEST_FILE_ONE) /= FALSE THEN
FAILED ("IS_OPEN GIVES TRUE ON " &
"UNSUCESSFUL OPEN");
END IF;
RAISE INCOMPLETE;
END;
VAL := IS_OPEN (TEST_FILE_ONE);
IF VAL = FALSE THEN
FAILED ("IS_OPEN RETURNS FALSE AFTER OPEN");
END IF;
-- AFTER RESET
VAL := FALSE;
BEGIN
RESET (TEST_FILE_ONE);
EXCEPTION
WHEN USE_ERROR =>
NULL;
END;
VAL := IS_OPEN (TEST_FILE_ONE);
IF VAL = FALSE THEN
FAILED ("IS_OPEN RETURNS FALSE AFTER RESET");
END IF;
-- AFTER DELETE
VAL := TRUE;
BEGIN
DELETE (TEST_FILE_ONE);
EXCEPTION
WHEN USE_ERROR =>
IF IS_OPEN (TEST_FILE_ONE) /= FALSE THEN
FAILED ("IS_OPEN GIVES TRUE ON UNSUCCESSFUL " &
"DELETE");
END IF;
RAISE INCOMPLETE;
END;
VAL := IS_OPEN (TEST_FILE_ONE);
IF VAL = TRUE THEN
FAILED ("IS_OPEN RETURNS TRUE AFTER DELETE");
END IF;
RESULT;
EXCEPTION
WHEN INCOMPLETE =>
RESULT;
END CE2103C;
| 27.54 | 79 | 0.587509 |
59c9b66987d5ce099f1341064045870daf1b2d7c | 303 | adb | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/case_character.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/case_character.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/gnat.dg/case_character.adb | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- { dg-do run }
procedure Case_Character is
function Test (C : Character) return Integer is
begin
case C is
when ASCII.HT | ' ' .. Character'Last => return 1;
when others => return 0;
end case;
end;
begin
if Test ('A') /= 1 then
raise Program_Error;
end if;
end;
| 15.15 | 56 | 0.60066 |
59bded7f0546ccade0ecf53afa13c230ef2d9a77 | 420 | ads | Ada | list0/task2/src/linear_search.ads | luk9400/nsi | dd76cfbc811163e77bdb05ab30115b734774ca33 | [
"MIT"
] | null | null | null | list0/task2/src/linear_search.ads | luk9400/nsi | dd76cfbc811163e77bdb05ab30115b734774ca33 | [
"MIT"
] | null | null | null | list0/task2/src/linear_search.ads | luk9400/nsi | dd76cfbc811163e77bdb05ab30115b734774ca33 | [
"MIT"
] | null | null | null | package Linear_Search
with SPARK_Mode
is
type T is range 0 .. 10;
subtype U is T range 1 .. 10;
type Ar is array (U) of Integer;
function Search (A : Ar; I : Integer) return T with
-- If I exists in A, then Search'Result indicates its position
Post => (if Search'Result in A'Range then A (Search'Result) = I
else (for all Index in A'Range => A (Index) /= I));
end Linear_Search;
| 26.25 | 68 | 0.635714 |
2f9108fe93bdbbbdfad20ce4700718f5ee5c1a91 | 14,554 | adb | Ada | software/modules/logger.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 12 | 2017-06-08T14:19:57.000Z | 2022-03-09T02:48:59.000Z | software/modules/logger.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 6 | 2017-06-08T13:13:50.000Z | 2020-05-15T09:32:43.000Z | software/modules/logger.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 3 | 2017-06-30T14:05:06.000Z | 2022-02-17T12:20:45.000Z | -- Project: StratoX
-- Authors: Martin Becker ([email protected])
-- Emanuel Regnath ([email protected])
--
-- Description:
-- allows logging of structured messages at several logging levels.
--
-- Usage:
-- Logger.init -- initializes the Logger
-- Logger.log_console (Logger.INFO, "Program started.") -- writes log on info level to console
-- Logger.log_sd (Logger.INFO, gps_msg) -- writes GPS record to SD card
-- Logger.log (Logger.INFO, "hello") -- writes to both SD and console
with Config.Tasking;
with SDLog;
with NVRAM;
with Buildinfo;
with HIL.Devices;
with HIL.UART;
with HIL.Random;
with Interfaces; use Interfaces;
with Ada.Unchecked_Conversion;
with Ada.Real_Time; use Ada.Real_Time;
with Bounded_Image;
with ULog;
-- force elaboration of those before the logging task starts
pragma Elaborate_All (SDLog);
pragma Elaborate_All (Ulog);
-- @summary Simultaneously writes to UART, and SD card.
package body Logger with SPARK_Mode,
Refined_State => (LogState => (queue_ulog, Logging_Task, logger_level))
is
-- the type for the queue buffer
type Buffer_Ulog is array (Natural range <>) of ULog.Message; -- IMPORTANT: no discriminant (=mutable)
type bufpos is mod LOG_QUEUE_LENGTH;
-- if GNATprove crashes with reference to that file,
-- then you have run into bug KP-160-P601-005.
-- workaround: move decl of protected type to package spec.
---------------------
-- LOG QUEUE TYPE
---------------------
-- protected type to implement the ULog queue
protected type Ulog_Queue_T is
procedure Enable;
-- initially the queue does not accept messages
-- call this after everything has been set up
-- (SD log, etc.).
procedure New_Msg (msg : in ULog.Message);
-- enqueue new message. this is not blocking, except to ensure mutex.
-- it is fast (only memcpy), but it can silently fail if buffer is full.
-- FIXME: how can we specify a precondition on the private variable?
-- for now we put an assertion in the body
entry Get_Msg (msg : out ULog.Message; n_queued_before : out Natural) with
Pre => not msg'Constrained;
-- try to get new message from buffer. if empty, this is blocking
-- until buffer has data, and then returns it.
-- FIXME: how can we specify a precondition on the private variable?
-- for now we put an assertion in the body
-- FIXME: we need to specify a precondition, that msg is a mutable
-- variant record. Otherwise a discriminant check will fail.
function Get_Num_Overflows return Natural;
-- query how often the buffer overflowed. If this happens, either increase
-- the buffer QUEUE_LENGTH, or increase priority of the logger task.
function Get_Length return Natural;
-- query number of messages waiting in the logging queue.
private
Buffer : Buffer_Ulog (0 .. LOG_QUEUE_LENGTH - 1);
-- cannot use a discriminant for this (would violate No_Implicit_Heap_Allocations)
Queue_Enable : Boolean := False;
Num_Queued : Natural := 0;
Not_Empty : Boolean := False; -- simple barrier (Ravenscar)
Pos_Read : bufpos := 0;
Pos_Write : bufpos := 0;
Num_Overflows : Natural := 0;
-- cannot use a dynamic predicate to etablish relationship, because this requires
-- a record. But we cannot have a record, since this would make Not_Empty a
-- non-simple barrier (=> Ravenscar violation).
end Ulog_Queue_T;
-- sporadic logging task waking up when message is enqueued
task Logging_Task is
pragma Priority (Config.Tasking.TASK_PRIO_LOGGING); -- lowest prio for logging
end Logging_Task;
pragma Annotate (GNATprove, Intentional,
"""sdlog.fh_log"" might not be initialized before start of tasks of type ""Logging_Task""",
"The queue will not accept values before fh_log is initialized. MBe.");
----------------------------
-- PROTOTYPES
----------------------------
subtype Img_String is String (1 .. 3);
function Image (level : Log_Level) return Img_String;
procedure Write_Bytes_To_SD (len : Natural; buf : HIL.Byte_Array)
with Pre => buf'Last >= buf'First and
then len <= Natural (Unsigned_16'Last) and
then buf'Length >= len;
----------------------------
-- INTERNAL STATES
----------------------------
queue_ulog : Ulog_Queue_T;
logger_level : Log_Level := DEBUG;
--With_SDLog : Boolean := False;
--------------
-- LOG TASK
--------------
-- the task which logs to SD card in the background
-- XXX: compiler assumes that all the code in a task body is potentially
-- executed at elaboration time if a task is declared at the library level.
-- thus, all callees here have to be elaborated before this task.
task body Logging_Task is
msg : ULog.Message; -- IMPORTANT: no discriminant -> mutable. Otherwise exceptions.
BUFLEN : constant := 512;
bytes : HIL.Byte_Array (1 .. BUFLEN);
len : Natural;
type loginfo_ratio is mod 100; -- every one out of this will be a log message about the queue
r : loginfo_ratio := 0;
n_que : Natural;
max_q : Natural := 0; -- max. queue level between queue logs
begin
loop
queue_ulog.Get_Msg (msg, n_que); -- under mutex, must be fast
ULog.Serialize_Ulog (msg, len, bytes); -- this can be slow again
Write_Bytes_To_SD (len => len, buf => bytes);
if n_que > max_q then
max_q := n_que;
end if;
-- occasionally log queue state (overflows, num_queued).
r := r + 1;
if r = 0 then
declare
m : ULog.Message (ULog.LOG_QUEUE);
n_ovf : constant Natural := queue_ulog.Get_Num_Overflows;
begin
m.t := Ada.Real_Time.Clock;
if n_ovf > Natural (Unsigned_16'Last) then
m.n_overflows := Unsigned_16'Last;
else
m.n_overflows := Unsigned_16 (n_ovf);
end if;
if max_q > Natural (Unsigned_8'Last) then
m.max_queued := Unsigned_8'Last;
else
m.max_queued := Unsigned_8 (max_q);
end if;
if n_que > Natural (Unsigned_8'Last) then
m.n_queued := Unsigned_8'Last;
else
m.n_queued := Unsigned_8 (n_que);
end if;
ULog.Serialize_Ulog (m, len, bytes);
Write_Bytes_To_SD (len => len, buf => bytes);
max_q := 0;
end;
end if;
end loop;
end Logging_Task;
-- implementation of the message queue
protected body Ulog_Queue_T is
procedure Enable is
begin
Queue_Enable := True;
end Enable;
procedure New_Msg (msg : in ULog.Message) is
begin
if Queue_Enable then
Buffer (Integer (Pos_Write)) := msg;
pragma Annotate (GNATprove, False_Positive,
"discriminant check might fail",
"GNATprove does not see that the buffer consists of mutable variant records. MBe");
Pos_Write := Pos_Write + 1;
if Num_Queued < Buffer'Last then
Num_Queued := Num_Queued + 1;
else -- =Buffer'Last
Pos_Read := Pos_Read + 1; -- overwrite oldest
if Num_Overflows < Natural'Last then
Num_Overflows := Num_Overflows + 1;
end if;
end if;
Not_Empty := (Num_Queued > 0);
pragma Assert ((Not_Empty and (Num_Queued > 0)) or ((not Not_Empty) and (Num_Queued = 0)));
end if;
end New_Msg;
entry Get_Msg (msg : out ULog.Message; n_queued_before : out Natural) when Not_Empty is
begin
pragma Assume (Num_Queued > 0); -- via barrier and assert in New_Msg
msg := Buffer (Integer (Pos_Read));
n_queued_before := Num_Queued;
Pos_Read := Pos_Read + 1;
Num_Queued := Num_Queued - 1;
Not_Empty := Num_Queued > 0;
pragma Assert ((Not_Empty and (Num_Queued > 0)) or ((not Not_Empty) and (Num_Queued = 0)));
end Get_Msg;
function Get_Num_Overflows return Natural is (Num_Overflows);
function Get_Length return Natural is (Num_Queued);
end Ulog_Queue_T;
-----------------------
-- Write_Bytes_To_SD
-----------------------
-- slow procedure! Takes Byte_Array, converts to SD data type and writes
procedure Write_Bytes_To_SD (len : Natural; buf : HIL.Byte_Array) is
begin
if len > 0 then
declare
pragma Assert (len > 0);
subtype Bytes_ULog is HIL.Byte_Array (1 .. len);
up : constant Unsigned_16 := Unsigned_16 (len);
subtype SD_Data_ULog is SDLog.SDLog_Data (1 .. up);
function To_FileData is new Ada.Unchecked_Conversion (Bytes_ULog, SD_Data_ULog);
buf_last : constant Integer := buf'First + (len - 1);
n_wr : Integer;
pragma Unreferenced (n_wr);
begin
if SDLog.Is_Open then -- defensive programming. We should not get here w/o opened log
SDLog.Write_Log (To_FileData (buf (buf'First .. buf_last)), n_wr);
end if;
end;
end if;
end Write_Bytes_To_SD;
-- HAL, only change Adapter to port Code
package body Adapter is
procedure init_adapter (status : out Init_Error_Code) is
begin
-- HIL.UART.configure; already done in CPU.initialize
status := SUCCESS;
end init_adapter;
procedure write (message : Message_Type) is
CR : constant Character := Character'Val (13); -- ASCII
begin
if message'Last < Integer'Last then
HIL.UART.write(HIL.Devices.Console, HIL.UART.toData_Type ( message & CR ) );
else
-- no space left for CR
HIL.UART.write(HIL.Devices.Console, HIL.UART.toData_Type ( message ));
end if;
end write;
end Adapter;
--------------
-- Init
--------------
procedure Init (status : out Init_Error_Code) is
begin
SDLog.Init;
Adapter.init_adapter (status);
end Init;
-----------
-- Image
-----------
function Image (level : Log_Level) return Img_String is
begin
return (case level is
when SENSOR => "S: ",
when ERROR => "E: ",
when WARN => "W: ",
when INFO => "I: ",
when DEBUG => "D: ",
when TRACE => "T: "
);
end Image;
procedure log(msg_level : Log_Level; message : Message_Type) is
text_msg : ULog.Message( ULog.TEXT );
now : constant Ada.Real_Time.Time := Ada.Real_Time.Clock;
maxlen : constant Integer := (if message'Length > text_msg.txt'Length
then text_msg.txt'Length else message'Length);
begin
log_console (msg_level, message);
if maxlen > 0 then
if Log_Level'Pos (msg_level) <= Log_Level'Pos (INFO) then
text_msg.t := now;
declare
idx_t : constant Integer := text_msg.txt'First - 1 + maxlen;
idx_m : constant Integer := message'First + (maxlen - 1);
begin
text_msg.txt(text_msg.txt'First .. idx_t) := message (message'First .. idx_m);
text_msg.txt_last := idx_m;
end;
log_sd (msg_level, text_msg);
end if;
end if;
end log;
-----------------
-- log_console
-----------------
procedure log_console (msg_level : Log_Level; message : Message_Type) with SPARK_Mode => Off is
begin
if Log_Level'Pos (msg_level) <= Log_Level'Pos (logger_level) then
Adapter.write (Image (msg_level) & message);
end if;
end log_console;
----------------
-- log_sd
----------------
procedure log_sd (msg_level : Log_Level; message : ULog.Message) is
begin
if Log_Level'Pos (msg_level) <= Log_Level'Pos (logger_level) then
queue_ulog.New_Msg (message);
end if;
end log_sd;
-------------------
-- set_log_level
-------------------
procedure Set_Log_Level (level : Log_Level) is
begin
logger_level := level;
end Set_Log_Level;
-------------------
-- Start_SDLog
-------------------
procedure Start_SDLog is
num_boots : HIL.Byte;
rand32 : Unsigned_32;
begin
NVRAM.Load (variable => NVRAM.VAR_BOOTCOUNTER, data => num_boots);
HIL.Random.Get_Unsigned (rand32);
declare
buildstring : constant String := Buildinfo.Short_Datetime;
bootstr : constant String := Bounded_Image.Unsigned8_Img (num_boots);
rnd : constant Unsigned_8 := Unsigned_8 (16#FF# and rand32);
rndstr : constant String := Bounded_Image.Unsigned8_Img (rnd);
fname : constant String := bootstr(bootstr'First .. bootstr'Last) & "_" & rndstr & ".log";
BUFLEN : constant := 128; -- header is around 90 bytes long
bytes : HIL.Byte_Array (1 .. BUFLEN);
len : Natural;
valid : Boolean;
log_started : Boolean;
begin
SDLog.Start_Logfile (dirname => buildstring, filename => fname, ret => log_started);
if not log_started
then
log_console (Logger.ERROR, "Cannot create logfile: " & buildstring & "/" & fname);
else
log_console (Logger.WARN, "Log name: " & buildstring & "/" & fname);
-- write file header (ULog message definitions)
Get_Ulog_Defs_Loop :
loop
ULog.Get_Header_Ulog (bytes, len, valid);
pragma Annotate (GNATprove, Intentional, """bytes"" might not be initialized", "MBe");
exit Get_Ulog_Defs_Loop when not valid;
if len > 0 then
Write_Bytes_To_SD (len => len, buf => bytes);
end if;
end loop Get_Ulog_Defs_Loop;
queue_ulog.Enable;
end if;
end;
end Start_SDLog;
end Logger;
| 36.47619 | 112 | 0.576886 |
5771a060674ed40c1d2630b011f9305137f539f5 | 5,265 | ads | Ada | bb-runtimes/src/s-bbpara__sparc.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/src/s-bbpara__sparc.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/src/s-bbpara__sparc.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- S Y S T E M . B B . P A R A M E T E R S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1999-2002 Universidad Politecnica de Madrid --
-- Copyright (C) 2003-2005 The European Space Agency --
-- Copyright (C) 2003-2016, AdaCore --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- 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. --
-- --
-- The port of GNARL to bare board targets was initially developed by the --
-- Real-Time Systems Group at the Technical University of Madrid. --
-- --
------------------------------------------------------------------------------
-- This package defines basic parameters used by the low level tasking system
-- This is the ERC32/LEON/LEON3 version of this package
pragma Restrictions (No_Elaboration_Code);
package System.BB.Parameters is
pragma Pure;
--------------------
-- Hardware clock --
--------------------
Clock_Frequency : constant Natural; -- Hertz
pragma Import (Asm, Clock_Frequency, "clock_frequency");
-- Frequency of the system clock
----------------
-- Interrupts --
----------------
-- The following are ERC32/LEON/LEON3 definitions and they cannot be
-- modified.
-- These definitions are in this package in order to isolate target
-- dependencies.
Number_Of_Interrupt_ID : constant := 15;
-- Number of interrupts in the SPARC architecture
Trap_Vectors : constant := 256;
-- The SPARC arquitecture supports 256 vectors
------------------------
-- Context Management --
------------------------
-- The SPARC processor needs to save:
--
-- * 18 integer registers of 32 bits (7 global, 8 output, PSR, Y, and WIM)
-- for normal processing
--
-- * 33 floating point registers of 32 bits
--
-- * the number of register windows saved to the stack
-- (the input and local registers are saved to the stack).
--
-- * interrupt nesting level corresponding to the task
--
-- * for LEON, to slots for the Cache Control Register
--
-- This would be 55 slots for LEON/LEON3 and 53 otherwise, but
-- this need to be rounded up to an even number to allow more
-- efficient access.
--
-- For LEON, we store the Cache Control Register to be able to keep the
-- cache status per task. We keep the base Cache Control Register (which
-- is not affected by automatic changes related to the freeze-on-interrupt
-- capability) and the actual Cache Control Register (the one directly
-- extracted from the hardware).
Base_CCR_Context_Index : constant := 53;
CCR_Context_Index : constant := 54;
Context_Buffer_Capacity : constant := 56;
------------
-- Stacks --
------------
Interrupt_Stack_Size : constant := 4 * 1024; -- bytes
-- Size of each of the interrupt stacks
----------
-- CPUS --
----------
Max_Number_Of_CPUs : constant := 1;
-- Maximum number of CPUs
Multiprocessor : constant Boolean := Max_Number_Of_CPUs /= 1;
-- Are we on a multiprocessor board?
end System.BB.Parameters;
| 43.512397 | 79 | 0.496296 |
2f00fca08486548daf3c28e21c5b4b6ab5905ed3 | 786 | adb | Ada | build_gnu/binutils/gdb/testsuite/gdb.ada/fullname_bp/foo.adb | jed-frey/e200-gcc | df1421b421a8ec8729d70791129f5283dee5f9ea | [
"BSD-3-Clause"
] | 1 | 2017-05-31T21:42:12.000Z | 2017-05-31T21:42:12.000Z | build_gnu/binutils/gdb/testsuite/gdb.ada/fullname_bp/foo.adb | jed-frey/e200-gcc | df1421b421a8ec8729d70791129f5283dee5f9ea | [
"BSD-3-Clause"
] | null | null | null | build_gnu/binutils/gdb/testsuite/gdb.ada/fullname_bp/foo.adb | jed-frey/e200-gcc | df1421b421a8ec8729d70791129f5283dee5f9ea | [
"BSD-3-Clause"
] | 1 | 2019-12-17T22:04:07.000Z | 2019-12-17T22:04:07.000Z | -- Copyright 2011-2014 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
with Pck; use Pck;
procedure Foo is
begin
Hello;
There;
end Foo;
| 35.727273 | 73 | 0.732824 |
41f70cda05aa0ce55221d09a3e709d6e38f63a34 | 69,287 | adb | Ada | src/natools-web-comments.adb | faelys/natools-web | f7ba99f2ffb6f5a06d1b1e8becbf5f92fd58c750 | [
"0BSD"
] | 1 | 2015-04-23T10:48:58.000Z | 2015-04-23T10:48:58.000Z | src/natools-web-comments.adb | faelys/natools-web | f7ba99f2ffb6f5a06d1b1e8becbf5f92fd58c750 | [
"0BSD"
] | null | null | null | src/natools-web-comments.adb | faelys/natools-web | f7ba99f2ffb6f5a06d1b1e8becbf5f92fd58c750 | [
"0BSD"
] | null | null | null | ------------------------------------------------------------------------------
-- Copyright (c) 2015-2019, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-- Natools.Web.Comments provides an implementation of user-posted comments --
-- like is commonly found on blogs. --
------------------------------------------------------------------------------
with Ada.Characters.Handling;
with Ada.Containers.Indefinite_Ordered_Maps;
with Ada.Exceptions;
with Ada.Streams.Stream_IO;
with Natools.File_Streams;
with Natools.S_Expressions.Atom_Buffers;
with Natools.S_Expressions.Atom_Ref_Constructors;
with Natools.S_Expressions.Caches;
with Natools.S_Expressions.Conditionals.Generic_Evaluate;
with Natools.S_Expressions.Conditionals.Strings;
with Natools.S_Expressions.Enumeration_IO;
with Natools.S_Expressions.Interpreter_Loop;
with Natools.S_Expressions.Parsers;
with Natools.S_Expressions.Printers.Pretty;
with Natools.S_Expressions.Templates.Dates;
with Natools.S_Expressions.Templates.Integers;
with Natools.Static_Maps.Web.Comments;
with Natools.Time_IO.RFC_3339;
with Natools.Time_Keys;
with Natools.Web.Backends;
with Natools.Web.Comment_Cookies;
with Natools.Web.Error_Pages;
with Natools.Web.Escapes;
with Natools.Web.Exchanges;
with Natools.Web.Fallback_Render;
with Natools.Web.Filters.Stores;
with Natools.Web.Filters.Text_Blocks;
with Natools.Web.Is_Valid_URL;
with Natools.Web.List_Templates;
with Natools.Web.Render_Default;
package body Natools.Web.Comments is
package Static_Maps renames Natools.Static_Maps.Web.Comments;
package Comment_Flag_IO is new S_Expressions.Enumeration_IO.Typed_IO
(Comment_Flags.Enum);
package List_Flag_IO is new S_Expressions.Enumeration_IO.Typed_IO
(List_Flags.Enum);
package String_Maps is new Ada.Containers.Indefinite_Ordered_Maps
(String, String);
type Post_Action is (Save_Comment, Force_Preview, Parent_Redirect);
package Post_Action_IO is new S_Expressions.Enumeration_IO.Typed_IO
(Post_Action);
type Comment_Builder is record
Core : Comment_Data;
Extra_Fields, Raw_Fields : String_Maps.Map;
Has_Unknown_Field : Boolean := False;
Cookie_Save : Boolean := False;
Action : Post_Action;
Reason : S_Expressions.Atom_Refs.Immutable_Reference;
Anchor : S_Expressions.Atom_Refs.Immutable_Reference;
Redirect_Base : S_Expressions.Atom_Refs.Immutable_Reference;
end record;
Invalid_Condition : exception;
Ignore_Button : constant String := "ignore";
Preview_Button : constant String := "preview";
Preview_Id_Ref : S_Expressions.Atom_Refs.Immutable_Reference;
Submit_Button : constant String := "submit";
Auto_Class_Prefix : constant S_Expressions.Atom
:= (1 => Character'Pos ('c'), 2 => Character'Pos ('o'),
3 => Character'Pos ('m'), 4 => Character'Pos ('m'),
5 => Character'Pos ('c'), 6 => Character'Pos ('l'),
7 => Character'Pos ('a'), 8 => Character'Pos ('s'),
9 => Character'Pos ('s'), 10 => Character'Pos ('-'));
procedure Append
(Exchange : in out Sites.Exchange;
Context : in Comment_List;
Data : in S_Expressions.Atom);
-- Append Data to Exchange, ignoring Context
procedure Append
(Exchange : in out Sites.Exchange;
Context : in Comment_Data;
Data : in S_Expressions.Atom);
-- Append Data to Exchange, ignoring Context
function Create (Data : S_Expressions.Atom)
return S_Expressions.Atom_Refs.Immutable_Reference
renames S_Expressions.Atom_Ref_Constructors.Create;
-- Atom expression constructor
function Evaluate_Parametric
(Builder : in Comment_Builder;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class)
return Boolean;
-- Evaluate a condition on a comment builder with arguments
function Evaluate_Simple
(Builder : in Comment_Builder;
Name : in S_Expressions.Atom)
return Boolean;
-- Evaluate a condition on a comment builder without argument
function Get_Class (Exchange : in Sites.Exchange)
return S_Expressions.Atom_Refs.Immutable_Reference;
-- Look for comment class in Exchange
function Get_Safe_Filter
(Site : in Sites.Site;
Name_Ref : in S_Expressions.Atom_Refs.Immutable_Reference;
Default : in S_Expressions.Atom_Refs.Immutable_Reference)
return Filters.Filter'Class;
function Get_Safe_Filter
(Builder : in Sites.Site_Builder;
Name_Ref : in S_Expressions.Atom_Refs.Immutable_Reference;
Default : in S_Expressions.Atom_Refs.Immutable_Reference)
return Filters.Filter'Class;
-- Return the filter designated by Name_Ref, falling back on raw
-- text when Name_Ref is empty or named filter is not found.
function Image (Name : Comment_Atoms.Enum) return String;
-- Return a string representation of Name
function Next_Rank (List : Comment_List) return Positive;
-- Return the next rank for a comment in List (i.e. length + 1)
procedure Parse_Action
(Builder : in out Comment_Builder;
Site : in Sites.Site;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class);
-- Evluate action with parameter
procedure Parse_Action_Simple
(Builder : in out Comment_Builder;
Site : in Sites.Site;
Name : in S_Expressions.Atom);
-- Evaluate parameterless action
procedure Process_Actions
(Builder : in out Comment_Builder;
Site : in Sites.Site;
Filter_Name : in S_Expressions.Atom_Refs.Immutable_Reference);
-- Evaluate the filter whose name is given
procedure Preprocess
(Comment : in out Comment_Data;
Text_Filter : in Filters.Filter'Class);
-- Common preprocessing code, after Text_Filter is determined
function Preview_Id return S_Expressions.Atom_Refs.Immutable_Reference;
-- Return the comment id of temporary previews
procedure Process_Form
(Data : in out Comment_Builder;
Exchange : in Sites.Exchange;
List : in Comment_List);
-- Read form data in Exchange to fill Data
procedure Render
(Exchange : in out Sites.Exchange;
Position : in Comment_Maps.Cursor;
Expression : in out S_Expressions.Lockable.Descriptor'Class);
procedure Render_Comment
(Exchange : in out Sites.Exchange;
Comment : in Comment_Data;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class);
procedure Render_List_Element
(Exchange : in out Sites.Exchange;
List : in Comment_List;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class);
-- Render a command
procedure Reset_If_Blank
(Ref : in out S_Expressions.Atom_Refs.Immutable_Reference);
-- Reset Ref if it only contains blank characters
function String_Fallback_Parametric
(Settings : in S_Expressions.Conditionals.Strings.Settings;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class)
return Boolean;
-- Raise Invalid_Condition
function String_Fallback_Simple
(Settings : in S_Expressions.Conditionals.Strings.Settings;
Name : in S_Expressions.Atom)
return Boolean;
-- Raise Invalid_Condition
procedure Update_Item
(Comment : in out Comment_Data;
Context : in Meaningless_Type;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class);
-- Update comment with the given expression
procedure Update_List
(List : in out Comment_List;
Context : in Meaningless_Type;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class);
-- Update comment list with the given expression
function Value (Name : S_Expressions.Atom) return Comment_Atoms.Enum;
-- Convert Name into a comment atom reference, raising Constraint_Error
-- when Name is not valid.
procedure Write
(Builder : in Comment_Builder;
Output : in out S_Expressions.Printers.Printer'Class);
-- Serialize a builder into the given S_Expression stream
procedure Write
(Builder : in Comment_Builder;
Site : in Sites.Site;
Arguments : in out S_Expressions.Lockable.Descriptor'Class);
-- Serialize a builder into the file named by Arguments.Current_Atom.
-- The Site argument is useless for now, but kept for a future
-- backend-based implementation.
function Evaluate is new S_Expressions.Conditionals.Generic_Evaluate
(Comment_Builder, Evaluate_Parametric, Evaluate_Simple);
procedure Parse is new S_Expressions.Interpreter_Loop
(Comment_Builder, Sites.Site, Parse_Action, Parse_Action_Simple);
procedure Render is new S_Expressions.Interpreter_Loop
(Sites.Exchange, Comment_List, Render_List_Element, Append);
procedure Render is new S_Expressions.Interpreter_Loop
(Sites.Exchange, Comment_Data, Render_Comment, Append);
procedure Render_List is new List_Templates.Render
(Comment_Maps.Cursor, Comment_Maps.Map_Iterator_Interfaces);
procedure Update is new S_Expressions.Interpreter_Loop
(Comment_Data, Meaningless_Type, Update_Item);
procedure Update is new S_Expressions.Interpreter_Loop
(Comment_List, Meaningless_Type, Update_List);
------------------------------
-- Local Helper Subprograms --
------------------------------
function Get_Class (Exchange : in Sites.Exchange)
return S_Expressions.Atom_Refs.Immutable_Reference
is
Groups : constant Containers.Atom_Array_Refs.Immutable_Reference
:= Containers.Elements (Sites.Identity (Exchange).Groups);
begin
if not Groups.Is_Empty then
for Ref of Groups.Query loop
if not Ref.Is_Empty then
declare
use type S_Expressions.Atom;
use type S_Expressions.Offset;
Contents : constant S_Expressions.Atom := Ref.Query;
begin
if Contents'Length > Auto_Class_Prefix'Length
and then Contents (Contents'First
.. Contents'First + Auto_Class_Prefix'Length - 1)
= Auto_Class_Prefix
then
return Create (Contents
(Contents'First + Auto_Class_Prefix'Length
.. Contents'Last));
end if;
end;
end if;
end loop;
end if;
return S_Expressions.Atom_Refs.Null_Immutable_Reference;
end Get_Class;
function Image (Name : Comment_Atoms.Enum) return String is
begin
return Ada.Characters.Handling.To_Lower
(Comment_Atoms.Enum'Image (Name));
end Image;
function Next_Rank (List : Comment_List) return Positive is
begin
return List.Comments.Query.Length + 1;
end Next_Rank;
function Value (Name : S_Expressions.Atom) return Comment_Atoms.Enum is
begin
return Comment_Atoms.Enum'Value (S_Expressions.To_String (Name));
end Value;
---------------
-- Renderers --
---------------
procedure Append
(Exchange : in out Sites.Exchange;
Context : in Comment_List;
Data : in S_Expressions.Atom)
is
pragma Unreferenced (Context);
begin
Exchange.Append (Data);
end Append;
procedure Append
(Exchange : in out Sites.Exchange;
Context : in Comment_Data;
Data : in S_Expressions.Atom)
is
pragma Unreferenced (Context);
begin
Exchange.Append (Data);
end Append;
procedure Render
(Exchange : in out Sites.Exchange;
Position : in Comment_Maps.Cursor;
Expression : in out S_Expressions.Lockable.Descriptor'Class) is
begin
Render (Expression, Exchange, Comment_Maps.Element (Position));
end Render;
procedure Render_Comment
(Exchange : in out Sites.Exchange;
Comment : in Comment_Data;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class)
is
use type Tags.Visible_Access;
use Static_Maps.Item.Command;
procedure Re_Enter
(Exchange : in out Sites.Exchange;
Expression : in out S_Expressions.Lockable.Descriptor'Class);
procedure Render_Ref
(Ref : in S_Expressions.Atom_Refs.Immutable_Reference);
procedure Value
(Image : in String;
Found : out Boolean;
Id : out Comment_Atoms.Enum);
procedure Re_Enter
(Exchange : in out Sites.Exchange;
Expression : in out S_Expressions.Lockable.Descriptor'Class) is
begin
Render (Expression, Exchange, Comment);
end Re_Enter;
procedure Render_Ref
(Ref : in S_Expressions.Atom_Refs.Immutable_Reference) is
begin
if not Ref.Is_Empty then
Exchange.Append (Ref.Query);
elsif Arguments.Current_Event
in S_Expressions.Events.Add_Atom | S_Expressions.Events.Open_List
then
Render (Arguments, Exchange, Comment);
end if;
end Render_Ref;
procedure Value
(Image : in String;
Found : out Boolean;
Id : out Comment_Atoms.Enum) is
begin
Id := Comment_Atoms.Enum'Value (Image);
Found := True;
exception
when Constraint_Error =>
Found := False;
end Value;
S_Name : constant String := S_Expressions.To_String (Name);
begin
pragma Assert (Comment.Flags (Comment_Flags.Preprocessed));
case Static_Maps.To_Item_Command (S_Name) is
when Unknown =>
declare
Has_Id : Boolean;
Atom_Id : Comment_Atoms.Enum;
begin
if S_Name'Length > 6
and then S_Name (S_Name'First .. S_Name'First + 5) = "if-no-"
then
Value
(S_Name (S_Name'First + 6 .. S_Name'Last),
Has_Id, Atom_Id);
if Has_Id and then Comment.Atoms (Atom_Id).Is_Empty then
Render (Arguments, Exchange, Comment);
end if;
elsif S_Name'Length > 3
and then S_Name (S_Name'First .. S_Name'First + 2) = "if-"
then
Value
(S_Name (S_Name'First + 3 .. S_Name'Last),
Has_Id, Atom_Id);
if Has_Id and then not Comment.Atoms (Atom_Id).Is_Empty then
Render (Arguments, Exchange, Comment);
end if;
elsif S_Name /= "filter" then
Value (S_Name, Has_Id, Atom_Id);
if Has_Id then
Render_Ref (Comment.Atoms (Atom_Id));
end if;
end if;
if not Has_Id then
Fallback_Render
(Exchange, Name, Arguments, "comment", Re_Enter'Access);
end if;
end;
when Date =>
S_Expressions.Templates.Dates.Render
(Exchange, Arguments, Comment.Date, Comment.Offset);
when Id =>
Exchange.Append (Comment.Id.Query);
when Parent =>
if Comment.Parent /= null then
Tags.Render (Exchange, Comment.Parent.all, Arguments);
end if;
when Rank =>
S_Expressions.Templates.Integers.Render
(Exchange, Arguments, Comment.Rank);
end case;
end Render_Comment;
procedure Render_List_Element
(Exchange : in out Sites.Exchange;
List : in Comment_List;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class)
is
use Static_Maps.List.Command;
procedure Re_Enter
(Exchange : in out Sites.Exchange;
Expression : in out S_Expressions.Lockable.Descriptor'Class);
procedure Re_Enter
(Exchange : in out Sites.Exchange;
Expression : in out S_Expressions.Lockable.Descriptor'Class) is
begin
Render (Expression, Exchange, List);
end Re_Enter;
begin
case Static_Maps.To_List_Command (S_Expressions.To_String (Name)) is
when Unknown =>
Fallback_Render
(Exchange, Name, Arguments, "comment list", Re_Enter'Access);
when If_Closed =>
if List.Flags (List_Flags.Closed) then
Render (Arguments, Exchange, List);
end if;
when If_Not_Closed =>
if not List.Flags (List_Flags.Closed) then
Render (Arguments, Exchange, List);
end if;
when Static_Maps.List.Command.List =>
Render_List
(Exchange,
List.Comments.Query.Iterate,
List_Templates.Read_Parameters (Arguments));
when Parent =>
if not Tags."=" (List.Parent, null) then
Tags.Render (Exchange, List.Parent.all, Arguments);
end if;
when Preview =>
if Exchange.Parameter (Preview_Button) = ""
and then Exchange.Parameter (Submit_Button) = ""
then
return;
end if;
declare
Builder : Comment_Builder;
begin
Builder.Core.Date := Ada.Calendar.Clock;
Builder.Core.Offset := Ada.Calendar.Time_Zones.UTC_Time_Offset
(Builder.Core.Date);
Builder.Core.Id := Preview_Id;
Builder.Core.Parent := List.Parent;
Builder.Core.Rank := Next_Rank (List);
Process_Form (Builder, Exchange, List);
Preprocess (Builder.Core, List, Exchange.Site.all);
Render (Arguments, Exchange, Builder.Core);
end;
when Size =>
S_Expressions.Templates.Integers.Render
(Exchange, Arguments, List.Comments.Query.Length);
end case;
end Render_List_Element;
------------------
-- Interpreters --
------------------
procedure Update_Item
(Comment : in out Comment_Data;
Context : in Meaningless_Type;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class)
is
pragma Unreferenced (Context);
use Static_Maps.Item.Element;
use type S_Expressions.Events.Event;
begin
pragma Assert (not Comment.Flags (Comment_Flags.Preprocessed));
if Arguments.Current_Event /= S_Expressions.Events.Add_Atom then
return;
end if;
case Static_Maps.To_Item_Element (S_Expressions.To_String (Name)) is
when Unknown =>
Set_Atom :
begin
Comment.Atoms (Value (Name)) := Create (Arguments.Current_Atom);
exception
when Constraint_Error =>
Log (Severities.Error,
"Unknown comment element """
& S_Expressions.To_String (Name) & '"');
end Set_Atom;
when Date =>
declare
Image : constant String
:= S_Expressions.To_String (Arguments.Current_Atom);
begin
Time_IO.RFC_3339.Value (Image, Comment.Date, Comment.Offset);
exception
when others =>
Log (Severities.Error, "Invalid date """
& Image & """ for comment "
& S_Expressions.To_String (Comment.Id.Query));
end;
when Flags =>
while Arguments.Current_Event in S_Expressions.Events.Add_Atom loop
begin
Comment.Flags
(Comment_Flag_IO.Value (Arguments.Current_Atom))
:= True;
exception
when Constraint_Error =>
Log (Severities.Error, "Invalid comment flag value """
& S_Expressions.To_String (Arguments.Current_Atom)
& '"');
end;
Arguments.Next;
end loop;
end case;
end Update_Item;
procedure Update_List
(List : in out Comment_List;
Context : in Meaningless_Type;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class)
is
pragma Unreferenced (Context);
use Static_Maps.List.Element;
use type S_Expressions.Events.Event;
Event : S_Expressions.Events.Event;
begin
if Arguments.Current_Event /= S_Expressions.Events.Add_Atom then
return;
end if;
case Static_Maps.To_List_Element (S_Expressions.To_String (Name)) is
when Unknown =>
null;
when Backend =>
List.Backend_Name := Create (Arguments.Current_Atom);
Arguments.Next (Event);
if Event = S_Expressions.Events.Add_Atom then
List.Backend_Path := Create (Arguments.Current_Atom);
end if;
when Default_Text_Filter =>
List.Default_Text_Filter := Create (Arguments.Current_Atom);
when Flags =>
while Arguments.Current_Event in S_Expressions.Events.Add_Atom loop
begin
List.Flags
(List_Flag_IO.Value (Arguments.Current_Atom))
:= True;
exception
when Constraint_Error =>
Log (Severities.Error, "Invalid comment list flag """
& S_Expressions.To_String (Arguments.Current_Atom)
& '"');
end;
Arguments.Next;
end loop;
when Post_Filter =>
List.Post_Filter := Create (Arguments.Current_Atom);
when Static_Maps.List.Element.Tags =>
declare
List_Builder : Containers.Unsafe_Atom_Lists.List;
begin
Containers.Append_Atoms (List_Builder, Arguments);
List.Tags := Containers.Create (List_Builder);
end;
when Text_Filters =>
declare
List_Builder : Containers.Unsafe_Atom_Lists.List;
begin
Containers.Append_Atoms (List_Builder, Arguments);
List.Text_Filters := Containers.Create (List_Builder);
end;
end case;
end Update_List;
--------------------------------
-- Conditionals and Filtering --
--------------------------------
function Evaluate_Parametric
(Builder : in Comment_Builder;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class)
return Boolean
is
function Dereference
(Ref : in S_Expressions.Atom_Refs.Immutable_Reference)
return String;
function String_Evaluate
(Ref : in S_Expressions.Atom_Refs.Immutable_Reference;
Arg : in out S_Expressions.Lockable.Descriptor'Class)
return Boolean;
function Dereference
(Ref : in S_Expressions.Atom_Refs.Immutable_Reference)
return String is
begin
if Ref.Is_Empty then
return "";
else
return S_Expressions.To_String (Ref.Query);
end if;
end Dereference;
function String_Evaluate
(Ref : in S_Expressions.Atom_Refs.Immutable_Reference;
Arg : in out S_Expressions.Lockable.Descriptor'Class)
return Boolean
is
Value : aliased constant String := Dereference (Ref);
Context : constant S_Expressions.Conditionals.Strings.Context
:= (Data => Value'Access,
Parametric_Fallback => String_Fallback_Parametric'Access,
Simple_Fallback => String_Fallback_Simple'Access,
Settings => <>);
begin
return S_Expressions.Conditionals.Strings.Evaluate (Context, Arg);
end String_Evaluate;
use Static_Maps.Item.Condition;
use type S_Expressions.Events.Event;
begin
case Static_Maps.To_Item_Condition (S_Expressions.To_String (Name)) is
when Unknown =>
Evaluate_Atom :
begin
return String_Evaluate
(Builder.Core.Atoms (Value (Name)), Arguments);
exception
when Constraint_Error => null;
end Evaluate_Atom;
raise Invalid_Condition with "Unknown parametric conditional """
& S_Expressions.To_String (Name) & '"';
when Action_Is =>
declare
Action : Post_Action;
Event : S_Expressions.Events.Event := Arguments.Current_Event;
begin
while Event = S_Expressions.Events.Add_Atom loop
begin
Action := Post_Action_IO.Value (Arguments.Current_Atom);
if Action = Builder.Action then
return True;
end if;
exception
when Constraint_Error =>
Log (Severities.Error, "Invalid post action string """
& S_Expressions.To_String (Arguments.Current_Atom)
& '"');
end;
Arguments.Next (Event);
end loop;
return False;
end;
when Field_List_Is =>
declare
Cursor : String_Maps.Cursor := Builder.Raw_Fields.First;
Event : S_Expressions.Events.Event := Arguments.Current_Event;
begin
loop
if not String_Maps.Has_Element (Cursor)
or else Event /= S_Expressions.Events.Add_Atom
then
return String_Maps.Has_Element (Cursor)
= (Event = S_Expressions.Events.Add_Atom);
end if;
if String_Maps.Key (Cursor)
/= S_Expressions.To_String (Arguments.Current_Atom)
then
return False;
end if;
Arguments.Next (Event);
String_Maps.Next (Cursor);
end loop;
end;
when Field_List_Contains =>
declare
Event : S_Expressions.Events.Event := Arguments.Current_Event;
begin
while Event = S_Expressions.Events.Add_Atom loop
if not Builder.Raw_Fields.Contains
(S_Expressions.To_String (Arguments.Current_Atom))
then
return False;
end if;
Arguments.Next (Event);
end loop;
return True;
end;
when Field_List_Among =>
declare
Cursor : String_Maps.Cursor := Builder.Raw_Fields.First;
Event : S_Expressions.Events.Event := Arguments.Current_Event;
begin
while String_Maps.Has_Element (Cursor) loop
if Event /= S_Expressions.Events.Add_Atom then
return False;
end if;
if String_Maps.Key (Cursor)
= S_Expressions.To_String (Arguments.Current_Atom)
then
String_Maps.Next (Cursor);
end if;
Arguments.Next (Event);
end loop;
return True;
end;
when Fields_Equal =>
if Arguments.Current_Event /= S_Expressions.Events.Add_Atom then
return True;
end if;
declare
function Current_Field return String;
function Current_Field return String is
Cursor : constant String_Maps.Cursor
:= Builder.Raw_Fields.Find
(S_Expressions.To_String (Arguments.Current_Atom));
begin
if String_Maps.Has_Element (Cursor) then
return String_Maps.Element (Cursor);
else
return "";
end if;
end Current_Field;
Reference : constant String := Current_Field;
Event : S_Expressions.Events.Event;
begin
loop
Arguments.Next (Event);
exit when Event /= S_Expressions.Events.Add_Atom;
if Current_Field /= Reference then
return False;
end if;
end loop;
return True;
end;
when Has_Extra_Fields =>
return not Builder.Extra_Fields.Is_Empty;
when Has_Unknown_Field =>
return Builder.Has_Unknown_Field;
end case;
end Evaluate_Parametric;
function Evaluate_Simple
(Builder : in Comment_Builder;
Name : in S_Expressions.Atom)
return Boolean
is
use Static_Maps.Item.Condition;
begin
case Static_Maps.To_Item_Condition (S_Expressions.To_String (Name)) is
when Unknown
| Action_Is | Field_List_Is | Field_List_Contains | Field_List_Among
| Fields_Equal
=>
Evaluate_Atom :
begin
return not Builder.Core.Atoms (Value (Name)).Is_Empty;
exception
when Constraint_Error => null;
end Evaluate_Atom;
raise Invalid_Condition with "Unknown simple conditional """
& S_Expressions.To_String (Name) & '"';
when Has_Extra_Fields =>
return not Builder.Extra_Fields.Is_Empty;
when Has_Unknown_Field =>
return Builder.Has_Unknown_Field;
end case;
end Evaluate_Simple;
procedure Parse_Action
(Builder : in out Comment_Builder;
Site : in Sites.Site;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class)
is
use type S_Expressions.Atom;
use type S_Expressions.Events.Event;
procedure Append
(Ref : in out S_Expressions.Atom_Refs.Immutable_Reference;
Separator : in S_Expressions.Atom;
Data : in S_Expressions.Atom);
procedure Update_Reason;
procedure Append
(Ref : in out S_Expressions.Atom_Refs.Immutable_Reference;
Separator : in S_Expressions.Atom;
Data : in S_Expressions.Atom) is
begin
if Ref.Is_Empty then
Ref := Create (Data);
else
Ref := Create (Ref.Query & Separator & Data);
end if;
end Append;
procedure Update_Reason is
use type S_Expressions.Octet;
use type S_Expressions.Offset;
begin
if Arguments.Current_Event /= S_Expressions.Events.Add_Atom then
return;
end if;
declare
Text : constant S_Expressions.Atom := Arguments.Current_Atom;
Event : S_Expressions.Events.Event;
O : S_Expressions.Offset;
begin
Arguments.Next (Event);
if Event = S_Expressions.Events.Add_Atom then
Append (Builder.Reason, Text, Arguments.Current_Atom);
else
if Text'Length > 1
and then Text (Text'First) = Character'Pos ('+')
then
case Text (Text'First + 1) is
when Character'Pos ('\') =>
Append
(Builder.Reason,
S_Expressions.Null_Atom,
Text (Text'First + 2 .. Text'Last));
when Character'Pos ('(') =>
O := Text'First + 2;
while O in Text'Range
and then Text (O) /= Character'Pos (')')
loop
O := O + 1;
end loop;
if O in Text'Range then
Append
(Builder.Reason,
Text (Text'First + 2 .. O - 1),
Text (O + 1 .. Text'Last));
else
Append
(Builder.Reason,
S_Expressions.Null_Atom,
Text (Text'First + 1 .. Text'Last));
end if;
when others =>
Append
(Builder.Reason,
S_Expressions.Null_Atom,
Text (Text'First + 1 .. Text'Last));
end case;
else
Builder.Reason := Create (Text);
end if;
end if;
end;
end Update_Reason;
use Static_Maps.Item.Post_Action;
S_Name : constant String := S_Expressions.To_String (Name);
begin
if S_Name = "if"
and then Arguments.Current_Event
in S_Expressions.Events.Add_Atom | S_Expressions.Events.Open_List
then
begin
if Evaluate (Builder, Arguments) then
Arguments.Next;
Parse (Arguments, Builder, Site);
end if;
exception
when Ex : Invalid_Condition =>
Log (Severities.Error, "Invalid comment condition: "
& Ada.Exceptions.Exception_Message (Ex));
end;
return;
end if;
case Static_Maps.To_Item_Action (S_Name) is
when Unknown =>
Log (Severities.Error, "Unknown comment action """ & S_Name & '"');
when Anchor =>
if Arguments.Current_Event = S_Expressions.Events.Add_Atom then
Builder.Anchor := Create (Arguments.Current_Atom);
else
Builder.Anchor.Reset;
end if;
when Append_Reason =>
if Arguments.Current_Event = S_Expressions.Events.Add_Atom then
declare
First_Part : constant S_Expressions.Atom
:= Arguments.Current_Atom;
Event : S_Expressions.Events.Event;
begin
Arguments.Next (Event);
if Event = S_Expressions.Events.Add_Atom then
Append
(Builder.Reason, First_Part, Arguments.Current_Atom);
else
Append
(Builder.Reason, S_Expressions.Null_Atom, First_Part);
end if;
end;
end if;
when Dump =>
Write (Builder, Site, Arguments);
when Force_Preview =>
Builder.Action := Force_Preview;
Update_Reason;
when Force_Redirect =>
if Arguments.Current_Event = S_Expressions.Events.Add_Atom then
Builder.Redirect_Base := Create (Arguments.Current_Atom);
else
Builder.Redirect_Base.Reset;
end if;
when Ignore =>
Builder.Core.Flags (Comment_Flags.Ignored) := True;
Update_Reason;
when Reason =>
Update_Reason;
when Reject =>
Builder.Action := Parent_Redirect;
Update_Reason;
when Save =>
Builder.Action := Save_Comment;
Update_Reason;
when Set_Reason =>
if Arguments.Current_Event = S_Expressions.Events.Add_Atom then
Builder.Reason := Create (Arguments.Current_Atom);
end if;
when Unignore =>
Builder.Core.Flags (Comment_Flags.Ignored) := False;
Update_Reason;
end case;
end Parse_Action;
procedure Parse_Action_Simple
(Builder : in out Comment_Builder;
Site : in Sites.Site;
Name : in S_Expressions.Atom)
is
pragma Unreferenced (Site);
use Static_Maps.Item.Post_Action;
S_Name : constant String := S_Expressions.To_String (Name);
begin
case Static_Maps.To_Item_Action (S_Name) is
when Unknown | Dump =>
Log (Severities.Error, "Unknown comment action """ & S_Name & '"');
when Anchor =>
Builder.Anchor.Reset;
when Append_Reason =>
null;
when Force_Preview =>
Builder.Action := Force_Preview;
when Force_Redirect =>
Builder.Redirect_Base.Reset;
when Ignore =>
Builder.Core.Flags (Comment_Flags.Ignored) := True;
when Reason | Set_Reason =>
Builder.Reason.Reset;
when Reject =>
Builder.Action := Parent_Redirect;
when Save =>
Builder.Action := Save_Comment;
when Unignore =>
Builder.Core.Flags (Comment_Flags.Ignored) := False;
end case;
end Parse_Action_Simple;
procedure Process_Actions
(Builder : in out Comment_Builder;
Site : in Sites.Site;
Filter_Name : in S_Expressions.Atom_Refs.Immutable_Reference)
is
Expression : Containers.Optional_Expression;
begin
if Filter_Name.Is_Empty then
return;
end if;
Expression := Site.Get_Template (Filter_Name.Query);
if not Expression.Is_Empty then
Parse (Expression.Value, Builder, Site);
end if;
end Process_Actions;
procedure Reset_If_Blank
(Ref : in out S_Expressions.Atom_Refs.Immutable_Reference) is
begin
if Ref.Is_Empty then
return;
end if;
Abort_If_Not_Blank :
declare
Accessor : constant S_Expressions.Atom_Refs.Accessor := Ref.Query;
begin
for I in Accessor.Data.all'Range loop
if Accessor.Data (I) not in 9 | 10 | 13 | 32 then
return;
end if;
end loop;
end Abort_If_Not_Blank;
Ref.Reset;
end Reset_If_Blank;
function String_Fallback_Parametric
(Settings : in S_Expressions.Conditionals.Strings.Settings;
Name : in S_Expressions.Atom;
Arguments : in out S_Expressions.Lockable.Descriptor'Class)
return Boolean
is
pragma Unreferenced (Settings, Arguments);
begin
raise Invalid_Condition with "Unknown string parametric conditional """
& S_Expressions.To_String (Name) & '"';
return False;
end String_Fallback_Parametric;
function String_Fallback_Simple
(Settings : in S_Expressions.Conditionals.Strings.Settings;
Name : in S_Expressions.Atom)
return Boolean
is
pragma Unreferenced (Settings);
begin
raise Invalid_Condition with "Unknown string simple conditional """
& S_Expressions.To_String (Name) & '"';
return False;
end String_Fallback_Simple;
------------------------
-- Comment Suprograms --
------------------------
function Get_Safe_Filter
(Site : in Sites.Site;
Name_Ref : in S_Expressions.Atom_Refs.Immutable_Reference;
Default : in S_Expressions.Atom_Refs.Immutable_Reference)
return Filters.Filter'Class is
begin
if not Name_Ref.Is_Empty then
begin
return Site.Get_Filter (Name_Ref.Query);
exception
when Filters.Stores.No_Filter => null;
end;
end if;
if not Default.Is_Empty then
begin
return Site.Get_Filter (Default.Query);
exception
when Filters.Stores.No_Filter => null;
end;
end if;
declare
Fallback : Filters.Text_Blocks.Filter;
begin
return Fallback;
end;
end Get_Safe_Filter;
function Get_Safe_Filter
(Builder : in Sites.Site_Builder;
Name_Ref : in S_Expressions.Atom_Refs.Immutable_Reference;
Default : in S_Expressions.Atom_Refs.Immutable_Reference)
return Filters.Filter'Class is
begin
if not Name_Ref.Is_Empty then
begin
return Sites.Get_Filter (Builder, Name_Ref.Query);
exception
when Filters.Stores.No_Filter => null;
end;
end if;
if not Default.Is_Empty then
begin
return Sites.Get_Filter (Builder, Default.Query);
exception
when Filters.Stores.No_Filter => null;
end;
end if;
declare
Fallback : Filters.Text_Blocks.Filter;
begin
return Fallback;
end;
end Get_Safe_Filter;
procedure Preprocess
(Comment : in out Comment_Data;
List : in Comment_List;
Site : in Sites.Site)
is
use Comment_Atoms;
begin
Preprocess
(Comment,
Get_Safe_Filter
(Site, Comment.Atoms (Filter), List.Default_Text_Filter));
end Preprocess;
procedure Preprocess
(Comment : in out Comment_Data;
List : in Comment_List;
Builder : in Sites.Site_Builder)
is
use Comment_Atoms;
begin
Preprocess
(Comment,
Get_Safe_Filter
(Builder, Comment.Atoms (Filter), List.Default_Text_Filter));
end Preprocess;
procedure Preprocess
(Comment : in out Comment_Data;
Text_Filter : in Filters.Filter'Class)
is
procedure Preprocess_Atom
(Ref : in out S_Expressions.Atom_Refs.Immutable_Reference);
procedure Preprocess_Link
(Ref : in out S_Expressions.Atom_Refs.Immutable_Reference;
Value : in S_Expressions.Atom);
procedure Preprocess_Atom
(Ref : in out S_Expressions.Atom_Refs.Immutable_Reference) is
begin
Reset_If_Blank (Ref);
if not Ref.Is_Empty then
Ref := Escapes.Escape (Ref, Escapes.HTML_Attribute);
end if;
end Preprocess_Atom;
procedure Preprocess_Link
(Ref : in out S_Expressions.Atom_Refs.Immutable_Reference;
Value : in S_Expressions.Atom)
is
use type S_Expressions.Atom;
begin
if Is_Valid_URL (S_Expressions.To_String (Value)) then
Ref := Escapes.Escape (Ref, Escapes.HTML_Attribute);
elsif Is_Valid_URL ("//" & S_Expressions.To_String (Value)) then
Ref := Escapes.Escape
((1 .. 2 => Character'Pos ('/')) & Value,
Escapes.HTML_Attribute);
else
Ref.Reset;
end if;
end Preprocess_Link;
use Comment_Atoms;
begin
if Comment.Flags (Comment_Flags.Preprocessed) then
return;
end if;
for I in Comment_Atoms.Enum loop
case I is
when Filter =>
null;
when Link =>
if not Comment.Atoms (I).Is_Empty then
Preprocess_Link (Comment.Atoms (I), Comment.Atoms (I).Query);
end if;
when Text =>
Reset_If_Blank (Comment.Atoms (I));
if not Comment.Atoms (I).Is_Empty then
declare
Buffer : S_Expressions.Atom_Buffers.Atom_Buffer;
begin
Text_Filter.Apply (Buffer, Comment.Atoms (I).Query);
Comment.Atoms (I) := Create (Buffer.Data);
end;
end if;
when Name | Mail | Class | Note | Title =>
Preprocess_Atom (Comment.Atoms (I));
end case;
end loop;
Comment.Flags (Comment_Flags.Preprocessed) := True;
end Preprocess;
function Preview_Id return S_Expressions.Atom_Refs.Immutable_Reference is
begin
if Preview_Id_Ref.Is_Empty then
Preview_Id_Ref := Create (S_Expressions.To_Atom ("preview"));
end if;
return Preview_Id_Ref;
end Preview_Id;
procedure Process_Form
(Data : in out Comment_Builder;
Exchange : in Sites.Exchange;
List : in Comment_List)
is
procedure Process (Field, Value : String);
procedure Process (Field, Value : String) is
use Static_Maps.Item.Form;
begin
Data.Raw_Fields.Insert (Field, Value);
case Static_Maps.To_Item_Form (Field) is
when Unknown =>
Data.Extra_Fields.Insert (Field, Value);
if Field /= Submit_Button and then Field /= Preview_Button then
Data.Has_Unknown_Field := True;
end if;
when Cookie_Save =>
if Value = "yes" then
Data.Cookie_Save := True;
else
Log (Severities.Info, "Unexpected cookie_save value """
& Value & '"');
end if;
when Date =>
if List.Flags (List_Flags.Allow_Date_Override) then
begin
Time_IO.RFC_3339.Value
(Value, Data.Core.Date, Data.Core.Offset);
exception
when others => null;
end;
else
Data.Extra_Fields.Insert (Field, Value);
Data.Has_Unknown_Field := True;
end if;
when Filter =>
if List.Text_Filters.Is_Empty then
Data.Extra_Fields.Insert (Field, Value);
Data.Has_Unknown_Field := True;
else
for Name_Ref of List.Text_Filters.Query.Data.all loop
if S_Expressions.To_String (Name_Ref.Query) = Value then
Data.Core.Atoms (Comment_Atoms.Filter) := Name_Ref;
exit;
end if;
end loop;
end if;
when Atom =>
pragma Assert (Field'Length > 2
and then Field (Field'First .. Field'First + 1) = "c_");
Data.Core.Atoms
(Comment_Atoms.Enum'Value
(Field (Field'First + 2 .. Field'Last)))
:= Create (S_Expressions.To_Atom (Value));
end case;
end Process;
begin
Data.Core.Atoms (Comment_Atoms.Class) := Get_Class (Exchange);
Exchange.Iterate_Parameters (Process'Access);
end Process_Form;
overriding procedure Render
(Exchange : in out Sites.Exchange;
Object : in Comment_Ref;
Expression : in out S_Expressions.Lockable.Descriptor'Class) is
begin
Render
(Expression, Exchange,
Comment_Maps.Element (Object.Container.Query.Find (Object.Id)));
end Render;
procedure Write
(Comment : in Comment_Data;
Output : in out S_Expressions.Printers.Printer'Class)
is
procedure Print (Key : in String; Value : in S_Expressions.Atom);
procedure Print
(Key : in String;
Value : in S_Expressions.Atom_Refs.Immutable_Reference);
procedure Print (Key : in String; Value : in S_Expressions.Atom) is
begin
Output.Open_List;
Output.Append_Atom (S_Expressions.To_Atom (Key));
Output.Append_Atom (Value);
Output.Close_List;
end Print;
procedure Print
(Key : in String;
Value : in S_Expressions.Atom_Refs.Immutable_Reference) is
begin
if not Value.Is_Empty then
Print (Key, Value.Query);
end if;
end Print;
use type Comment_Atoms.Enum;
begin
pragma Assert (not Comment.Flags (Comment_Flags.Preprocessed));
Print ("date", S_Expressions.To_Atom
(Time_IO.RFC_3339.Image (Comment.Date, Comment.Offset)));
for I in Comment_Atoms.Enum loop
Print (Image (I), Comment.Atoms (I));
end loop;
Print_Flags :
declare
Flag_Printed : Boolean := False;
begin
for Flag in Comment_Flags.Enum loop
if Comment.Flags (Flag) then
if not Flag_Printed then
Output.Open_List;
Output.Append_String ("flags");
Flag_Printed := True;
end if;
Output.Append_Atom (Comment_Flag_IO.Image (Flag));
end if;
end loop;
if Flag_Printed then
Output.Close_List;
end if;
end Print_Flags;
end Write;
procedure Write
(Builder : in Comment_Builder;
Output : in out S_Expressions.Printers.Printer'Class) is
begin
Output.Open_List;
Output.Append_Atom (Builder.Core.Id.Query);
Write (Builder.Core, Output);
Write_Extra_Fields :
declare
Cursor : String_Maps.Cursor := Builder.Extra_Fields.First;
begin
Output.Open_List;
Output.Append_String ("extra-fields");
while String_Maps.Has_Element (Cursor) loop
Output.Open_List;
Output.Append_String (String_Maps.Key (Cursor));
Output.Append_String (String_Maps.Element (Cursor));
Output.Close_List;
String_Maps.Next (Cursor);
end loop;
Output.Close_List;
end Write_Extra_Fields;
Output.Open_List;
Output.Append_String ("has-unknown-field");
Output.Append_String (Boolean'Image (Builder.Has_Unknown_Field));
Output.Close_List;
Output.Open_List;
Output.Append_String ("action");
Output.Append_Atom (Post_Action_IO.Image (Builder.Action));
if not Builder.Reason.Is_Empty then
Output.Append_Atom (Builder.Reason.Query);
end if;
Output.Close_List;
if not Builder.Anchor.Is_Empty then
Output.Open_List;
Output.Append_String ("anchor");
Output.Append_Atom (Builder.Anchor.Query);
Output.Close_List;
end if;
Output.Close_List;
end Write;
procedure Write
(Builder : in Comment_Builder;
Site : in Sites.Site;
Arguments : in out S_Expressions.Lockable.Descriptor'Class)
is
use type S_Expressions.Events.Event;
begin
if Arguments.Current_Event /= S_Expressions.Events.Add_Atom then
Log (Severities.Error,
"Invalid write target: first name is not an atom");
return;
end if;
declare
Stream : aliased File_Streams.File_Stream := File_Streams.Open
(Ada.Streams.Stream_IO.Append_File,
S_Expressions.To_String (Arguments.Current_Atom));
Printer : S_Expressions.Printers.Pretty.Stream_Printer
(Stream'Access);
begin
Site.Set_Parameters (Printer);
Write (Builder, Printer);
Printer.Newline;
end;
end Write;
------------------------------
-- Comment List Subprograms --
------------------------------
overriding procedure Finalize (Object : in out Comment_List) is
begin
if not Object.Comments.Is_Empty then
Object.Comments.Update.Orphan;
Object.Comments.Reset;
end if;
end Finalize;
procedure Live_Load
(Object : in out Comment_List;
Site : in Sites.Site;
Parent : in Tags.Visible_Access := null;
Parent_Path : in S_Expressions.Atom_Refs.Immutable_Reference
:= S_Expressions.Atom_Refs.Null_Immutable_Reference) is
begin
if Object.Backend_Name.Is_Empty or else Object.Backend_Path.Is_Empty then
return;
end if;
Object.Parent_Path := Parent_Path;
declare
procedure Process (Name : in S_Expressions.Atom);
Backend : constant Backends.Backend'Class
:= Site.Get_Backend (Object.Backend_Name.Query);
Directory : constant S_Expressions.Atom_Refs.Accessor
:= Object.Backend_Path.Query;
Map : Comment_Maps.Unsafe_Maps.Map;
procedure Process (Name : in S_Expressions.Atom) is
Input_Stream : aliased Ada.Streams.Root_Stream_Type'Class
:= Backend.Read (Directory, Name);
Reader : S_Expressions.Parsers.Stream_Parser (Input_Stream'Access);
Comment : Comment_Data;
Position : Comment_Maps.Unsafe_Maps.Cursor;
Inserted : Boolean;
begin
Reader.Next;
Update (Reader, Comment, Meaningless_Value);
if not Comment.Flags (Comment_Flags.Ignored) then
Comment.Id := Create (Name);
Comment.Parent := Parent;
Preprocess (Comment, Object, Site);
Map.Insert (Name, Comment, Position, Inserted);
if not Inserted then
Log (Severities.Error, "Duplicate comment id """
& S_Expressions.To_String (Name) & '"');
end if;
end if;
end Process;
begin
Backend.Iterate (Directory, Process'Access);
Object.Comments := Container_Refs.Create (new Comment_Container);
Object.Comments.Update.Initialize (Map, Parent);
Object.Parent := Parent;
end;
if not Object.Tags.Is_Empty then
declare
C : Comment_Maps.Cursor := Object.Comments.Query.First;
Id : S_Expressions.Atom_Refs.Immutable_Reference;
begin
while Comment_Maps.Has_Element (C) loop
Id := Comment_Maps.Element (C).Id;
Site.Queue_Update (Comment_Inserter'
(Container => Object.Comments,
Id => Id,
Tags => Object.Tags));
Comment_Maps.Next (C);
end loop;
end;
end if;
end Live_Load;
procedure Load
(Object : in out Comment_List;
Builder : in out Sites.Site_Builder;
Parent : in Tags.Visible_Access := null;
Parent_Path : in S_Expressions.Atom_Refs.Immutable_Reference
:= S_Expressions.Atom_Refs.Null_Immutable_Reference) is
begin
if Object.Backend_Name.Is_Empty or else Object.Backend_Path.Is_Empty then
return;
end if;
Object.Parent_Path := Parent_Path;
declare
procedure Process (Name : in S_Expressions.Atom);
Backend : constant Backends.Backend'Class
:= Sites.Get_Backend (Builder, Object.Backend_Name.Query);
Directory : constant S_Expressions.Atom_Refs.Accessor
:= Object.Backend_Path.Query;
Map : Comment_Maps.Unsafe_Maps.Map;
procedure Process (Name : in S_Expressions.Atom) is
Input_Stream : aliased Ada.Streams.Root_Stream_Type'Class
:= Backend.Read (Directory, Name);
Reader : S_Expressions.Parsers.Stream_Parser (Input_Stream'Access);
Comment : Comment_Data;
Position : Comment_Maps.Unsafe_Maps.Cursor;
Inserted : Boolean;
begin
Reader.Next;
Update (Reader, Comment, Meaningless_Value);
if not Comment.Flags (Comment_Flags.Ignored) then
Comment.Id := Create (Name);
Comment.Parent := Parent;
Preprocess (Comment, Object, Builder);
Map.Insert (Name, Comment, Position, Inserted);
if not Inserted then
Log (Severities.Error, "Duplicate comment id """
& S_Expressions.To_String (Name) & '"');
end if;
end if;
end Process;
begin
Backend.Iterate (Directory, Process'Access);
Object.Comments := Container_Refs.Create (new Comment_Container);
Object.Comments.Update.Initialize (Map, Parent);
Object.Parent := Parent;
end;
if not Object.Tags.Is_Empty then
declare
C : Comment_Maps.Cursor := Object.Comments.Query.First;
Id : S_Expressions.Atom_Refs.Immutable_Reference;
begin
while Comment_Maps.Has_Element (C) loop
Id := Comment_Maps.Element (C).Id;
Sites.Insert
(Builder,
Tags.Create (Object.Tags.Query, Id),
Comment_Ref'(Object.Comments, Id));
Comment_Maps.Next (C);
end loop;
end;
end if;
end Load;
procedure Render
(Exchange : in out Sites.Exchange;
Object : in Comment_List;
Expression : in out S_Expressions.Lockable.Descriptor'Class) is
begin
if not Object.Backend_Name.Is_Empty
and then not Object.Backend_Path.Is_Empty
then
Render (Expression, Exchange, Object);
end if;
end Render;
procedure Respond
(List : in out Comment_List;
Exchange : in out Sites.Exchange;
Extra_Path : in S_Expressions.Atom)
is
function Get_Anchor
(Builder : Comment_Builder;
Default : S_Expressions.Atom)
return S_Expressions.Atom;
function Redirect_Base
(Builder : Comment_Builder)
return S_Expressions.Atom;
function Redirect_Location
(Default_Anchor : S_Expressions.Atom := S_Expressions.Null_Atom)
return S_Expressions.Atom;
function Get_Anchor
(Builder : Comment_Builder;
Default : S_Expressions.Atom)
return S_Expressions.Atom is
begin
if Builder.Anchor.Is_Empty then
return Default;
else
return Builder.Anchor.Query;
end if;
end Get_Anchor;
function Redirect_Base
(Builder : Comment_Builder)
return S_Expressions.Atom is
begin
if Builder.Redirect_Base.Is_Empty then
return List.Parent_Path.Query;
else
return Builder.Redirect_Base.Query;
end if;
end Redirect_Base;
Builder : Comment_Builder;
function Redirect_Location
(Default_Anchor : S_Expressions.Atom := S_Expressions.Null_Atom)
return S_Expressions.Atom
is
use type Ada.Streams.Stream_Element_Array;
Anchor : constant S_Expressions.Atom
:= Get_Anchor (Builder, Default_Anchor);
begin
if Anchor'Length > 0 then
return Redirect_Base (Builder) & Character'Pos ('#') & Anchor;
else
return Redirect_Base (Builder);
end if;
end Redirect_Location;
begin
if Extra_Path'Length > 0
or else List.Flags (List_Flags.Closed)
or else List.Backend_Name.Is_Empty
or else List.Backend_Path.Is_Empty
or else List.Parent_Path.Is_Empty
then
return;
end if;
Check_Method :
declare
Allowed : Boolean;
begin
Error_Pages.Check_Method (Exchange, Exchanges.POST, Allowed);
if not Allowed then
return;
end if;
end Check_Method;
if Exchange.Parameter (Preview_Button) /= "" then
if not Tags."=" (List.Parent, null) then
Render_Default (Exchange, List.Parent.all);
end if;
return;
elsif Exchange.Parameter (Ignore_Button) /= ""
and then List.Flags (List_Flags.Allow_Ignore)
then
declare
procedure Process (Name, Value : in String);
Ids : Id_Lists.List;
procedure Process (Name, Value : in String) is
Ref : S_Expressions.Atom_Refs.Immutable_Reference;
begin
if Name /= "id" then
return;
end if;
List.Comments.Update.Ignore
(S_Expressions.To_Atom (Value), Ref);
if Ref.Is_Empty then
return;
end if;
Ids.Append (Ref);
Update_Stored_Comment :
declare
Backend : Backends.Backend'Class
:= Exchange.Site.Get_Backend (List.Backend_Name.Query);
Stream : aliased Ada.Streams.Root_Stream_Type'Class
:= Backend.Append
(List.Backend_Path.Query,
Ref.Query);
Printer : S_Expressions.Printers.Pretty.Stream_Printer
(Stream'Access);
begin
Exchange.Site.Set_Parameters (Printer);
Printer.Open_List;
Printer.Append_String ("flags");
Printer.Append_Atom
(Comment_Flag_IO.Image (Comment_Flags.Ignored));
Printer.Close_List;
end Update_Stored_Comment;
end Process;
begin
Exchange.Iterate_Parameters (Process'Access);
if not List.Tags.Is_Empty and then not Ids.Is_Empty then
Exchange.Site.Queue_Update (Comment_Remover'
(Container => List.Comments,
Ids => Ids,
Tags => List.Tags));
end if;
end;
Error_Pages.See_Other (Exchange, Redirect_Location);
return;
elsif Exchange.Parameter (Submit_Button) = "" then
return;
end if;
Builder.Action := Save_Comment;
Builder.Core.Date := Ada.Calendar.Clock;
Builder.Core.Offset := Ada.Calendar.Time_Zones.UTC_Time_Offset
(Builder.Core.Date);
Builder.Core.Id := Create (S_Expressions.To_Atom
(Time_Keys.To_Key (Builder.Core.Date)));
Builder.Core.Flags (Comment_Flags.Ignored)
:= List.Flags (List_Flags.Ignore_By_Default);
Process_Form (Builder, Exchange, List);
Process_Actions (Builder, Exchange.Site.all, List.Post_Filter);
if not Builder.Reason.Is_Empty then
Log (Severities.Info, "Comment tagged "
& Post_Action'Image (Builder.Action)
& " because "
& S_Expressions.To_String (Builder.Reason.Query));
end if;
case Builder.Action is
when Force_Preview =>
if not Tags."=" (List.Parent, null) then
Render_Default (Exchange, List.Parent.all);
end if;
when Parent_Redirect =>
Error_Pages.See_Other (Exchange, Redirect_Location);
when Save_Comment =>
Write_Comment :
declare
Backend : Backends.Backend'Class
:= Exchange.Site.Get_Backend (List.Backend_Name.Query);
Stream : aliased Ada.Streams.Root_Stream_Type'Class
:= Backend.Create
(List.Backend_Path.Query,
Builder.Core.Id.Query);
Printer : S_Expressions.Printers.Pretty.Stream_Printer
(Stream'Access);
begin
Exchange.Site.Set_Parameters (Printer);
Write (Builder.Core, Printer);
end Write_Comment;
if Builder.Cookie_Save then
Set_Cookie :
declare
Info : constant Comment_Cookies.Comment_Info
:= Comment_Cookies.Create
(Name => Builder.Core.Atoms (Comment_Atoms.Name),
Mail => Builder.Core.Atoms (Comment_Atoms.Mail),
Link => Builder.Core.Atoms (Comment_Atoms.Link),
Filter => Builder.Core.Atoms (Comment_Atoms.Filter));
begin
Sites.Set_Comment_Cookie (Exchange, Info);
end Set_Cookie;
end if;
Error_Pages.See_Other
(Exchange,
Redirect_Location (Builder.Core.Id.Query));
if not Builder.Core.Flags (Comment_Flags.Ignored) then
Preprocess (Builder.Core, List, Exchange.Site.all);
List.Comments.Update.Insert (Builder.Core);
if not List.Tags.Is_Empty then
Exchange.Site.Queue_Update (Comment_Inserter'
(Container => List.Comments,
Id => Builder.Core.Id,
Tags => List.Tags));
end if;
end if;
end case;
end Respond;
procedure Set
(List : out Comment_List;
Expression : in out S_Expressions.Lockable.Descriptor'Class) is
begin
List := Empty_List;
Update (Expression, List, Meaningless_Value);
end Set;
procedure Set
(List : out Comment_List;
Template : in out S_Expressions.Lockable.Descriptor'Class;
Expression : in out S_Expressions.Lockable.Descriptor'Class;
Path_Override : in S_Expressions.Atom_Refs.Immutable_Reference
:= S_Expressions.Atom_Refs.Null_Immutable_Reference) is
begin
List := Empty_List;
Update (Template, List, Meaningless_Value);
Update (Expression, List, Meaningless_Value);
if not Path_Override.Is_Empty then
List.Backend_Path := Path_Override;
end if;
end Set;
procedure Set_Parent
(Container : in out Comment_Maps.Updatable_Map;
Parent : in Tags.Visible_Access) is
begin
for E of Container loop
E.Parent := Parent;
end loop;
end Set_Parent;
procedure Update_Ranks (Container : in out Comment_Maps.Updatable_Map) is
Current_Rank : Positive := 1;
begin
for E of Container loop
E.Rank := Current_Rank;
Current_Rank := Current_Rank + 1;
end loop;
pragma Assert (Current_Rank = Natural (Container.Length) + 1);
end Update_Ranks;
-----------------------
-- Comment Container --
-----------------------
protected body Comment_Container is
procedure Initialize
(Data : in Comment_Maps.Unsafe_Maps.Map;
Parent : in Tags.Visible_Access) is
begin
Map := Comment_Maps.Create (Data);
Set_Parent (Map, Parent);
Update_Ranks (Map);
Comment_Container.Parent := Parent;
end Initialize;
procedure Insert (Data : in Comment_Data) is
New_Item : Comment_Data := Data;
begin
New_Item.Parent := Parent;
Map := Comment_Maps.Insert (Map, New_Item.Id.Query, New_Item);
Update_Ranks (Map);
end Insert;
procedure Ignore
(Id : in S_Expressions.Atom;
Ref : out S_Expressions.Atom_Refs.Immutable_Reference)
is
Position : constant Comment_Maps.Cursor := Map.Find (Id);
begin
if Comment_Maps.Has_Element (Position) then
Ref := Comment_Maps.Element (Position).Id;
Map := Comment_Maps.Delete (Map, Position);
Update_Ranks (Map);
else
Ref := S_Expressions.Atom_Refs.Null_Immutable_Reference;
Log (Severities.Error,
"Unknown comment id """
& S_Expressions.To_String (Id)
& """ to ignore");
end if;
end Ignore;
procedure Orphan is
begin
Set_Parent (Map, null);
Parent := null;
end Orphan;
function Find (Id : S_Expressions.Atom_Refs.Immutable_Reference)
return Comment_Maps.Cursor is
begin
return Map.Find (Id.Query);
end Find;
function First return Comment_Maps.Cursor is
begin
return Map.First;
end First;
function Iterate return
Comment_Maps.Map_Iterator_Interfaces.Reversible_Iterator'Class is
begin
return Map.Iterate;
end Iterate;
function Length return Natural is
begin
return Natural (Map.Length);
end Length;
end Comment_Container;
-------------------
-- Site Updaters --
-------------------
overriding procedure Update
(Self : in Comment_Inserter;
Site : in out Sites.Site) is
begin
pragma Assert (not Self.Tags.Is_Empty);
Site.Insert
(Tags.Create (Self.Tags.Query, Self.Id),
Comment_Ref'(Self.Container, Self.Id));
end Update;
overriding procedure Update
(Self : in Comment_Remover;
Site : in out Sites.Site) is
begin
pragma Assert (not Self.Tags.Is_Empty);
for Id of Self.Ids loop
Site.Remove
(Tags.Create (Self.Tags.Query, Id),
Comment_Ref'(Self.Container, Id));
end loop;
end Update;
end Natools.Web.Comments;
| 32.256518 | 79 | 0.581985 |
598e6ce403b84be43983e78aaa8dc5e9a9190934 | 23,122 | ads | Ada | arch/ARM/STM32/svd/stm32l5x2/stm32_svd-octospi.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | arch/ARM/STM32/svd/stm32l5x2/stm32_svd-octospi.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | arch/ARM/STM32/svd/stm32l5x2/stm32_svd-octospi.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | -- This spec has been automatically generated from STM32L5x2.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.OctoSPI is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CR_FTHRES_Field is HAL.UInt5;
subtype CR_FMODE_Field is HAL.UInt2;
-- control register
type CR_Register is record
-- Enable
EN : Boolean := False;
-- Abort request
ABORT_k : Boolean := False;
-- DMA enable
DMAEN : Boolean := False;
-- Timeout counter enable
TCEN : Boolean := False;
-- unspecified
Reserved_4_5 : HAL.UInt2 := 16#0#;
-- Dual-quad mode
DQM : Boolean := False;
-- FLASH memory selection
FSEL : Boolean := False;
-- IFO threshold level
FTHRES : CR_FTHRES_Field := 16#0#;
-- unspecified
Reserved_13_15 : HAL.UInt3 := 16#0#;
-- Transfer error interrupt enable
TEIE : Boolean := False;
-- Transfer complete interrupt enable
TCIE : Boolean := False;
-- FIFO threshold interrupt enable
FTIE : Boolean := False;
-- Status match interrupt enable
SMIE : Boolean := False;
-- TimeOut interrupt enable
TOIE : Boolean := False;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- Automatic poll mode stop
APMS : Boolean := False;
-- Polling match mode
PMM : Boolean := False;
-- unspecified
Reserved_24_27 : HAL.UInt4 := 16#0#;
-- Functional mode
FMODE : CR_FMODE_Field := 16#0#;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CR_Register use record
EN at 0 range 0 .. 0;
ABORT_k at 0 range 1 .. 1;
DMAEN at 0 range 2 .. 2;
TCEN at 0 range 3 .. 3;
Reserved_4_5 at 0 range 4 .. 5;
DQM at 0 range 6 .. 6;
FSEL at 0 range 7 .. 7;
FTHRES at 0 range 8 .. 12;
Reserved_13_15 at 0 range 13 .. 15;
TEIE at 0 range 16 .. 16;
TCIE at 0 range 17 .. 17;
FTIE at 0 range 18 .. 18;
SMIE at 0 range 19 .. 19;
TOIE at 0 range 20 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
APMS at 0 range 22 .. 22;
PMM at 0 range 23 .. 23;
Reserved_24_27 at 0 range 24 .. 27;
FMODE at 0 range 28 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
subtype DCR1_CSHT_Field is HAL.UInt3;
subtype DCR1_DEVSIZE_Field is HAL.UInt5;
subtype DCR1_MTYP_Field is HAL.UInt2;
-- device configuration register
type DCR1_Register is record
-- Mode 0 / mode 3
CKMODE : Boolean := False;
-- Free running clock
FRCK : Boolean := False;
-- unspecified
Reserved_2_7 : HAL.UInt6 := 16#0#;
-- Chip-select high time
CSHT : DCR1_CSHT_Field := 16#0#;
-- unspecified
Reserved_11_15 : HAL.UInt5 := 16#0#;
-- Device size
DEVSIZE : DCR1_DEVSIZE_Field := 16#0#;
-- unspecified
Reserved_21_23 : HAL.UInt3 := 16#0#;
-- Memory type
MTYP : DCR1_MTYP_Field := 16#0#;
-- unspecified
Reserved_26_31 : HAL.UInt6 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DCR1_Register use record
CKMODE at 0 range 0 .. 0;
FRCK at 0 range 1 .. 1;
Reserved_2_7 at 0 range 2 .. 7;
CSHT at 0 range 8 .. 10;
Reserved_11_15 at 0 range 11 .. 15;
DEVSIZE at 0 range 16 .. 20;
Reserved_21_23 at 0 range 21 .. 23;
MTYP at 0 range 24 .. 25;
Reserved_26_31 at 0 range 26 .. 31;
end record;
subtype DCR2_PRESCALER_Field is HAL.UInt8;
subtype DCR2_WRAPSIZE_Field is HAL.UInt3;
-- device configuration register 2
type DCR2_Register is record
-- Clock prescaler
PRESCALER : DCR2_PRESCALER_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Wrap size
WRAPSIZE : DCR2_WRAPSIZE_Field := 16#0#;
-- unspecified
Reserved_19_31 : HAL.UInt13 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DCR2_Register use record
PRESCALER at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
WRAPSIZE at 0 range 16 .. 18;
Reserved_19_31 at 0 range 19 .. 31;
end record;
subtype DCR3_CSBOUND_Field is HAL.UInt5;
-- device configuration register 3
type DCR3_Register is record
-- unspecified
Reserved_0_15 : HAL.UInt16 := 16#0#;
-- CS boundary
CSBOUND : DCR3_CSBOUND_Field := 16#0#;
-- unspecified
Reserved_21_31 : HAL.UInt11 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DCR3_Register use record
Reserved_0_15 at 0 range 0 .. 15;
CSBOUND at 0 range 16 .. 20;
Reserved_21_31 at 0 range 21 .. 31;
end record;
subtype DCR4_FLEVEL_Field is HAL.UInt6;
-- DCR4
type DCR4_Register is record
-- Transfer error flag
TEF : Boolean := False;
-- Transfer complete flag
TCF : Boolean := False;
-- FIFO threshold flag
FTF : Boolean := False;
-- Status match flag
SMF : Boolean := False;
-- Timeout flag
TOF : Boolean := False;
-- BUSY
BUSY : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- FIFO level
FLEVEL : DCR4_FLEVEL_Field := 16#0#;
-- unspecified
Reserved_14_31 : HAL.UInt18 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DCR4_Register use record
TEF at 0 range 0 .. 0;
TCF at 0 range 1 .. 1;
FTF at 0 range 2 .. 2;
SMF at 0 range 3 .. 3;
TOF at 0 range 4 .. 4;
BUSY at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
FLEVEL at 0 range 8 .. 13;
Reserved_14_31 at 0 range 14 .. 31;
end record;
-- status register
type SR_Register is record
-- Write-only. Clear transfer error flag
CTEF : Boolean := False;
-- Write-only. Clear transfer complete flag
CTCF : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Write-only. Clear status match flag
CSMF : Boolean := False;
-- Write-only. Clear timeout flag
CTOF : Boolean := False;
-- unspecified
Reserved_5_31 : HAL.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for SR_Register use record
CTEF at 0 range 0 .. 0;
CTCF at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
CSMF at 0 range 3 .. 3;
CTOF at 0 range 4 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
subtype PSMAR_INTERVAL_Field is HAL.UInt16;
-- polling status match register
type PSMAR_Register is record
-- Polling interval
INTERVAL : PSMAR_INTERVAL_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PSMAR_Register use record
INTERVAL at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype PIR_IMODE_Field is HAL.UInt3;
subtype PIR_ISIZE_Field is HAL.UInt2;
subtype PIR_ADMODE_Field is HAL.UInt3;
subtype PIR_ADSIZE_Field is HAL.UInt2;
subtype PIR_ABMODE_Field is HAL.UInt3;
subtype PIR_ABSIZE_Field is HAL.UInt2;
subtype PIR_DMODE_Field is HAL.UInt3;
-- polling interval register
type PIR_Register is record
-- Instruction mode
IMODE : PIR_IMODE_Field := 16#0#;
-- Instruction double transfer rate
IDTR : Boolean := False;
-- Instruction size
ISIZE : PIR_ISIZE_Field := 16#0#;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Address mode
ADMODE : PIR_ADMODE_Field := 16#0#;
-- Address double transfer rate
ADDTR : Boolean := False;
-- Address size
ADSIZE : PIR_ADSIZE_Field := 16#0#;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- Alternate byte mode
ABMODE : PIR_ABMODE_Field := 16#0#;
-- Alternate bytes double transfer rate
ABDTR : Boolean := False;
-- Alternate bytes size
ABSIZE : PIR_ABSIZE_Field := 16#0#;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Data mode
DMODE : PIR_DMODE_Field := 16#0#;
-- Alternate bytes double transfer rate
DDTR : Boolean := False;
-- unspecified
Reserved_28_28 : HAL.Bit := 16#0#;
-- DQS enable
DQSE : Boolean := False;
-- unspecified
Reserved_30_30 : HAL.Bit := 16#0#;
-- Send instruction only once mode
SIOO : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for PIR_Register use record
IMODE at 0 range 0 .. 2;
IDTR at 0 range 3 .. 3;
ISIZE at 0 range 4 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
ADMODE at 0 range 8 .. 10;
ADDTR at 0 range 11 .. 11;
ADSIZE at 0 range 12 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
ABMODE at 0 range 16 .. 18;
ABDTR at 0 range 19 .. 19;
ABSIZE at 0 range 20 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
DMODE at 0 range 24 .. 26;
DDTR at 0 range 27 .. 27;
Reserved_28_28 at 0 range 28 .. 28;
DQSE at 0 range 29 .. 29;
Reserved_30_30 at 0 range 30 .. 30;
SIOO at 0 range 31 .. 31;
end record;
subtype CCR_DCYC_Field is HAL.UInt5;
-- communication configuration register
type CCR_Register is record
-- Number of dummy cycles
DCYC : CCR_DCYC_Field := 16#0#;
-- unspecified
Reserved_5_27 : HAL.UInt23 := 16#0#;
-- Delay hold quarter cycle
DHQC : Boolean := False;
-- unspecified
Reserved_29_29 : HAL.Bit := 16#0#;
-- Sample shift
SSHIFT : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CCR_Register use record
DCYC at 0 range 0 .. 4;
Reserved_5_27 at 0 range 5 .. 27;
DHQC at 0 range 28 .. 28;
Reserved_29_29 at 0 range 29 .. 29;
SSHIFT at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype ABR_TIMEOUT_Field is HAL.UInt16;
-- alternate bytes register
type ABR_Register is record
-- Timeout period
TIMEOUT : ABR_TIMEOUT_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for ABR_Register use record
TIMEOUT at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype LPTR_IMODE_Field is HAL.UInt3;
subtype LPTR_ISIZE_Field is HAL.UInt2;
subtype LPTR_ADMODE_Field is HAL.UInt3;
subtype LPTR_ADSIZE_Field is HAL.UInt2;
subtype LPTR_ABMODE_Field is HAL.UInt3;
subtype LPTR_ABSIZE_Field is HAL.UInt2;
subtype LPTR_DMODE_Field is HAL.UInt3;
-- low-power timeout register
type LPTR_Register is record
-- Instruction mode
IMODE : LPTR_IMODE_Field := 16#0#;
-- Instruction double transfer rate
IDTR : Boolean := False;
-- Instruction size
ISIZE : LPTR_ISIZE_Field := 16#0#;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Address mode
ADMODE : LPTR_ADMODE_Field := 16#0#;
-- Address double transfer rate
ADDTR : Boolean := False;
-- Address size
ADSIZE : LPTR_ADSIZE_Field := 16#0#;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- Alternate byte mode
ABMODE : LPTR_ABMODE_Field := 16#0#;
-- Alternate bytes double transfer rate
ABDTR : Boolean := False;
-- Alternate bytes size
ABSIZE : LPTR_ABSIZE_Field := 16#0#;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Data mode
DMODE : LPTR_DMODE_Field := 16#0#;
-- alternate bytes double transfer rate
DDTR : Boolean := False;
-- unspecified
Reserved_28_28 : HAL.Bit := 16#0#;
-- DQS enable
DQSE : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for LPTR_Register use record
IMODE at 0 range 0 .. 2;
IDTR at 0 range 3 .. 3;
ISIZE at 0 range 4 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
ADMODE at 0 range 8 .. 10;
ADDTR at 0 range 11 .. 11;
ADSIZE at 0 range 12 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
ABMODE at 0 range 16 .. 18;
ABDTR at 0 range 19 .. 19;
ABSIZE at 0 range 20 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
DMODE at 0 range 24 .. 26;
DDTR at 0 range 27 .. 27;
Reserved_28_28 at 0 range 28 .. 28;
DQSE at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
subtype WPCCR_DCYC_Field is HAL.UInt5;
-- write communication configuration register
type WPCCR_Register is record
-- Number of dummy cycles
DCYC : WPCCR_DCYC_Field := 16#0#;
-- unspecified
Reserved_5_27 : HAL.UInt23 := 16#0#;
-- Delay hold quarter cycle
DHQC : Boolean := False;
-- unspecified
Reserved_29_29 : HAL.Bit := 16#0#;
-- Sample shift
SSHIFT : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for WPCCR_Register use record
DCYC at 0 range 0 .. 4;
Reserved_5_27 at 0 range 5 .. 27;
DHQC at 0 range 28 .. 28;
Reserved_29_29 at 0 range 29 .. 29;
SSHIFT at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype WPABR_TACC_Field is HAL.UInt8;
subtype WPABR_TRWR_Field is HAL.UInt8;
-- write alternate bytes register
type WPABR_Register is record
-- Latency mode
LM : Boolean := False;
-- Write zero latency
WZL : Boolean := False;
-- unspecified
Reserved_2_7 : HAL.UInt6 := 16#0#;
-- Access time
TACC : WPABR_TACC_Field := 16#0#;
-- Read write recovery time
TRWR : WPABR_TRWR_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for WPABR_Register use record
LM at 0 range 0 .. 0;
WZL at 0 range 1 .. 1;
Reserved_2_7 at 0 range 2 .. 7;
TACC at 0 range 8 .. 15;
TRWR at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype WCCR_REFRESH_Field is HAL.UInt16;
-- WCCR
type WCCR_Register is record
-- REFRESH
REFRESH : WCCR_REFRESH_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for WCCR_Register use record
REFRESH at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype WTCR_IMODE_Field is HAL.UInt3;
subtype WTCR_ISIZE_Field is HAL.UInt2;
subtype WTCR_ADMODE_Field is HAL.UInt3;
subtype WTCR_ADSIZE_Field is HAL.UInt2;
subtype WTCR_ABMODE_Field is HAL.UInt3;
subtype WTCR_ABSIZE_Field is HAL.UInt2;
subtype WTCR_DMODE_Field is HAL.UInt3;
-- WTCR
type WTCR_Register is record
-- IMODE
IMODE : WTCR_IMODE_Field := 16#0#;
-- IDTR
IDTR : Boolean := False;
-- ISIZE
ISIZE : WTCR_ISIZE_Field := 16#0#;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- ADMODE
ADMODE : WTCR_ADMODE_Field := 16#0#;
-- ADDTR
ADDTR : Boolean := False;
-- ADSIZE
ADSIZE : WTCR_ADSIZE_Field := 16#0#;
-- unspecified
Reserved_14_15 : HAL.UInt2 := 16#0#;
-- ABMODE
ABMODE : WTCR_ABMODE_Field := 16#0#;
-- ABDTR
ABDTR : Boolean := False;
-- ABSIZE
ABSIZE : WTCR_ABSIZE_Field := 16#0#;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- DMODE
DMODE : WTCR_DMODE_Field := 16#0#;
-- DDTR
DDTR : Boolean := False;
-- unspecified
Reserved_28_28 : HAL.Bit := 16#0#;
-- DQSE
DQSE : Boolean := False;
-- unspecified
Reserved_30_31 : HAL.UInt2 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for WTCR_Register use record
IMODE at 0 range 0 .. 2;
IDTR at 0 range 3 .. 3;
ISIZE at 0 range 4 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
ADMODE at 0 range 8 .. 10;
ADDTR at 0 range 11 .. 11;
ADSIZE at 0 range 12 .. 13;
Reserved_14_15 at 0 range 14 .. 15;
ABMODE at 0 range 16 .. 18;
ABDTR at 0 range 19 .. 19;
ABSIZE at 0 range 20 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
DMODE at 0 range 24 .. 26;
DDTR at 0 range 27 .. 27;
Reserved_28_28 at 0 range 28 .. 28;
DQSE at 0 range 29 .. 29;
Reserved_30_31 at 0 range 30 .. 31;
end record;
subtype WIR_DCYC_Field is HAL.UInt5;
-- WIR
type WIR_Register is record
-- DCYC
DCYC : WIR_DCYC_Field := 16#0#;
-- unspecified
Reserved_5_31 : HAL.UInt27 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for WIR_Register use record
DCYC at 0 range 0 .. 4;
Reserved_5_31 at 0 range 5 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- OctoSPI
type OctoSPI_Peripheral is record
-- control register
CR : aliased CR_Register;
-- device configuration register
DCR1 : aliased DCR1_Register;
-- device configuration register 2
DCR2 : aliased DCR2_Register;
-- device configuration register 3
DCR3 : aliased DCR3_Register;
-- DCR4
DCR4 : aliased DCR4_Register;
-- status register
SR : aliased SR_Register;
-- flag clear register
FCR : aliased HAL.UInt32;
-- data length register
DLR : aliased HAL.UInt32;
-- address register
AR : aliased HAL.UInt32;
-- data register
DR : aliased HAL.UInt32;
-- polling status mask register
PSMKR : aliased HAL.UInt32;
-- polling status match register
PSMAR : aliased PSMAR_Register;
-- polling interval register
PIR : aliased PIR_Register;
-- communication configuration register
CCR : aliased CCR_Register;
-- timing configuration register
TCR : aliased HAL.UInt32;
-- instruction register
IR : aliased HAL.UInt32;
-- alternate bytes register
ABR : aliased ABR_Register;
-- low-power timeout register
LPTR : aliased LPTR_Register;
-- write communication configuration register
WPCCR : aliased WPCCR_Register;
-- write timing configuration register
WPTCR : aliased HAL.UInt32;
-- write instruction register
WPIR : aliased HAL.UInt32;
-- write alternate bytes register
WPABR : aliased WPABR_Register;
-- WCCR
WCCR : aliased WCCR_Register;
-- WTCR
WTCR : aliased WTCR_Register;
-- WIR
WIR : aliased WIR_Register;
-- WABR
WABR : aliased HAL.UInt32;
-- HyperBusTM latency configuration register
HLCR : aliased HAL.UInt32;
end record
with Volatile;
for OctoSPI_Peripheral use record
CR at 16#0# range 0 .. 31;
DCR1 at 16#8# range 0 .. 31;
DCR2 at 16#C# range 0 .. 31;
DCR3 at 16#10# range 0 .. 31;
DCR4 at 16#14# range 0 .. 31;
SR at 16#20# range 0 .. 31;
FCR at 16#24# range 0 .. 31;
DLR at 16#40# range 0 .. 31;
AR at 16#48# range 0 .. 31;
DR at 16#50# range 0 .. 31;
PSMKR at 16#80# range 0 .. 31;
PSMAR at 16#88# range 0 .. 31;
PIR at 16#90# range 0 .. 31;
CCR at 16#100# range 0 .. 31;
TCR at 16#108# range 0 .. 31;
IR at 16#110# range 0 .. 31;
ABR at 16#120# range 0 .. 31;
LPTR at 16#130# range 0 .. 31;
WPCCR at 16#140# range 0 .. 31;
WPTCR at 16#148# range 0 .. 31;
WPIR at 16#150# range 0 .. 31;
WPABR at 16#160# range 0 .. 31;
WCCR at 16#180# range 0 .. 31;
WTCR at 16#188# range 0 .. 31;
WIR at 16#190# range 0 .. 31;
WABR at 16#1A0# range 0 .. 31;
HLCR at 16#200# range 0 .. 31;
end record;
-- OctoSPI
OCTOSPI1_Periph : aliased OctoSPI_Peripheral
with Import, Address => System'To_Address (16#44021000#);
-- OctoSPI
SEC_OCTOSPI1_Periph : aliased OctoSPI_Peripheral
with Import, Address => System'To_Address (16#54021000#);
end STM32_SVD.OctoSPI;
| 32.890469 | 65 | 0.553283 |
3d4a2d584994f1b49f2706ed2c7d4bb2c0999f81 | 2,650 | ads | Ada | orka_plugin_gltf/src/orka-gltf-accessors.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 52 | 2016-07-30T23:00:28.000Z | 2022-02-05T11:54:55.000Z | orka_plugin_gltf/src/orka-gltf-accessors.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 79 | 2016-08-01T18:36:48.000Z | 2022-02-27T12:14:20.000Z | orka_plugin_gltf/src/orka-gltf-accessors.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 4 | 2018-04-28T22:36:26.000Z | 2020-11-14T23:00:29.000Z | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2016 onox <[email protected]>
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
with GL.Types;
with Orka.Containers.Bounded_Vectors;
with Orka.Transforms.Singles.Vectors;
package Orka.glTF.Accessors is
pragma Preelaborate;
subtype Stride_Natural is Natural range Natural'First .. 255;
type Component_Kind is (Byte, Unsigned_Byte, Short, Unsigned_Short, Unsigned_Int, Float);
type Attribute_Kind is (Scalar, Vector2, Vector3, Vector4, Matrix2, Matrix3, Matrix4);
Bytes_Element : constant array (Component_Kind) of Positive :=
(Byte => 1,
Unsigned_Byte => 1,
Short => 2,
Unsigned_Short => 2,
Unsigned_Int => 4,
Float => 4);
Attribute_Length : constant array (Attribute_Kind) of Positive :=
(Scalar => 1,
Vector2 => 2,
Vector3 => 3,
Vector4 => 4,
Matrix2 => 4,
Matrix3 => 9,
Matrix4 => 16);
Numeric_Type : constant array (Component_Kind) of GL.Types.Numeric_Type :=
(Byte => GL.Types.Byte_Type,
Unsigned_Byte => GL.Types.UByte_Type,
Short => GL.Types.Short_Type,
Unsigned_Short => GL.Types.UShort_Type,
Unsigned_Int => GL.Types.UInt_Type,
Float => GL.Types.Single_Type);
function Unsigned_Type (Value : Component_Kind) return GL.Types.Index_Type;
package Transforms renames Orka.Transforms.Singles.Vectors;
type Accessor (Bounds : Boolean := False) is record
View : Natural;
Offset : Natural;
Component : Component_Kind;
Normalized : Boolean;
Count : Positive;
Kind : Attribute_Kind;
case Bounds is
when True =>
Min_Bounds : Transforms.Vector4;
Max_Bounds : Transforms.Vector4;
when False =>
null;
end case;
end record;
package Accessor_Vectors is new Orka.Containers.Bounded_Vectors (Natural, Accessor);
function Get_Accessors
(Accessors : Types.JSON_Value) return Accessor_Vectors.Vector;
end Orka.glTF.Accessors;
| 32.317073 | 92 | 0.656604 |
57cb198812ae01c8211e2dc78490719cd97a5733 | 4,000 | ada | Ada | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc3222a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc3222a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/testsuite/ada/acats/tests/cc/cc3222a.ada | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | -- CC3222A.ADA
-- Grant of Unlimited Rights
--
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
-- unlimited rights in the software and documentation contained herein.
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
-- this public release, the Government intends to confer upon all
-- recipients unlimited rights equal to those held by the Government.
-- These rights include rights to use, duplicate, release or disclose the
-- released technical data and computer software in whole or in part, in
-- any manner and for any purpose whatsoever, and to have or permit others
-- to do so.
--
-- DISCLAIMER
--
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
-- PARTICULAR PURPOSE OF SAID MATERIAL.
--*
-- OBJECTIVE:
-- CHECK THAT A FLOATING POINT FORMAL TYPE DENOTES ITS ACTUAL
-- PARAMETER, AND OPERATIONS OF THE FORMAL TYPE ARE IDENTIFIED WITH
-- CORRESPONDING OPERATIONS OF THE ACTUAL TYPE.
-- HISTORY:
-- TBN 10/09/86 CREATED ORIGINAL TEST.
-- PWN 01/31/95 REMOVED INCONSISTENCIES WITH ADA 9X.
WITH REPORT; USE REPORT;
PROCEDURE CC3222A IS
TYPE FLOAT IS DIGITS 5 RANGE 0.0 .. 10.0;
GENERIC
TYPE T IS DIGITS <>;
PACKAGE P IS
SUBTYPE SUB_T IS T;
PAC_VAR : T;
END P;
FUNCTION IDENT_FLO (X : FLOAT) RETURN FLOAT IS
BEGIN
IF EQUAL (3, 3) THEN
RETURN X;
ELSE
RETURN (0.0);
END IF;
END IDENT_FLO;
BEGIN
TEST ("CC3222A", "CHECK THAT A FLOATING POINT FORMAL TYPE " &
"DENOTES ITS ACTUAL PARAMETER, AND OPERATIONS " &
"OF THE FORMAL TYPE ARE IDENTIFIED WITH " &
"CORRESPONDING OPERATIONS OF THE ACTUAL TYPE");
DECLARE
OBJ_INT : INTEGER := 1;
OBJ_FLO : FLOAT := 1.0;
PACKAGE P1 IS NEW P (FLOAT);
USE P1;
TYPE NEW_T IS NEW SUB_T;
OBJ_NEWT : NEW_T;
BEGIN
PAC_VAR := SUB_T'(1.0);
IF PAC_VAR /= OBJ_FLO THEN
FAILED ("INCORRECT RESULTS - 1");
END IF;
OBJ_FLO := IDENT_FLO (PAC_VAR) + IDENT_FLO (OBJ_FLO);
IF OBJ_FLO <= PAC_VAR THEN
FAILED ("INCORRECT RESULTS - 2");
END IF;
PAC_VAR := PAC_VAR * OBJ_FLO;
IF PAC_VAR NOT IN FLOAT THEN
FAILED ("INCORRECT RESULTS - 3");
END IF;
IF OBJ_FLO NOT IN SUB_T THEN
FAILED ("INCORRECT RESULTS - 4");
END IF;
PAC_VAR := 1.0;
OBJ_FLO := 1.0;
OBJ_FLO := PAC_VAR * OBJ_FLO;
IF OBJ_FLO /= 1.0 THEN
FAILED ("INCORRECT RESULTS - 5");
END IF;
OBJ_FLO := 1.0;
OBJ_FLO := OBJ_FLO / OBJ_FLO;
IF OBJ_FLO /= 1.0 THEN
FAILED ("INCORRECT RESULTS - 6");
END IF;
PAC_VAR := 1.0;
OBJ_FLO := PAC_VAR ** OBJ_INT;
IF OBJ_FLO /= 1.0 THEN
FAILED ("INCORRECT RESULTS - 7");
END IF;
IF SUB_T'DIGITS /= 5 THEN
FAILED ("INCORRECT RESULTS - 8");
END IF;
OBJ_NEWT := 1.0;
OBJ_NEWT := OBJ_NEWT - 1.0;
IF OBJ_NEWT NOT IN NEW_T THEN
FAILED ("INCORRECT RESULTS - 9");
END IF;
IF NEW_T'DIGITS /= 5 THEN
FAILED ("INCORRECT RESULTS - 10");
END IF;
END;
RESULT;
END CC3222A;
| 34.188034 | 79 | 0.55925 |
4126ce039457fbe62f3a8bebe506aef2489aefa3 | 130 | ada | Ada | Task/CSV-to-HTML-translation/Ada/csv-to-html-translation-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/CSV-to-HTML-translation/Ada/csv-to-html-translation-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/CSV-to-HTML-translation/Ada/csv-to-html-translation-2.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | <table>
@@TABLE@@
<tr>
<td>@_WEB_ESCAPE:CHAR_@</td>
<td>@_WEB_ESCAPE:SPEECH_@</td>
</tr>
@@END_TABLE@@
</table>
| 14.444444 | 36 | 0.538462 |
2982a78c8cef488bfcd89cdbbe39e3da54d4906b | 1,422 | ada | Ada | Task/Delegates/Ada/delegates.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Delegates/Ada/delegates.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Delegates/Ada/delegates.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | with Ada.Text_IO; use Ada.Text_IO;
procedure Delegation is
package Things is
-- We need a common root for our stuff
type Object is tagged null record;
type Object_Ptr is access all Object'Class;
-- Objects that have operation thing
type Substantial is new Object with null record;
function Thing (X : Substantial) return String;
-- Delegator objects
type Delegator is new Object with record
Delegate : Object_Ptr;
end record;
function Operation (X : Delegator) return String;
No_Thing : aliased Object; -- Does not have thing
Has_Thing : aliased Substantial; -- Has one
end Things;
package body Things is
function Thing (X : Substantial) return String is
begin
return "delegate implementation";
end Thing;
function Operation (X : Delegator) return String is
begin
if X.Delegate /= null and then X.Delegate.all in Substantial'Class then
return Thing (Substantial'Class (X.Delegate.all));
else
return "default implementation";
end if;
end Operation;
end Things;
use Things;
A : Delegator; -- Without a delegate
begin
Put_Line (A.Operation);
A.Delegate := No_Thing'Access; -- Set no thing
Put_Line (A.Operation);
A.Delegate := Has_Thing'Access; -- Set a thing
Put_Line (A.Operation);
end Delegation;
| 29.020408 | 80 | 0.651195 |
412a45b258329795b43617302e2f7e9f3f360860 | 24,185 | ads | Ada | gcc-gcc-7_3_0-release/gcc/ada/scos.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/scos.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/scos.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S C O S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2009-2016, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package defines tables used to store Source Coverage Obligations. It
-- is used by Par_SCO to build the SCO information before writing it out to
-- the ALI file, and by Get_SCO/Put_SCO to read and write the text form that
-- is used in the ALI file.
with Namet; use Namet;
with Types; use Types;
with GNAT.Table;
package SCOs is
-- SCO information can exist in one of two forms. In the ALI file, it is
-- represented using a text format that is described in this specification.
-- Internally it is stored using two tables SCO_Table and SCO_Unit_Table,
-- which are also defined in this unit.
-- Par_SCO is part of the compiler. It scans the parsed source tree and
-- populates the internal tables.
-- Get_SCO reads the text lines in ALI format and populates the internal
-- tables with corresponding information.
-- Put_SCO reads the internal tables and generates text lines in the ALI
-- format.
-- WARNING: There are C bindings for this package. Any changes to this
-- source file must be properly reflected in the C header file scos.h
--------------------
-- SCO ALI Format --
--------------------
-- Source coverage obligations are generated on a unit-by-unit basis in the
-- ALI file, using lines that start with the identifying character C. These
-- lines are generated if the -gnateS switch is set.
-- Sloc Ranges
-- In several places in the SCO lines, Sloc ranges appear. These are used
-- to indicate the first and last Sloc of some construct in the tree and
-- they have the form:
-- line:col-line:col
-- Note that SCO's are generated only for generic templates, not for
-- generic instances (since only the first are part of the source). So
-- we don't need generic instantiation stuff in these line:col items.
-- SCO File headers
-- The SCO information follows the cross-reference information, so it
-- need not be read by tools like gnatbind, gnatmake etc. The SCO output
-- is divided into sections, one section for each unit for which SCO's
-- are generated. A SCO section has a header of the form:
-- C dependency-number filename
-- This header precedes SCO information for the unit identified by
-- dependency number and file name. The dependency number is the
-- index into the generated D lines and is ones origin (i.e. 2 =
-- reference to second generated D line).
-- Note that the filename here will reflect the original name if
-- a Source_Reference pragma was encountered (since all line number
-- references will be with respect to the original file).
-- Note: the filename is redundant in that it could be deduced from
-- the corresponding D line, but it is convenient at least for human
-- reading of the SCO information, and means that the SCO information
-- can stand on its own without needing other parts of the ALI file.
-- Statements
-- For the purpose of SCO generation, the notion of statement includes
-- simple statements and also the following declaration types:
-- type_declaration
-- subtype_declaration
-- object_declaration
-- renaming_declaration
-- generic_instantiation
-- and the following regions of the syntax tree:
-- the part of a case_statement from CASE up to the expression
-- the part of a FOR loop iteration scheme from FOR up to the
-- loop_parameter_specification
-- the part of a WHILE loop up to the condition
-- the part of an extended_return_statement from RETURN up to the
-- expression (if present) or to the return_subtype_indication (if
-- no expression)
-- and any pragma that occurs at a place where a statement or declaration
-- is allowed.
-- Statement lines
-- These lines correspond to one or more successive statements (in the
-- sense of the above list) which are always executed in sequence (in the
-- absence of exceptions or other external interruptions).
-- Entry points to such sequences are:
-- the first declaration of any declarative_part
-- the first statement of any sequence_of_statements that is not in a
-- body or block statement that has a non-empty declarative part
-- the first statement after a compound statement
-- the first statement after an EXIT, RAISE or GOTO statement
-- any statement with a label (the label itself is not part of the
-- entry point that is recorded).
-- Each entry point must appear as the first statement entry on a CS
-- line. Thus, if any simple statement on a CS line is known to have
-- been executed, then all statements that appear before it on the same
-- CS line are certain to also have been executed.
-- The form of a statement line in the ALI file is:
-- CS [dominance] *sloc-range [*sloc-range...]
-- where each sloc-range corresponds to a single statement, and * is
-- one of:
-- t type declaration
-- s subtype declaration
-- o object declaration
-- r renaming declaration
-- i generic instantiation
-- d any other kind of declaration
-- A ACCEPT statement (from ACCEPT to end of parameter profile)
-- C CASE statement (from CASE to end of expression)
-- E EXIT statement
-- F FOR loop (from FOR to end of iteration scheme)
-- I IF statement (from IF to end of condition)
-- P[name:] PRAGMA with the indicated name
-- p[name:] disabled PRAGMA with the indicated name
-- R extended RETURN statement
-- S SELECT statement
-- W WHILE loop statement (from WHILE to end of condition)
-- Note: for I and W, condition above is in the RM syntax sense (this
-- condition is a decision in SCO terminology).
-- and is omitted for all other cases
-- The optional dominance marker is of the form gives additional
-- information as to how the sequence of statements denoted by the CS
-- line can be entered:
-- >F<sloc>
-- sequence is entered only if the decision at <sloc> is False
-- >T<sloc>
-- sequence is entered only if the decision at <sloc> is True
-- >S<sloc>
-- sequence is entered only if the statement at <sloc> has been
-- executed
-- >E<sloc-range>
-- sequence is the sequence of statements for a exception_handler
-- with the given sloc range
-- Note: up to 6 entries can appear on a single CS line. If more than 6
-- entries appear in one logical statement sequence, continuation lines
-- are marked by Cs and appear immediately after the CS line.
-- Implementation permission: a SCO generator is permitted to emit a
-- narrower SLOC range for a statement if the corresponding code
-- generation circuitry ensures that all debug information for the code
-- implementing the statement will be labeled with SLOCs that fall within
-- that narrower range.
-- Decisions
-- Note: in the following description, logical operator includes only the
-- short-circuited forms and NOT (so can be only NOT, AND THEN, OR ELSE).
-- The reason that we can exclude AND/OR/XOR is that we expect SCO's to
-- be generated using the restriction No_Direct_Boolean_Operators if we
-- are interested in decision coverage, which does not permit the use of
-- AND/OR/XOR on boolean operands. These are permitted on modular integer
-- types, but such operations do not count as decisions in any case. If
-- we are generating SCO's only for simple coverage, then we are not
-- interested in decisions in any case.
-- Note: the reason we include NOT is for informational purposes. The
-- presence of NOT does not generate additional coverage obligations,
-- but if we know where the NOT's are, the coverage tool can generate
-- more accurate diagnostics on uncovered tests.
-- A top level boolean expression is a boolean expression that is not an
-- operand of a logical operator.
-- Decisions are either simple or complex. A simple decision is a top
-- level boolean expression that has only one condition and that occurs
-- in the context of a control structure in the source program, including
-- WHILE, IF, EXIT WHEN, or immediately within an Assert, Check,
-- Pre_Condition or Post_Condition pragma, or as the first argument of a
-- dyadic pragma Debug. Note that a top level boolean expression with
-- only one condition that occurs in any other context, for example as
-- right hand side of an assignment, is not considered to be a (simple)
-- decision.
-- A complex decision is a top level boolean expression that has more
-- than one condition. A complex decision may occur in any boolean
-- expression context.
-- So for example, if we have
-- A, B, C, D : Boolean;
-- function F (Arg : Boolean) return Boolean);
-- ...
-- A and then (B or else F (C and then D))
-- There are two (complex) decisions here:
-- 1. X and then (Y or else Z)
-- where X = A, Y = B, and Z = F (C and then D)
-- 2. C and then D
-- For each decision, a decision line is generated with the form:
-- C* sloc expression
-- Here * is one of the following:
-- E decision in EXIT WHEN statement
-- G decision in entry guard
-- I decision in IF statement or if expression
-- P decision in pragma Assert / Check / Pre/Post_Condition
-- A[name] decision in aspect Pre/Post (aspect name optional)
-- W decision in WHILE iteration scheme
-- X decision in some other expression context
-- For E, G, I, P, W, sloc is the source location of the EXIT, ENTRY, IF,
-- PRAGMA or WHILE token, respectively
-- For A sloc is the source location of the aspect identifier
-- For X, sloc is omitted
-- The expression is a prefix polish form indicating the structure of
-- the decision, including logical operators and short-circuit forms.
-- The following is a grammar showing the structure of expression:
-- expression ::= term (if expr is not logical operator)
-- expression ::= &sloc term term (if expr is AND or AND THEN)
-- expression ::= |sloc term term (if expr is OR or OR ELSE)
-- expression ::= !sloc term (if expr is NOT)
-- In the last three cases, sloc is the source location of the AND, OR,
-- or NOT token, respectively.
-- term ::= element
-- term ::= expression
-- element ::= *sloc-range
-- where * is one of the following letters:
-- c condition
-- t true condition
-- f false condition
-- t/f are used to mark a condition that has been recognized by the
-- compiler as always being true or false. c is the normal case of
-- conditions whose value is not known at compile time.
-- & indicates AND THEN connecting two conditions
-- | indicates OR ELSE connecting two conditions
-- ! indicates NOT applied to the expression
-- Note that complex decisions do NOT include non-short-circuited logical
-- operators (AND/XOR/OR). In the context of existing coverage tools the
-- No_Direct_Boolean_Operators restriction is assumed, so these operators
-- cannot appear in the source in any case.
-- The SCO line for a decision always occurs after the CS line for the
-- enclosing statement. The SCO line for a nested decision always occurs
-- after the line for the enclosing decision.
-- Note that membership tests are considered to be a single simple
-- condition, and that is true even if the Ada 2005 set membership
-- form is used, e.g. A in (2,7,11.15).
-- Implementation permission: a SCO generator is permitted to emit a
-- narrower SLOC range for a condition if the corresponding code
-- generation circuitry ensures that all debug information for the code
-- evaluating the condition will be labeled with SLOCs that fall within
-- that narrower range.
-- Case Expressions
-- For case statements, we rely on statement coverage to make sure that
-- all branches of a case statement are covered, but that does not work
-- for case expressions, since the entire expression is contained in a
-- single statement. However, for complete coverage we really should be
-- able to check that every branch of the case statement is covered, so
-- we generate a SCO of the form:
-- CC sloc-range sloc-range ...
-- where sloc-range covers the range of the case expression
-- Note: up to 6 entries can appear on a single CC line. If more than 6
-- entries appear in one logical statement sequence, continuation lines
-- are marked by Cc and appear immediately after the CC line.
-- Generic instances
-- A table of all generic instantiations in the compilation is generated
-- whose entries have the form:
-- C i index dependency-number|sloc [enclosing]
-- Where index is the 1-based index of the entry in the table,
-- dependency-number and sloc indicate the source location of the
-- instantiation, and enclosing is the index of the enclosing
-- instantiation in the table (for a nested instantiation), or is
-- omitted for an outer instantiation.
-- Disabled pragmas
-- No SCO is generated for disabled pragmas
---------------------------------------------------------------------
-- Internal table used to store Source Coverage Obligations (SCOs) --
---------------------------------------------------------------------
type Source_Location is record
Line : Logical_Line_Number;
Col : Column_Number;
end record;
No_Source_Location : constant Source_Location :=
(No_Line_Number, No_Column_Number);
type SCO_Table_Entry is record
From : Source_Location := No_Source_Location;
To : Source_Location := No_Source_Location;
C1 : Character := ' ';
C2 : Character := ' ';
Last : Boolean := False;
Pragma_Sloc : Source_Ptr := No_Location;
-- For the decision SCO of a pragma, or for the decision SCO of any
-- expression nested in a pragma Debug/Assert/PPC, location of PRAGMA
-- token (used for control of SCO output, value not recorded in ALI
-- file). Similarly, for the decision SCO of an aspect, or for the
-- decision SCO of any expression nested in an aspect, location of
-- aspect identifier token.
Pragma_Aspect_Name : Name_Id := No_Name;
-- For the SCO for a pragma/aspect, gives the pragma/apsect name
end record;
package SCO_Table is new GNAT.Table (
Table_Component_Type => SCO_Table_Entry,
Table_Index_Type => Nat,
Table_Low_Bound => 1,
Table_Initial => 500,
Table_Increment => 300);
Is_Decision : constant array (Character) of Boolean :=
('E' | 'G' | 'I' | 'P' | 'a' | 'A' | 'W' | 'X' => True,
others => False);
-- Indicates which C1 values correspond to decisions
-- The SCO_Table_Entry values appear as follows:
-- Statements
-- C1 = 'S'
-- C2 = statement type code to appear on CS line (or ' ' if none)
-- From = starting source location
-- To = ending source location
-- Last = False for all but the last entry, True for last entry
-- Note: successive statements (possibly interspersed with entries of
-- other kinds, that are ignored for this purpose), starting with one
-- labeled with C1 = 'S', up to and including the first one labeled with
-- Last = True, indicate the sequence to be output for a sequence of
-- statements on a single CS line (possibly followed by Cs continuation
-- lines).
-- Note: for a pragma that may be disabled (Debug, Assert, PPC, Check),
-- the entry is initially created with C2 = 'p', to mark it as disabled.
-- Later on during semantic analysis, if the pragma is enabled,
-- Set_SCO_Pragma_Enabled changes C2 to 'P' to cause the entry to be
-- emitted in Put_SCOs.
-- Dominance marker
-- C1 = '>'
-- C2 = 'F'/'T'/'S'/'E'
-- From = Decision/statement sloc ('F'/'T'/'S'),
-- handler first sloc ('E')
-- To = No_Source_Location ('F'/'T'/'S'), handler last sloc ('E')
-- Note: A dominance marker is always followed by a statement entry
-- Decision (EXIT/entry guard/IF/WHILE)
-- C1 = 'E'/'G'/'I'/'W' (for EXIT/entry Guard/IF/WHILE)
-- C2 = ' '
-- From = EXIT/ENTRY/IF/WHILE token
-- To = No_Source_Location
-- Last = unused
-- Decision (PRAGMA)
-- C1 = 'P'
-- C2 = ' '
-- From = PRAGMA token
-- To = No_Source_Location
-- Last = unused
-- Note: when the parse tree is first scanned, we unconditionally build a
-- pragma decision entry for any decision in a pragma (here as always in
-- SCO contexts, the only pragmas with decisions are Assert, Check,
-- dyadic Debug, Precondition and Postcondition). These entries will
-- be omitted in output if the pragma is disabled (see comments for
-- statement entries): this filtering is achieved during the second pass
-- of SCO generation (Par_SCO.SCO_Record_Filtered).
-- Decision (ASPECT)
-- C1 = 'A'
-- C2 = ' '
-- From = aspect identifier
-- To = No_Source_Location
-- Last = unused
-- Note: when the parse tree is first scanned, we unconditionally build a
-- pragma decision entry for any decision in an aspect (Pre/Post/
-- [Type_]Invariant/[Static_|Dynamic_]Predicate). Entries for disabled
-- Pre/Post aspects will be omitted from output.
-- Decision (Expression)
-- C1 = 'X'
-- C2 = ' '
-- From = No_Source_Location
-- To = No_Source_Location
-- Last = unused
-- Operator
-- C1 = '!', '&', '|'
-- C2 = ' '/'?'/ (Logical operator/Putative one)
-- From = location of NOT/AND/OR token
-- To = No_Source_Location
-- Last = False
-- Element (condition)
-- C1 = ' '
-- C2 = 'c', 't', or 'f' (condition/true/false)
-- From = starting source location
-- To = ending source location
-- Last = False for all but the last entry, True for last entry
-- Note: the sequence starting with a decision, and continuing with
-- operators and elements up to and including the first one labeled with
-- Last = True, indicate the sequence to be output on one decision line.
----------------
-- Unit Table --
----------------
-- This table keeps track of the units and the corresponding starting and
-- ending indexes (From, To) in the SCO table. Note that entry zero is
-- present but unused, it is for convenience in calling the sort routine.
-- Thus the lower bound for real entries is 1.
type SCO_Unit_Index is new Int;
-- Used to index values in this table. Values start at 1 and are assigned
-- sequentially as entries are constructed.
Missing_Dep_Num : constant Nat := 0;
-- Represents a dependency number for a dependency that is ignored. SCO
-- information consumers use this to strip units that must be kept out of
-- the coverage analysis.
type SCO_Unit_Table_Entry is record
File_Name : String_Ptr;
-- Pointer to file name in ALI file
File_Index : Source_File_Index;
-- Index for the source file
Dep_Num : Nat;
-- Dependency number in ALI file. This is a positive number when the
-- dependency is actually available in the context, it is
-- Missing_Dep_Num otherwise.
From : Nat;
-- Starting index in SCO_Table of SCO information for this unit
To : Nat;
-- Ending index in SCO_Table of SCO information for this unit
-- Warning: SCOs generation (in Par_SCO) is done in two passes, which
-- communicate through an intermediate table (Par_SCO.SCO_Raw_Table).
-- Before the second pass executes, From and To actually reference index
-- in the internal table: SCO_Table is empty. Then, at the end of the
-- second pass, these indexes are updated in order to reference indexes
-- in SCO_Table.
end record;
package SCO_Unit_Table is new GNAT.Table (
Table_Component_Type => SCO_Unit_Table_Entry,
Table_Index_Type => SCO_Unit_Index,
Table_Low_Bound => 0, -- see note above on sorting
Table_Initial => 20,
Table_Increment => 200);
-----------------------
-- Generic instances --
-----------------------
type SCO_Instance_Index is new Nat;
type SCO_Instance_Table_Entry is record
Inst_Dep_Num : Nat;
Inst_Loc : Source_Location;
-- File and source location of instantiation
Enclosing_Instance : SCO_Instance_Index;
end record;
package SCO_Instance_Table is new GNAT.Table (
Table_Component_Type => SCO_Instance_Table_Entry,
Table_Index_Type => SCO_Instance_Index,
Table_Low_Bound => 1,
Table_Initial => 20,
Table_Increment => 200);
-----------------
-- Subprograms --
-----------------
procedure Initialize;
-- Reset tables for a new compilation
end SCOs;
| 42.504394 | 79 | 0.612115 |
29bb3a8e150951e82e3a041833b6ad3ecf77a1c7 | 882 | adb | Ada | contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/formatted_ref/defs.adb | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | 3 | 2021-05-04T17:09:06.000Z | 2021-10-04T07:19:26.000Z | contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/formatted_ref/defs.adb | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | null | null | null | contrib/gnu/gdb/dist/gdb/testsuite/gdb.ada/formatted_ref/defs.adb | TheSledgeHammer/2.11BSD | fe61f0b9aaa273783cd027c7b5ec77e95ead2153 | [
"BSD-3-Clause"
] | null | null | null | -- Copyright 2007-2020 Free Software Foundation, Inc.
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
package body Defs is
function F1 (S : Struct1) return Integer is
begin
return s.x; -- Set breakpoint marker here.
end F1;
end Defs;
| 36.75 | 73 | 0.709751 |
29c1e21cd68cace2531827c0199dbd5d14df7dc4 | 20,525 | ads | Ada | source/amf/uml/amf-uml-properties.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/uml/amf-uml-properties.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/uml/amf-uml-properties.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- 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.
------------------------------------------------------------------------------
-- Property represents a declared state of one or more instances in terms of
-- a named relationship to a value or values. When a property is an attribute
-- of a classifier, the value or values are related to the instance of the
-- classifier by being held in slots of the instance. When a property is an
-- association end, the value or values are related to the instance or
-- instances at the other end(s) of the association. The range of valid
-- values represented by the property can be controlled by setting the
-- property's type.
--
-- A property has the capability of being a deployment target in a deployment
-- relationship. This enables modeling the deployment to hierarchical nodes
-- that have properties functioning as internal parts.
--
-- Property specializes ParameterableElement to specify that a property can
-- be exposed as a formal template parameter, and provided as an actual
-- parameter in a binding of a template.
--
-- A property represents a set of instances that are owned by a containing
-- classifier instance.
--
-- A property is a structural feature of a classifier that characterizes
-- instances of the classifier. A property related by ownedAttribute to a
-- classifier (other than an association) represents an attribute and might
-- also represent an association end. It relates an instance of the class to
-- a value or set of values of the type of the attribute. A property related
-- by memberEnd or its specializations to an association represents an end of
-- the association. The type of the property is the type of the end of the
-- association.
------------------------------------------------------------------------------
limited with AMF.UML.Associations;
limited with AMF.UML.Classes;
with AMF.UML.Connectable_Elements;
limited with AMF.UML.Data_Types;
with AMF.UML.Deployment_Targets;
limited with AMF.UML.Interfaces;
limited with AMF.UML.Parameterable_Elements;
limited with AMF.UML.Properties.Collections;
limited with AMF.UML.Redefinable_Elements;
with AMF.UML.Structural_Features;
limited with AMF.UML.Types.Collections;
limited with AMF.UML.Value_Specifications;
package AMF.UML.Properties is
pragma Preelaborate;
type UML_Property is limited interface
and AMF.UML.Connectable_Elements.UML_Connectable_Element
and AMF.UML.Deployment_Targets.UML_Deployment_Target
and AMF.UML.Structural_Features.UML_Structural_Feature;
type UML_Property_Access is
access all UML_Property'Class;
for UML_Property_Access'Storage_Size use 0;
not overriding function Get_Aggregation
(Self : not null access constant UML_Property)
return AMF.UML.UML_Aggregation_Kind is abstract;
-- Getter of Property::aggregation.
--
-- Specifies the kind of aggregation that applies to the Property.
not overriding procedure Set_Aggregation
(Self : not null access UML_Property;
To : AMF.UML.UML_Aggregation_Kind) is abstract;
-- Setter of Property::aggregation.
--
-- Specifies the kind of aggregation that applies to the Property.
not overriding function Get_Association
(Self : not null access constant UML_Property)
return AMF.UML.Associations.UML_Association_Access is abstract;
-- Getter of Property::association.
--
-- References the association of which this property is a member, if any.
not overriding procedure Set_Association
(Self : not null access UML_Property;
To : AMF.UML.Associations.UML_Association_Access) is abstract;
-- Setter of Property::association.
--
-- References the association of which this property is a member, if any.
not overriding function Get_Association_End
(Self : not null access constant UML_Property)
return AMF.UML.Properties.UML_Property_Access is abstract;
-- Getter of Property::associationEnd.
--
-- Designates the optional association end that owns a qualifier attribute.
not overriding procedure Set_Association_End
(Self : not null access UML_Property;
To : AMF.UML.Properties.UML_Property_Access) is abstract;
-- Setter of Property::associationEnd.
--
-- Designates the optional association end that owns a qualifier attribute.
not overriding function Get_Class
(Self : not null access constant UML_Property)
return AMF.UML.Classes.UML_Class_Access is abstract;
-- Getter of Property::class.
--
-- References the Class that owns the Property.
-- References the Class that owns the Property.
not overriding procedure Set_Class
(Self : not null access UML_Property;
To : AMF.UML.Classes.UML_Class_Access) is abstract;
-- Setter of Property::class.
--
-- References the Class that owns the Property.
-- References the Class that owns the Property.
not overriding function Get_Datatype
(Self : not null access constant UML_Property)
return AMF.UML.Data_Types.UML_Data_Type_Access is abstract;
-- Getter of Property::datatype.
--
-- The DataType that owns this Property.
not overriding procedure Set_Datatype
(Self : not null access UML_Property;
To : AMF.UML.Data_Types.UML_Data_Type_Access) is abstract;
-- Setter of Property::datatype.
--
-- The DataType that owns this Property.
not overriding function Get_Default
(Self : not null access constant UML_Property)
return AMF.Optional_String is abstract;
-- Getter of Property::default.
--
-- A String that is evaluated to give a default value for the Property
-- when an object of the owning Classifier is instantiated.
-- Specifies a String that represents a value to be used when no argument
-- is supplied for the Property.
not overriding procedure Set_Default
(Self : not null access UML_Property;
To : AMF.Optional_String) is abstract;
-- Setter of Property::default.
--
-- A String that is evaluated to give a default value for the Property
-- when an object of the owning Classifier is instantiated.
-- Specifies a String that represents a value to be used when no argument
-- is supplied for the Property.
not overriding function Get_Default_Value
(Self : not null access constant UML_Property)
return AMF.UML.Value_Specifications.UML_Value_Specification_Access is abstract;
-- Getter of Property::defaultValue.
--
-- A ValueSpecification that is evaluated to give a default value for the
-- Property when an object of the owning Classifier is instantiated.
not overriding procedure Set_Default_Value
(Self : not null access UML_Property;
To : AMF.UML.Value_Specifications.UML_Value_Specification_Access) is abstract;
-- Setter of Property::defaultValue.
--
-- A ValueSpecification that is evaluated to give a default value for the
-- Property when an object of the owning Classifier is instantiated.
not overriding function Get_Interface
(Self : not null access constant UML_Property)
return AMF.UML.Interfaces.UML_Interface_Access is abstract;
-- Getter of Property::interface.
--
-- References the Interface that owns the Property
not overriding procedure Set_Interface
(Self : not null access UML_Property;
To : AMF.UML.Interfaces.UML_Interface_Access) is abstract;
-- Setter of Property::interface.
--
-- References the Interface that owns the Property
not overriding function Get_Is_Composite
(Self : not null access constant UML_Property)
return Boolean is abstract;
-- Getter of Property::isComposite.
--
-- If isComposite is true, the object containing the attribute is a
-- container for the object or value contained in the attribute.
-- This is a derived value, indicating whether the aggregation of the
-- Property is composite or not.
not overriding procedure Set_Is_Composite
(Self : not null access UML_Property;
To : Boolean) is abstract;
-- Setter of Property::isComposite.
--
-- If isComposite is true, the object containing the attribute is a
-- container for the object or value contained in the attribute.
-- This is a derived value, indicating whether the aggregation of the
-- Property is composite or not.
not overriding function Get_Is_Derived
(Self : not null access constant UML_Property)
return Boolean is abstract;
-- Getter of Property::isDerived.
--
-- Specifies whether the Property is derived, i.e., whether its value or
-- values can be computed from other information.
-- If isDerived is true, the value of the attribute is derived from
-- information elsewhere.
not overriding procedure Set_Is_Derived
(Self : not null access UML_Property;
To : Boolean) is abstract;
-- Setter of Property::isDerived.
--
-- Specifies whether the Property is derived, i.e., whether its value or
-- values can be computed from other information.
-- If isDerived is true, the value of the attribute is derived from
-- information elsewhere.
not overriding function Get_Is_Derived_Union
(Self : not null access constant UML_Property)
return Boolean is abstract;
-- Getter of Property::isDerivedUnion.
--
-- Specifies whether the property is derived as the union of all of the
-- properties that are constrained to subset it.
not overriding procedure Set_Is_Derived_Union
(Self : not null access UML_Property;
To : Boolean) is abstract;
-- Setter of Property::isDerivedUnion.
--
-- Specifies whether the property is derived as the union of all of the
-- properties that are constrained to subset it.
not overriding function Get_Is_ID
(Self : not null access constant UML_Property)
return Boolean is abstract;
-- Getter of Property::isID.
--
-- True indicates this property can be used to uniquely identify an
-- instance of the containing Class.
not overriding procedure Set_Is_ID
(Self : not null access UML_Property;
To : Boolean) is abstract;
-- Setter of Property::isID.
--
-- True indicates this property can be used to uniquely identify an
-- instance of the containing Class.
overriding function Get_Is_Read_Only
(Self : not null access constant UML_Property)
return Boolean is abstract;
-- Getter of Property::isReadOnly.
--
-- If isReadOnly is true, the attribute may not be written to after
-- initialization.
-- If true, the attribute may only be read, and not written.
overriding procedure Set_Is_Read_Only
(Self : not null access UML_Property;
To : Boolean) is abstract;
-- Setter of Property::isReadOnly.
--
-- If isReadOnly is true, the attribute may not be written to after
-- initialization.
-- If true, the attribute may only be read, and not written.
not overriding function Get_Opposite
(Self : not null access constant UML_Property)
return AMF.UML.Properties.UML_Property_Access is abstract;
-- Getter of Property::opposite.
--
-- In the case where the property is one navigable end of a binary
-- association with both ends navigable, this gives the other end.
not overriding procedure Set_Opposite
(Self : not null access UML_Property;
To : AMF.UML.Properties.UML_Property_Access) is abstract;
-- Setter of Property::opposite.
--
-- In the case where the property is one navigable end of a binary
-- association with both ends navigable, this gives the other end.
not overriding function Get_Owning_Association
(Self : not null access constant UML_Property)
return AMF.UML.Associations.UML_Association_Access is abstract;
-- Getter of Property::owningAssociation.
--
-- References the owning association of this property, if any.
not overriding procedure Set_Owning_Association
(Self : not null access UML_Property;
To : AMF.UML.Associations.UML_Association_Access) is abstract;
-- Setter of Property::owningAssociation.
--
-- References the owning association of this property, if any.
not overriding function Get_Qualifier
(Self : not null access constant UML_Property)
return AMF.UML.Properties.Collections.Ordered_Set_Of_UML_Property is abstract;
-- Getter of Property::qualifier.
--
-- An optional list of ordered qualifier attributes for the end. If the
-- list is empty, then the Association is not qualified.
not overriding function Get_Redefined_Property
(Self : not null access constant UML_Property)
return AMF.UML.Properties.Collections.Set_Of_UML_Property is abstract;
-- Getter of Property::redefinedProperty.
--
-- References the properties that are redefined by this property.
not overriding function Get_Subsetted_Property
(Self : not null access constant UML_Property)
return AMF.UML.Properties.Collections.Set_Of_UML_Property is abstract;
-- Getter of Property::subsettedProperty.
--
-- References the properties of which this property is constrained to be a
-- subset.
not overriding function Default
(Self : not null access constant UML_Property)
return AMF.Optional_String is abstract;
-- Operation Property::default.
--
-- Missing derivation for Property::/default : String
not overriding function Is_Attribute
(Self : not null access constant UML_Property;
P : AMF.UML.Properties.UML_Property_Access)
return Boolean is abstract;
-- Operation Property::isAttribute.
--
-- The query isAttribute() is true if the Property is defined as an
-- attribute of some classifier.
overriding function Is_Compatible_With
(Self : not null access constant UML_Property;
P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access)
return Boolean is abstract;
-- Operation Property::isCompatibleWith.
--
-- The query isCompatibleWith() determines if this parameterable element
-- is compatible with the specified parameterable element. By default
-- parameterable element P is compatible with parameterable element Q if
-- the kind of P is the same or a subtype as the kind of Q. In addition,
-- for properties, the type must be conformant with the type of the
-- specified parameterable element.
not overriding function Is_Composite
(Self : not null access constant UML_Property)
return Boolean is abstract;
-- Operation Property::isComposite.
--
-- The value of isComposite is true only if aggregation is composite.
overriding function Is_Consistent_With
(Self : not null access constant UML_Property;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is abstract;
-- Operation Property::isConsistentWith.
--
-- The query isConsistentWith() specifies, for any two Properties in a
-- context in which redefinition is possible, whether redefinition would
-- be logically consistent. A redefining property is consistent with a
-- redefined property if the type of the redefining property conforms to
-- the type of the redefined property, the multiplicity of the redefining
-- property (if specified) is contained in the multiplicity of the
-- redefined property.
-- The query isConsistentWith() specifies, for any two Properties in a
-- context in which redefinition is possible, whether redefinition would
-- be logically consistent. A redefining property is consistent with a
-- redefined property if the type of the redefining property conforms to
-- the type of the redefined property, and the multiplicity of the
-- redefining property (if specified) is contained in the multiplicity of
-- the redefined property.
not overriding function Is_Navigable
(Self : not null access constant UML_Property)
return Boolean is abstract;
-- Operation Property::isNavigable.
--
-- The query isNavigable() indicates whether it is possible to navigate
-- across the property.
not overriding function Opposite
(Self : not null access constant UML_Property)
return AMF.UML.Properties.UML_Property_Access is abstract;
-- Operation Property::opposite.
--
-- If this property is owned by a class, associated with a binary
-- association, and the other end of the association is also owned by a
-- class, then opposite gives the other end.
not overriding function Subsetting_Context
(Self : not null access constant UML_Property)
return AMF.UML.Types.Collections.Set_Of_UML_Type is abstract;
-- Operation Property::subsettingContext.
--
-- The query subsettingContext() gives the context for subsetting a
-- property. It consists, in the case of an attribute, of the
-- corresponding classifier, and in the case of an association end, all of
-- the classifiers at the other ends.
end AMF.UML.Properties;
| 45.509978 | 86 | 0.666017 |
12437ee7543390bae11bbd416a8e88cc6670be3d | 327 | ads | Ada | src/backends/x11/xtest_h.ads | kqr/qweyboard | d4e8b8cac8450d5dbb0ed69e78d8d71dcaec91da | [
"0BSD"
] | 33 | 2017-02-25T22:20:45.000Z | 2022-02-18T01:21:58.000Z | src/backends/x11/xtest_h.ads | kqr/qweyboard | d4e8b8cac8450d5dbb0ed69e78d8d71dcaec91da | [
"0BSD"
] | 1 | 2017-03-09T08:05:57.000Z | 2017-03-09T08:05:57.000Z | src/backends/x11/xtest_h.ads | kqr/qweyboard | d4e8b8cac8450d5dbb0ed69e78d8d71dcaec91da | [
"0BSD"
] | 2 | 2017-03-08T21:32:37.000Z | 2020-01-09T21:15:30.000Z | with XLib_H; use XLib_H;
package XTest_H is
XTestKeyboard : constant String := "Virtual core XTEST keyboard";
function XTestFakeKeyEvent (Display : Display_Access; Keycode : C.Int; Is_Press : C.Int; After_Delay : C.Unsigned_Long) return C.Int;
pragma Import (C, XTestFakeKeyEvent, "XTestFakeKeyEvent");
end XTest_H;
| 36.333333 | 136 | 0.755352 |
2959a5395d36e70d1ba5f0131855da4b7867ceab | 4,992 | adb | Ada | src/Ada/ewok-perm.adb | wookey-project/ewok-legacy | c973752dac3a0ebe3f7cfca062f50744578f051b | [
"Apache-2.0"
] | null | null | null | src/Ada/ewok-perm.adb | wookey-project/ewok-legacy | c973752dac3a0ebe3f7cfca062f50744578f051b | [
"Apache-2.0"
] | null | null | null | src/Ada/ewok-perm.adb | wookey-project/ewok-legacy | c973752dac3a0ebe3f7cfca062f50744578f051b | [
"Apache-2.0"
] | null | null | null | --
-- Copyright 2018 The wookey project team <[email protected]>
-- - Ryad Benadjila
-- - Arnauld Michelizza
-- - Mathieu Renard
-- - Philippe Thierry
-- - Philippe Trebuchet
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--
--
#if CONFIG_KERNEL_DOMAIN
with ewok.tasks;
#end if;
package body ewok.perm
with spark_mode => on
is
function dmashm_is_granted
(from : in t_real_task_id;
to : in t_real_task_id)
return boolean
is
begin
-- Assertion on the statically built com_dmashm_perm:
-- a task is not allowed to declare a DMA_SHM to itself
-- This assertion is a DMA_SHM matrix sanitation
pragma assert
(for all x in t_real_task_id =>
(not ewok.perm_auto.com_dmashm_perm(x,x)));
return ewok.perm_auto.com_dmashm_perm (from, to);
end dmashm_is_granted;
function ipc_is_granted
(from : in t_real_task_id;
to : in t_real_task_id)
return boolean
is
begin
-- Assertion on the statically built com_ipc_perm:
-- a task is not allowed to declare an IPC channel to itself
-- This assertion is an IPC matrix sanitation
pragma assert
(for all x in t_real_task_id =>
(not ewok.perm_auto.com_ipc_perm(x,x)));
return ewok.perm_auto.com_ipc_perm (from, to);
end ipc_is_granted;
#if CONFIG_KERNEL_DOMAIN
function is_same_domain
(from : in t_real_task_id;
to : in t_real_task_id)
return boolean
with
spark_mode => off -- implies tasks.get_domain() to be Spark compatible
is
begin
return
ewok.tasks.get_domain (from) = ewok.tasks.get_domain (to);
end is_same_domain;
#end if;
function ressource_is_granted
(perm_name : in t_perm_name;
task_id : in applications.t_real_task_id)
return boolean
is
begin
-- is there some assertion checking that some ressources tuples are
-- forbidden
case perm_name is
when PERM_RES_DEV_DMA =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_DMA = 1;
when PERM_RES_DEV_CRYPTO_USR =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_CRYPTO = 1 or
ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_CRYPTO = 3;
when PERM_RES_DEV_CRYPTO_CFG =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_CRYPTO = 2 or
ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_CRYPTO = 3;
when PERM_RES_DEV_CRYPTO_FULL =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_CRYPTO = 3;
when PERM_RES_DEV_BUSES =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_BUS = 1;
when PERM_RES_DEV_EXTI =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_EXTI = 1;
when PERM_RES_DEV_TIM =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).DEV_TIM = 1;
when PERM_RES_TIM_GETMILLI =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).TIM_TIME > 0;
when PERM_RES_TIM_GETMICRO =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).TIM_TIME > 1;
when PERM_RES_TIM_GETCYCLE =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).TIM_TIME > 2;
when PERM_RES_TSK_FISR =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).TSK_FISR = 1;
when PERM_RES_TSK_FIPC =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).TSK_FIPC = 1;
when PERM_RES_TSK_RESET =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).TSK_RESET = 1;
when PERM_RES_TSK_UPGRADE =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).TSK_UPGRADE = 1;
when PERM_RES_TSK_RNG =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).TSK_RNG = 1;
when PERM_RES_MEM_DYNAMIC_MAP =>
return
ewok.perm_auto.ressource_perm_register_tab(task_id).MEM_DYNAMIC_MAP = 1;
end case;
end ressource_is_granted;
end ewok.perm;
| 31.2 | 87 | 0.647436 |
4dc03ffc325fc5139b5287a6e57e0fe88409a684 | 3,268 | ads | Ada | tools-src/gnu/gcc/gcc/ada/s-pack33.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | tools-src/gnu/gcc/gcc/ada/s-pack33.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | tools-src/gnu/gcc/gcc/ada/s-pack33.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUNTIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 3 3 --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1992-1999 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-3307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Handling of packed arrays with Component_Size = 33
package System.Pack_33 is
pragma Preelaborate (Pack_33);
Bits : constant := 33;
type Bits_33 is mod 2 ** Bits;
for Bits_33'Size use Bits;
function Get_33 (Arr : System.Address; N : Natural) return Bits_33;
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is extracted and returned.
procedure Set_33 (Arr : System.Address; N : Natural; E : Bits_33);
-- Arr is the address of the packed array, N is the zero-based
-- subscript. This element is set to the given value.
end System.Pack_33;
| 59.418182 | 78 | 0.448898 |
a1d9232f9df582bd58672a59aedb26668e2bb381 | 108,858 | adb | Ada | awa/plugins/awa-wikis/src/model/awa-wikis-models.adb | twdroeger/ada-awa | 77b824773747aecb912c37b1b7b59ea414679b80 | [
"Apache-2.0"
] | null | null | null | awa/plugins/awa-wikis/src/model/awa-wikis-models.adb | twdroeger/ada-awa | 77b824773747aecb912c37b1b7b59ea414679b80 | [
"Apache-2.0"
] | null | null | null | awa/plugins/awa-wikis/src/model/awa-wikis-models.adb | twdroeger/ada-awa | 77b824773747aecb912c37b1b7b59ea414679b80 | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- AWA.Wikis.Models -- AWA.Wikis.Models
-----------------------------------------------------------------------
-- File generated by ada-gen DO NOT MODIFY
-- Template used: templates/model/package-body.xhtml
-- Ada Generator: https://ada-gen.googlecode.com/svn/trunk Revision 1095
-----------------------------------------------------------------------
-- Copyright (C) 2019 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Unchecked_Deallocation;
with Util.Beans.Objects.Time;
with ASF.Events.Faces.Actions;
package body AWA.Wikis.Models is
use type ADO.Objects.Object_Record_Access;
use type ADO.Objects.Object_Ref;
pragma Warnings (Off, "formal parameter * is not referenced");
function Wiki_Content_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => WIKI_CONTENT_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Wiki_Content_Key;
function Wiki_Content_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => WIKI_CONTENT_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Wiki_Content_Key;
function "=" (Left, Right : Wiki_Content_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Wiki_Content_Ref'Class;
Impl : out Wiki_Content_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Wiki_Content_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Wiki_Content_Ref) is
Impl : Wiki_Content_Access;
begin
Impl := new Wiki_Content_Impl;
Impl.Create_Date := ADO.DEFAULT_TIME;
Impl.Format := AWA.Wikis.Models.Format_Type'First;
Impl.Version := 0;
Impl.Page_Version := 0;
Impl.Page_Id := ADO.NO_IDENTIFIER;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Wiki_Content
-- ----------------------------------------
procedure Set_Id (Object : in out Wiki_Content_Ref;
Value : in ADO.Identifier) is
Impl : Wiki_Content_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Wiki_Content_Ref)
return ADO.Identifier is
Impl : constant Wiki_Content_Access
:= Wiki_Content_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Create_Date (Object : in out Wiki_Content_Ref;
Value : in Ada.Calendar.Time) is
Impl : Wiki_Content_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 2, Impl.Create_Date, Value);
end Set_Create_Date;
function Get_Create_Date (Object : in Wiki_Content_Ref)
return Ada.Calendar.Time is
Impl : constant Wiki_Content_Access
:= Wiki_Content_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Create_Date;
end Get_Create_Date;
procedure Set_Content (Object : in out Wiki_Content_Ref;
Value : in String) is
Impl : Wiki_Content_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 3, Impl.Content, Value);
end Set_Content;
procedure Set_Content (Object : in out Wiki_Content_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Wiki_Content_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 3, Impl.Content, Value);
end Set_Content;
function Get_Content (Object : in Wiki_Content_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Content);
end Get_Content;
function Get_Content (Object : in Wiki_Content_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Wiki_Content_Access
:= Wiki_Content_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Content;
end Get_Content;
procedure Set_Format (Object : in out Wiki_Content_Ref;
Value : in AWA.Wikis.Models.Format_Type) is
procedure Set_Field_Enum is
new ADO.Objects.Set_Field_Operation (Format_Type);
Impl : Wiki_Content_Access;
begin
Set_Field (Object, Impl);
Set_Field_Enum (Impl.all, 4, Impl.Format, Value);
end Set_Format;
function Get_Format (Object : in Wiki_Content_Ref)
return AWA.Wikis.Models.Format_Type is
Impl : constant Wiki_Content_Access
:= Wiki_Content_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Format;
end Get_Format;
procedure Set_Save_Comment (Object : in out Wiki_Content_Ref;
Value : in String) is
Impl : Wiki_Content_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 5, Impl.Save_Comment, Value);
end Set_Save_Comment;
procedure Set_Save_Comment (Object : in out Wiki_Content_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Wiki_Content_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 5, Impl.Save_Comment, Value);
end Set_Save_Comment;
function Get_Save_Comment (Object : in Wiki_Content_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Save_Comment);
end Get_Save_Comment;
function Get_Save_Comment (Object : in Wiki_Content_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Wiki_Content_Access
:= Wiki_Content_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Save_Comment;
end Get_Save_Comment;
function Get_Version (Object : in Wiki_Content_Ref)
return Integer is
Impl : constant Wiki_Content_Access
:= Wiki_Content_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Page_Version (Object : in out Wiki_Content_Ref;
Value : in Integer) is
Impl : Wiki_Content_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 7, Impl.Page_Version, Value);
end Set_Page_Version;
function Get_Page_Version (Object : in Wiki_Content_Ref)
return Integer is
Impl : constant Wiki_Content_Access
:= Wiki_Content_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Page_Version;
end Get_Page_Version;
procedure Set_Page_Id (Object : in out Wiki_Content_Ref;
Value : in ADO.Identifier) is
Impl : Wiki_Content_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Identifier (Impl.all, 8, Impl.Page_Id, Value);
end Set_Page_Id;
function Get_Page_Id (Object : in Wiki_Content_Ref)
return ADO.Identifier is
Impl : constant Wiki_Content_Access
:= Wiki_Content_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Page_Id;
end Get_Page_Id;
procedure Set_Author (Object : in out Wiki_Content_Ref;
Value : in AWA.Users.Models.User_Ref'Class) is
Impl : Wiki_Content_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 9, Impl.Author, Value);
end Set_Author;
function Get_Author (Object : in Wiki_Content_Ref)
return AWA.Users.Models.User_Ref'Class is
Impl : constant Wiki_Content_Access
:= Wiki_Content_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Author;
end Get_Author;
-- Copy of the object.
procedure Copy (Object : in Wiki_Content_Ref;
Into : in out Wiki_Content_Ref) is
Result : Wiki_Content_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Wiki_Content_Access
:= Wiki_Content_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Wiki_Content_Access
:= new Wiki_Content_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Create_Date := Impl.Create_Date;
Copy.Content := Impl.Content;
Copy.Format := Impl.Format;
Copy.Save_Comment := Impl.Save_Comment;
Copy.Version := Impl.Version;
Copy.Page_Version := Impl.Page_Version;
Copy.Page_Id := Impl.Page_Id;
Copy.Author := Impl.Author;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Wiki_Content_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Wiki_Content_Access := new Wiki_Content_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Wiki_Content_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Wiki_Content_Access := new Wiki_Content_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Wiki_Content_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Wiki_Content_Access := new Wiki_Content_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Wiki_Content_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Wiki_Content_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Wiki_Content_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Wiki_Content_Impl) is
type Wiki_Content_Impl_Ptr is access all Wiki_Content_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Wiki_Content_Impl, Wiki_Content_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Wiki_Content_Impl_Ptr := Wiki_Content_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Wiki_Content_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, WIKI_CONTENT_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Wiki_Content_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Wiki_Content_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (WIKI_CONTENT_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_1_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (7) then
Stmt.Save_Field (Name => COL_6_1_NAME, -- page_version
Value => Object.Page_Version);
Object.Clear_Modified (7);
end if;
if Object.Is_Modified (8) then
Stmt.Save_Field (Name => COL_7_1_NAME, -- page_id
Value => Object.Page_Id);
Object.Clear_Modified (8);
end if;
if Object.Is_Modified (9) then
Stmt.Save_Field (Name => COL_8_1_NAME, -- author_id
Value => Object.Author);
Object.Clear_Modified (9);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
end;
end if;
end Save;
procedure Create (Object : in out Wiki_Content_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (WIKI_CONTENT_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_1_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_1_NAME, -- create_date
Value => Object.Create_Date);
Query.Save_Field (Name => COL_2_1_NAME, -- content
Value => Object.Content);
Query.Save_Field (Name => COL_3_1_NAME, -- format
Value => Integer (Format_Type'Pos (Object.Format)));
Query.Save_Field (Name => COL_4_1_NAME, -- save_comment
Value => Object.Save_Comment);
Query.Save_Field (Name => COL_5_1_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_6_1_NAME, -- page_version
Value => Object.Page_Version);
Query.Save_Field (Name => COL_7_1_NAME, -- page_id
Value => Object.Page_Id);
Query.Save_Field (Name => COL_8_1_NAME, -- author_id
Value => Object.Author);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
end Create;
procedure Delete (Object : in out Wiki_Content_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (WIKI_CONTENT_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Content_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Wiki_Content_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Wiki_Content_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (Impl.Create_Date);
elsif Name = "content" then
return Util.Beans.Objects.To_Object (Impl.Content);
elsif Name = "format" then
return AWA.Wikis.Models.Format_Type_Objects.To_Object (Impl.Format);
elsif Name = "save_comment" then
return Util.Beans.Objects.To_Object (Impl.Save_Comment);
elsif Name = "page_version" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Page_Version));
elsif Name = "page_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Page_Id));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Wiki_Content_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Create_Date := Stmt.Get_Time (1);
Object.Content := Stmt.Get_Unbounded_String (2);
Object.Format := Format_Type'Val (Stmt.Get_Integer (3));
Object.Save_Comment := Stmt.Get_Unbounded_String (4);
Object.Page_Version := Stmt.Get_Integer (6);
Object.Page_Id := Stmt.Get_Identifier (7);
if not Stmt.Is_Null (8) then
Object.Author.Set_Key_Value (Stmt.Get_Identifier (8), Session);
end if;
Object.Version := Stmt.Get_Integer (5);
ADO.Objects.Set_Created (Object);
end Load;
function Wiki_Space_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => WIKI_SPACE_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Wiki_Space_Key;
function Wiki_Space_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => WIKI_SPACE_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Wiki_Space_Key;
function "=" (Left, Right : Wiki_Space_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Wiki_Space_Ref'Class;
Impl : out Wiki_Space_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Wiki_Space_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Wiki_Space_Ref) is
Impl : Wiki_Space_Access;
begin
Impl := new Wiki_Space_Impl;
Impl.Is_Public := False;
Impl.Version := 0;
Impl.Create_Date := ADO.DEFAULT_TIME;
Impl.Format := AWA.Wikis.Models.Format_Type'First;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Wiki_Space
-- ----------------------------------------
procedure Set_Id (Object : in out Wiki_Space_Ref;
Value : in ADO.Identifier) is
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Wiki_Space_Ref)
return ADO.Identifier is
Impl : constant Wiki_Space_Access
:= Wiki_Space_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Name (Object : in out Wiki_Space_Ref;
Value : in String) is
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
procedure Set_Name (Object : in out Wiki_Space_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_Unbounded_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
function Get_Name (Object : in Wiki_Space_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Name);
end Get_Name;
function Get_Name (Object : in Wiki_Space_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Wiki_Space_Access
:= Wiki_Space_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Name;
end Get_Name;
procedure Set_Is_Public (Object : in out Wiki_Space_Ref;
Value : in Boolean) is
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_Boolean (Impl.all, 3, Impl.Is_Public, Value);
end Set_Is_Public;
function Get_Is_Public (Object : in Wiki_Space_Ref)
return Boolean is
Impl : constant Wiki_Space_Access
:= Wiki_Space_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Is_Public;
end Get_Is_Public;
function Get_Version (Object : in Wiki_Space_Ref)
return Integer is
Impl : constant Wiki_Space_Access
:= Wiki_Space_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Create_Date (Object : in out Wiki_Space_Ref;
Value : in Ada.Calendar.Time) is
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Time (Impl.all, 5, Impl.Create_Date, Value);
end Set_Create_Date;
function Get_Create_Date (Object : in Wiki_Space_Ref)
return Ada.Calendar.Time is
Impl : constant Wiki_Space_Access
:= Wiki_Space_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Create_Date;
end Get_Create_Date;
procedure Set_Left_Side (Object : in out Wiki_Space_Ref;
Value : in String) is
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 6, Impl.Left_Side, Value);
end Set_Left_Side;
procedure Set_Left_Side (Object : in out Wiki_Space_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 6, Impl.Left_Side, Value);
end Set_Left_Side;
function Get_Left_Side (Object : in Wiki_Space_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Left_Side);
end Get_Left_Side;
function Get_Left_Side (Object : in Wiki_Space_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Wiki_Space_Access
:= Wiki_Space_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Left_Side;
end Get_Left_Side;
procedure Set_Right_Side (Object : in out Wiki_Space_Ref;
Value : in String) is
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_String (Impl.all, 7, Impl.Right_Side, Value);
end Set_Right_Side;
procedure Set_Right_Side (Object : in out Wiki_Space_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Unbounded_String (Impl.all, 7, Impl.Right_Side, Value);
end Set_Right_Side;
function Get_Right_Side (Object : in Wiki_Space_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Right_Side);
end Get_Right_Side;
function Get_Right_Side (Object : in Wiki_Space_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Wiki_Space_Access
:= Wiki_Space_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Right_Side;
end Get_Right_Side;
procedure Set_Format (Object : in out Wiki_Space_Ref;
Value : in AWA.Wikis.Models.Format_Type) is
procedure Set_Field_Enum is
new ADO.Audits.Set_Field_Operation (Format_Type,
Format_Type_Objects.To_Object);
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
Set_Field_Enum (Impl.all, 8, Impl.Format, Value);
end Set_Format;
function Get_Format (Object : in Wiki_Space_Ref)
return AWA.Wikis.Models.Format_Type is
Impl : constant Wiki_Space_Access
:= Wiki_Space_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Format;
end Get_Format;
procedure Set_Workspace (Object : in out Wiki_Space_Ref;
Value : in AWA.Workspaces.Models.Workspace_Ref'Class) is
Impl : Wiki_Space_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 9, Impl.Workspace, Value);
end Set_Workspace;
function Get_Workspace (Object : in Wiki_Space_Ref)
return AWA.Workspaces.Models.Workspace_Ref'Class is
Impl : constant Wiki_Space_Access
:= Wiki_Space_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Workspace;
end Get_Workspace;
-- Copy of the object.
procedure Copy (Object : in Wiki_Space_Ref;
Into : in out Wiki_Space_Ref) is
Result : Wiki_Space_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Wiki_Space_Access
:= Wiki_Space_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Wiki_Space_Access
:= new Wiki_Space_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Name := Impl.Name;
Copy.Is_Public := Impl.Is_Public;
Copy.Version := Impl.Version;
Copy.Create_Date := Impl.Create_Date;
Copy.Left_Side := Impl.Left_Side;
Copy.Right_Side := Impl.Right_Side;
Copy.Format := Impl.Format;
Copy.Workspace := Impl.Workspace;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Wiki_Space_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Wiki_Space_Access := new Wiki_Space_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Wiki_Space_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Wiki_Space_Access := new Wiki_Space_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Wiki_Space_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Wiki_Space_Access := new Wiki_Space_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Wiki_Space_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Wiki_Space_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Wiki_Space_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Wiki_Space_Impl) is
type Wiki_Space_Impl_Ptr is access all Wiki_Space_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Wiki_Space_Impl, Wiki_Space_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Wiki_Space_Impl_Ptr := Wiki_Space_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Wiki_Space_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, WIKI_SPACE_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Wiki_Space_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Wiki_Space_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (WIKI_SPACE_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_2_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_2_NAME, -- name
Value => Object.Name);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_2_NAME, -- is_public
Value => Object.Is_Public);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_2_NAME, -- create_date
Value => Object.Create_Date);
Object.Clear_Modified (5);
end if;
if Object.Is_Modified (6) then
Stmt.Save_Field (Name => COL_5_2_NAME, -- left_side
Value => Object.Left_Side);
Object.Clear_Modified (6);
end if;
if Object.Is_Modified (7) then
Stmt.Save_Field (Name => COL_6_2_NAME, -- right_side
Value => Object.Right_Side);
Object.Clear_Modified (7);
end if;
if Object.Is_Modified (8) then
Stmt.Save_Field (Name => COL_7_2_NAME, -- format
Value => Integer (Format_Type'Pos (Object.Format)));
Object.Clear_Modified (8);
end if;
if Object.Is_Modified (9) then
Stmt.Save_Field (Name => COL_8_2_NAME, -- workspace_id
Value => Object.Workspace);
Object.Clear_Modified (9);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
ADO.Audits.Save (Object, Session);
end;
end if;
end Save;
procedure Create (Object : in out Wiki_Space_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (WIKI_SPACE_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_2_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_2_NAME, -- name
Value => Object.Name);
Query.Save_Field (Name => COL_2_2_NAME, -- is_public
Value => Object.Is_Public);
Query.Save_Field (Name => COL_3_2_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_4_2_NAME, -- create_date
Value => Object.Create_Date);
Query.Save_Field (Name => COL_5_2_NAME, -- left_side
Value => Object.Left_Side);
Query.Save_Field (Name => COL_6_2_NAME, -- right_side
Value => Object.Right_Side);
Query.Save_Field (Name => COL_7_2_NAME, -- format
Value => Integer (Format_Type'Pos (Object.Format)));
Query.Save_Field (Name => COL_8_2_NAME, -- workspace_id
Value => Object.Workspace);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
ADO.Audits.Save (Object, Session);
end Create;
procedure Delete (Object : in out Wiki_Space_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (WIKI_SPACE_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Space_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Wiki_Space_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Wiki_Space_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "name" then
return Util.Beans.Objects.To_Object (Impl.Name);
elsif Name = "is_public" then
return Util.Beans.Objects.To_Object (Impl.Is_Public);
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (Impl.Create_Date);
elsif Name = "left_side" then
return Util.Beans.Objects.To_Object (Impl.Left_Side);
elsif Name = "right_side" then
return Util.Beans.Objects.To_Object (Impl.Right_Side);
elsif Name = "format" then
return AWA.Wikis.Models.Format_Type_Objects.To_Object (Impl.Format);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Wiki_Space_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Name := Stmt.Get_Unbounded_String (1);
Object.Is_Public := Stmt.Get_Boolean (2);
Object.Create_Date := Stmt.Get_Time (4);
Object.Left_Side := Stmt.Get_Unbounded_String (5);
Object.Right_Side := Stmt.Get_Unbounded_String (6);
Object.Format := Format_Type'Val (Stmt.Get_Integer (7));
if not Stmt.Is_Null (8) then
Object.Workspace.Set_Key_Value (Stmt.Get_Identifier (8), Session);
end if;
Object.Version := Stmt.Get_Integer (3);
ADO.Objects.Set_Created (Object);
end Load;
function Wiki_Page_Key (Id : in ADO.Identifier) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => WIKI_PAGE_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Wiki_Page_Key;
function Wiki_Page_Key (Id : in String) return ADO.Objects.Object_Key is
Result : ADO.Objects.Object_Key (Of_Type => ADO.Objects.KEY_INTEGER,
Of_Class => WIKI_PAGE_DEF'Access);
begin
ADO.Objects.Set_Value (Result, Id);
return Result;
end Wiki_Page_Key;
function "=" (Left, Right : Wiki_Page_Ref'Class) return Boolean is
begin
return ADO.Objects.Object_Ref'Class (Left) = ADO.Objects.Object_Ref'Class (Right);
end "=";
procedure Set_Field (Object : in out Wiki_Page_Ref'Class;
Impl : out Wiki_Page_Access) is
Result : ADO.Objects.Object_Record_Access;
begin
Object.Prepare_Modify (Result);
Impl := Wiki_Page_Impl (Result.all)'Access;
end Set_Field;
-- Internal method to allocate the Object_Record instance
procedure Allocate (Object : in out Wiki_Page_Ref) is
Impl : Wiki_Page_Access;
begin
Impl := new Wiki_Page_Impl;
Impl.Last_Version := 0;
Impl.Is_Public := False;
Impl.Version := 0;
Impl.Read_Count := 0;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Allocate;
-- ----------------------------------------
-- Data object: Wiki_Page
-- ----------------------------------------
procedure Set_Id (Object : in out Wiki_Page_Ref;
Value : in ADO.Identifier) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Key_Value (Impl.all, 1, Value);
end Set_Id;
function Get_Id (Object : in Wiki_Page_Ref)
return ADO.Identifier is
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Object.all)'Access;
begin
return Impl.Get_Key_Value;
end Get_Id;
procedure Set_Name (Object : in out Wiki_Page_Ref;
Value : in String) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
procedure Set_Name (Object : in out Wiki_Page_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_Unbounded_String (Impl.all, 2, Impl.Name, Value);
end Set_Name;
function Get_Name (Object : in Wiki_Page_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Name);
end Get_Name;
function Get_Name (Object : in Wiki_Page_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Name;
end Get_Name;
procedure Set_Last_Version (Object : in out Wiki_Page_Ref;
Value : in Integer) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_Integer (Impl.all, 3, Impl.Last_Version, Value);
end Set_Last_Version;
function Get_Last_Version (Object : in Wiki_Page_Ref)
return Integer is
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Last_Version;
end Get_Last_Version;
procedure Set_Is_Public (Object : in out Wiki_Page_Ref;
Value : in Boolean) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_Boolean (Impl.all, 4, Impl.Is_Public, Value);
end Set_Is_Public;
function Get_Is_Public (Object : in Wiki_Page_Ref)
return Boolean is
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Is_Public;
end Get_Is_Public;
procedure Set_Title (Object : in out Wiki_Page_Ref;
Value : in String) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_String (Impl.all, 5, Impl.Title, Value);
end Set_Title;
procedure Set_Title (Object : in out Wiki_Page_Ref;
Value : in Ada.Strings.Unbounded.Unbounded_String) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Audits.Set_Field_Unbounded_String (Impl.all, 5, Impl.Title, Value);
end Set_Title;
function Get_Title (Object : in Wiki_Page_Ref)
return String is
begin
return Ada.Strings.Unbounded.To_String (Object.Get_Title);
end Get_Title;
function Get_Title (Object : in Wiki_Page_Ref)
return Ada.Strings.Unbounded.Unbounded_String is
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Title;
end Get_Title;
function Get_Version (Object : in Wiki_Page_Ref)
return Integer is
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Version;
end Get_Version;
procedure Set_Read_Count (Object : in out Wiki_Page_Ref;
Value : in Integer) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Integer (Impl.all, 7, Impl.Read_Count, Value);
end Set_Read_Count;
function Get_Read_Count (Object : in Wiki_Page_Ref)
return Integer is
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Read_Count;
end Get_Read_Count;
procedure Set_Preview (Object : in out Wiki_Page_Ref;
Value : in AWA.Images.Models.Image_Ref'Class) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 8, Impl.Preview, Value);
end Set_Preview;
function Get_Preview (Object : in Wiki_Page_Ref)
return AWA.Images.Models.Image_Ref'Class is
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Preview;
end Get_Preview;
procedure Set_Wiki (Object : in out Wiki_Page_Ref;
Value : in AWA.Wikis.Models.Wiki_Space_Ref'Class) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 9, Impl.Wiki, Value);
end Set_Wiki;
function Get_Wiki (Object : in Wiki_Page_Ref)
return AWA.Wikis.Models.Wiki_Space_Ref'Class is
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Wiki;
end Get_Wiki;
procedure Set_Content (Object : in out Wiki_Page_Ref;
Value : in AWA.Wikis.Models.Wiki_Content_Ref'Class) is
Impl : Wiki_Page_Access;
begin
Set_Field (Object, Impl);
ADO.Objects.Set_Field_Object (Impl.all, 10, Impl.Content, Value);
end Set_Content;
function Get_Content (Object : in Wiki_Page_Ref)
return AWA.Wikis.Models.Wiki_Content_Ref'Class is
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Load_Object.all)'Access;
begin
return Impl.Content;
end Get_Content;
-- Copy of the object.
procedure Copy (Object : in Wiki_Page_Ref;
Into : in out Wiki_Page_Ref) is
Result : Wiki_Page_Ref;
begin
if not Object.Is_Null then
declare
Impl : constant Wiki_Page_Access
:= Wiki_Page_Impl (Object.Get_Load_Object.all)'Access;
Copy : constant Wiki_Page_Access
:= new Wiki_Page_Impl;
begin
ADO.Objects.Set_Object (Result, Copy.all'Access);
Copy.Copy (Impl.all);
Copy.Name := Impl.Name;
Copy.Last_Version := Impl.Last_Version;
Copy.Is_Public := Impl.Is_Public;
Copy.Title := Impl.Title;
Copy.Version := Impl.Version;
Copy.Read_Count := Impl.Read_Count;
Copy.Preview := Impl.Preview;
Copy.Wiki := Impl.Wiki;
Copy.Content := Impl.Content;
end;
end if;
Into := Result;
end Copy;
procedure Find (Object : in out Wiki_Page_Ref;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Impl : constant Wiki_Page_Access := new Wiki_Page_Impl;
begin
Impl.Find (Session, Query, Found);
if Found then
ADO.Objects.Set_Object (Object, Impl.all'Access);
else
ADO.Objects.Set_Object (Object, null);
Destroy (Impl);
end if;
end Find;
procedure Load (Object : in out Wiki_Page_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier) is
Impl : constant Wiki_Page_Access := new Wiki_Page_Impl;
Found : Boolean;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
raise ADO.Objects.NOT_FOUND;
end if;
ADO.Objects.Set_Object (Object, Impl.all'Access);
end Load;
procedure Load (Object : in out Wiki_Page_Ref;
Session : in out ADO.Sessions.Session'Class;
Id : in ADO.Identifier;
Found : out Boolean) is
Impl : constant Wiki_Page_Access := new Wiki_Page_Impl;
Query : ADO.SQL.Query;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Impl.Find (Session, Query, Found);
if not Found then
Destroy (Impl);
else
ADO.Objects.Set_Object (Object, Impl.all'Access);
end if;
end Load;
procedure Save (Object : in out Wiki_Page_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl = null then
Impl := new Wiki_Page_Impl;
ADO.Objects.Set_Object (Object, Impl);
end if;
if not ADO.Objects.Is_Created (Impl.all) then
Impl.Create (Session);
else
Impl.Save (Session);
end if;
end Save;
procedure Delete (Object : in out Wiki_Page_Ref;
Session : in out ADO.Sessions.Master_Session'Class) is
Impl : constant ADO.Objects.Object_Record_Access := Object.Get_Object;
begin
if Impl /= null then
Impl.Delete (Session);
end if;
end Delete;
-- --------------------
-- Free the object
-- --------------------
procedure Destroy (Object : access Wiki_Page_Impl) is
type Wiki_Page_Impl_Ptr is access all Wiki_Page_Impl;
procedure Unchecked_Free is new Ada.Unchecked_Deallocation
(Wiki_Page_Impl, Wiki_Page_Impl_Ptr);
pragma Warnings (Off, "*redundant conversion*");
Ptr : Wiki_Page_Impl_Ptr := Wiki_Page_Impl (Object.all)'Access;
pragma Warnings (On, "*redundant conversion*");
begin
Unchecked_Free (Ptr);
end Destroy;
procedure Find (Object : in out Wiki_Page_Impl;
Session : in out ADO.Sessions.Session'Class;
Query : in ADO.SQL.Query'Class;
Found : out Boolean) is
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Query, WIKI_PAGE_DEF'Access);
begin
Stmt.Execute;
if Stmt.Has_Elements then
Object.Load (Stmt, Session);
Stmt.Next;
Found := not Stmt.Has_Elements;
else
Found := False;
end if;
end Find;
overriding
procedure Load (Object : in out Wiki_Page_Impl;
Session : in out ADO.Sessions.Session'Class) is
Found : Boolean;
Query : ADO.SQL.Query;
Id : constant ADO.Identifier := Object.Get_Key_Value;
begin
Query.Bind_Param (Position => 1, Value => Id);
Query.Set_Filter ("id = ?");
Object.Find (Session, Query, Found);
if not Found then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Save (Object : in out Wiki_Page_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Update_Statement
:= Session.Create_Statement (WIKI_PAGE_DEF'Access);
begin
if Object.Is_Modified (1) then
Stmt.Save_Field (Name => COL_0_3_NAME, -- id
Value => Object.Get_Key);
Object.Clear_Modified (1);
end if;
if Object.Is_Modified (2) then
Stmt.Save_Field (Name => COL_1_3_NAME, -- name
Value => Object.Name);
Object.Clear_Modified (2);
end if;
if Object.Is_Modified (3) then
Stmt.Save_Field (Name => COL_2_3_NAME, -- last_version
Value => Object.Last_Version);
Object.Clear_Modified (3);
end if;
if Object.Is_Modified (4) then
Stmt.Save_Field (Name => COL_3_3_NAME, -- is_public
Value => Object.Is_Public);
Object.Clear_Modified (4);
end if;
if Object.Is_Modified (5) then
Stmt.Save_Field (Name => COL_4_3_NAME, -- title
Value => Object.Title);
Object.Clear_Modified (5);
end if;
if Object.Is_Modified (7) then
Stmt.Save_Field (Name => COL_6_3_NAME, -- read_count
Value => Object.Read_Count);
Object.Clear_Modified (7);
end if;
if Object.Is_Modified (8) then
Stmt.Save_Field (Name => COL_7_3_NAME, -- preview_id
Value => Object.Preview);
Object.Clear_Modified (8);
end if;
if Object.Is_Modified (9) then
Stmt.Save_Field (Name => COL_8_3_NAME, -- wiki_id
Value => Object.Wiki);
Object.Clear_Modified (9);
end if;
if Object.Is_Modified (10) then
Stmt.Save_Field (Name => COL_9_3_NAME, -- content_id
Value => Object.Content);
Object.Clear_Modified (10);
end if;
if Stmt.Has_Save_Fields then
Object.Version := Object.Version + 1;
Stmt.Save_Field (Name => "version",
Value => Object.Version);
Stmt.Set_Filter (Filter => "id = ? and version = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Add_Param (Value => Object.Version - 1);
declare
Result : Integer;
begin
Stmt.Execute (Result);
if Result /= 1 then
if Result /= 0 then
raise ADO.Objects.UPDATE_ERROR;
else
raise ADO.Objects.LAZY_LOCK;
end if;
end if;
ADO.Audits.Save (Object, Session);
end;
end if;
end Save;
procedure Create (Object : in out Wiki_Page_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Query : ADO.Statements.Insert_Statement
:= Session.Create_Statement (WIKI_PAGE_DEF'Access);
Result : Integer;
begin
Object.Version := 1;
Session.Allocate (Id => Object);
Query.Save_Field (Name => COL_0_3_NAME, -- id
Value => Object.Get_Key);
Query.Save_Field (Name => COL_1_3_NAME, -- name
Value => Object.Name);
Query.Save_Field (Name => COL_2_3_NAME, -- last_version
Value => Object.Last_Version);
Query.Save_Field (Name => COL_3_3_NAME, -- is_public
Value => Object.Is_Public);
Query.Save_Field (Name => COL_4_3_NAME, -- title
Value => Object.Title);
Query.Save_Field (Name => COL_5_3_NAME, -- version
Value => Object.Version);
Query.Save_Field (Name => COL_6_3_NAME, -- read_count
Value => Object.Read_Count);
Query.Save_Field (Name => COL_7_3_NAME, -- preview_id
Value => Object.Preview);
Query.Save_Field (Name => COL_8_3_NAME, -- wiki_id
Value => Object.Wiki);
Query.Save_Field (Name => COL_9_3_NAME, -- content_id
Value => Object.Content);
Query.Execute (Result);
if Result /= 1 then
raise ADO.Objects.INSERT_ERROR;
end if;
ADO.Objects.Set_Created (Object);
ADO.Audits.Save (Object, Session);
end Create;
procedure Delete (Object : in out Wiki_Page_Impl;
Session : in out ADO.Sessions.Master_Session'Class) is
Stmt : ADO.Statements.Delete_Statement
:= Session.Create_Statement (WIKI_PAGE_DEF'Access);
begin
Stmt.Set_Filter (Filter => "id = ?");
Stmt.Add_Param (Value => Object.Get_Key);
Stmt.Execute;
end Delete;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Page_Ref;
Name : in String) return Util.Beans.Objects.Object is
Obj : ADO.Objects.Object_Record_Access;
Impl : access Wiki_Page_Impl;
begin
if From.Is_Null then
return Util.Beans.Objects.Null_Object;
end if;
Obj := From.Get_Load_Object;
Impl := Wiki_Page_Impl (Obj.all)'Access;
if Name = "id" then
return ADO.Objects.To_Object (Impl.Get_Key);
elsif Name = "name" then
return Util.Beans.Objects.To_Object (Impl.Name);
elsif Name = "last_version" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Last_Version));
elsif Name = "is_public" then
return Util.Beans.Objects.To_Object (Impl.Is_Public);
elsif Name = "title" then
return Util.Beans.Objects.To_Object (Impl.Title);
elsif Name = "read_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (Impl.Read_Count));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Load the object from current iterator position
-- ------------------------------
procedure Load (Object : in out Wiki_Page_Impl;
Stmt : in out ADO.Statements.Query_Statement'Class;
Session : in out ADO.Sessions.Session'Class) is
begin
Object.Set_Key_Value (Stmt.Get_Identifier (0));
Object.Name := Stmt.Get_Unbounded_String (1);
Object.Last_Version := Stmt.Get_Integer (2);
Object.Is_Public := Stmt.Get_Boolean (3);
Object.Title := Stmt.Get_Unbounded_String (4);
Object.Read_Count := Stmt.Get_Integer (6);
if not Stmt.Is_Null (7) then
Object.Preview.Set_Key_Value (Stmt.Get_Identifier (7), Session);
end if;
if not Stmt.Is_Null (8) then
Object.Wiki.Set_Key_Value (Stmt.Get_Identifier (8), Session);
end if;
if not Stmt.Is_Null (9) then
Object.Content.Set_Key_Value (Stmt.Get_Identifier (9), Session);
end if;
Object.Version := Stmt.Get_Integer (5);
ADO.Objects.Set_Created (Object);
end Load;
procedure Op_Load (Bean : in out Wiki_Image_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Wiki_Image_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_Image_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Wiki_Image_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_Image_Bean,
Method => Op_Load,
Name => "load");
Binding_Wiki_Image_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Wiki_Image_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Wiki_Image_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Wiki_Image_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Image_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "folder_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Folder_Id));
elsif Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "create_date" then
if From.Create_Date.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.Time.To_Object (From.Create_Date.Value);
end if;
elsif Name = "uri" then
if From.Uri.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (From.Uri.Value);
end if;
elsif Name = "storage" then
return AWA.Storages.Models.Storage_Type_Objects.To_Object (From.Storage);
elsif Name = "mime_type" then
if From.Mime_Type.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (From.Mime_Type.Value);
end if;
elsif Name = "file_size" then
if From.File_Size.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.File_Size.Value));
end if;
elsif Name = "width" then
if From.Width.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Width.Value));
end if;
elsif Name = "height" then
if From.Height.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Height.Value));
end if;
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_Image_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "folder_id" then
Item.Folder_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "create_date" then
Item.Create_Date.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Create_Date.Is_Null then
Item.Create_Date.Value := Util.Beans.Objects.Time.To_Time (Value);
end if;
elsif Name = "uri" then
Item.Uri.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Uri.Is_Null then
Item.Uri.Value := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
elsif Name = "storage" then
Item.Storage := AWA.Storages.Models.Storage_Type_Objects.To_Value (Value);
elsif Name = "mime_type" then
Item.Mime_Type.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Mime_Type.Is_Null then
Item.Mime_Type.Value := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
elsif Name = "file_size" then
Item.File_Size.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.File_Size.Is_Null then
Item.File_Size.Value := Util.Beans.Objects.To_Integer (Value);
end if;
elsif Name = "width" then
Item.Width.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Width.Is_Null then
Item.Width.Value := Util.Beans.Objects.To_Integer (Value);
end if;
elsif Name = "height" then
Item.Height.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Height.Is_Null then
Item.Height.Value := Util.Beans.Objects.To_Integer (Value);
end if;
end if;
end Set_Value;
-- --------------------
-- Read in the object the data from the query result and prepare to read the next row.
-- If there is no row, raise the ADO.NOT_FOUND exception.
-- --------------------
procedure Read (Into : in out Wiki_Image_Bean;
Stmt : in out ADO.Statements.Query_Statement'Class) is
begin
if not Stmt.Has_Elements then
raise ADO.Objects.NOT_FOUND;
end if;
Into.Folder_Id := Stmt.Get_Identifier (0);
Into.Id := Stmt.Get_Identifier (1);
Into.Create_Date := Stmt.Get_Nullable_Time (2);
Into.Uri := Stmt.Get_Nullable_String (3);
Into.Storage := AWA.Storages.Models.Storage_Type'Val (Stmt.Get_Integer (4));
Into.Mime_Type := Stmt.Get_Nullable_String (5);
Into.File_Size := Stmt.Get_Nullable_Integer (6);
Into.Width := Stmt.Get_Nullable_Integer (7);
Into.Height := Stmt.Get_Nullable_Integer (8);
Stmt.Next;
end Read;
-- --------------------
-- Run the query controlled by <b>Context</b> and load the result in <b>Object</b>.
-- --------------------
procedure Load (Object : in out Wiki_Image_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Context);
begin
Stmt.Execute;
Read (Object, Stmt);
if Stmt.Has_Elements then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Image_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "folder_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Folder_Id));
elsif Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "create_date" then
if From.Create_Date.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.Time.To_Object (From.Create_Date.Value);
end if;
elsif Name = "uri" then
if From.Uri.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (From.Uri.Value);
end if;
elsif Name = "storage" then
return AWA.Storages.Models.Storage_Type_Objects.To_Object (From.Storage);
elsif Name = "mime_type" then
if From.Mime_Type.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (From.Mime_Type.Value);
end if;
elsif Name = "file_size" then
if From.File_Size.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.File_Size.Value));
end if;
elsif Name = "width" then
if From.Width.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Width.Value));
end if;
elsif Name = "height" then
if From.Height.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Height.Value));
end if;
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_Image_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "folder_id" then
Item.Folder_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "create_date" then
Item.Create_Date.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Create_Date.Is_Null then
Item.Create_Date.Value := Util.Beans.Objects.Time.To_Time (Value);
end if;
elsif Name = "uri" then
Item.Uri.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Uri.Is_Null then
Item.Uri.Value := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
elsif Name = "storage" then
Item.Storage := AWA.Storages.Models.Storage_Type_Objects.To_Value (Value);
elsif Name = "mime_type" then
Item.Mime_Type.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Mime_Type.Is_Null then
Item.Mime_Type.Value := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
elsif Name = "file_size" then
Item.File_Size.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.File_Size.Is_Null then
Item.File_Size.Value := Util.Beans.Objects.To_Integer (Value);
end if;
elsif Name = "width" then
Item.Width.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Width.Is_Null then
Item.Width.Value := Util.Beans.Objects.To_Integer (Value);
end if;
elsif Name = "height" then
Item.Height.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Height.Is_Null then
Item.Height.Value := Util.Beans.Objects.To_Integer (Value);
end if;
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out Wiki_Image_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The information about an image used in a wiki page.
-- --------------------
procedure List (Object : in out Wiki_Image_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out Wiki_Image_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Positive := 1;
procedure Read (Into : in out Wiki_Image_Info) is
begin
Into.Folder_Id := Stmt.Get_Identifier (0);
Into.Id := Stmt.Get_Identifier (1);
Into.Create_Date := Stmt.Get_Nullable_Time (2);
Into.Uri := Stmt.Get_Nullable_String (3);
Into.Storage := AWA.Storages.Models.Storage_Type'Val (Stmt.Get_Integer (4));
Into.Mime_Type := Stmt.Get_Nullable_String (5);
Into.File_Size := Stmt.Get_Nullable_Integer (6);
Into.Width := Stmt.Get_Nullable_Integer (7);
Into.Height := Stmt.Get_Nullable_Integer (8);
end Read;
begin
Stmt.Execute;
Wiki_Image_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "name" then
return Util.Beans.Objects.To_Object (From.Name);
elsif Name = "is_public" then
return Util.Beans.Objects.To_Object (From.Is_Public);
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (From.Create_Date);
elsif Name = "page_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page_Count));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "name" then
Item.Name := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "is_public" then
Item.Is_Public := Util.Beans.Objects.To_Boolean (Value);
elsif Name = "create_date" then
Item.Create_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "page_count" then
Item.Page_Count := Util.Beans.Objects.To_Integer (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out Wiki_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The list of wikis.
-- --------------------
procedure List (Object : in out Wiki_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out Wiki_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Positive := 1;
procedure Read (Into : in out Wiki_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Name := Stmt.Get_Unbounded_String (1);
Into.Is_Public := Stmt.Get_Boolean (2);
Into.Create_Date := Stmt.Get_Time (3);
Into.Page_Count := Stmt.Get_Integer (4);
end Read;
begin
Stmt.Execute;
Wiki_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Page_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "name" then
return Util.Beans.Objects.To_Object (From.Name);
elsif Name = "title" then
return Util.Beans.Objects.To_Object (From.Title);
elsif Name = "is_public" then
return Util.Beans.Objects.To_Object (From.Is_Public);
elsif Name = "last_version" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Last_Version));
elsif Name = "read_count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Read_Count));
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (From.Create_Date);
elsif Name = "author" then
return Util.Beans.Objects.To_Object (From.Author);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_Page_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "name" then
Item.Name := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "title" then
Item.Title := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "is_public" then
Item.Is_Public := Util.Beans.Objects.To_Boolean (Value);
elsif Name = "last_version" then
Item.Last_Version := Util.Beans.Objects.To_Integer (Value);
elsif Name = "read_count" then
Item.Read_Count := Util.Beans.Objects.To_Integer (Value);
elsif Name = "create_date" then
Item.Create_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "author" then
Item.Author := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out Wiki_Page_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The information about a wiki page.
-- --------------------
procedure List (Object : in out Wiki_Page_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out Wiki_Page_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Positive := 1;
procedure Read (Into : in out Wiki_Page_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Name := Stmt.Get_Unbounded_String (1);
Into.Title := Stmt.Get_Unbounded_String (2);
Into.Is_Public := Stmt.Get_Boolean (3);
Into.Last_Version := Stmt.Get_Integer (4);
Into.Read_Count := Stmt.Get_Integer (5);
Into.Create_Date := Stmt.Get_Time (6);
Into.Author := Stmt.Get_Unbounded_String (7);
end Read;
begin
Stmt.Execute;
Wiki_Page_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Version_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "comment" then
return Util.Beans.Objects.To_Object (From.Comment);
elsif Name = "create_date" then
return Util.Beans.Objects.Time.To_Object (From.Create_Date);
elsif Name = "page_version" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page_Version));
elsif Name = "author" then
return Util.Beans.Objects.To_Object (From.Author);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_Version_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "comment" then
Item.Comment := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "create_date" then
Item.Create_Date := Util.Beans.Objects.Time.To_Time (Value);
elsif Name = "page_version" then
Item.Page_Version := Util.Beans.Objects.To_Integer (Value);
elsif Name = "author" then
Item.Author := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
-- --------------------
-- Run the query controlled by <b>Context</b> and append the list in <b>Object</b>.
-- --------------------
procedure List (Object : in out Wiki_Version_Info_List_Bean'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
begin
List (Object.List, Session, Context);
end List;
-- --------------------
-- The information about a wiki page version.
-- --------------------
procedure List (Object : in out Wiki_Version_Info_Vector;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
procedure Read (Into : in out Wiki_Version_Info);
Stmt : ADO.Statements.Query_Statement
:= Session.Create_Statement (Context);
Pos : Positive := 1;
procedure Read (Into : in out Wiki_Version_Info) is
begin
Into.Id := Stmt.Get_Identifier (0);
Into.Comment := Stmt.Get_Unbounded_String (1);
Into.Create_Date := Stmt.Get_Time (2);
Into.Page_Version := Stmt.Get_Integer (3);
Into.Author := Stmt.Get_Unbounded_String (4);
end Read;
begin
Stmt.Execute;
Wiki_Version_Info_Vectors.Clear (Object);
while Stmt.Has_Elements loop
Object.Insert_Space (Before => Pos);
Object.Update_Element (Index => Pos, Process => Read'Access);
Pos := Pos + 1;
Stmt.Next;
end loop;
end List;
procedure Op_Load (Bean : in out Wiki_View_Info;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Wiki_View_Info;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_View_Info'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Wiki_View_Info_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_View_Info,
Method => Op_Load,
Name => "load");
Binding_Wiki_View_Info_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Wiki_View_Info_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Wiki_View_Info)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Wiki_View_Info_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_View_Info;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Id));
elsif Name = "name" then
if From.Name.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (From.Name.Value);
end if;
elsif Name = "title" then
if From.Title.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (From.Title.Value);
end if;
elsif Name = "is_public" then
if From.Is_Public.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (From.Is_Public.Value);
end if;
elsif Name = "version" then
if From.Version.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Version.Value));
end if;
elsif Name = "read_count" then
if From.Read_Count.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Read_Count.Value));
end if;
elsif Name = "date" then
if From.Date.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.Time.To_Object (From.Date.Value);
end if;
elsif Name = "format" then
if From.Format.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Format_Type_Objects.To_Object (From.Format.Value);
end if;
elsif Name = "content" then
if From.Content.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (From.Content.Value);
end if;
elsif Name = "save_comment" then
if From.Save_Comment.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (From.Save_Comment.Value);
end if;
elsif Name = "left_side" then
return Util.Beans.Objects.To_Object (From.Left_Side);
elsif Name = "right_side" then
return Util.Beans.Objects.To_Object (From.Right_Side);
elsif Name = "side_format" then
return AWA.Wikis.Models.Format_Type_Objects.To_Object (From.Side_Format);
elsif Name = "author" then
if From.Author.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (From.Author.Value);
end if;
elsif Name = "acl_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Acl_Id));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_View_Info;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
Item.Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "name" then
Item.Name.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Name.Is_Null then
Item.Name.Value := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
elsif Name = "title" then
Item.Title.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Title.Is_Null then
Item.Title.Value := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
elsif Name = "is_public" then
Item.Is_Public.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Is_Public.Is_Null then
Item.Is_Public.Value := Util.Beans.Objects.To_Boolean (Value);
end if;
elsif Name = "version" then
Item.Version.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Version.Is_Null then
Item.Version.Value := Util.Beans.Objects.To_Integer (Value);
end if;
elsif Name = "read_count" then
Item.Read_Count.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Read_Count.Is_Null then
Item.Read_Count.Value := Util.Beans.Objects.To_Integer (Value);
end if;
elsif Name = "date" then
Item.Date.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Date.Is_Null then
Item.Date.Value := Util.Beans.Objects.Time.To_Time (Value);
end if;
elsif Name = "format" then
Item.Format.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Format.Is_Null then
Item.Format.Value := Format_Type_Objects.To_Value (Value);
end if;
elsif Name = "content" then
Item.Content.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Content.Is_Null then
Item.Content.Value := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
elsif Name = "save_comment" then
Item.Save_Comment.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Save_Comment.Is_Null then
Item.Save_Comment.Value := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
elsif Name = "left_side" then
Item.Left_Side := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "right_side" then
Item.Right_Side := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "side_format" then
Item.Side_Format := AWA.Wikis.Models.Format_Type_Objects.To_Value (Value);
elsif Name = "author" then
Item.Author.Is_Null := Util.Beans.Objects.Is_Null (Value);
if not Item.Author.Is_Null then
Item.Author.Value := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
elsif Name = "acl_id" then
Item.Acl_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
end if;
end Set_Value;
-- --------------------
-- Read in the object the data from the query result and prepare to read the next row.
-- If there is no row, raise the ADO.NOT_FOUND exception.
-- --------------------
procedure Read (Into : in out Wiki_View_Info;
Stmt : in out ADO.Statements.Query_Statement'Class) is
begin
if not Stmt.Has_Elements then
raise ADO.Objects.NOT_FOUND;
end if;
Into.Id := Stmt.Get_Identifier (0);
Into.Name := Stmt.Get_Nullable_String (1);
Into.Title := Stmt.Get_Nullable_String (2);
Into.Is_Public := Stmt.Get_Nullable_Boolean (3);
Into.Version := Stmt.Get_Nullable_Integer (4);
Into.Read_Count := Stmt.Get_Nullable_Integer (5);
Into.Date := Stmt.Get_Nullable_Time (6);
Into.Format.Is_Null := Stmt.Is_Null (7);
if not Into.Format.Is_Null then
Into.Format.Value := AWA.Wikis.Models.Format_Type'Val (Stmt.Get_Integer (7));
end if;
Into.Content := Stmt.Get_Nullable_String (8);
Into.Save_Comment := Stmt.Get_Nullable_String (9);
Into.Left_Side := Stmt.Get_Unbounded_String (10);
Into.Right_Side := Stmt.Get_Unbounded_String (11);
Into.Side_Format := AWA.Wikis.Models.Format_Type'Val (Stmt.Get_Integer (12));
Into.Author := Stmt.Get_Nullable_String (13);
Into.Acl_Id := Stmt.Get_Identifier (14);
Stmt.Next;
end Read;
-- --------------------
-- Run the query controlled by <b>Context</b> and load the result in <b>Object</b>.
-- --------------------
procedure Load (Object : in out Wiki_View_Info'Class;
Session : in out ADO.Sessions.Session'Class;
Context : in out ADO.Queries.Context'Class) is
Stmt : ADO.Statements.Query_Statement := Session.Create_Statement (Context);
begin
Stmt.Execute;
Read (Object, Stmt);
if Stmt.Has_Elements then
raise ADO.Objects.NOT_FOUND;
end if;
end Load;
procedure Op_Save (Bean : in out Wiki_Space_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Save (Bean : in out Wiki_Space_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_Space_Bean'Class (Bean).Save (Outcome);
end Op_Save;
package Binding_Wiki_Space_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_Space_Bean,
Method => Op_Save,
Name => "save");
procedure Op_Load (Bean : in out Wiki_Space_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Wiki_Space_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_Space_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Wiki_Space_Bean_2 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_Space_Bean,
Method => Op_Load,
Name => "load");
Binding_Wiki_Space_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Wiki_Space_Bean_1.Proxy'Access,
2 => Binding_Wiki_Space_Bean_2.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Wiki_Space_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Wiki_Space_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_Space_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "name" then
Item.Set_Name (Util.Beans.Objects.To_String (Value));
elsif Name = "is_public" then
Item.Set_Is_Public (Util.Beans.Objects.To_Boolean (Value));
elsif Name = "create_date" then
Item.Set_Create_Date (Util.Beans.Objects.Time.To_Time (Value));
elsif Name = "left_side" then
Item.Set_Left_Side (Util.Beans.Objects.To_String (Value));
elsif Name = "right_side" then
Item.Set_Right_Side (Util.Beans.Objects.To_String (Value));
elsif Name = "format" then
Item.Set_Format (Format_Type_Objects.To_Value (Value));
end if;
end Set_Value;
procedure Op_Save (Bean : in out Wiki_Page_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Save (Bean : in out Wiki_Page_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_Page_Bean'Class (Bean).Save (Outcome);
end Op_Save;
package Binding_Wiki_Page_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_Page_Bean,
Method => Op_Save,
Name => "save");
procedure Op_Delete (Bean : in out Wiki_Page_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Delete (Bean : in out Wiki_Page_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_Page_Bean'Class (Bean).Delete (Outcome);
end Op_Delete;
package Binding_Wiki_Page_Bean_2 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_Page_Bean,
Method => Op_Delete,
Name => "delete");
procedure Op_Load (Bean : in out Wiki_Page_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Wiki_Page_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_Page_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Wiki_Page_Bean_3 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_Page_Bean,
Method => Op_Load,
Name => "load");
procedure Op_Setup (Bean : in out Wiki_Page_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Setup (Bean : in out Wiki_Page_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_Page_Bean'Class (Bean).Setup (Outcome);
end Op_Setup;
package Binding_Wiki_Page_Bean_4 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_Page_Bean,
Method => Op_Setup,
Name => "setup");
Binding_Wiki_Page_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Wiki_Page_Bean_1.Proxy'Access,
2 => Binding_Wiki_Page_Bean_2.Proxy'Access,
3 => Binding_Wiki_Page_Bean_3.Proxy'Access,
4 => Binding_Wiki_Page_Bean_4.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Wiki_Page_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Wiki_Page_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_Page_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "name" then
Item.Set_Name (Util.Beans.Objects.To_String (Value));
elsif Name = "last_version" then
Item.Set_Last_Version (Util.Beans.Objects.To_Integer (Value));
elsif Name = "is_public" then
Item.Set_Is_Public (Util.Beans.Objects.To_Boolean (Value));
elsif Name = "title" then
Item.Set_Title (Util.Beans.Objects.To_String (Value));
elsif Name = "read_count" then
Item.Set_Read_Count (Util.Beans.Objects.To_Integer (Value));
end if;
end Set_Value;
procedure Op_Load (Bean : in out Wiki_Page_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Wiki_Page_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_Page_List_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Wiki_Page_List_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_Page_List_Bean,
Method => Op_Load,
Name => "load");
Binding_Wiki_Page_List_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Wiki_Page_List_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Wiki_Page_List_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Wiki_Page_List_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Page_List_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "page" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page));
elsif Name = "count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Count));
elsif Name = "page_size" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page_Size));
elsif Name = "tag" then
return Util.Beans.Objects.To_Object (From.Tag);
elsif Name = "wiki_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Wiki_Id));
elsif Name = "sort" then
return Util.Beans.Objects.To_Object (From.Sort);
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_Page_List_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "page" then
Item.Page := Util.Beans.Objects.To_Integer (Value);
elsif Name = "count" then
Item.Count := Util.Beans.Objects.To_Integer (Value);
elsif Name = "page_size" then
Item.Page_Size := Util.Beans.Objects.To_Integer (Value);
elsif Name = "tag" then
Item.Tag := Util.Beans.Objects.To_Unbounded_String (Value);
elsif Name = "wiki_id" then
Item.Wiki_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "sort" then
Item.Sort := Util.Beans.Objects.To_Unbounded_String (Value);
end if;
end Set_Value;
procedure Op_Load (Bean : in out Wiki_Version_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Wiki_Version_List_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_Version_List_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Wiki_Version_List_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_Version_List_Bean,
Method => Op_Load,
Name => "load");
Binding_Wiki_Version_List_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Wiki_Version_List_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Wiki_Version_List_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Wiki_Version_List_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Version_List_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "page" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page));
elsif Name = "count" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Count));
elsif Name = "page_size" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page_Size));
elsif Name = "wiki_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Wiki_Id));
elsif Name = "page_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page_Id));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_Version_List_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "page" then
Item.Page := Util.Beans.Objects.To_Integer (Value);
elsif Name = "count" then
Item.Count := Util.Beans.Objects.To_Integer (Value);
elsif Name = "page_size" then
Item.Page_Size := Util.Beans.Objects.To_Integer (Value);
elsif Name = "wiki_id" then
Item.Wiki_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "page_id" then
Item.Page_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
end if;
end Set_Value;
procedure Op_Load (Bean : in out Wiki_Page_Info_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String);
procedure Op_Load (Bean : in out Wiki_Page_Info_Bean;
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is
begin
Wiki_Page_Info_Bean'Class (Bean).Load (Outcome);
end Op_Load;
package Binding_Wiki_Page_Info_Bean_1 is
new ASF.Events.Faces.Actions.Action_Method.Bind (Bean => Wiki_Page_Info_Bean,
Method => Op_Load,
Name => "load");
Binding_Wiki_Page_Info_Bean_Array : aliased constant Util.Beans.Methods.Method_Binding_Array
:= (1 => Binding_Wiki_Page_Info_Bean_1.Proxy'Access
);
-- ------------------------------
-- This bean provides some methods that can be used in a Method_Expression.
-- ------------------------------
overriding
function Get_Method_Bindings (From : in Wiki_Page_Info_Bean)
return Util.Beans.Methods.Method_Binding_Array_Access is
pragma Unreferenced (From);
begin
return Binding_Wiki_Page_Info_Bean_Array'Access;
end Get_Method_Bindings;
-- ------------------------------
-- Get the bean attribute identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Page_Info_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "wiki_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Wiki_Id));
elsif Name = "page_id" then
return Util.Beans.Objects.To_Object (Long_Long_Integer (From.Page_Id));
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name
-- ------------------------------
overriding
procedure Set_Value (Item : in out Wiki_Page_Info_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "wiki_id" then
Item.Wiki_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
elsif Name = "page_id" then
Item.Page_Id := ADO.Identifier (Util.Beans.Objects.To_Long_Long_Integer (Value));
end if;
end Set_Value;
end AWA.Wikis.Models;
| 38.919557 | 98 | 0.598771 |
57b9912375fc26579fd8258bc14faec8815392ef | 5,239 | ads | Ada | gcc-gcc-7_3_0-release/gcc/ada/g-hesorg.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/g-hesorg.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/g-hesorg.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . H E A P _ S O R T _ G --
-- --
-- S p e c --
-- --
-- Copyright (C) 1995-2010, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Heapsort generic package using formal procedures
-- This package provides a generic heapsort routine that can be used with
-- different types of data.
-- See also GNAT.Heap_Sort, a version that works with subprogram access
-- parameters, allowing code sharing. The generic version is slightly more
-- efficient but does not allow code sharing and has an interface that is
-- more awkward to use.
-- There is also GNAT.Heap_Sort_A, which is now considered obsolete, but
-- was an older version working with subprogram parameters. This version
-- is retained for backwards compatibility with old versions of GNAT.
-- This heapsort algorithm uses approximately N*log(N) compares in the
-- worst case and is in place with no additional storage required. See
-- the body for exact details of the algorithm used.
generic
-- The data to be sorted is assumed to be indexed by integer values from
-- 1 to N, where N is the number of items to be sorted. In addition, the
-- index value zero is used for a temporary location used during the sort.
with procedure Move (From : Natural; To : Natural);
-- A procedure that moves the data item with index value From to the data
-- item with index value To (the old value in To being lost). An index
-- value of zero is used for moves from and to a single temporary location.
-- For best efficiency, this routine should be marked as inlined.
with function Lt (Op1, Op2 : Natural) return Boolean;
-- A function that compares two items and returns True if the item with
-- index Op1 is less than the item with Index Op2, and False if the Op1
-- item is greater than the Op2 item. If the two items are equal, then
-- it does not matter whether True or False is returned (it is slightly
-- more efficient to return False). For best efficiency, this routine
-- should be marked as inlined.
-- Note on use of temporary location
-- There are two ways of providing for the index value zero to represent
-- a temporary value. Either an extra location can be allocated at the
-- start of the array, or alternatively the Move and Lt subprograms can
-- test for the case of zero and treat it specially. In any case it is
-- desirable to specify the two subprograms as inlined and the tests for
-- zero will in this case be resolved at instantiation time.
package GNAT.Heap_Sort_G is
pragma Pure;
procedure Sort (N : Natural);
-- This procedures sorts items in the range from 1 to N into ascending
-- order making calls to Lt to do required comparisons, and Move to move
-- items around. Note that, as described above, both Move and Lt use a
-- single temporary location with index value zero. This sort is not
-- stable, i.e. the order of equal elements in the input is not preserved.
end GNAT.Heap_Sort_G;
| 58.865169 | 79 | 0.561367 |
59e9d1e20d24f52d66f59c83650db184e5220c23 | 3,909 | adb | Ada | Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb | neverware-mirrors/ncurses | 931939e0d2765af13962820e59cb6629df3ee638 | [
"X11"
] | 269 | 2015-03-01T21:34:42.000Z | 2022-03-30T23:07:18.000Z | Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb | neverware-mirrors/ncurses | 931939e0d2765af13962820e59cb6629df3ee638 | [
"X11"
] | 3 | 2020-10-09T15:00:37.000Z | 2020-10-09T15:05:19.000Z | Ada95/src/terminal_interface-curses-forms-field_types-intfield.adb | neverware-mirrors/ncurses | 931939e0d2765af13962820e59cb6629df3ee638 | [
"X11"
] | 97 | 2016-04-25T06:22:54.000Z | 2022-03-30T23:07:19.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding --
-- --
-- Terminal_Interface.Curses.Forms.Field_Types.IntField --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright 2020 Thomas E. Dickey --
-- Copyright 1999-2011,2014 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control:
-- $Revision: 1.14 $
-- $Date: 2020/02/02 23:34:34 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
package body Terminal_Interface.Curses.Forms.Field_Types.IntField is
procedure Set_Field_Type (Fld : Field;
Typ : Integer_Field)
is
function Set_Fld_Type (F : Field := Fld;
Arg1 : C_Int;
Arg2 : C_Long_Int;
Arg3 : C_Long_Int) return Eti_Error;
pragma Import (C, Set_Fld_Type, "set_field_type_integer");
begin
Eti_Exception (Set_Fld_Type (Arg1 => C_Int (Typ.Precision),
Arg2 => C_Long_Int (Typ.Lower_Limit),
Arg3 => C_Long_Int (Typ.Upper_Limit)));
Wrap_Builtin (Fld, Typ);
end Set_Field_Type;
end Terminal_Interface.Curses.Forms.Field_Types.IntField;
| 61.078125 | 78 | 0.447429 |
3d7d12e82321b8cc5ccd8e6432f13d6b7fcfff4c | 1,641 | adb | Ada | samples/volume_server.adb | My-Colaborations/ada-servlet | 4a82140ecf87418808ca8882f698384bb56b412e | [
"Apache-2.0"
] | null | null | null | samples/volume_server.adb | My-Colaborations/ada-servlet | 4a82140ecf87418808ca8882f698384bb56b412e | [
"Apache-2.0"
] | null | null | null | samples/volume_server.adb | My-Colaborations/ada-servlet | 4a82140ecf87418808ca8882f698384bb56b412e | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- volume_server -- Example of server with a servlet
-- Copyright (C) 2010, 2015, 2018 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Servlet.Server.Web;
with Servlet.Core;
with Volume_Servlet;
with Util.Log.Loggers;
procedure Volume_Server is
Compute : aliased Volume_Servlet.Servlet;
App : aliased Servlet.Core.Servlet_Registry;
WS : Servlet.Server.Web.AWS_Container;
Log : constant Util.Log.Loggers.Logger := Util.Log.Loggers.Create ("Volume_Server");
begin
-- Register the servlets and filters
App.Add_Servlet (Name => "compute", Server => Compute'Unchecked_Access);
-- Define servlet mappings
App.Add_Mapping (Name => "compute", Pattern => "*.html");
WS.Register_Application ("/volume", App'Unchecked_Access);
Log.Info ("Connect you browser to: http://localhost:8080/volume/compute.html");
WS.Start;
delay 60.0;
end Volume_Server;
| 36.466667 | 91 | 0.659354 |
2fb82f2c8c66b0f0171cdd2a88d10c3216f793bf | 2,792 | adb | Ada | regtests/mysql/ado-schemas-mysql-tests.adb | Letractively/ada-ado | f0863c6975ae1a2c5349daee1e98a04fe11ba11e | [
"Apache-2.0"
] | null | null | null | regtests/mysql/ado-schemas-mysql-tests.adb | Letractively/ada-ado | f0863c6975ae1a2c5349daee1e98a04fe11ba11e | [
"Apache-2.0"
] | null | null | null | regtests/mysql/ado-schemas-mysql-tests.adb | Letractively/ada-ado | f0863c6975ae1a2c5349daee1e98a04fe11ba11e | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- schemas Tests -- Test loading of database schema for MySQL
-- Copyright (C) 2009, 2010, 2011, 2012 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Util.Test_Caller;
with ADO.Drivers;
with ADO.Drivers.Connections;
with ADO.Sessions;
with ADO.Databases;
with ADO.Schemas.Mysql;
with Regtests;
package body ADO.Schemas.Mysql.Tests is
use Util.Tests;
package Caller is new Util.Test_Caller (Test, "ADO.Schemas.MySQL");
procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite) is
begin
Caller.Add_Test (Suite, "Test ADO.Schemas.Load_Schema",
Test_Load_Schema'Access);
end Add_Tests;
procedure Test_Load_Schema (T : in out Test) is
use type ADO.Drivers.Connections.Driver_Access;
S : constant ADO.Sessions.Session := Regtests.Get_Database;
DB : constant ADO.Databases.Connection'Class := S.Get_Connection;
Dr : constant ADO.Drivers.Connections.Driver_Access := DB.Get_Driver;
Schema : Schema_Definition;
Table : Table_Definition;
begin
T.Assert (Dr /= null, "Database connection has no driver");
if Dr.Get_Driver_Name /= "mysql" then
return;
end if;
ADO.Schemas.Mysql.Load_Schema (DB, Schema);
Table := ADO.Schemas.Find_Table (Schema, "allocate");
T.Assert (Table /= null, "Table schema for test_allocate not found");
Assert_Equals (T, "allocate", Get_Name (Table));
declare
C : Column_Cursor := Get_Columns (Table);
Nb_Columns : Integer := 0;
begin
while Has_Element (C) loop
Nb_Columns := Nb_Columns + 1;
Next (C);
end loop;
Assert_Equals (T, 3, Nb_Columns, "Invalid number of columns");
end;
declare
C : constant Column_Definition := Find_Column (Table, "ID");
begin
T.Assert (C /= null, "Cannot find column 'id' in table schema");
Assert_Equals (T, "ID", Get_Name (C), "Invalid column name");
end;
end Test_Load_Schema;
end ADO.Schemas.Mysql.Tests;
| 34.04878 | 76 | 0.635029 |
3d1aa19a667d7caad54e9f9e97073bbae57e13cb | 2,740 | ads | Ada | src/orig/dds-request_reply-connext_c_untyped_impl.ads | alexcamposruiz/dds-requestreply | 9f29d34554b5d3e9291151c6e92d2ce6cc31bb71 | [
"MIT"
] | null | null | null | src/orig/dds-request_reply-connext_c_untyped_impl.ads | alexcamposruiz/dds-requestreply | 9f29d34554b5d3e9291151c6e92d2ce6cc31bb71 | [
"MIT"
] | null | null | null | src/orig/dds-request_reply-connext_c_untyped_impl.ads | alexcamposruiz/dds-requestreply | 9f29d34554b5d3e9291151c6e92d2ce6cc31bb71 | [
"MIT"
] | 2 | 2020-04-06T19:34:15.000Z | 2020-04-06T19:50:03.000Z | with DDS.DataReader;
with DDS.DataWriter;
with DDS.ReadCondition;
with DDS.WaitSet;
with DDS.Request_Reply.Untypedcommon;
package DDS.Request_Reply.connext_c_untyped_impl is
use Untypedcommon;
function RTI_Connext_EntityUntypedImpl_Wait_For_Samples
(Self : not null access RTI_Connext_EntityUntypedImpl;
Max_Wait : DDS.Duration_T;
Min_Sample_Count : DDS.Natural;
Waitset : not null DDS.WaitSet.Ref_Access;
Initial_Condition : DDS.ReadCondition.Ref_Access;
Condition : DDS.ReadCondition.Ref_Access) return Dds.ReturnCode_T;
function RTI_Connext_EntityUntypedImpl_Get_Sample_Loaned
(Self : not null access RTI_Connext_EntityUntypedImpl;
Received_Data : System.Address;
Data_Count : out DDS.Integer;
Is_Loan : DDS.Boolean;
DataSeqContiguousBuffer : System.Address;
Info_Seq : not null access DDS.SampleInfo_Seq.Sequence;
Data_Seq_Len : DDS.long;
Data_Seq_Max_Len : DDS.long;
Ownership : DDS.Boolean;
Max_Samples : DDS.long;
Read_Condition : DDS.ReadCondition.Ref_Access;
Take : DDS.Boolean) return Dds.ReturnCode_T;
function RTI_Connext_EntityUntypedImpl_Send_Sample
(Self : not null access RTI_Connext_EntityUntypedImpl;
Data : System.Address;
Info : not null access DDS.WriteParams_T) return DDS.ReturnCode_T;
function RTI_Connext_EntityUntypedImpl_wait_for_any_sample
(Self : not null access RTI_Connext_EntityUntypedImpl;
max_wait : Duration_t;
Min_Sample_Count : Integer) return DDS.ReturnCode_T;
function RTI_Connext_EntityUntypedImpl_Return_Loan
(Self : not null access RTI_Connext_EntityUntypedImpl;
dataArray : System.Address;
Info_Seq : not null access SampleInfo_Seq.Sequence) return DDS.ReturnCode_T;
function RTI_Connext_EntityUntypedImpl_Get_Datawriter
(Self : not null access RTI_Connext_EntityUntypedImpl) return DDS.DataWriter.Ref_Access;
function RTI_Connext_EntityUntypedImpl_Get_Datareader
(Self : not null access RTI_Connext_EntityUntypedImpl) return DDS.DataReader.Ref_Access;
function RTI_Connext_EntityUntypedImpl_Delete
(Self : RTI_Connext_EntityUntypedImpl_Access) return ReturnCode_t;
function RTI_Connext_EntityUntypedImpl_Validate_Receive_Params
(Self : not null access RTI_Connext_EntityUntypedImpl;
METHOD_NAME : Standard.String;
Min_Count : long;
Max_Count : long;
Max_Wait : Duration_T
) return Boolean;
end DDS.Request_Reply.connext_c_untyped_impl;
| 39.710145 | 93 | 0.709854 |
57dc0cb74cd2e712240dd8929d98021a5eebe38c | 4,606 | adb | Ada | sources/md/markdown-fenced_code_blocks.adb | reznikmm/markdown | af47bd45427f1c016c0a2a11e86fa2d1b1c82315 | [
"MIT"
] | null | null | null | sources/md/markdown-fenced_code_blocks.adb | reznikmm/markdown | af47bd45427f1c016c0a2a11e86fa2d1b1c82315 | [
"MIT"
] | null | null | null | sources/md/markdown-fenced_code_blocks.adb | reznikmm/markdown | af47bd45427f1c016c0a2a11e86fa2d1b1c82315 | [
"MIT"
] | null | null | null | -- SPDX-FileCopyrightText: 2020 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
----------------------------------------------------------------
with League.Regexps;
with Markdown.Visitors;
package body Markdown.Fenced_Code_Blocks is
Pattern : constant League.Regexps.Regexp_Pattern :=
League.Regexps.Compile
(League.Strings.To_Universal_String
("^\ {0,3}((\`{3,})\ *([^\`]*)|(\~{3,})\ *(.*))$"));
-- 12 3 4 5
-----------------
-- Append_Line --
-----------------
overriding procedure Append_Line
(Self : in out Fenced_Code_Block;
Line : Markdown.Blocks.Text_Line;
CIP : Can_Interrupt_Paragraph;
Ok : in out Boolean)
is
pragma Unreferenced (CIP);
Match : constant League.Regexps.Regexp_Match :=
Pattern.Find_Match (Line.Line);
begin
if Self.Closed then
Ok := False;
return;
elsif Match.Is_Matched
-- Closing fences cannot have info string
and then Match.Last_Index (3) < Match.First_Index (3)
and then Match.Last_Index (5) < Match.First_Index (5)
then
if Self.Is_Tick_Fence then
Self.Closed := Match.Last_Index (2) > 0 and then
Match.Last_Index (2) - Match.First_Index (2) + 1 >=
Self.Fence_Length;
else
Self.Closed := Match.Last_Index (2) = 0 and then
Match.Last_Index (4) - Match.First_Index (4) + 1 >=
Self.Fence_Length;
end if;
end if;
if not Self.Closed then
declare
From : Positive := 1;
begin
for J in 1 .. Self.Fence_Indent loop
if J <= Line.Line.Length and then
Line.Line (J).To_Wide_Wide_Character = ' '
then
From := J + 1;
else
exit;
end if;
end loop;
if From > Line.Line.Length then
Self.Blank.Append (League.Strings.Empty_Universal_String);
else
Self.Lines.Append (Self.Blank);
Self.Blank.Clear;
Self.Lines.Append (Line.Line.Tail_From (From));
end if;
end;
elsif not Self.Blank.Is_Empty then
Self.Lines.Append (Self.Blank);
Self.Blank.Clear;
end if;
Ok := True;
end Append_Line;
------------
-- Create --
------------
overriding function Create
(Line : not null access Markdown.Blocks.Text_Line)
return Fenced_Code_Block
is
Match : constant League.Regexps.Regexp_Match :=
Pattern.Find_Match (Line.Line);
begin
pragma Assert (Match.Is_Matched);
return Result : Fenced_Code_Block do
Result.Fence_Indent := Match.First_Index (1) - 1;
Result.Is_Tick_Fence := Match.Last_Index (2) > 0;
if Result.Is_Tick_Fence then
Result.Fence_Length :=
Match.Last_Index (2) - Match.First_Index (2) + 1;
Result.Info_String := Line.Line.Slice
(Match.First_Index (3), Match.Last_Index (3));
else
Result.Fence_Length :=
Match.Last_Index (4) - Match.First_Index (4) + 1;
Result.Info_String := Line.Line.Slice
(Match.First_Index (5), Match.Last_Index (5));
end if;
Line.Line.Clear;
end return;
end Create;
------------
-- Filter --
------------
procedure Filter
(Line : Markdown.Blocks.Text_Line;
Tag : in out Ada.Tags.Tag;
CIP : out Can_Interrupt_Paragraph)
is
Match : constant League.Regexps.Regexp_Match :=
Pattern.Find_Match (Line.Line);
begin
if Match.Is_Matched then
Tag := Fenced_Code_Block'Tag;
CIP := True;
end if;
end Filter;
-----------------
-- Info_String --
-----------------
function Info_String (Self : Fenced_Code_Block'Class)
return League.Strings.Universal_String is
begin
return Self.Info_String;
end Info_String;
-----------
-- Lines --
-----------
function Lines (Self : Fenced_Code_Block'Class)
return League.String_Vectors.Universal_String_Vector is
begin
return Self.Lines;
end Lines;
-----------
-- Visit --
-----------
overriding procedure Visit
(Self : in out Fenced_Code_Block;
Visitor : in out Markdown.Visitors.Visitor'Class) is
begin
Visitor.Fenced_Code_Block (Self);
end Visit;
end Markdown.Fenced_Code_Blocks;
| 27.915152 | 73 | 0.542336 |
41c743da7ec1fa10a7d452af8d3a5f3ea6ab9a2e | 939 | ads | Ada | src/util-concurrent.ads | Letractively/ada-util | e4c63b93635dc07c46e95f12ba02d18903b307b3 | [
"Apache-2.0"
] | 18 | 2015-10-26T21:32:08.000Z | 2021-11-30T10:38:51.000Z | src/util-concurrent.ads | Letractively/ada-util | e4c63b93635dc07c46e95f12ba02d18903b307b3 | [
"Apache-2.0"
] | 2 | 2018-03-18T08:22:06.000Z | 2022-02-16T22:15:05.000Z | src/util-concurrent.ads | Letractively/ada-util | e4c63b93635dc07c46e95f12ba02d18903b307b3 | [
"Apache-2.0"
] | 2 | 2019-04-05T17:10:34.000Z | 2022-02-13T20:50:56.000Z | -----------------------------------------------------------------------
-- Util.Concurrent -- Concurrent Tools
-- Copyright (C) 2001, 2002, 2003, 2009, 2010 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
package Util.Concurrent is
pragma Pure;
end Util.Concurrent;
| 40.826087 | 76 | 0.621938 |
a1dc85b45c9796e70b450765be3a5f32ba479708 | 43,949 | adb | Ada | src/spat-spark_info.adb | yannickmoy/spat | 9974849c8086f0b8297727d37a1707b417a8f1ed | [
"WTFPL"
] | null | null | null | src/spat-spark_info.adb | yannickmoy/spat | 9974849c8086f0b8297727d37a1707b417a8f1ed | [
"WTFPL"
] | null | null | null | src/spat-spark_info.adb | yannickmoy/spat | 9974849c8086f0b8297727d37a1707b417a8f1ed | [
"WTFPL"
] | null | null | null | ------------------------------------------------------------------------------
-- Copyright (C) 2020 by Heisenbug Ltd. ([email protected])
--
-- This work is free. You can redistribute it and/or modify it under the
-- terms of the Do What The Fuck You Want To Public License, Version 2,
-- as published by Sam Hocevar. See the LICENSE file for more details.
------------------------------------------------------------------------------
pragma License (Unrestricted);
with Ada.Directories;
with Ada.Strings.Fixed;
with SPAT.Entity_Line;
with SPAT.Field_Names;
with SPAT.Flow_Item;
with SPAT.Log;
with SPAT.Preconditions;
with SPAT.Proof_Item;
with SPAT.Strings;
package body SPAT.Spark_Info is
use type Ada.Containers.Count_Type;
use type Analyzed_Entities.Cursor;
-- Make JSON type enumeration literals directly visible.
use all type GNATCOLL.JSON.JSON_Value_Type;
---------------------------------------------------------------------------
-- Subprogram prototypes.
---------------------------------------------------------------------------
---------------------------------------------------------------------------
-- Get_Sentinel (Flows)
---------------------------------------------------------------------------
function Get_Sentinel (Node : in Analyzed_Entities.Constant_Reference_Type)
return Flows_Sentinel;
---------------------------------------------------------------------------
-- Get_Sentinel (Proofs)
---------------------------------------------------------------------------
function Get_Sentinel (Node : in Analyzed_Entities.Constant_Reference_Type)
return Proofs_Sentinel;
---------------------------------------------------------------------------
-- Guess_Version
--
-- Checks for presence of certain fields that are presumed version
-- specific.
---------------------------------------------------------------------------
function Guess_Version (Root : in JSON_Value) return File_Version;
---------------------------------------------------------------------------
-- Map_Assumptions_Elements
---------------------------------------------------------------------------
procedure Map_Assumptions_Elements (This : in out T;
Root : in JSON_Array);
---------------------------------------------------------------------------
-- Map_Entities
---------------------------------------------------------------------------
procedure Map_Entities (This : in out T;
Root : in JSON_Value;
From_File : in File_Name) with
Pre => (Preconditions.Ensure_Field (Object => Root,
Field => Field_Names.Name,
Kind => JSON_String_Type) and then
Preconditions.Ensure_Field (Object => Root,
Field => Field_Names.Sloc,
Kind => JSON_Array_Type));
---------------------------------------------------------------------------
-- Map_Flow_Elements
---------------------------------------------------------------------------
procedure Map_Flow_Elements (This : in out T;
Root : in JSON_Array);
---------------------------------------------------------------------------
-- Map_Proof_Elements
---------------------------------------------------------------------------
procedure Map_Proof_Elements (This : in out T;
Version : in File_Version;
Root : in JSON_Array);
---------------------------------------------------------------------------
-- Map_Sloc_Elements
---------------------------------------------------------------------------
procedure Map_Sloc_Elements (This : in out T;
The_Tree : in out Entity.Tree.T;
Position : in Entity.Tree.Cursor;
Root : in JSON_Array);
---------------------------------------------------------------------------
-- Map_Spark_Elements
---------------------------------------------------------------------------
procedure Map_Spark_Elements (This : in out T;
Root : in JSON_Array;
From_File : in File_Name);
---------------------------------------------------------------------------
-- Map_Timings
---------------------------------------------------------------------------
procedure Map_Timings (This : in out T;
File : in File_Name;
Root : in JSON_Value;
Version : in File_Version);
---------------------------------------------------------------------------
-- Sort_Entity_By_Name
--
-- Sort code entities by their name.
-- Sorting: alphabetical, ascending
---------------------------------------------------------------------------
procedure Sort_Entity_By_Name (This : in T;
Container : in out Strings.Entity_Names);
---------------------------------------------------------------------------
-- Sort_Entity_By_Proof_Time
--
-- Sort code entities by how much total proof time they required.
-- Sorting: numerical, descending
---------------------------------------------------------------------------
procedure Sort_Entity_By_Proof_Time
(This : in T;
Container : in out Strings.Entity_Names);
---------------------------------------------------------------------------
-- Sort_File_By_Basename
--
-- Sort files by their base name (i.e. without containing directory or
-- extension).
-- Sorting: alphabetical, ascending
---------------------------------------------------------------------------
procedure Sort_File_By_Basename (This : in T;
Container : in out Strings.File_Names);
---------------------------------------------------------------------------
-- Sort_File_By_Proof_Time
--
-- Sort files by how much total time it required to spend in flow analysis
-- and proof.
-- Sorting: numerical, descending
---------------------------------------------------------------------------
procedure Sort_File_By_Proof_Time (This : in T;
Container : in out Strings.File_Names);
---------------------------------------------------------------------------
-- Subprogram implementations
---------------------------------------------------------------------------
---------------------------------------------------------------------------
-- Flow_Time
---------------------------------------------------------------------------
not overriding
function Flow_Time (This : in T;
File : in File_Name) return Duration is
(This.Files (File).Flow);
---------------------------------------------------------------------------
-- Get_Sentinel (Flows)
---------------------------------------------------------------------------
function Get_Sentinel (Node : in Analyzed_Entities.Constant_Reference_Type)
return Flows_Sentinel
is
(Flows_Sentinel (SPAT.Entity.Tree.Element (Position => Node.Flows)));
---------------------------------------------------------------------------
-- Get_Sentinel (Proofs)
---------------------------------------------------------------------------
function Get_Sentinel (Node : in Analyzed_Entities.Constant_Reference_Type)
return Proofs_Sentinel
is
(Proofs_Sentinel (SPAT.Entity.Tree.Element (Position => Node.Proofs)));
---------------------------------------------------------------------------
-- Guess_Version
---------------------------------------------------------------------------
function Guess_Version (Root : in JSON_Value) return File_Version
is
Result : File_Version := GNAT_CE_2019;
begin
if Root.Has_Field (Field => Field_Names.Session_Map) then
-- "session_map" seems new in CE 2020.
Result := GNAT_CE_2020;
elsif Root.Has_Field (Field => Field_Names.Timings) then
declare
Timings : constant GNATCOLL.JSON.JSON_Value :=
Root.Get (Field => Field_Names.Timings);
begin
if Timings.Has_Field (Field => Field_Names.Translation_Of_Compilation_Unit) then
-- This field seems to have disappeared in GNAT CE 2020, so if
-- it is present, we assume GNAT CE 2019.
Result := GNAT_CE_2019;
else
Result := GNAT_CE_2020;
end if;
end;
end if;
Log.Debug (Message => "File version: " & Result'Image);
return Result;
end Guess_Version;
---------------------------------------------------------------------------
-- Has_Failed_Attempts
---------------------------------------------------------------------------
not overriding
function Has_Failed_Attempts (This : in T;
Entity : in Entity_Name) return Boolean is
Reference : constant Analyzed_Entities.Constant_Reference_Type :=
This.Entities.Constant_Reference (Key => Entity);
Sentinel : constant Proofs_Sentinel := Get_Sentinel (Node => Reference);
begin
return Sentinel.Cache.Has_Failed_Attempts;
end Has_Failed_Attempts;
---------------------------------------------------------------------------
-- Has_Unjustified_Attempts
---------------------------------------------------------------------------
not overriding
function Has_Unjustified_Attempts
(This : in T;
Entity : in Entity_Name) return Boolean
is
Reference : constant Analyzed_Entities.Constant_Reference_Type :=
This.Entities.Constant_Reference (Key => Entity);
Sentinel : constant Proofs_Sentinel := Get_Sentinel (Node => Reference);
begin
return Sentinel.Cache.Has_Unjustified_Attempts;
end Has_Unjustified_Attempts;
---------------------------------------------------------------------------
-- Has_Unproved_Attempts
---------------------------------------------------------------------------
not overriding
function Has_Unproved_Attempts (This : in T;
Entity : in Entity_Name) return Boolean is
Reference : constant Analyzed_Entities.Constant_Reference_Type :=
This.Entities.Constant_Reference (Key => Entity);
Sentinel : constant Proofs_Sentinel := Get_Sentinel (Node => Reference);
begin
return Sentinel.Cache.Has_Unproved_Attempts;
end Has_Unproved_Attempts;
---------------------------------------------------------------------------
-- Iterate_Children
---------------------------------------------------------------------------
not overriding
function Iterate_Children (This : in T;
Entity : in Entity_Name;
Position : in SPAT.Entity.Tree.Cursor)
return SPAT.Entity.Tree.Forward_Iterator'Class is
begin
return
This.Entities (Entity).The_Tree.Iterate_Children (Parent => Position);
end Iterate_Children;
---------------------------------------------------------------------------
-- List_All_Entities
---------------------------------------------------------------------------
not overriding
function List_All_Entities
(This : in T;
Sort_By : in Sorting_Criterion := Name) return Strings.Entity_Names is
begin
return Result : Strings.Entity_Names (Capacity => This.Entities.Length) do
for Position in This.Entities.Iterate loop
Result.Append
(New_Item => Analyzed_Entities.Key (Position => Position));
end loop;
case Sort_By is
when None =>
null;
when Name =>
This.Sort_Entity_By_Name (Container => Result);
when Time =>
This.Sort_Entity_By_Proof_Time (Container => Result);
end case;
end return;
end List_All_Entities;
---------------------------------------------------------------------------
-- List_All_Files
---------------------------------------------------------------------------
not overriding
function List_All_Files
(This : in T;
Sort_By : in Sorting_Criterion := None) return Strings.File_Names is
begin
return Result : Strings.File_Names (Capacity => This.Entities.Length) do
for Position in This.Files.Iterate loop
Result.Append (New_Item => File_Timings.Key (Position => Position));
end loop;
case Sort_By is
when None =>
null;
when Name =>
This.Sort_File_By_Basename (Container => Result);
when Time =>
This.Sort_File_By_Proof_Time (Container => Result);
end case;
end return;
end List_All_Files;
---------------------------------------------------------------------------
-- Map_Assumptions_Elements
---------------------------------------------------------------------------
procedure Map_Assumptions_Elements (This : in out T;
Root : in JSON_Array) is
begin
-- TODO: Add all elements from the "assumptions" array.
null;
end Map_Assumptions_Elements;
---------------------------------------------------------------------------
-- Map_Entities
---------------------------------------------------------------------------
procedure Map_Entities (This : in out T;
Root : in JSON_Value;
From_File : in File_Name)
is
Obj_Name : constant Entity_Name :=
Entity_Name (Subject_Name'(Root.Get (Field => Field_Names.Name)));
Slocs : constant JSON_Array := Root.Get (Field => Field_Names.Sloc);
Index : Analyzed_Entities.Cursor :=
This.Entities.Find (Key => Obj_Name);
begin
if Index = Analyzed_Entities.No_Element then
declare
Element : Analyzed_Entity;
Dummy_Inserted : Boolean;
begin
Element.SPARK_File := From_File;
This.Entities.Insert (Key => Obj_Name,
New_Item => Element,
Position => Index,
Inserted => Dummy_Inserted);
end;
end if;
declare
Reference : constant Analyzed_Entities.Reference_Type :=
This.Entities.Reference (Position => Index);
use type Entity.Tree.Cursor;
begin
-- Add sentinel(s) if not yet present.
if Reference.Source_Lines = Entity.Tree.No_Element then
Reference.The_Tree.Insert_Child
(Parent => Reference.The_Tree.Root,
Before => Entity.Tree.No_Element,
New_Item => Source_Lines_Sentinel'(Entity.T with null record),
Position => Reference.Source_Lines);
end if;
if Reference.Flows = Entity.Tree.No_Element then
Reference.The_Tree.Insert_Child
(Parent => Reference.The_Tree.Root,
Before => Entity.Tree.No_Element,
New_Item => Empty_Flows_Sentinel,
Position => Reference.Flows);
end if;
if Reference.Proofs = Entity.Tree.No_Element then
Reference.The_Tree.Insert_Child
(Parent => Reference.The_Tree.Root,
Before => Entity.Tree.No_Element,
New_Item => Empty_Proofs_Sentinel,
Position => Reference.Proofs);
end if;
This.Map_Sloc_Elements (Root => Slocs,
The_Tree => Reference.The_Tree,
Position => Reference.Source_Lines);
end;
end Map_Entities;
---------------------------------------------------------------------------
-- Map_Flow_Elements
---------------------------------------------------------------------------
procedure Map_Flow_Elements (This : in out T;
Root : in JSON_Array) is
begin
for I in 1 .. GNATCOLL.JSON.Length (Arr => Root) loop
declare
Element : constant JSON_Value := GNATCOLL.JSON.Get (Arr => Root,
Index => I);
begin
if
Preconditions.Ensure_Field (Object => Element,
Field => Field_Names.Entity,
Kind => JSON_Object_Type)
then
declare
Source_Entity : constant JSON_Value :=
Element.Get (Field => Field_Names.Entity);
begin
-- The name referenced here should match a name we already
-- have in the hash table.
if
Preconditions.Ensure_Field (Object => Source_Entity,
Field => Field_Names.Name,
Kind => JSON_String_Type)
then
declare
The_Key : constant Entity_Name :=
Entity_Name
(Subject_Name'
(Source_Entity.Get (Field => Field_Names.Name)));
Update_At : constant Analyzed_Entities.Cursor :=
This.Entities.Find (Key => The_Key);
begin
if Update_At /= Analyzed_Entities.No_Element then
if
Flow_Item.Has_Required_Fields (Object => Element)
then
declare
Reference : constant
Analyzed_Entities.Reference_Type :=
This.Entities.Reference
(Position => Update_At);
begin
Reference.The_Tree.Append_Child
(Parent => Reference.Flows,
New_Item =>
Flow_Item.Create (Object => Element));
end;
end if;
else
Log.Warning
(Message =>
"flow: """ & To_String (Source => The_Key) &
""" not found in index.");
end if;
end;
end if;
end;
end if;
end;
end loop;
-- Sort flows by file name:line:column.
for E of This.Entities loop
SPAT.Flow_Item.Sort_By_Location (This => E.The_Tree,
Parent => E.Flows);
end loop;
end Map_Flow_Elements;
---------------------------------------------------------------------------
-- Map_Proof_Elements
---------------------------------------------------------------------------
procedure Map_Proof_Elements (This : in out T;
Version : in File_Version;
Root : in JSON_Array) is
begin
for I in 1 .. GNATCOLL.JSON.Length (Arr => Root) loop
declare
Element : constant JSON_Value := GNATCOLL.JSON.Get (Arr => Root,
Index => I);
begin
if
Preconditions.Ensure_Field (Object => Element,
Field => Field_Names.Entity,
Kind => JSON_Object_Type)
then
declare
Source_Entity : constant JSON_Value :=
Element.Get (Field => Field_Names.Entity);
begin
-- The name referenced here should match a name we already
-- have in the hash table.
if
Preconditions.Ensure_Field (Object => Source_Entity,
Field => Field_Names.Name,
Kind => JSON_String_Type)
then
declare
The_Key : constant Entity_Name :=
Entity_Name
(Subject_Name'
(Source_Entity.Get (Field => Field_Names.Name)));
Update_At : constant Analyzed_Entities.Cursor :=
This.Entities.Find (Key => The_Key);
begin
if Update_At /= Analyzed_Entities.No_Element then
if
Proof_Item.Has_Required_Fields (Object => Element,
Version => Version)
then
declare
Reference : constant
Analyzed_Entities.Reference_Type :=
This.Entities.Reference
(Position => Update_At);
begin
Proof_Item.Add_To_Tree
(Object => Element,
Version => Version,
Tree => Reference.The_Tree,
Parent => Reference.Proofs);
-- Update parent sentinel with new proof
-- times.
declare
------------------------------------------
-- Update_Sentinel
------------------------------------------
procedure Update_Sentinel
(Element : in out Entity.T'Class);
------------------------------------------
-- Update_Sentinel
------------------------------------------
procedure Update_Sentinel
(Element : in out Entity.T'Class)
is
S : Proofs_Sentinel renames
Proofs_Sentinel (Element);
N : constant Proof_Item.T :=
Proof_Item.T
(Entity.T'Class'
(Reference.The_Tree
(Entity.Tree.Last_Child
(Position =>
Reference.Proofs))));
begin
S.Cache :=
Proof_Cache'
(Max_Proof_Time =>
Duration'Max (S.Cache.Max_Proof_Time,
N.Max_Time),
Total_Proof_Time =>
S.Cache.Total_Proof_Time +
N.Total_Time,
Has_Failed_Attempts =>
S.Cache.Has_Failed_Attempts or else
N.Has_Failed_Attempts,
Has_Unproved_Attempts =>
S.Cache.Has_Unproved_Attempts or else
N.Has_Unproved_Attempts,
Has_Unjustified_Attempts =>
S.Cache.Has_Unjustified_Attempts or else
N.Is_Unjustified);
end Update_Sentinel;
begin
Reference.The_Tree.Update_Element
(Position => Reference.Proofs,
Process => Update_Sentinel'Access);
null;
-- Reference.The_Tree.Update_Element
-- ();
end;
end;
end if;
else
Log.Warning
(Message =>
"proof: """ & To_String (Source => The_Key) &
""" not found in index.");
end if;
end;
end if;
end;
end if;
end;
end loop;
-- Sort proofs by time to proof them.
for E of This.Entities loop
SPAT.Proof_Item.Sort_By_Duration (Tree => E.The_Tree,
Parent => E.Proofs);
end loop;
end Map_Proof_Elements;
---------------------------------------------------------------------------
-- Map_Sloc_Elements
---------------------------------------------------------------------------
procedure Map_Sloc_Elements (This : in out T;
The_Tree : in out Entity.Tree.T;
Position : in Entity.Tree.Cursor;
Root : in JSON_Array)
is
pragma Unreferenced (This);
begin
for I in 1 .. GNATCOLL.JSON.Length (Arr => Root) loop
declare
Sloc : constant JSON_Value := GNATCOLL.JSON.Get (Arr => Root,
Index => I);
begin
if Entity_Line.Has_Required_Fields (Object => Sloc) then
The_Tree.Append_Child
(Parent => Position,
New_Item => Entity_Line.Create (Object => Sloc));
end if;
end;
end loop;
end Map_Sloc_Elements;
---------------------------------------------------------------------------
-- Map_Spark_Elements
---------------------------------------------------------------------------
procedure Map_Spark_Elements (This : in out T;
Root : in JSON_Array;
From_File : in File_Name)
is
Length : constant Natural := GNATCOLL.JSON.Length (Arr => Root);
begin
This.Entities.Reserve_Capacity
(Capacity => Ada.Containers.Count_Type (Length));
for I in 1 .. Length loop
declare
Element : constant JSON_Value := GNATCOLL.JSON.Get (Arr => Root,
Index => I);
begin
if
Preconditions.Ensure_Field (Object => Element,
Field => Field_Names.Name,
Kind => JSON_String_Type) and then
Preconditions.Ensure_Field (Object => Element,
Field => Field_Names.Sloc,
Kind => JSON_Array_Type)
then
This.Map_Entities (Root => Element,
From_File => From_File);
end if;
end;
end loop;
end Map_Spark_Elements;
---------------------------------------------------------------------------
-- Map_Spark_File
---------------------------------------------------------------------------
not overriding
procedure Map_Spark_File (This : in out T;
File : in File_Name;
Root : in JSON_Value)
is
Version : constant File_Version := Guess_Version (Root => Root);
begin
-- Clear cache data.
This.Flow_Count := -1;
This.Proof_Count := -1;
-- If I understand the .spark file format correctly, this should
-- establish the table of all known analysis elements.
if
Preconditions.Ensure_Field (Object => Root,
Field => Field_Names.Spark,
Kind => JSON_Array_Type)
then
This.Map_Spark_Elements
(Root => Root.Get (Field => Field_Names.Spark),
From_File => File);
end if;
if
Preconditions.Ensure_Field (Object => Root,
Field => Field_Names.Flow,
Kind => JSON_Array_Type)
then
This.Map_Flow_Elements (Root => Root.Get (Field => Field_Names.Flow));
end if;
if
Preconditions.Ensure_Field (Object => Root,
Field => Field_Names.Proof,
Kind => JSON_Array_Type)
then
This.Map_Proof_Elements
(Root => Root.Get (Field => Field_Names.Proof),
Version => Version);
end if;
if
Preconditions.Ensure_Field (Object => Root,
Field => Field_Names.Assumptions,
Kind => JSON_Array_Type)
then
This.Map_Assumptions_Elements
(Root => Root.Get (Field => Field_Names.Assumptions));
end if;
if
Preconditions.Ensure_Field (Object => Root,
Field => Field_Names.Timings,
Kind => JSON_Object_Type)
then
-- The "timings" object is version dependent.
This.Map_Timings (File => File,
Root => Root.Get (Field => Field_Names.Timings),
Version => Version);
end if;
end Map_Spark_File;
---------------------------------------------------------------------------
-- Map_Timings
---------------------------------------------------------------------------
procedure Map_Timings (This : in out T;
File : in File_Name;
Root : in JSON_Value;
Version : in File_Version) is
begin
if
Timing_Item.Has_Required_Fields (Object => Root,
Version => Version)
then
This.Files.Insert
(Key => File,
New_Item => Timing_Item.Create (Object => Root,
Version => Version));
else
This.Files.Insert (Key => File,
New_Item => Timing_Item.None);
end if;
end Map_Timings;
---------------------------------------------------------------------------
-- Max_Proof_Time
---------------------------------------------------------------------------
not overriding
function Max_Proof_Time (This : in T;
Entity : in Entity_Name) return Duration
is
Reference : constant Analyzed_Entities.Constant_Reference_Type :=
This.Entities.Constant_Reference (Key => Entity);
Sentinel : constant Proofs_Sentinel := Get_Sentinel (Node => Reference);
begin
return Sentinel.Cache.Max_Proof_Time;
end Max_Proof_Time;
---------------------------------------------------------------------------
-- Num_Flows
---------------------------------------------------------------------------
not overriding
function Num_Flows (This : not null access T)
return Ada.Containers.Count_Type
is
Result : Ada.Containers.Count_Type := 0;
begin
-- Data already cached?
if This.Flow_Count /= -1 then
return This.Flow_Count;
end if;
for E of This.Entities loop
Result := Result + Entity.Tree.Child_Count (Parent => E.Flows);
end loop;
-- Update cache.
This.Flow_Count := Result;
return Result;
end Num_Flows;
---------------------------------------------------------------------------
-- Num_Proofs
---------------------------------------------------------------------------
not overriding
function Num_Proofs (This : not null access T)
return Ada.Containers.Count_Type
is
Result : Ada.Containers.Count_Type := 0;
begin
-- Data already cached?
if This.Proof_Count /= -1 then
return This.Proof_Count;
end if;
for E of This.Entities loop
Result := Result + Entity.Tree.Child_Count (Parent => E.Proofs);
end loop;
-- Update cache.
This.Proof_Count := Result;
return Result;
end Num_Proofs;
---------------------------------------------------------------------------
-- Print_Trees
---------------------------------------------------------------------------
not overriding
procedure Print_Trees (This : in T) is
begin
if SPAT.Log.Debug_Enabled then
for Position in This.Entities.Iterate loop
declare
Reference : constant Analyzed_Entities.Constant_Reference_Type :=
This.Entities.Constant_Reference (Position => Position);
begin
for C in
SPAT.Entity.Tree.Iterate_Subtree (Position => Reference.Proofs)
loop
declare
E : constant Entity.T'Class := Entity.Tree.Element (C);
use Ada.Strings.Fixed;
begin
SPAT.Log.Debug
(Natural
(SPAT.Entity.Tree.Child_Depth
(Reference.Proofs, C)) * ' ' & "[]: " & E.Image);
end;
end loop;
end;
end loop;
end if;
end Print_Trees;
---------------------------------------------------------------------------
-- Proof_Time
---------------------------------------------------------------------------
not overriding
function Proof_Time (This : in T;
File : in File_Name) return Duration is
Timings : constant Timing_Item.T := This.Files (File);
begin
case Timings.Version is
when GNAT_CE_2019 =>
-- In this version we have a "proof" timing field, report it
-- directly.
return Timings.Proof;
when GNAT_CE_2020 =>
declare
Summed_Proof_Time : Duration := Timings.Proof;
begin
-- In this version there's no proof timing field anymore, so we
-- need to sum the proof times of the entities, too.
for Position in This.Entities.Iterate loop
declare
Name : constant Entity_Name :=
Analyzed_Entities.Key (Position);
begin
if
Analyzed_Entities.Element (Position).SPARK_File = File
then
Summed_Proof_Time :=
Summed_Proof_Time + This.Total_Proof_Time (Name);
end if;
end;
end loop;
return Summed_Proof_Time;
end;
end case;
end Proof_Time;
---------------------------------------------------------------------------
-- Proof_Tree
---------------------------------------------------------------------------
not overriding
function Proof_Tree (This : in T;
Entity : in Entity_Name)
return SPAT.Entity.Tree.Forward_Iterator'Class
is
Reference : constant Analyzed_Entities.Constant_Reference_Type :=
This.Entities.Constant_Reference (Key => Entity);
begin
return Reference.The_Tree.Iterate_Children (Parent => Reference.Proofs);
end Proof_Tree;
---------------------------------------------------------------------------
-- Sort_Entity_By_Name
---------------------------------------------------------------------------
procedure Sort_Entity_By_Name (This : in T;
Container : in out Strings.Entity_Names)
is
pragma Unreferenced (This);
package Sorting is new
Strings.Implementation.Entities.Base_Vectors.Generic_Sorting ("<" => "<");
begin
Sorting.Sort
(Container =>
Strings.Implementation.Entities.Base_Vectors.Vector (Container));
end Sort_Entity_By_Name;
---------------------------------------------------------------------------
-- Sort_Entity_By_Proof_Time
---------------------------------------------------------------------------
procedure Sort_Entity_By_Proof_Time (This : in T;
Container : in out Strings.Entity_Names)
is
------------------------------------------------------------------------
-- "<"
------------------------------------------------------------------------
function "<" (Left : in Entity_Name;
Right : in Entity_Name) return Boolean;
------------------------------------------------------------------------
-- "<"
------------------------------------------------------------------------
function "<" (Left : in Entity_Name;
Right : in Entity_Name) return Boolean is
Left_Total : constant Duration :=
This.Total_Proof_Time (Entity => Left);
Right_Total : constant Duration :=
This.Total_Proof_Time (Entity => Right);
Left_Max : constant Duration :=
This.Max_Proof_Time (Entity => Left);
Right_Max : constant Duration :=
This.Max_Proof_Time (Entity => Right);
begin
-- First by total time.
if Left_Total /= Right_Total then
return Left_Total > Right_Total;
end if;
-- Total time is the same, try to sort by max time.
if Left_Max /= Right_Max then
return Left_Max > Right_Max;
end if;
-- Resort to alphabetical order.
return SPAT."<" (Left, Right); -- Trap! "Left < Right" is recursive.
end "<";
package Sorting is new
Strings.Implementation.Entities.Base_Vectors.Generic_Sorting ("<" => "<");
begin
Sorting.Sort
(Container =>
Strings.Implementation.Entities.Base_Vectors.Vector (Container));
end Sort_Entity_By_Proof_Time;
---------------------------------------------------------------------------
-- By_Basename
---------------------------------------------------------------------------
function By_Basename (Left : in File_Name;
Right : in File_Name) return Boolean is
(Ada.Directories.Base_Name (Name => To_String (Source => Left)) <
Ada.Directories.Base_Name (Name => To_String (Source => Right)));
package File_Name_Sorting is new
Strings.Implementation.File_Names.Base_Vectors.Generic_Sorting
("<" => By_Basename);
---------------------------------------------------------------------------
-- Sort_File_By_Basename
---------------------------------------------------------------------------
procedure Sort_File_By_Basename (This : in T;
Container : in out Strings.File_Names) is
pragma Unreferenced (This); -- Only provided for consistency.
begin
File_Name_Sorting.Sort
(Container =>
Strings.Implementation.File_Names.Base_Vectors.Vector (Container));
end Sort_File_By_Basename;
---------------------------------------------------------------------------
-- Sort_File_By_Proof_Time
---------------------------------------------------------------------------
procedure Sort_File_By_Proof_Time (This : in T;
Container : in out Strings.File_Names)
is
------------------------------------------------------------------------
-- "<"
------------------------------------------------------------------------
function "<" (Left : in File_Name;
Right : in File_Name) return Boolean;
------------------------------------------------------------------------
-- "<"
------------------------------------------------------------------------
function "<" (Left : in File_Name;
Right : in File_Name) return Boolean
is
Left_Proof : constant Duration := This.Proof_Time (File => Left);
Right_Proof : constant Duration := This.Proof_Time (File => Right);
Left_Flow : constant Duration := This.Flow_Time (File => Left);
Right_Flow : constant Duration := This.Flow_Time (File => Right);
Left_Total : constant Duration := Left_Proof + Left_Flow;
Right_Total : constant Duration := Right_Proof + Right_Flow;
begin
-- First by total time.
if Left_Total /= Right_Total then
return Left_Total > Right_Total;
end if;
-- If totals differ, prioritize proof time.
if Left_Proof /= Right_Proof then
return Left_Proof > Right_Proof;
end if;
-- Total and proof times were equal, so flow times must be equal, too.
pragma Assert (Left_Flow = Right_Flow);
-- Last resort, sort by name.
return By_Basename (Left => Left,
Right => Right);
end "<";
package Sorting is new
Strings.Implementation.File_Names.Base_Vectors.Generic_Sorting
("<" => "<");
begin
Sorting.Sort
(Container =>
Strings.Implementation.File_Names.Base_Vectors.Vector (Container));
end Sort_File_By_Proof_Time;
---------------------------------------------------------------------------
-- Total_Proof_Time
---------------------------------------------------------------------------
not overriding
function Total_Proof_Time (This : in T;
Entity : in Entity_Name) return Duration
is
Reference : constant Analyzed_Entities.Constant_Reference_Type :=
This.Entities.Constant_Reference (Key => Entity);
Sentinel : constant Proofs_Sentinel := Get_Sentinel (Node => Reference);
begin
return Sentinel.Cache.Total_Proof_Time;
end Total_Proof_Time;
end SPAT.Spark_Info;
| 42.960899 | 92 | 0.404173 |
a1a7e4b2e415ef1754096b3c9a904742093a00ee | 1,943 | ads | Ada | src/edc_client-alpha-block1.ads | hgrodriguez/edc-client | 604711851d356014b653e2f50218ebcfe50f05a0 | [
"BSD-3-Clause"
] | null | null | null | src/edc_client-alpha-block1.ads | hgrodriguez/edc-client | 604711851d356014b653e2f50218ebcfe50f05a0 | [
"BSD-3-Clause"
] | null | null | null | src/edc_client-alpha-block1.ads | hgrodriguez/edc-client | 604711851d356014b653e2f50218ebcfe50f05a0 | [
"BSD-3-Clause"
] | null | null | null | --===========================================================================
--
-- This package is the interface for the Alpha part of the EDC Client
-- for the first block (the block on the left)
--
--===========================================================================
--
-- Copyright 2021 (C) Holger Rodriguez
--
-- SPDX-License-Identifier: BSD-3-Clause
--
package Edc_Client.Alpha.Block1 is
--------------------------------------------------------------------------
-- Shows a Single Letter
--------------------------------------------------------------------------
subtype Single_Letter_Positions is Integer range 1 .. 8;
procedure Show_Single_Letter (Position : Single_Letter_Positions;
Value : Single_Letter_String)
with Pre => Initialized;
--------------------------------------------------------------------------
-- Shows Double Letters
--------------------------------------------------------------------------
subtype Double_Letters_Positions is Integer range 1 .. 4;
procedure Show_Double_Letters (Position : Double_Letters_Positions;
Value : Double_Letters_String)
with Pre => Initialized;
--------------------------------------------------------------------------
-- Shows Four Letters
--------------------------------------------------------------------------
subtype Four_Letters_Positions is Integer range 1 .. 2;
procedure Show_Four_Letters (Position : Four_Letters_Positions;
Value : Four_Letters_String)
with Pre => Initialized;
--------------------------------------------------------------------------
-- Shows Eight Letters
--------------------------------------------------------------------------
procedure Show_Eight_Letters (Value : Eight_Letters_String)
with Pre => Initialized;
end Edc_Client.Alpha.Block1;
| 43.177778 | 77 | 0.401956 |
4188158f05c9979c524a7f598cf9116c6ab0ae28 | 4,605 | ads | Ada | Ada95/samples/sample-function_key_setting.ads | Ancient-Rom/android_external_libncurses | cfb80399910df8d55602d879d5cf0bc5ceaa2f89 | [
"X11"
] | 1,167 | 2017-08-21T21:21:24.000Z | 2022-03-31T15:42:10.000Z | release/src/router/libncurses/Ada95/samples/sample-function_key_setting.ads | mon-routeur/Firmware | b25fef7cdab7fe306853baa471ad4a96a9da4600 | [
"FSFAP"
] | 374 | 2015-11-03T12:37:22.000Z | 2021-12-17T14:18:08.000Z | release/src/router/libncurses/Ada95/samples/sample-function_key_setting.ads | mon-routeur/Firmware | b25fef7cdab7fe306853baa471ad4a96a9da4600 | [
"FSFAP"
] | 96 | 2015-11-22T07:47:26.000Z | 2022-01-20T19:52:19.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- Sample.Function_Key_Setting --
-- --
-- S P E C --
-- --
------------------------------------------------------------------------------
-- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc. --
-- --
-- Permission is hereby granted, free of charge, to any person obtaining a --
-- copy of this software and associated documentation files (the --
-- "Software"), to deal in the Software without restriction, including --
-- without limitation the rights to use, copy, modify, merge, publish, --
-- distribute, distribute with modifications, sublicense, and/or sell --
-- copies of the Software, and to permit persons to whom the Software is --
-- furnished to do so, subject to the following conditions: --
-- --
-- The above copyright notice and this permission notice shall be included --
-- in all copies or substantial portions of the Software. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS --
-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF --
-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. --
-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, --
-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR --
-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR --
-- THE USE OR OTHER DEALINGS IN THE SOFTWARE. --
-- --
-- Except as contained in this notice, the name(s) of the above copyright --
-- holders shall not be used in advertising or otherwise to promote the --
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
------------------------------------------------------------------------------
-- Author: Juergen Pfeifer, 1996
-- Version Control
-- $Revision: 1.11 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
-- This package implements a simple stack of function key label environments.
--
package Sample.Function_Key_Setting is
procedure Push_Environment (Key : String;
Reset : Boolean := True);
-- Push the definition of the current function keys on an internal
-- stack. If the reset flag is true, all labels are reset while
-- pushed, so the new environment can assume a tabula rasa.
-- The Key defines the new Help Context associated with the new
-- Environment. This saves also the currently active Notepad.
procedure Pop_Environment;
-- Pop the Definitions from the stack and make them the current ones.
-- This also restores the Help context and the previous Notepad.
procedure Initialize (Mode : Soft_Label_Key_Format := PC_Style;
Just : Label_Justification := Left);
-- Initialize the environment
function Context return String;
-- Return the current context identifier
function Find_Context (Key : String) return Boolean;
-- Look for a context, return true if it is in the stack,
-- false otherwise.
procedure Notepad_To_Context (Pan : Panel);
-- Add a panel representing a notepad to the current context.
Function_Key_Stack_Error : exception;
procedure Default_Labels;
-- Set the default labels used in all environments
function Notepad_Window return Window;
-- Return the current notepad window or Null_Window if there is none.
end Sample.Function_Key_Setting;
| 55.481928 | 78 | 0.520955 |
5715f77310c8639317ac60ee832ec6e789190237 | 6,246 | adb | Ada | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/s-pack15.adb | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/s-pack15.adb | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/s-pack15.adb | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . P A C K _ 1 5 --
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2021, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- --
-- --
-- --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Storage_Elements;
with System.Unsigned_Types;
package body System.Pack_15 is
subtype Bit_Order is System.Bit_Order;
Reverse_Bit_Order : constant Bit_Order :=
Bit_Order'Val (1 - Bit_Order'Pos (System.Default_Bit_Order));
subtype Ofs is System.Storage_Elements.Storage_Offset;
subtype Uns is System.Unsigned_Types.Unsigned;
subtype N07 is System.Unsigned_Types.Unsigned range 0 .. 7;
use type System.Storage_Elements.Storage_Offset;
use type System.Unsigned_Types.Unsigned;
type Cluster is record
E0, E1, E2, E3, E4, E5, E6, E7 : Bits_15;
end record;
for Cluster use record
E0 at 0 range 0 * Bits .. 0 * Bits + Bits - 1;
E1 at 0 range 1 * Bits .. 1 * Bits + Bits - 1;
E2 at 0 range 2 * Bits .. 2 * Bits + Bits - 1;
E3 at 0 range 3 * Bits .. 3 * Bits + Bits - 1;
E4 at 0 range 4 * Bits .. 4 * Bits + Bits - 1;
E5 at 0 range 5 * Bits .. 5 * Bits + Bits - 1;
E6 at 0 range 6 * Bits .. 6 * Bits + Bits - 1;
E7 at 0 range 7 * Bits .. 7 * Bits + Bits - 1;
end record;
for Cluster'Size use Bits * 8;
for Cluster'Alignment use Integer'Min (Standard'Maximum_Alignment,
1 +
1 * Boolean'Pos (Bits mod 2 = 0) +
2 * Boolean'Pos (Bits mod 4 = 0));
-- Use maximum possible alignment, given the bit field size, since this
-- will result in the most efficient code possible for the field.
type Cluster_Ref is access Cluster;
type Rev_Cluster is new Cluster
with Bit_Order => Reverse_Bit_Order,
Scalar_Storage_Order => Reverse_Bit_Order;
type Rev_Cluster_Ref is access Rev_Cluster;
------------
-- Get_15 --
------------
function Get_15
(Arr : System.Address;
N : Natural;
Rev_SSO : Boolean) return Bits_15
is
A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
C : Cluster_Ref with Address => A'Address, Import;
RC : Rev_Cluster_Ref with Address => A'Address, Import;
begin
if Rev_SSO then
case N07 (Uns (N) mod 8) is
when 0 => return RC.E0;
when 1 => return RC.E1;
when 2 => return RC.E2;
when 3 => return RC.E3;
when 4 => return RC.E4;
when 5 => return RC.E5;
when 6 => return RC.E6;
when 7 => return RC.E7;
end case;
else
case N07 (Uns (N) mod 8) is
when 0 => return C.E0;
when 1 => return C.E1;
when 2 => return C.E2;
when 3 => return C.E3;
when 4 => return C.E4;
when 5 => return C.E5;
when 6 => return C.E6;
when 7 => return C.E7;
end case;
end if;
end Get_15;
------------
-- Set_15 --
------------
procedure Set_15
(Arr : System.Address;
N : Natural;
E : Bits_15;
Rev_SSO : Boolean)
is
A : constant System.Address := Arr + Bits * Ofs (Uns (N) / 8);
C : Cluster_Ref with Address => A'Address, Import;
RC : Rev_Cluster_Ref with Address => A'Address, Import;
begin
if Rev_SSO then
case N07 (Uns (N) mod 8) is
when 0 => RC.E0 := E;
when 1 => RC.E1 := E;
when 2 => RC.E2 := E;
when 3 => RC.E3 := E;
when 4 => RC.E4 := E;
when 5 => RC.E5 := E;
when 6 => RC.E6 := E;
when 7 => RC.E7 := E;
end case;
else
case N07 (Uns (N) mod 8) is
when 0 => C.E0 := E;
when 1 => C.E1 := E;
when 2 => C.E2 := E;
when 3 => C.E3 := E;
when 4 => C.E4 := E;
when 5 => C.E5 := E;
when 6 => C.E6 := E;
when 7 => C.E7 := E;
end case;
end if;
end Set_15;
end System.Pack_15;
| 39.531646 | 78 | 0.434198 |
57b88c651bf6fe326ad3e9c681d62c932af5166d | 120,478 | adb | Ada | src/gnat/prj-proc.adb | jquorning/dynamo | 10d68571476c270b8e45a9c5ef585fa9139b0d05 | [
"Apache-2.0"
] | 15 | 2015-01-18T23:04:19.000Z | 2022-03-01T20:27:08.000Z | src/gnat/prj-proc.adb | jquorning/dynamo | 10d68571476c270b8e45a9c5ef585fa9139b0d05 | [
"Apache-2.0"
] | 16 | 2018-06-10T07:09:30.000Z | 2022-03-26T18:28:40.000Z | src/gnat/prj-proc.adb | jquorning/dynamo | 10d68571476c270b8e45a9c5ef585fa9139b0d05 | [
"Apache-2.0"
] | 3 | 2015-11-11T18:00:14.000Z | 2022-01-30T23:08:45.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- P R J . P R O C --
-- --
-- B o d y --
-- --
-- Copyright (C) 2001-2015, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING3. If not, go to --
-- http://www.gnu.org/licenses for a complete copy of the license. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with Atree; use Atree;
with Err_Vars; use Err_Vars;
with Opt; use Opt;
with Osint; use Osint;
with Output; use Output;
with Prj.Attr; use Prj.Attr;
with Prj.Env;
with Prj.Err; use Prj.Err;
with Prj.Ext; use Prj.Ext;
with Prj.Nmsc; use Prj.Nmsc;
with Prj.Part;
with Prj.Util;
with Snames;
with Ada.Containers.Vectors;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with GNAT.Case_Util; use GNAT.Case_Util;
with GNAT.HTable;
package body Prj.Proc is
package Processed_Projects is new GNAT.HTable.Simple_HTable
(Header_Num => Header_Num,
Element => Project_Id,
No_Element => No_Project,
Key => Name_Id,
Hash => Hash,
Equal => "=");
-- This hash table contains all processed projects
package Unit_Htable is new GNAT.HTable.Simple_HTable
(Header_Num => Header_Num,
Element => Source_Id,
No_Element => No_Source,
Key => Name_Id,
Hash => Hash,
Equal => "=");
-- This hash table contains all processed projects
package Runtime_Defaults is new GNAT.HTable.Simple_HTable
(Header_Num => Prj.Header_Num,
Element => Name_Id,
No_Element => No_Name,
Key => Name_Id,
Hash => Prj.Hash,
Equal => "=");
-- Stores the default values of 'Runtime names for the various languages
procedure Add (To_Exp : in out Name_Id; Str : Name_Id);
-- Concatenate two strings and returns another string if both
-- arguments are not null string.
-- In the following procedures, we are expected to guess the meaning of
-- the parameters from their names, this is never a good idea, comments
-- should be added precisely defining every formal ???
procedure Add_Attributes
(Project : Project_Id;
Project_Name : Name_Id;
Project_Dir : Name_Id;
Shared : Shared_Project_Tree_Data_Access;
Decl : in out Declarations;
First : Attribute_Node_Id;
Project_Level : Boolean);
-- Add all attributes, starting with First, with their default values to
-- the package or project with declarations Decl.
procedure Check
(In_Tree : Project_Tree_Ref;
Project : Project_Id;
Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
Flags : Processing_Flags);
-- Set all projects to not checked, then call Recursive_Check for the
-- main project Project. Project is set to No_Project if errors occurred.
-- Current_Dir is for optimization purposes, avoiding extra system calls.
-- If Allow_Duplicate_Basenames, then files with the same base names are
-- authorized within a project for source-based languages (never for unit
-- based languages)
procedure Copy_Package_Declarations
(From : Declarations;
To : in out Declarations;
New_Loc : Source_Ptr;
Restricted : Boolean;
Shared : Shared_Project_Tree_Data_Access);
-- Copy a package declaration From to To for a renamed package. Change the
-- locations of all the attributes to New_Loc. When Restricted is
-- True, do not copy attributes Body, Spec, Implementation, Specification
-- and Linker_Options.
function Expression
(Project : Project_Id;
Shared : Shared_Project_Tree_Data_Access;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
Env : Prj.Tree.Environment;
Pkg : Package_Id;
First_Term : Project_Node_Id;
Kind : Variable_Kind) return Variable_Value;
-- From N_Expression project node From_Project_Node, compute the value
-- of an expression and return it as a Variable_Value.
function Imported_Or_Extended_Project_From
(Project : Project_Id;
With_Name : Name_Id;
No_Extending : Boolean := False) return Project_Id;
-- Find an imported or extended project of Project whose name is With_Name.
-- When No_Extending is True, do not look for extending projects, returns
-- the exact project whose name is With_Name.
function Package_From
(Project : Project_Id;
Shared : Shared_Project_Tree_Data_Access;
With_Name : Name_Id) return Package_Id;
-- Find the package of Project whose name is With_Name
procedure Process_Declarative_Items
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
From_Project_Node : Project_Node_Id;
Node_Tree : Project_Node_Tree_Ref;
Env : Prj.Tree.Environment;
Pkg : Package_Id;
Item : Project_Node_Id;
Child_Env : in out Prj.Tree.Environment);
-- Process declarative items starting with From_Project_Node, and put them
-- in declarations Decl. This is a recursive procedure; it calls itself for
-- a package declaration or a case construction.
--
-- Child_Env is the modified environment after seeing declarations like
-- "for External(...) use" or "for Project_Path use" in aggregate projects.
-- It should have been initialized first.
procedure Recursive_Process
(In_Tree : Project_Tree_Ref;
Project : out Project_Id;
Packages_To_Check : String_List_Access;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
Env : in out Prj.Tree.Environment;
Extended_By : Project_Id;
From_Encapsulated_Lib : Boolean;
On_New_Tree_Loaded : Tree_Loaded_Callback := null);
-- Process project with node From_Project_Node in the tree. Do nothing if
-- From_Project_Node is Empty_Node. If project has already been processed,
-- simply return its project id. Otherwise create a new project id, mark it
-- as processed, call itself recursively for all imported projects and a
-- extended project, if any. Then process the declarative items of the
-- project.
--
-- Is_Root_Project should be true only for the project that the user
-- explicitly loaded. In the context of aggregate projects, only that
-- project is allowed to modify the environment that will be used to load
-- projects (Child_Env).
--
-- From_Encapsulated_Lib is true if we are parsing a project from
-- encapsulated library dependencies.
--
-- If specified, On_New_Tree_Loaded is called after each aggregated project
-- has been processed succesfully.
function Get_Attribute_Index
(Tree : Project_Node_Tree_Ref;
Attr : Project_Node_Id;
Index : Name_Id) return Name_Id;
-- Copy the index of the attribute into Name_Buffer, converting to lower
-- case if the attribute is case-insensitive.
---------
-- Add --
---------
procedure Add (To_Exp : in out Name_Id; Str : Name_Id) is
begin
if To_Exp = No_Name or else To_Exp = Empty_String then
-- To_Exp is nil or empty. The result is Str
To_Exp := Str;
-- If Str is nil, then do not change To_Ext
elsif Str /= No_Name and then Str /= Empty_String then
declare
S : constant String := Get_Name_String (Str);
begin
Get_Name_String (To_Exp);
Add_Str_To_Name_Buffer (S);
To_Exp := Name_Find;
end;
end if;
end Add;
--------------------
-- Add_Attributes --
--------------------
procedure Add_Attributes
(Project : Project_Id;
Project_Name : Name_Id;
Project_Dir : Name_Id;
Shared : Shared_Project_Tree_Data_Access;
Decl : in out Declarations;
First : Attribute_Node_Id;
Project_Level : Boolean)
is
The_Attribute : Attribute_Node_Id := First;
begin
while The_Attribute /= Empty_Attribute loop
if Attribute_Kind_Of (The_Attribute) = Single then
declare
New_Attribute : Variable_Value;
begin
case Variable_Kind_Of (The_Attribute) is
-- Undefined should not happen
when Undefined =>
pragma Assert
(False, "attribute with an undefined kind");
raise Program_Error;
-- Single attributes have a default value of empty string
when Single =>
New_Attribute :=
(Project => Project,
Kind => Single,
Location => No_Location,
Default => True,
Value => Empty_String,
Index => 0);
-- Special cases of <project>'Name and
-- <project>'Project_Dir.
if Project_Level then
if Attribute_Name_Of (The_Attribute) =
Snames.Name_Name
then
New_Attribute.Value := Project_Name;
elsif Attribute_Name_Of (The_Attribute) =
Snames.Name_Project_Dir
then
New_Attribute.Value := Project_Dir;
end if;
end if;
-- List attributes have a default value of nil list
when List =>
New_Attribute :=
(Project => Project,
Kind => List,
Location => No_Location,
Default => True,
Values => Nil_String);
end case;
Variable_Element_Table.Increment_Last
(Shared.Variable_Elements);
Shared.Variable_Elements.Table
(Variable_Element_Table.Last (Shared.Variable_Elements)) :=
(Next => Decl.Attributes,
Name => Attribute_Name_Of (The_Attribute),
Value => New_Attribute);
Decl.Attributes :=
Variable_Element_Table.Last
(Shared.Variable_Elements);
end;
end if;
The_Attribute := Next_Attribute (After => The_Attribute);
end loop;
end Add_Attributes;
-----------
-- Check --
-----------
procedure Check
(In_Tree : Project_Tree_Ref;
Project : Project_Id;
Node_Tree : Prj.Tree.Project_Node_Tree_Ref;
Flags : Processing_Flags)
is
begin
Process_Naming_Scheme (In_Tree, Project, Node_Tree, Flags);
-- Set the Other_Part field for the units
declare
Source1 : Source_Id;
Name : Name_Id;
Source2 : Source_Id;
Iter : Source_Iterator;
begin
Unit_Htable.Reset;
Iter := For_Each_Source (In_Tree);
loop
Source1 := Prj.Element (Iter);
exit when Source1 = No_Source;
if Source1.Unit /= No_Unit_Index then
Name := Source1.Unit.Name;
Source2 := Unit_Htable.Get (Name);
if Source2 = No_Source then
Unit_Htable.Set (K => Name, E => Source1);
else
Unit_Htable.Remove (Name);
end if;
end if;
Next (Iter);
end loop;
end;
end Check;
-------------------------------
-- Copy_Package_Declarations --
-------------------------------
procedure Copy_Package_Declarations
(From : Declarations;
To : in out Declarations;
New_Loc : Source_Ptr;
Restricted : Boolean;
Shared : Shared_Project_Tree_Data_Access)
is
V1 : Variable_Id;
V2 : Variable_Id := No_Variable;
Var : Variable;
A1 : Array_Id;
A2 : Array_Id := No_Array;
Arr : Array_Data;
E1 : Array_Element_Id;
E2 : Array_Element_Id := No_Array_Element;
Elm : Array_Element;
begin
-- To avoid references in error messages to attribute declarations in
-- an original package that has been renamed, copy all the attribute
-- declarations of the package and change all locations to New_Loc,
-- the location of the renamed package.
-- First single attributes
V1 := From.Attributes;
while V1 /= No_Variable loop
-- Copy the attribute
Var := Shared.Variable_Elements.Table (V1);
V1 := Var.Next;
-- Do not copy the value of attribute Linker_Options if Restricted
if Restricted and then Var.Name = Snames.Name_Linker_Options then
Var.Value.Values := Nil_String;
end if;
-- Remove the Next component
Var.Next := No_Variable;
-- Change the location to New_Loc
Var.Value.Location := New_Loc;
Variable_Element_Table.Increment_Last (Shared.Variable_Elements);
-- Put in new declaration
if To.Attributes = No_Variable then
To.Attributes :=
Variable_Element_Table.Last (Shared.Variable_Elements);
else
Shared.Variable_Elements.Table (V2).Next :=
Variable_Element_Table.Last (Shared.Variable_Elements);
end if;
V2 := Variable_Element_Table.Last (Shared.Variable_Elements);
Shared.Variable_Elements.Table (V2) := Var;
end loop;
-- Then the associated array attributes
A1 := From.Arrays;
while A1 /= No_Array loop
Arr := Shared.Arrays.Table (A1);
A1 := Arr.Next;
-- Remove the Next component
Arr.Next := No_Array;
Array_Table.Increment_Last (Shared.Arrays);
-- Create new Array declaration
if To.Arrays = No_Array then
To.Arrays := Array_Table.Last (Shared.Arrays);
else
Shared.Arrays.Table (A2).Next :=
Array_Table.Last (Shared.Arrays);
end if;
A2 := Array_Table.Last (Shared.Arrays);
-- Don't store the array as its first element has not been set yet
-- Copy the array elements of the array
E1 := Arr.Value;
Arr.Value := No_Array_Element;
while E1 /= No_Array_Element loop
-- Copy the array element
Elm := Shared.Array_Elements.Table (E1);
E1 := Elm.Next;
-- Remove the Next component
Elm.Next := No_Array_Element;
Elm.Restricted := Restricted;
-- Change the location
Elm.Value.Location := New_Loc;
Array_Element_Table.Increment_Last (Shared.Array_Elements);
-- Create new array element
if Arr.Value = No_Array_Element then
Arr.Value := Array_Element_Table.Last (Shared.Array_Elements);
else
Shared.Array_Elements.Table (E2).Next :=
Array_Element_Table.Last (Shared.Array_Elements);
end if;
E2 := Array_Element_Table.Last (Shared.Array_Elements);
Shared.Array_Elements.Table (E2) := Elm;
end loop;
-- Finally, store the new array
Shared.Arrays.Table (A2) := Arr;
end loop;
end Copy_Package_Declarations;
-------------------------
-- Get_Attribute_Index --
-------------------------
function Get_Attribute_Index
(Tree : Project_Node_Tree_Ref;
Attr : Project_Node_Id;
Index : Name_Id) return Name_Id
is
begin
if Index = All_Other_Names
or else not Case_Insensitive (Attr, Tree)
then
return Index;
end if;
Get_Name_String (Index);
To_Lower (Name_Buffer (1 .. Name_Len));
return Name_Find;
end Get_Attribute_Index;
----------------
-- Expression --
----------------
function Expression
(Project : Project_Id;
Shared : Shared_Project_Tree_Data_Access;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
Env : Prj.Tree.Environment;
Pkg : Package_Id;
First_Term : Project_Node_Id;
Kind : Variable_Kind) return Variable_Value
is
The_Term : Project_Node_Id;
-- The term in the expression list
The_Current_Term : Project_Node_Id := Empty_Node;
-- The current term node id
Result : Variable_Value (Kind => Kind);
-- The returned result
Last : String_List_Id := Nil_String;
-- Reference to the last string elements in Result, when Kind is List
Current_Term_Kind : Project_Node_Kind;
begin
Result.Project := Project;
Result.Location := Location_Of (First_Term, From_Project_Node_Tree);
-- Process each term of the expression, starting with First_Term
The_Term := First_Term;
while Present (The_Term) loop
The_Current_Term := Current_Term (The_Term, From_Project_Node_Tree);
if The_Current_Term /= Empty_Node then
Current_Term_Kind :=
Kind_Of (The_Current_Term, From_Project_Node_Tree);
case Current_Term_Kind is
when N_Literal_String =>
case Kind is
when Undefined =>
-- Should never happen
pragma Assert (False, "Undefined expression kind");
raise Program_Error;
when Single =>
Add (Result.Value,
String_Value_Of
(The_Current_Term, From_Project_Node_Tree));
Result.Index :=
Source_Index_Of
(The_Current_Term, From_Project_Node_Tree);
when List =>
String_Element_Table.Increment_Last
(Shared.String_Elements);
if Last = Nil_String then
-- This can happen in an expression like () & "toto"
Result.Values := String_Element_Table.Last
(Shared.String_Elements);
else
Shared.String_Elements.Table
(Last).Next := String_Element_Table.Last
(Shared.String_Elements);
end if;
Last := String_Element_Table.Last
(Shared.String_Elements);
Shared.String_Elements.Table (Last) :=
(Value => String_Value_Of
(The_Current_Term,
From_Project_Node_Tree),
Index => Source_Index_Of
(The_Current_Term,
From_Project_Node_Tree),
Display_Value => No_Name,
Location => Location_Of
(The_Current_Term,
From_Project_Node_Tree),
Flag => False,
Next => Nil_String);
end case;
when N_Literal_String_List =>
declare
String_Node : Project_Node_Id :=
First_Expression_In_List
(The_Current_Term,
From_Project_Node_Tree);
Value : Variable_Value;
begin
if Present (String_Node) then
-- If String_Node is nil, it is an empty list, there is
-- nothing to do.
Value := Expression
(Project => Project,
Shared => Shared,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
Env => Env,
Pkg => Pkg,
First_Term =>
Tree.First_Term
(String_Node, From_Project_Node_Tree),
Kind => Single);
String_Element_Table.Increment_Last
(Shared.String_Elements);
if Result.Values = Nil_String then
-- This literal string list is the first term in a
-- string list expression
Result.Values :=
String_Element_Table.Last
(Shared.String_Elements);
else
Shared.String_Elements.Table (Last).Next :=
String_Element_Table.Last (Shared.String_Elements);
end if;
Last :=
String_Element_Table.Last (Shared.String_Elements);
Shared.String_Elements.Table (Last) :=
(Value => Value.Value,
Display_Value => No_Name,
Location => Value.Location,
Flag => False,
Next => Nil_String,
Index => Value.Index);
loop
-- Add the other element of the literal string list
-- one after the other.
String_Node :=
Next_Expression_In_List
(String_Node, From_Project_Node_Tree);
exit when No (String_Node);
Value :=
Expression
(Project => Project,
Shared => Shared,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
Env => Env,
Pkg => Pkg,
First_Term =>
Tree.First_Term
(String_Node, From_Project_Node_Tree),
Kind => Single);
String_Element_Table.Increment_Last
(Shared.String_Elements);
Shared.String_Elements.Table (Last).Next :=
String_Element_Table.Last (Shared.String_Elements);
Last := String_Element_Table.Last
(Shared.String_Elements);
Shared.String_Elements.Table (Last) :=
(Value => Value.Value,
Display_Value => No_Name,
Location => Value.Location,
Flag => False,
Next => Nil_String,
Index => Value.Index);
end loop;
end if;
end;
when N_Variable_Reference | N_Attribute_Reference =>
declare
The_Project : Project_Id := Project;
The_Package : Package_Id := Pkg;
The_Name : Name_Id := No_Name;
The_Variable_Id : Variable_Id := No_Variable;
The_Variable : Variable_Value;
Term_Project : constant Project_Node_Id :=
Project_Node_Of
(The_Current_Term,
From_Project_Node_Tree);
Term_Package : constant Project_Node_Id :=
Package_Node_Of
(The_Current_Term,
From_Project_Node_Tree);
Index : Name_Id := No_Name;
begin
<<Object_Dir_Restart>>
The_Project := Project;
The_Package := Pkg;
The_Name := No_Name;
The_Variable_Id := No_Variable;
Index := No_Name;
if Present (Term_Project)
and then Term_Project /= From_Project_Node
then
-- This variable or attribute comes from another project
The_Name :=
Name_Of (Term_Project, From_Project_Node_Tree);
The_Project := Imported_Or_Extended_Project_From
(Project => Project,
With_Name => The_Name,
No_Extending => True);
end if;
if Present (Term_Package) then
-- This is an attribute of a package
The_Name :=
Name_Of (Term_Package, From_Project_Node_Tree);
The_Package := The_Project.Decl.Packages;
while The_Package /= No_Package
and then Shared.Packages.Table (The_Package).Name /=
The_Name
loop
The_Package :=
Shared.Packages.Table (The_Package).Next;
end loop;
pragma Assert
(The_Package /= No_Package, "package not found.");
elsif Kind_Of (The_Current_Term, From_Project_Node_Tree) =
N_Attribute_Reference
then
The_Package := No_Package;
end if;
The_Name :=
Name_Of (The_Current_Term, From_Project_Node_Tree);
if Current_Term_Kind = N_Attribute_Reference then
Index :=
Associative_Array_Index_Of
(The_Current_Term, From_Project_Node_Tree);
end if;
-- If it is not an associative array attribute
if Index = No_Name then
-- It is not an associative array attribute
if The_Package /= No_Package then
-- First, if there is a package, look into the package
if Current_Term_Kind = N_Variable_Reference then
The_Variable_Id :=
Shared.Packages.Table
(The_Package).Decl.Variables;
else
The_Variable_Id :=
Shared.Packages.Table
(The_Package).Decl.Attributes;
end if;
while The_Variable_Id /= No_Variable
and then Shared.Variable_Elements.Table
(The_Variable_Id).Name /= The_Name
loop
The_Variable_Id :=
Shared.Variable_Elements.Table
(The_Variable_Id).Next;
end loop;
end if;
if The_Variable_Id = No_Variable then
-- If we have not found it, look into the project
if Current_Term_Kind = N_Variable_Reference then
The_Variable_Id := The_Project.Decl.Variables;
else
The_Variable_Id := The_Project.Decl.Attributes;
end if;
while The_Variable_Id /= No_Variable
and then Shared.Variable_Elements.Table
(The_Variable_Id).Name /= The_Name
loop
The_Variable_Id :=
Shared.Variable_Elements.Table
(The_Variable_Id).Next;
end loop;
end if;
if From_Project_Node_Tree.Incomplete_With then
if The_Variable_Id = No_Variable then
The_Variable := Nil_Variable_Value;
else
The_Variable :=
Shared.Variable_Elements.Table
(The_Variable_Id).Value;
end if;
else
pragma Assert (The_Variable_Id /= No_Variable,
"variable or attribute not found");
The_Variable :=
Shared.Variable_Elements.Table
(The_Variable_Id).Value;
end if;
else
-- It is an associative array attribute
declare
The_Array : Array_Id := No_Array;
The_Element : Array_Element_Id := No_Array_Element;
Array_Index : Name_Id := No_Name;
begin
if The_Package /= No_Package then
The_Array :=
Shared.Packages.Table (The_Package).Decl.Arrays;
else
The_Array := The_Project.Decl.Arrays;
end if;
while The_Array /= No_Array
and then Shared.Arrays.Table (The_Array).Name /=
The_Name
loop
The_Array := Shared.Arrays.Table (The_Array).Next;
end loop;
if The_Array /= No_Array then
The_Element :=
Shared.Arrays.Table (The_Array).Value;
Array_Index :=
Get_Attribute_Index
(From_Project_Node_Tree,
The_Current_Term,
Index);
while The_Element /= No_Array_Element
and then Shared.Array_Elements.Table
(The_Element).Index /= Array_Index
loop
The_Element :=
Shared.Array_Elements.Table (The_Element).Next;
end loop;
end if;
if The_Element /= No_Array_Element then
The_Variable :=
Shared.Array_Elements.Table (The_Element).Value;
else
if Expression_Kind_Of
(The_Current_Term, From_Project_Node_Tree) =
List
then
The_Variable :=
(Project => Project,
Kind => List,
Location => No_Location,
Default => True,
Values => Nil_String);
else
The_Variable :=
(Project => Project,
Kind => Single,
Location => No_Location,
Default => True,
Value => Empty_String,
Index => 0);
end if;
end if;
end;
end if;
-- Check the defaults
if Current_Term_Kind = N_Attribute_Reference then
declare
The_Default : constant Attribute_Default_Value :=
Default_Of
(The_Current_Term, From_Project_Node_Tree);
begin
-- Check the special value for 'Target when specified
if The_Default = Target_Value
and then Opt.Target_Origin = Specified
then
Name_Len := 0;
Add_Str_To_Name_Buffer (Opt.Target_Value.all);
The_Variable.Value := Name_Find;
-- Check the defaults
elsif The_Variable.Default then
case The_Variable.Kind is
when Undefined =>
null;
when Single =>
case The_Default is
when Read_Only_Value =>
null;
when Empty_Value =>
The_Variable.Value := Empty_String;
when Dot_Value =>
The_Variable.Value := Dot_String;
when Object_Dir_Value =>
From_Project_Node_Tree.Project_Nodes.Table
(The_Current_Term).Name :=
Snames.Name_Object_Dir;
From_Project_Node_Tree.Project_Nodes.Table
(The_Current_Term).Default :=
Dot_Value;
goto Object_Dir_Restart;
when Target_Value =>
if Opt.Target_Value = null then
The_Variable.Value := Empty_String;
else
Name_Len := 0;
Add_Str_To_Name_Buffer
(Opt.Target_Value.all);
The_Variable.Value := Name_Find;
end if;
when Runtime_Value =>
Get_Name_String (Index);
To_Lower (Name_Buffer (1 .. Name_Len));
The_Variable.Value :=
Runtime_Defaults.Get (Name_Find);
if The_Variable.Value = No_Name then
The_Variable.Value := Empty_String;
end if;
end case;
when List =>
case The_Default is
when Read_Only_Value =>
null;
when Empty_Value =>
The_Variable.Values := Nil_String;
when Dot_Value =>
The_Variable.Values :=
Shared.Dot_String_List;
when Object_Dir_Value |
Target_Value |
Runtime_Value =>
null;
end case;
end case;
end if;
end;
end if;
case Kind is
when Undefined =>
-- Should never happen
pragma Assert (False, "undefined expression kind");
null;
when Single =>
case The_Variable.Kind is
when Undefined =>
null;
when Single =>
Add (Result.Value, The_Variable.Value);
when List =>
-- Should never happen
pragma Assert
(False,
"list cannot appear in single " &
"string expression");
null;
end case;
when List =>
case The_Variable.Kind is
when Undefined =>
null;
when Single =>
String_Element_Table.Increment_Last
(Shared.String_Elements);
if Last = Nil_String then
-- This can happen in an expression such as
-- () & Var
Result.Values :=
String_Element_Table.Last
(Shared.String_Elements);
else
Shared.String_Elements.Table (Last).Next :=
String_Element_Table.Last
(Shared.String_Elements);
end if;
Last :=
String_Element_Table.Last
(Shared.String_Elements);
Shared.String_Elements.Table (Last) :=
(Value => The_Variable.Value,
Display_Value => No_Name,
Location => Location_Of
(The_Current_Term,
From_Project_Node_Tree),
Flag => False,
Next => Nil_String,
Index => 0);
when List =>
declare
The_List : String_List_Id :=
The_Variable.Values;
begin
while The_List /= Nil_String loop
String_Element_Table.Increment_Last
(Shared.String_Elements);
if Last = Nil_String then
Result.Values :=
String_Element_Table.Last
(Shared.String_Elements);
else
Shared.
String_Elements.Table (Last).Next :=
String_Element_Table.Last
(Shared.String_Elements);
end if;
Last :=
String_Element_Table.Last
(Shared.String_Elements);
Shared.String_Elements.Table
(Last) :=
(Value =>
Shared.String_Elements.Table
(The_List).Value,
Display_Value => No_Name,
Location =>
Location_Of
(The_Current_Term,
From_Project_Node_Tree),
Flag => False,
Next => Nil_String,
Index => 0);
The_List := Shared.String_Elements.Table
(The_List).Next;
end loop;
end;
end case;
end case;
end;
when N_External_Value =>
Get_Name_String
(String_Value_Of
(External_Reference_Of
(The_Current_Term, From_Project_Node_Tree),
From_Project_Node_Tree));
declare
Name : constant Name_Id := Name_Find;
Default : Name_Id := No_Name;
Value : Name_Id := No_Name;
Ext_List : Boolean := False;
Str_List : String_List_Access := null;
Def_Var : Variable_Value;
Default_Node : constant Project_Node_Id :=
External_Default_Of
(The_Current_Term,
From_Project_Node_Tree);
begin
-- If there is a default value for the external reference,
-- get its value.
if Present (Default_Node) then
Def_Var := Expression
(Project => Project,
Shared => Shared,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
Env => Env,
Pkg => Pkg,
First_Term =>
Tree.First_Term
(Default_Node, From_Project_Node_Tree),
Kind => Single);
if Def_Var /= Nil_Variable_Value then
Default := Def_Var.Value;
end if;
end if;
Ext_List := Expression_Kind_Of
(The_Current_Term,
From_Project_Node_Tree) = List;
if Ext_List then
Value := Prj.Ext.Value_Of (Env.External, Name, No_Name);
if Value /= No_Name then
declare
Sep : constant String :=
Get_Name_String (Default);
First : Positive := 1;
Lst : Natural;
Done : Boolean := False;
Nmb : Natural;
begin
Get_Name_String (Value);
if Name_Len = 0
or else Sep'Length = 0
or else Name_Buffer (1 .. Name_Len) = Sep
then
Done := True;
end if;
if not Done and then Name_Len < Sep'Length then
Str_List :=
new String_List'
(1 => new String'
(Name_Buffer (1 .. Name_Len)));
Done := True;
end if;
if not Done then
if Name_Buffer (1 .. Sep'Length) = Sep then
First := Sep'Length + 1;
end if;
if Name_Len - First + 1 >= Sep'Length
and then
Name_Buffer (Name_Len - Sep'Length + 1 ..
Name_Len) = Sep
then
Name_Len := Name_Len - Sep'Length;
end if;
if Name_Len = 0 then
Str_List :=
new String_List'(1 => new String'(""));
Done := True;
end if;
end if;
if not Done then
-- Count the number of strings
declare
Saved : constant Positive := First;
begin
Nmb := 1;
loop
Lst :=
Index
(Source =>
Name_Buffer (First .. Name_Len),
Pattern => Sep);
exit when Lst = 0;
Nmb := Nmb + 1;
First := Lst + Sep'Length;
end loop;
First := Saved;
end;
Str_List := new String_List (1 .. Nmb);
-- Populate the string list
Nmb := 1;
loop
Lst :=
Index
(Source =>
Name_Buffer (First .. Name_Len),
Pattern => Sep);
if Lst = 0 then
Str_List (Nmb) :=
new String'
(Name_Buffer (First .. Name_Len));
exit;
else
Str_List (Nmb) :=
new String'
(Name_Buffer (First .. Lst - 1));
Nmb := Nmb + 1;
First := Lst + Sep'Length;
end if;
end loop;
end if;
end;
end if;
else
-- Get the value
Value := Prj.Ext.Value_Of (Env.External, Name, Default);
if Value = No_Name then
if not Quiet_Output then
Error_Msg
(Env.Flags, "?undefined external reference",
Location_Of
(The_Current_Term, From_Project_Node_Tree),
Project);
end if;
Value := Empty_String;
end if;
end if;
case Kind is
when Undefined =>
null;
when Single =>
if Ext_List then
null; -- error
else
Add (Result.Value, Value);
end if;
when List =>
if not Ext_List or else Str_List /= null then
String_Element_Table.Increment_Last
(Shared.String_Elements);
if Last = Nil_String then
Result.Values :=
String_Element_Table.Last
(Shared.String_Elements);
else
Shared.String_Elements.Table (Last).Next
:= String_Element_Table.Last
(Shared.String_Elements);
end if;
Last := String_Element_Table.Last
(Shared.String_Elements);
if Ext_List then
for Ind in Str_List'Range loop
Name_Len := 0;
Add_Str_To_Name_Buffer (Str_List (Ind).all);
Value := Name_Find;
Shared.String_Elements.Table (Last) :=
(Value => Value,
Display_Value => No_Name,
Location =>
Location_Of
(The_Current_Term,
From_Project_Node_Tree),
Flag => False,
Next => Nil_String,
Index => 0);
if Ind /= Str_List'Last then
String_Element_Table.Increment_Last
(Shared.String_Elements);
Shared.String_Elements.Table (Last).Next :=
String_Element_Table.Last
(Shared.String_Elements);
Last := String_Element_Table.Last
(Shared.String_Elements);
end if;
end loop;
else
Shared.String_Elements.Table (Last) :=
(Value => Value,
Display_Value => No_Name,
Location =>
Location_Of
(The_Current_Term,
From_Project_Node_Tree),
Flag => False,
Next => Nil_String,
Index => 0);
end if;
end if;
end case;
end;
when others =>
-- Should never happen
pragma Assert
(False,
"illegal node kind in an expression");
raise Program_Error;
end case;
end if;
The_Term := Next_Term (The_Term, From_Project_Node_Tree);
end loop;
return Result;
end Expression;
---------------------------------------
-- Imported_Or_Extended_Project_From --
---------------------------------------
function Imported_Or_Extended_Project_From
(Project : Project_Id;
With_Name : Name_Id;
No_Extending : Boolean := False) return Project_Id
is
List : Project_List;
Result : Project_Id;
Temp_Result : Project_Id;
begin
-- First check if it is the name of an extended project
Result := Project.Extends;
while Result /= No_Project loop
if Result.Name = With_Name then
return Result;
else
Result := Result.Extends;
end if;
end loop;
-- Then check the name of each imported project
Temp_Result := No_Project;
List := Project.Imported_Projects;
while List /= null loop
Result := List.Project;
-- If the project is directly imported, then returns its ID
if Result.Name = With_Name then
return Result;
end if;
-- If a project extending the project is imported, then keep this
-- extending project as a possibility. It will be the returned ID
-- if the project is not imported directly.
declare
Proj : Project_Id;
begin
Proj := Result.Extends;
while Proj /= No_Project loop
if Proj.Name = With_Name then
if No_Extending then
Temp_Result := Proj;
else
Temp_Result := Result;
end if;
exit;
end if;
Proj := Proj.Extends;
end loop;
end;
List := List.Next;
end loop;
pragma Assert (Temp_Result /= No_Project, "project not found");
return Temp_Result;
end Imported_Or_Extended_Project_From;
------------------
-- Package_From --
------------------
function Package_From
(Project : Project_Id;
Shared : Shared_Project_Tree_Data_Access;
With_Name : Name_Id) return Package_Id
is
Result : Package_Id := Project.Decl.Packages;
begin
-- Check the name of each existing package of Project
while Result /= No_Package
and then Shared.Packages.Table (Result).Name /= With_Name
loop
Result := Shared.Packages.Table (Result).Next;
end loop;
if Result = No_Package then
-- Should never happen
Write_Line
("package """ & Get_Name_String (With_Name) & """ not found");
raise Program_Error;
else
return Result;
end if;
end Package_From;
-------------
-- Process --
-------------
procedure Process
(In_Tree : Project_Tree_Ref;
Project : out Project_Id;
Packages_To_Check : String_List_Access;
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
Env : in out Prj.Tree.Environment;
Reset_Tree : Boolean := True;
On_New_Tree_Loaded : Tree_Loaded_Callback := null)
is
begin
Process_Project_Tree_Phase_1
(In_Tree => In_Tree,
Project => Project,
Success => Success,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
Env => Env,
Packages_To_Check => Packages_To_Check,
Reset_Tree => Reset_Tree,
On_New_Tree_Loaded => On_New_Tree_Loaded);
if Project_Qualifier_Of
(From_Project_Node, From_Project_Node_Tree) /= Configuration
then
Process_Project_Tree_Phase_2
(In_Tree => In_Tree,
Project => Project,
Success => Success,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
Env => Env);
end if;
end Process;
-------------------------------
-- Process_Declarative_Items --
-------------------------------
procedure Process_Declarative_Items
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
From_Project_Node : Project_Node_Id;
Node_Tree : Project_Node_Tree_Ref;
Env : Prj.Tree.Environment;
Pkg : Package_Id;
Item : Project_Node_Id;
Child_Env : in out Prj.Tree.Environment)
is
Shared : constant Shared_Project_Tree_Data_Access := In_Tree.Shared;
procedure Check_Or_Set_Typed_Variable
(Value : in out Variable_Value;
Declaration : Project_Node_Id);
-- Check whether Value is valid for this typed variable declaration. If
-- it is an error, the behavior depends on the flags: either an error is
-- reported, or a warning, or nothing. In the last two cases, the value
-- of the variable is set to a valid value, replacing Value.
procedure Process_Package_Declaration
(Current_Item : Project_Node_Id);
procedure Process_Attribute_Declaration
(Current : Project_Node_Id);
procedure Process_Case_Construction
(Current_Item : Project_Node_Id);
procedure Process_Associative_Array
(Current_Item : Project_Node_Id);
procedure Process_Expression
(Current : Project_Node_Id);
procedure Process_Expression_For_Associative_Array
(Current : Project_Node_Id;
New_Value : Variable_Value);
procedure Process_Expression_Variable_Decl
(Current_Item : Project_Node_Id;
New_Value : Variable_Value);
-- Process the various declarative items
---------------------------------
-- Check_Or_Set_Typed_Variable --
---------------------------------
procedure Check_Or_Set_Typed_Variable
(Value : in out Variable_Value;
Declaration : Project_Node_Id)
is
Loc : constant Source_Ptr := Location_Of (Declaration, Node_Tree);
Reset_Value : Boolean := False;
Current_String : Project_Node_Id;
begin
-- Report an error for an empty string
if Value.Value = Empty_String then
Error_Msg_Name_1 := Name_Of (Declaration, Node_Tree);
case Env.Flags.Allow_Invalid_External is
when Error =>
Error_Msg
(Env.Flags, "no value defined for %%", Loc, Project);
when Warning =>
Reset_Value := True;
Error_Msg
(Env.Flags, "?no value defined for %%", Loc, Project);
when Silent =>
Reset_Value := True;
end case;
else
-- Loop through all the valid strings for the
-- string type and compare to the string value.
Current_String :=
First_Literal_String
(String_Type_Of (Declaration, Node_Tree), Node_Tree);
while Present (Current_String)
and then
String_Value_Of (Current_String, Node_Tree) /= Value.Value
loop
Current_String :=
Next_Literal_String (Current_String, Node_Tree);
end loop;
-- Report error if string value is not one for the string type
if No (Current_String) then
Error_Msg_Name_1 := Value.Value;
Error_Msg_Name_2 := Name_Of (Declaration, Node_Tree);
case Env.Flags.Allow_Invalid_External is
when Error =>
Error_Msg
(Env.Flags, "value %% is illegal for typed string %%",
Loc, Project);
when Warning =>
Error_Msg
(Env.Flags, "?value %% is illegal for typed string %%",
Loc, Project);
Reset_Value := True;
when Silent =>
Reset_Value := True;
end case;
end if;
end if;
if Reset_Value then
Current_String :=
First_Literal_String
(String_Type_Of (Declaration, Node_Tree), Node_Tree);
Value.Value := String_Value_Of (Current_String, Node_Tree);
end if;
end Check_Or_Set_Typed_Variable;
---------------------------------
-- Process_Package_Declaration --
---------------------------------
procedure Process_Package_Declaration
(Current_Item : Project_Node_Id)
is
begin
-- Do not process a package declaration that should be ignored
if Expression_Kind_Of (Current_Item, Node_Tree) /= Ignored then
-- Create the new package
Package_Table.Increment_Last (Shared.Packages);
declare
New_Pkg : constant Package_Id :=
Package_Table.Last (Shared.Packages);
The_New_Package : Package_Element;
Project_Of_Renamed_Package : constant Project_Node_Id :=
Project_Of_Renamed_Package_Of
(Current_Item, Node_Tree);
begin
-- Set the name of the new package
The_New_Package.Name := Name_Of (Current_Item, Node_Tree);
-- Insert the new package in the appropriate list
if Pkg /= No_Package then
The_New_Package.Next :=
Shared.Packages.Table (Pkg).Decl.Packages;
Shared.Packages.Table (Pkg).Decl.Packages := New_Pkg;
else
The_New_Package.Next := Project.Decl.Packages;
Project.Decl.Packages := New_Pkg;
end if;
Shared.Packages.Table (New_Pkg) := The_New_Package;
if Present (Project_Of_Renamed_Package) then
-- Renamed or extending package
declare
Project_Name : constant Name_Id :=
Name_Of (Project_Of_Renamed_Package,
Node_Tree);
Renamed_Project : constant Project_Id :=
Imported_Or_Extended_Project_From
(Project, Project_Name);
Renamed_Package : constant Package_Id :=
Package_From
(Renamed_Project, Shared,
Name_Of (Current_Item, Node_Tree));
begin
-- For a renamed package, copy the declarations of the
-- renamed package, but set all the locations to the
-- location of the package name in the renaming
-- declaration.
Copy_Package_Declarations
(From => Shared.Packages.Table
(Renamed_Package).Decl,
To => Shared.Packages.Table (New_Pkg).Decl,
New_Loc => Location_Of (Current_Item, Node_Tree),
Restricted => False,
Shared => Shared);
end;
else
-- Set the default values of the attributes
Add_Attributes
(Project,
Project.Name,
Name_Id (Project.Directory.Display_Name),
Shared,
Shared.Packages.Table (New_Pkg).Decl,
First_Attribute_Of
(Package_Id_Of (Current_Item, Node_Tree)),
Project_Level => False);
end if;
-- Process declarative items (nothing to do when the package is
-- renaming, as the first declarative item is null).
Process_Declarative_Items
(Project => Project,
In_Tree => In_Tree,
From_Project_Node => From_Project_Node,
Node_Tree => Node_Tree,
Env => Env,
Pkg => New_Pkg,
Item =>
First_Declarative_Item_Of (Current_Item, Node_Tree),
Child_Env => Child_Env);
end;
end if;
end Process_Package_Declaration;
-------------------------------
-- Process_Associative_Array --
-------------------------------
procedure Process_Associative_Array
(Current_Item : Project_Node_Id)
is
Current_Item_Name : constant Name_Id :=
Name_Of (Current_Item, Node_Tree);
-- The name of the attribute
Current_Location : constant Source_Ptr :=
Location_Of (Current_Item, Node_Tree);
New_Array : Array_Id;
-- The new associative array created
Orig_Array : Array_Id;
-- The associative array value
Orig_Project_Name : Name_Id := No_Name;
-- The name of the project where the associative array
-- value is.
Orig_Project : Project_Id := No_Project;
-- The id of the project where the associative array
-- value is.
Orig_Package_Name : Name_Id := No_Name;
-- The name of the package, if any, where the associative array value
-- is located.
Orig_Package : Package_Id := No_Package;
-- The id of the package, if any, where the associative array value
-- is located.
New_Element : Array_Element_Id := No_Array_Element;
-- Id of a new array element created
Prev_Element : Array_Element_Id := No_Array_Element;
-- Last new element id created
Orig_Element : Array_Element_Id := No_Array_Element;
-- Current array element in original associative array
Next_Element : Array_Element_Id := No_Array_Element;
-- Id of the array element that follows the new element. This is not
-- always nil, because values for the associative array attribute may
-- already have been declared, and the array elements declared are
-- reused.
Prj : Project_List;
begin
-- First find if the associative array attribute already has elements
-- declared.
if Pkg /= No_Package then
New_Array := Shared.Packages.Table (Pkg).Decl.Arrays;
else
New_Array := Project.Decl.Arrays;
end if;
while New_Array /= No_Array
and then Shared.Arrays.Table (New_Array).Name /= Current_Item_Name
loop
New_Array := Shared.Arrays.Table (New_Array).Next;
end loop;
-- If the attribute has never been declared add new entry in the
-- arrays of the project/package and link it.
if New_Array = No_Array then
Array_Table.Increment_Last (Shared.Arrays);
New_Array := Array_Table.Last (Shared.Arrays);
if Pkg /= No_Package then
Shared.Arrays.Table (New_Array) :=
(Name => Current_Item_Name,
Location => Current_Location,
Value => No_Array_Element,
Next => Shared.Packages.Table (Pkg).Decl.Arrays);
Shared.Packages.Table (Pkg).Decl.Arrays := New_Array;
else
Shared.Arrays.Table (New_Array) :=
(Name => Current_Item_Name,
Location => Current_Location,
Value => No_Array_Element,
Next => Project.Decl.Arrays);
Project.Decl.Arrays := New_Array;
end if;
end if;
-- Find the project where the value is declared
Orig_Project_Name :=
Name_Of
(Associative_Project_Of (Current_Item, Node_Tree), Node_Tree);
Prj := In_Tree.Projects;
while Prj /= null loop
if Prj.Project.Name = Orig_Project_Name then
Orig_Project := Prj.Project;
exit;
end if;
Prj := Prj.Next;
end loop;
pragma Assert (Orig_Project /= No_Project,
"original project not found");
if No (Associative_Package_Of (Current_Item, Node_Tree)) then
Orig_Array := Orig_Project.Decl.Arrays;
else
-- If in a package, find the package where the value is declared
Orig_Package_Name :=
Name_Of
(Associative_Package_Of (Current_Item, Node_Tree), Node_Tree);
Orig_Package := Orig_Project.Decl.Packages;
pragma Assert (Orig_Package /= No_Package,
"original package not found");
while Shared.Packages.Table
(Orig_Package).Name /= Orig_Package_Name
loop
Orig_Package := Shared.Packages.Table (Orig_Package).Next;
pragma Assert (Orig_Package /= No_Package,
"original package not found");
end loop;
Orig_Array := Shared.Packages.Table (Orig_Package).Decl.Arrays;
end if;
-- Now look for the array
while Orig_Array /= No_Array
and then Shared.Arrays.Table (Orig_Array).Name /= Current_Item_Name
loop
Orig_Array := Shared.Arrays.Table (Orig_Array).Next;
end loop;
if Orig_Array = No_Array then
Error_Msg
(Env.Flags,
"associative array value not found",
Location_Of (Current_Item, Node_Tree),
Project);
else
Orig_Element := Shared.Arrays.Table (Orig_Array).Value;
-- Copy each array element
while Orig_Element /= No_Array_Element loop
-- Case of first element
if Prev_Element = No_Array_Element then
-- And there is no array element declared yet, create a new
-- first array element.
if Shared.Arrays.Table (New_Array).Value =
No_Array_Element
then
Array_Element_Table.Increment_Last
(Shared.Array_Elements);
New_Element := Array_Element_Table.Last
(Shared.Array_Elements);
Shared.Arrays.Table (New_Array).Value := New_Element;
Next_Element := No_Array_Element;
-- Otherwise, the new element is the first
else
New_Element := Shared.Arrays.Table (New_Array).Value;
Next_Element :=
Shared.Array_Elements.Table (New_Element).Next;
end if;
-- Otherwise, reuse an existing element, or create
-- one if necessary.
else
Next_Element :=
Shared.Array_Elements.Table (Prev_Element).Next;
if Next_Element = No_Array_Element then
Array_Element_Table.Increment_Last
(Shared.Array_Elements);
New_Element := Array_Element_Table.Last
(Shared.Array_Elements);
Shared.Array_Elements.Table (Prev_Element).Next :=
New_Element;
else
New_Element := Next_Element;
Next_Element :=
Shared.Array_Elements.Table (New_Element).Next;
end if;
end if;
-- Copy the value of the element
Shared.Array_Elements.Table (New_Element) :=
Shared.Array_Elements.Table (Orig_Element);
Shared.Array_Elements.Table (New_Element).Value.Project
:= Project;
-- Adjust the Next link
Shared.Array_Elements.Table (New_Element).Next := Next_Element;
-- Adjust the previous id for the next element
Prev_Element := New_Element;
-- Go to the next element in the original array
Orig_Element := Shared.Array_Elements.Table (Orig_Element).Next;
end loop;
-- Make sure that the array ends here, in case there previously a
-- greater number of elements.
Shared.Array_Elements.Table (New_Element).Next := No_Array_Element;
end if;
end Process_Associative_Array;
----------------------------------------------
-- Process_Expression_For_Associative_Array --
----------------------------------------------
procedure Process_Expression_For_Associative_Array
(Current : Project_Node_Id;
New_Value : Variable_Value)
is
Name : constant Name_Id := Name_Of (Current, Node_Tree);
Current_Location : constant Source_Ptr :=
Location_Of (Current, Node_Tree);
Index_Name : Name_Id :=
Associative_Array_Index_Of (Current, Node_Tree);
Source_Index : constant Int :=
Source_Index_Of (Current, Node_Tree);
The_Array : Array_Id;
Elem : Array_Element_Id := No_Array_Element;
begin
if Index_Name /= All_Other_Names then
Index_Name := Get_Attribute_Index (Node_Tree, Current, Index_Name);
end if;
-- Look for the array in the appropriate list
if Pkg /= No_Package then
The_Array := Shared.Packages.Table (Pkg).Decl.Arrays;
else
The_Array := Project.Decl.Arrays;
end if;
while The_Array /= No_Array
and then Shared.Arrays.Table (The_Array).Name /= Name
loop
The_Array := Shared.Arrays.Table (The_Array).Next;
end loop;
-- If the array cannot be found, create a new entry in the list.
-- As The_Array_Element is initialized to No_Array_Element, a new
-- element will be created automatically later
if The_Array = No_Array then
Array_Table.Increment_Last (Shared.Arrays);
The_Array := Array_Table.Last (Shared.Arrays);
if Pkg /= No_Package then
Shared.Arrays.Table (The_Array) :=
(Name => Name,
Location => Current_Location,
Value => No_Array_Element,
Next => Shared.Packages.Table (Pkg).Decl.Arrays);
Shared.Packages.Table (Pkg).Decl.Arrays := The_Array;
else
Shared.Arrays.Table (The_Array) :=
(Name => Name,
Location => Current_Location,
Value => No_Array_Element,
Next => Project.Decl.Arrays);
Project.Decl.Arrays := The_Array;
end if;
else
Elem := Shared.Arrays.Table (The_Array).Value;
end if;
-- Look in the list, if any, to find an element with the same index
-- and same source index.
while Elem /= No_Array_Element
and then
(Shared.Array_Elements.Table (Elem).Index /= Index_Name
or else
Shared.Array_Elements.Table (Elem).Src_Index /= Source_Index)
loop
Elem := Shared.Array_Elements.Table (Elem).Next;
end loop;
-- If no such element were found, create a new one
-- and insert it in the element list, with the
-- proper value.
if Elem = No_Array_Element then
Array_Element_Table.Increment_Last (Shared.Array_Elements);
Elem := Array_Element_Table.Last (Shared.Array_Elements);
Shared.Array_Elements.Table
(Elem) :=
(Index => Index_Name,
Restricted => False,
Src_Index => Source_Index,
Index_Case_Sensitive =>
not Case_Insensitive (Current, Node_Tree),
Value => New_Value,
Next => Shared.Arrays.Table (The_Array).Value);
Shared.Arrays.Table (The_Array).Value := Elem;
else
-- An element with the same index already exists, just replace its
-- value with the new one.
Shared.Array_Elements.Table (Elem).Value := New_Value;
end if;
if Name = Snames.Name_External then
if In_Tree.Is_Root_Tree then
Add (Child_Env.External,
External_Name => Get_Name_String (Index_Name),
Value => Get_Name_String (New_Value.Value),
Source => From_External_Attribute);
Add (Env.External,
External_Name => Get_Name_String (Index_Name),
Value => Get_Name_String (New_Value.Value),
Source => From_External_Attribute,
Silent => True);
else
if Current_Verbosity = High then
Debug_Output
("'for External' has no effect except in root aggregate ("
& Get_Name_String (Index_Name) & ")", New_Value.Value);
end if;
end if;
end if;
end Process_Expression_For_Associative_Array;
--------------------------------------
-- Process_Expression_Variable_Decl --
--------------------------------------
procedure Process_Expression_Variable_Decl
(Current_Item : Project_Node_Id;
New_Value : Variable_Value)
is
Name : constant Name_Id := Name_Of (Current_Item, Node_Tree);
Is_Attribute : constant Boolean :=
Kind_Of (Current_Item, Node_Tree) =
N_Attribute_Declaration;
Var : Variable_Id := No_Variable;
begin
-- First, find the list where to find the variable or attribute
if Is_Attribute then
if Pkg /= No_Package then
Var := Shared.Packages.Table (Pkg).Decl.Attributes;
else
Var := Project.Decl.Attributes;
end if;
else
if Pkg /= No_Package then
Var := Shared.Packages.Table (Pkg).Decl.Variables;
else
Var := Project.Decl.Variables;
end if;
end if;
-- Loop through the list, to find if it has already been declared
while Var /= No_Variable
and then Shared.Variable_Elements.Table (Var).Name /= Name
loop
Var := Shared.Variable_Elements.Table (Var).Next;
end loop;
-- If it has not been declared, create a new entry in the list
if Var = No_Variable then
-- All single string attribute should already have been declared
-- with a default empty string value.
pragma Assert
(not Is_Attribute,
"illegal attribute declaration for " & Get_Name_String (Name));
Variable_Element_Table.Increment_Last (Shared.Variable_Elements);
Var := Variable_Element_Table.Last (Shared.Variable_Elements);
-- Put the new variable in the appropriate list
if Pkg /= No_Package then
Shared.Variable_Elements.Table (Var) :=
(Next => Shared.Packages.Table (Pkg).Decl.Variables,
Name => Name,
Value => New_Value);
Shared.Packages.Table (Pkg).Decl.Variables := Var;
else
Shared.Variable_Elements.Table (Var) :=
(Next => Project.Decl.Variables,
Name => Name,
Value => New_Value);
Project.Decl.Variables := Var;
end if;
-- If the variable/attribute has already been declared, just
-- change the value.
else
Shared.Variable_Elements.Table (Var).Value := New_Value;
end if;
if Is_Attribute and then Name = Snames.Name_Project_Path then
if In_Tree.Is_Root_Tree then
declare
package Name_Ids is
new Ada.Containers.Vectors (Positive, Name_Id);
Val : String_List_Id := New_Value.Values;
List : Name_Ids.Vector;
begin
-- Get all values
while Val /= Nil_String loop
List.Prepend
(Shared.String_Elements.Table (Val).Value);
Val := Shared.String_Elements.Table (Val).Next;
end loop;
-- Prepend them in the order found in the attribute
for K in Positive range 1 .. Positive (List.Length) loop
Prj.Env.Add_Directories
(Child_Env.Project_Path,
Normalize_Pathname
(Name => Get_Name_String
(List.Element (K)),
Directory => Get_Name_String
(Project.Directory.Display_Name)),
Prepend => True);
end loop;
end;
else
if Current_Verbosity = High then
Debug_Output
("'for Project_Path' has no effect except in"
& " root aggregate");
end if;
end if;
end if;
end Process_Expression_Variable_Decl;
------------------------
-- Process_Expression --
------------------------
procedure Process_Expression (Current : Project_Node_Id) is
New_Value : Variable_Value :=
Expression
(Project => Project,
Shared => Shared,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => Node_Tree,
Env => Env,
Pkg => Pkg,
First_Term =>
Tree.First_Term
(Expression_Of (Current, Node_Tree), Node_Tree),
Kind =>
Expression_Kind_Of (Current, Node_Tree));
begin
-- Process a typed variable declaration
if Kind_Of (Current, Node_Tree) = N_Typed_Variable_Declaration then
Check_Or_Set_Typed_Variable (New_Value, Current);
end if;
if Kind_Of (Current, Node_Tree) /= N_Attribute_Declaration
or else Associative_Array_Index_Of (Current, Node_Tree) = No_Name
then
Process_Expression_Variable_Decl (Current, New_Value);
else
Process_Expression_For_Associative_Array (Current, New_Value);
end if;
end Process_Expression;
-----------------------------------
-- Process_Attribute_Declaration --
-----------------------------------
procedure Process_Attribute_Declaration (Current : Project_Node_Id) is
begin
if Expression_Of (Current, Node_Tree) = Empty_Node then
Process_Associative_Array (Current);
else
Process_Expression (Current);
end if;
end Process_Attribute_Declaration;
-------------------------------
-- Process_Case_Construction --
-------------------------------
procedure Process_Case_Construction
(Current_Item : Project_Node_Id)
is
The_Project : Project_Id := Project;
-- The id of the project of the case variable
The_Package : Package_Id := Pkg;
-- The id of the package, if any, of the case variable
The_Variable : Variable_Value := Nil_Variable_Value;
-- The case variable
Case_Value : Name_Id := No_Name;
-- The case variable value
Case_Item : Project_Node_Id := Empty_Node;
Choice_String : Project_Node_Id := Empty_Node;
Decl_Item : Project_Node_Id := Empty_Node;
begin
declare
Variable_Node : constant Project_Node_Id :=
Case_Variable_Reference_Of
(Current_Item,
Node_Tree);
Var_Id : Variable_Id := No_Variable;
Name : Name_Id := No_Name;
begin
-- If a project was specified for the case variable, get its id
if Present (Project_Node_Of (Variable_Node, Node_Tree)) then
Name :=
Name_Of
(Project_Node_Of (Variable_Node, Node_Tree), Node_Tree);
The_Project :=
Imported_Or_Extended_Project_From
(Project, Name, No_Extending => True);
The_Package := No_Package;
end if;
-- If a package was specified for the case variable, get its id
if Present (Package_Node_Of (Variable_Node, Node_Tree)) then
Name :=
Name_Of
(Package_Node_Of (Variable_Node, Node_Tree), Node_Tree);
The_Package := Package_From (The_Project, Shared, Name);
end if;
Name := Name_Of (Variable_Node, Node_Tree);
-- First, look for the case variable into the package, if any
if The_Package /= No_Package then
Name := Name_Of (Variable_Node, Node_Tree);
Var_Id := Shared.Packages.Table (The_Package).Decl.Variables;
while Var_Id /= No_Variable
and then Shared.Variable_Elements.Table (Var_Id).Name /= Name
loop
Var_Id := Shared.Variable_Elements.Table (Var_Id).Next;
end loop;
end if;
-- If not found in the package, or if there is no package, look at
-- the project level.
if Var_Id = No_Variable
and then No (Package_Node_Of (Variable_Node, Node_Tree))
then
Var_Id := The_Project.Decl.Variables;
while Var_Id /= No_Variable
and then Shared.Variable_Elements.Table (Var_Id).Name /= Name
loop
Var_Id := Shared.Variable_Elements.Table (Var_Id).Next;
end loop;
end if;
if Var_Id = No_Variable then
if Node_Tree.Incomplete_With then
return;
-- Should never happen, because this has already been checked
-- during parsing.
else
Write_Line
("variable """ & Get_Name_String (Name) & """ not found");
raise Program_Error;
end if;
end if;
-- Get the case variable
The_Variable := Shared.Variable_Elements. Table (Var_Id).Value;
if The_Variable.Kind /= Single then
-- Should never happen, because this has already been checked
-- during parsing.
Write_Line ("variable""" & Get_Name_String (Name) &
""" is not a single string variable");
raise Program_Error;
end if;
-- Get the case variable value
Case_Value := The_Variable.Value;
end;
-- Now look into all the case items of the case construction
Case_Item := First_Case_Item_Of (Current_Item, Node_Tree);
Case_Item_Loop :
while Present (Case_Item) loop
Choice_String := First_Choice_Of (Case_Item, Node_Tree);
-- When Choice_String is nil, it means that it is the
-- "when others =>" alternative.
if No (Choice_String) then
Decl_Item := First_Declarative_Item_Of (Case_Item, Node_Tree);
exit Case_Item_Loop;
end if;
-- Look into all the alternative of this case item
Choice_Loop :
while Present (Choice_String) loop
if Case_Value = String_Value_Of (Choice_String, Node_Tree) then
Decl_Item :=
First_Declarative_Item_Of (Case_Item, Node_Tree);
exit Case_Item_Loop;
end if;
Choice_String := Next_Literal_String (Choice_String, Node_Tree);
end loop Choice_Loop;
Case_Item := Next_Case_Item (Case_Item, Node_Tree);
end loop Case_Item_Loop;
-- If there is an alternative, then we process it
if Present (Decl_Item) then
Process_Declarative_Items
(Project => Project,
In_Tree => In_Tree,
From_Project_Node => From_Project_Node,
Node_Tree => Node_Tree,
Env => Env,
Pkg => Pkg,
Item => Decl_Item,
Child_Env => Child_Env);
end if;
end Process_Case_Construction;
-- Local variables
Current, Decl : Project_Node_Id;
Kind : Project_Node_Kind;
-- Start of processing for Process_Declarative_Items
begin
Decl := Item;
while Present (Decl) loop
Current := Current_Item_Node (Decl, Node_Tree);
Decl := Next_Declarative_Item (Decl, Node_Tree);
Kind := Kind_Of (Current, Node_Tree);
case Kind is
when N_Package_Declaration =>
Process_Package_Declaration (Current);
-- Nothing to process for string type declaration
when N_String_Type_Declaration =>
null;
when N_Attribute_Declaration |
N_Typed_Variable_Declaration |
N_Variable_Declaration =>
Process_Attribute_Declaration (Current);
when N_Case_Construction =>
Process_Case_Construction (Current);
when others =>
Write_Line ("Illegal declarative item: " & Kind'Img);
raise Program_Error;
end case;
end loop;
end Process_Declarative_Items;
----------------------------------
-- Process_Project_Tree_Phase_1 --
----------------------------------
procedure Process_Project_Tree_Phase_1
(In_Tree : Project_Tree_Ref;
Project : out Project_Id;
Packages_To_Check : String_List_Access;
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
Env : in out Prj.Tree.Environment;
Reset_Tree : Boolean := True;
On_New_Tree_Loaded : Tree_Loaded_Callback := null)
is
begin
if Reset_Tree then
-- Make sure there are no projects in the data structure
Free_List (In_Tree.Projects, Free_Project => True);
end if;
Processed_Projects.Reset;
-- And process the main project and all of the projects it depends on,
-- recursively.
Debug_Increase_Indent ("Process tree, phase 1");
Recursive_Process
(Project => Project,
In_Tree => In_Tree,
Packages_To_Check => Packages_To_Check,
From_Project_Node => From_Project_Node,
From_Project_Node_Tree => From_Project_Node_Tree,
Env => Env,
Extended_By => No_Project,
From_Encapsulated_Lib => False,
On_New_Tree_Loaded => On_New_Tree_Loaded);
Success :=
Total_Errors_Detected = 0
and then
(Warning_Mode /= Treat_As_Error or else Warnings_Detected = 0);
if Current_Verbosity = High then
Debug_Decrease_Indent
("Done Process tree, phase 1, Success=" & Success'Img);
end if;
end Process_Project_Tree_Phase_1;
----------------------------------
-- Process_Project_Tree_Phase_2 --
----------------------------------
procedure Process_Project_Tree_Phase_2
(In_Tree : Project_Tree_Ref;
Project : Project_Id;
Success : out Boolean;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
Env : Environment)
is
Obj_Dir : Path_Name_Type;
Extending : Project_Id;
Extending2 : Project_Id;
Prj : Project_List;
-- Start of processing for Process_Project_Tree_Phase_2
begin
Success := True;
Debug_Increase_Indent ("Process tree, phase 2", Project.Name);
if Project /= No_Project then
Check (In_Tree, Project, From_Project_Node_Tree, Env.Flags);
end if;
-- If main project is an extending all project, set object directory of
-- all virtual extending projects to object directory of main project.
if Project /= No_Project
and then Is_Extending_All (From_Project_Node, From_Project_Node_Tree)
then
declare
Object_Dir : constant Path_Information := Project.Object_Directory;
begin
Prj := In_Tree.Projects;
while Prj /= null loop
if Prj.Project.Virtual then
Prj.Project.Object_Directory := Object_Dir;
end if;
Prj := Prj.Next;
end loop;
end;
end if;
-- Check that no extending project shares its object directory with
-- the project(s) it extends.
if Project /= No_Project then
Prj := In_Tree.Projects;
while Prj /= null loop
Extending := Prj.Project.Extended_By;
if Extending /= No_Project then
Obj_Dir := Prj.Project.Object_Directory.Name;
-- Check that a project being extended does not share its
-- object directory with any project that extends it, directly
-- or indirectly, including a virtual extending project.
-- Start with the project directly extending it
Extending2 := Extending;
while Extending2 /= No_Project loop
if Has_Ada_Sources (Extending2)
and then Extending2.Object_Directory.Name = Obj_Dir
then
if Extending2.Virtual then
Error_Msg_Name_1 := Prj.Project.Display_Name;
Error_Msg
(Env.Flags,
"project %% cannot be extended by a virtual" &
" project with the same object directory",
Prj.Project.Location, Project);
else
Error_Msg_Name_1 := Extending2.Display_Name;
Error_Msg_Name_2 := Prj.Project.Display_Name;
Error_Msg
(Env.Flags,
"project %% cannot extend project %%",
Extending2.Location, Project);
Error_Msg
(Env.Flags,
"\they share the same object directory",
Extending2.Location, Project);
end if;
end if;
-- Continue with the next extending project, if any
Extending2 := Extending2.Extended_By;
end loop;
end if;
Prj := Prj.Next;
end loop;
end if;
Debug_Decrease_Indent ("Done Process tree, phase 2");
Success := Total_Errors_Detected = 0
and then
(Warning_Mode /= Treat_As_Error or else Warnings_Detected = 0);
end Process_Project_Tree_Phase_2;
-----------------------
-- Recursive_Process --
-----------------------
procedure Recursive_Process
(In_Tree : Project_Tree_Ref;
Project : out Project_Id;
Packages_To_Check : String_List_Access;
From_Project_Node : Project_Node_Id;
From_Project_Node_Tree : Project_Node_Tree_Ref;
Env : in out Prj.Tree.Environment;
Extended_By : Project_Id;
From_Encapsulated_Lib : Boolean;
On_New_Tree_Loaded : Tree_Loaded_Callback := null)
is
Shared : constant Shared_Project_Tree_Data_Access := In_Tree.Shared;
Child_Env : Prj.Tree.Environment;
-- Only used for the root aggregate project (if any). This is left
-- uninitialized otherwise.
procedure Process_Imported_Projects
(Imported : in out Project_List;
Limited_With : Boolean);
-- Process imported projects. If Limited_With is True, then only
-- projects processed through a "limited with" are processed, otherwise
-- only projects imported through a standard "with" are processed.
-- Imported is the id of the last imported project.
procedure Process_Aggregated_Projects;
-- Process all the projects aggregated in List. This does nothing if the
-- project is not an aggregate project.
procedure Process_Extended_Project;
-- Process the extended project: inherit all packages from the extended
-- project that are not explicitly defined or renamed. Also inherit the
-- languages, if attribute Languages is not explicitly defined.
-------------------------------
-- Process_Imported_Projects --
-------------------------------
procedure Process_Imported_Projects
(Imported : in out Project_List;
Limited_With : Boolean)
is
With_Clause : Project_Node_Id;
New_Project : Project_Id;
Proj_Node : Project_Node_Id;
begin
With_Clause :=
First_With_Clause_Of
(From_Project_Node, From_Project_Node_Tree);
while Present (With_Clause) loop
Proj_Node :=
Non_Limited_Project_Node_Of
(With_Clause, From_Project_Node_Tree);
New_Project := No_Project;
if (Limited_With and then No (Proj_Node))
or else (not Limited_With and then Present (Proj_Node))
then
Recursive_Process
(In_Tree => In_Tree,
Project => New_Project,
Packages_To_Check => Packages_To_Check,
From_Project_Node =>
Project_Node_Of (With_Clause, From_Project_Node_Tree),
From_Project_Node_Tree => From_Project_Node_Tree,
Env => Env,
Extended_By => No_Project,
From_Encapsulated_Lib => From_Encapsulated_Lib,
On_New_Tree_Loaded => On_New_Tree_Loaded);
if Imported = null then
Project.Imported_Projects := new Project_List_Element'
(Project => New_Project,
From_Encapsulated_Lib => False,
Next => null);
Imported := Project.Imported_Projects;
else
Imported.Next := new Project_List_Element'
(Project => New_Project,
From_Encapsulated_Lib => False,
Next => null);
Imported := Imported.Next;
end if;
end if;
With_Clause :=
Next_With_Clause_Of (With_Clause, From_Project_Node_Tree);
end loop;
end Process_Imported_Projects;
---------------------------------
-- Process_Aggregated_Projects --
---------------------------------
procedure Process_Aggregated_Projects is
List : Aggregated_Project_List;
Loaded_Project : Prj.Tree.Project_Node_Id;
Success : Boolean := True;
Tree : Project_Tree_Ref;
Node_Tree : Project_Node_Tree_Ref;
begin
if Project.Qualifier not in Aggregate_Project then
return;
end if;
Debug_Increase_Indent ("Process_Aggregated_Projects", Project.Name);
Prj.Nmsc.Process_Aggregated_Projects
(Tree => In_Tree,
Project => Project,
Node_Tree => From_Project_Node_Tree,
Flags => Env.Flags);
List := Project.Aggregated_Projects;
while Success and then List /= null loop
Node_Tree := new Project_Node_Tree_Data;
Initialize (Node_Tree);
Prj.Part.Parse
(In_Tree => Node_Tree,
Project => Loaded_Project,
Packages_To_Check => Packages_To_Check,
Project_File_Name => Get_Name_String (List.Path),
Errout_Handling => Prj.Part.Never_Finalize,
Current_Directory => Get_Name_String (Project.Directory.Name),
Is_Config_File => False,
Env => Child_Env);
Success := not Prj.Tree.No (Loaded_Project);
if Success then
if Node_Tree.Incomplete_With then
From_Project_Node_Tree.Incomplete_With := True;
end if;
List.Tree := new Project_Tree_Data (Is_Root_Tree => False);
Prj.Initialize (List.Tree);
List.Tree.Shared := In_Tree.Shared;
-- In aggregate library, aggregated projects are parsed using
-- the aggregate library tree.
if Project.Qualifier = Aggregate_Library then
Tree := In_Tree;
else
Tree := List.Tree;
end if;
-- We can only do the phase 1 of the processing, since we do
-- not have access to the configuration file yet (this is
-- called when doing phase 1 of the processing for the root
-- aggregate project).
if In_Tree.Is_Root_Tree then
Process_Project_Tree_Phase_1
(In_Tree => Tree,
Project => List.Project,
Packages_To_Check => Packages_To_Check,
Success => Success,
From_Project_Node => Loaded_Project,
From_Project_Node_Tree => Node_Tree,
Env => Child_Env,
Reset_Tree => False,
On_New_Tree_Loaded => On_New_Tree_Loaded);
else
-- use the same environment as the rest of the aggregated
-- projects, ie the one that was setup by the root aggregate
Process_Project_Tree_Phase_1
(In_Tree => Tree,
Project => List.Project,
Packages_To_Check => Packages_To_Check,
Success => Success,
From_Project_Node => Loaded_Project,
From_Project_Node_Tree => Node_Tree,
Env => Env,
Reset_Tree => False,
On_New_Tree_Loaded => On_New_Tree_Loaded);
end if;
if On_New_Tree_Loaded /= null then
On_New_Tree_Loaded
(Node_Tree, Tree, Loaded_Project, List.Project);
end if;
else
Debug_Output ("Failed to parse", Name_Id (List.Path));
end if;
List := List.Next;
end loop;
Debug_Decrease_Indent ("Done Process_Aggregated_Projects");
end Process_Aggregated_Projects;
------------------------------
-- Process_Extended_Project --
------------------------------
procedure Process_Extended_Project is
Extended_Pkg : Package_Id;
Current_Pkg : Package_Id;
Element : Package_Element;
First : constant Package_Id := Project.Decl.Packages;
Attribute1 : Variable_Id;
Attribute2 : Variable_Id;
Attr_Value1 : Variable;
Attr_Value2 : Variable;
begin
Extended_Pkg := Project.Extends.Decl.Packages;
while Extended_Pkg /= No_Package loop
Element := Shared.Packages.Table (Extended_Pkg);
Current_Pkg := First;
while Current_Pkg /= No_Package
and then
Shared.Packages.Table (Current_Pkg).Name /= Element.Name
loop
Current_Pkg := Shared.Packages.Table (Current_Pkg).Next;
end loop;
if Current_Pkg = No_Package then
Package_Table.Increment_Last (Shared.Packages);
Current_Pkg := Package_Table.Last (Shared.Packages);
Shared.Packages.Table (Current_Pkg) :=
(Name => Element.Name,
Decl => No_Declarations,
Parent => No_Package,
Next => Project.Decl.Packages);
Project.Decl.Packages := Current_Pkg;
Copy_Package_Declarations
(From => Element.Decl,
To => Shared.Packages.Table (Current_Pkg).Decl,
New_Loc => No_Location,
Restricted => True,
Shared => Shared);
end if;
Extended_Pkg := Element.Next;
end loop;
-- Check if attribute Languages is declared in the extending project
Attribute1 := Project.Decl.Attributes;
while Attribute1 /= No_Variable loop
Attr_Value1 := Shared.Variable_Elements. Table (Attribute1);
exit when Attr_Value1.Name = Snames.Name_Languages;
Attribute1 := Attr_Value1.Next;
end loop;
if Attribute1 = No_Variable or else Attr_Value1.Value.Default then
-- Attribute Languages is not declared in the extending project.
-- Check if it is declared in the project being extended.
Attribute2 := Project.Extends.Decl.Attributes;
while Attribute2 /= No_Variable loop
Attr_Value2 := Shared.Variable_Elements.Table (Attribute2);
exit when Attr_Value2.Name = Snames.Name_Languages;
Attribute2 := Attr_Value2.Next;
end loop;
if Attribute2 /= No_Variable
and then not Attr_Value2.Value.Default
then
-- As attribute Languages is declared in the project being
-- extended, copy its value for the extending project.
if Attribute1 = No_Variable then
Variable_Element_Table.Increment_Last
(Shared.Variable_Elements);
Attribute1 := Variable_Element_Table.Last
(Shared.Variable_Elements);
Attr_Value1.Next := Project.Decl.Attributes;
Project.Decl.Attributes := Attribute1;
end if;
Attr_Value1.Name := Snames.Name_Languages;
Attr_Value1.Value := Attr_Value2.Value;
Shared.Variable_Elements.Table (Attribute1) := Attr_Value1;
end if;
end if;
end Process_Extended_Project;
-- Start of processing for Recursive_Process
begin
if No (From_Project_Node) then
Project := No_Project;
else
declare
Imported, Mark : Project_List;
Declaration_Node : Project_Node_Id := Empty_Node;
Name : constant Name_Id :=
Name_Of (From_Project_Node, From_Project_Node_Tree);
Display_Name : constant Name_Id :=
Display_Name_Of
(From_Project_Node, From_Project_Node_Tree);
begin
Project := Processed_Projects.Get (Name);
if Project /= No_Project then
-- Make sure that, when a project is extended, the project id
-- of the project extending it is recorded in its data, even
-- when it has already been processed as an imported project.
-- This is for virtually extended projects.
if Extended_By /= No_Project then
Project.Extended_By := Extended_By;
end if;
return;
end if;
-- Check if the project is already in the tree
Project := No_Project;
declare
List : Project_List := In_Tree.Projects;
Path : constant Path_Name_Type :=
Path_Name_Of (From_Project_Node,
From_Project_Node_Tree);
begin
while List /= null loop
if List.Project.Path.Display_Name = Path then
Project := List.Project;
exit;
end if;
List := List.Next;
end loop;
end;
if Project = No_Project then
Project :=
new Project_Data'
(Empty_Project
(Project_Qualifier_Of
(From_Project_Node, From_Project_Node_Tree)));
-- Note that at this point we do not know yet if the project
-- has been withed from an encapsulated library or not.
In_Tree.Projects :=
new Project_List_Element'
(Project => Project,
From_Encapsulated_Lib => False,
Next => In_Tree.Projects);
end if;
-- Keep track of this point
Mark := In_Tree.Projects;
Processed_Projects.Set (Name, Project);
Project.Name := Name;
Project.Display_Name := Display_Name;
Get_Name_String (Name);
-- If name starts with the virtual prefix, flag the project as
-- being a virtual extending project.
if Name_Len > Virtual_Prefix'Length
and then
Name_Buffer (1 .. Virtual_Prefix'Length) = Virtual_Prefix
then
Project.Virtual := True;
end if;
Project.Path.Display_Name :=
Path_Name_Of (From_Project_Node, From_Project_Node_Tree);
Get_Name_String (Project.Path.Display_Name);
Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
Project.Path.Name := Name_Find;
Project.Location :=
Location_Of (From_Project_Node, From_Project_Node_Tree);
Project.Directory.Display_Name :=
Directory_Of (From_Project_Node, From_Project_Node_Tree);
Get_Name_String (Project.Directory.Display_Name);
Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
Project.Directory.Name := Name_Find;
Project.Extended_By := Extended_By;
Add_Attributes
(Project,
Name,
Name_Id (Project.Directory.Display_Name),
In_Tree.Shared,
Project.Decl,
Prj.Attr.Attribute_First,
Project_Level => True);
Process_Imported_Projects (Imported, Limited_With => False);
if Project.Qualifier = Aggregate then
Initialize_And_Copy (Child_Env, Copy_From => Env);
elsif Project.Qualifier = Aggregate_Library then
-- The child environment is the same as the current one
Child_Env := Env;
else
-- No need to initialize Child_Env, since it will not be
-- used anyway by Process_Declarative_Items (only the root
-- aggregate can modify it, and it is never read anyway).
null;
end if;
Declaration_Node :=
Project_Declaration_Of
(From_Project_Node, From_Project_Node_Tree);
Recursive_Process
(In_Tree => In_Tree,
Project => Project.Extends,
Packages_To_Check => Packages_To_Check,
From_Project_Node =>
Extended_Project_Of
(Declaration_Node, From_Project_Node_Tree),
From_Project_Node_Tree => From_Project_Node_Tree,
Env => Env,
Extended_By => Project,
From_Encapsulated_Lib => From_Encapsulated_Lib,
On_New_Tree_Loaded => On_New_Tree_Loaded);
Process_Declarative_Items
(Project => Project,
In_Tree => In_Tree,
From_Project_Node => From_Project_Node,
Node_Tree => From_Project_Node_Tree,
Env => Env,
Pkg => No_Package,
Item => First_Declarative_Item_Of
(Declaration_Node, From_Project_Node_Tree),
Child_Env => Child_Env);
if Project.Extends /= No_Project then
Process_Extended_Project;
end if;
Process_Imported_Projects (Imported, Limited_With => True);
if Total_Errors_Detected = 0 then
Process_Aggregated_Projects;
end if;
-- At this point (after Process_Declarative_Items) we have the
-- attribute values set, we can backtrace In_Tree.Project and
-- set the From_Encapsulated_Library status.
declare
Lib_Standalone : constant Prj.Variable_Value :=
Prj.Util.Value_Of
(Snames.Name_Library_Standalone,
Project.Decl.Attributes,
Shared);
List : Project_List := In_Tree.Projects;
Is_Encapsulated : Boolean;
begin
Get_Name_String (Lib_Standalone.Value);
To_Lower (Name_Buffer (1 .. Name_Len));
Is_Encapsulated := Name_Buffer (1 .. Name_Len) = "encapsulated";
if Is_Encapsulated then
while List /= null and then List /= Mark loop
List.From_Encapsulated_Lib := Is_Encapsulated;
List := List.Next;
end loop;
end if;
if Total_Errors_Detected = 0 then
-- For an aggregate library we add the aggregated projects
-- as imported ones. This is necessary to give visibility
-- to all sources from the aggregates from the aggregated
-- library projects.
if Project.Qualifier = Aggregate_Library then
declare
L : Aggregated_Project_List;
begin
L := Project.Aggregated_Projects;
while L /= null loop
Project.Imported_Projects :=
new Project_List_Element'
(Project => L.Project,
From_Encapsulated_Lib => Is_Encapsulated,
Next =>
Project.Imported_Projects);
L := L.Next;
end loop;
end;
end if;
end if;
end;
if Project.Qualifier = Aggregate and then In_Tree.Is_Root_Tree then
Free (Child_Env);
end if;
end;
end if;
end Recursive_Process;
-----------------------------
-- Set_Default_Runtime_For --
-----------------------------
procedure Set_Default_Runtime_For (Language : Name_Id; Value : String) is
begin
Name_Len := Value'Length;
Name_Buffer (1 .. Name_Len) := Value;
Runtime_Defaults.Set (Language, Name_Find);
end Set_Default_Runtime_For;
end Prj.Proc;
| 37.850456 | 79 | 0.47539 |
2916e15c71cd37e2231d1a2f82eb050f1346099f | 10,773 | adb | Ada | Ada95/samples/ncurses2-acs_display.adb | neverware-mirrors/ncurses | 931939e0d2765af13962820e59cb6629df3ee638 | [
"X11"
] | 269 | 2015-03-01T21:34:42.000Z | 2022-03-30T23:07:18.000Z | Ada95/samples/ncurses2-acs_display.adb | neverware-mirrors/ncurses | 931939e0d2765af13962820e59cb6629df3ee638 | [
"X11"
] | 3 | 2020-10-09T15:00:37.000Z | 2020-10-09T15:05:19.000Z | Ada95/samples/ncurses2-acs_display.adb | neverware-mirrors/ncurses | 931939e0d2765af13962820e59cb6629df3ee638 | [
"X11"
] | 97 | 2016-04-25T06:22:54.000Z | 2022-03-30T23:07:19.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT ncurses Binding Samples --
-- --
-- ncurses --
-- --
-- B O D Y --
-- --
------------------------------------------------------------------------------
-- Copyright 2020 Thomas E. Dickey --
-- Copyright 2000-2006,2008 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: Eugene V. Melaragno <[email protected]> 2000
-- Version Control
-- $Revision: 1.7 $
-- $Date: 2020/02/02 23:34:34 $
-- Binding Version 01.00
------------------------------------------------------------------------------
with ncurses2.util; use ncurses2.util;
with ncurses2.genericPuts;
with Terminal_Interface.Curses; use Terminal_Interface.Curses;
with Ada.Strings.Unbounded;
with Ada.Strings.Fixed;
procedure ncurses2.acs_display is
use Int_IO;
procedure show_upper_chars (first : Integer);
function show_1_acs (N : Integer;
name : String;
code : Attributed_Character)
return Integer;
procedure show_acs_chars;
procedure show_upper_chars (first : Integer) is
C1 : constant Boolean := (first = 128);
last : constant Integer := first + 31;
package p is new ncurses2.genericPuts (200);
use p;
use p.BS;
use Ada.Strings.Unbounded;
tmpa : Unbounded_String;
tmpb : BS.Bounded_String;
begin
Erase;
Switch_Character_Attribute
(Attr => (Bold_Character => True, others => False));
Move_Cursor (Line => 0, Column => 20);
tmpa := To_Unbounded_String ("Display of ");
if C1 then
tmpa := tmpa & "C1";
else
tmpa := tmpa & "GR";
end if;
tmpa := tmpa & " Character Codes ";
myPut (tmpb, first);
Append (tmpa, To_String (tmpb));
Append (tmpa, " to ");
myPut (tmpb, last);
Append (tmpa, To_String (tmpb));
Add (Str => To_String (tmpa));
Switch_Character_Attribute
(On => False,
Attr => (Bold_Character => True, others => False));
Refresh;
for code in first .. last loop
declare
row : constant Line_Position
:= Line_Position (4 + ((code - first) mod 16));
col : constant Column_Position
:= Column_Position (((code - first) / 16) *
Integer (Columns) / 2);
tmp3 : String (1 .. 3);
tmpx : String (1 .. Integer (Columns / 4));
reply : Key_Code;
begin
Put (tmp3, code);
myPut (tmpb, code, 16);
tmpa := To_Unbounded_String (tmp3 & " (" & To_String (tmpb) & ')');
Ada.Strings.Fixed.Move (To_String (tmpa), tmpx,
Justify => Ada.Strings.Right);
Add (Line => row, Column => col,
Str => tmpx & ' ' & ':' & ' ');
if C1 then
Set_NoDelay_Mode (Mode => True);
end if;
Add_With_Immediate_Echo (Ch => Code_To_Char (Key_Code (code)));
-- TODO check this
if C1 then
reply := Getchar;
while reply /= Key_None loop
Add (Ch => Code_To_Char (reply));
Nap_Milli_Seconds (10);
reply := Getchar;
end loop;
Set_NoDelay_Mode (Mode => False);
end if;
end;
end loop;
end show_upper_chars;
function show_1_acs (N : Integer;
name : String;
code : Attributed_Character)
return Integer is
height : constant Integer := 16;
row : constant Line_Position := Line_Position (4 + (N mod height));
col : constant Column_Position := Column_Position ((N / height) *
Integer (Columns) / 2);
tmpx : String (1 .. Integer (Columns) / 3);
begin
Ada.Strings.Fixed.Move (name, tmpx,
Justify => Ada.Strings.Right,
Drop => Ada.Strings.Left);
Add (Line => row, Column => col, Str => tmpx & ' ' & ':' & ' ');
-- we need more room than C because our identifiers are longer
-- 22 chars actually
Add (Ch => code);
return N + 1;
end show_1_acs;
procedure show_acs_chars is
n : Integer;
begin
Erase;
Switch_Character_Attribute
(Attr => (Bold_Character => True, others => False));
Add (Line => 0, Column => 20,
Str => "Display of the ACS Character Set");
Switch_Character_Attribute (On => False,
Attr => (Bold_Character => True,
others => False));
Refresh;
-- the following is useful to generate the below
-- grep '^[ ]*ACS_' ../src/terminal_interface-curses.ads |
-- awk '{print "n := show_1_acs(n, \""$1"\", ACS_Map("$1"));"}'
n := show_1_acs (0, "ACS_Upper_Left_Corner",
ACS_Map (ACS_Upper_Left_Corner));
n := show_1_acs (n, "ACS_Lower_Left_Corner",
ACS_Map (ACS_Lower_Left_Corner));
n := show_1_acs (n, "ACS_Upper_Right_Corner",
ACS_Map (ACS_Upper_Right_Corner));
n := show_1_acs (n, "ACS_Lower_Right_Corner",
ACS_Map (ACS_Lower_Right_Corner));
n := show_1_acs (n, "ACS_Left_Tee", ACS_Map (ACS_Left_Tee));
n := show_1_acs (n, "ACS_Right_Tee", ACS_Map (ACS_Right_Tee));
n := show_1_acs (n, "ACS_Bottom_Tee", ACS_Map (ACS_Bottom_Tee));
n := show_1_acs (n, "ACS_Top_Tee", ACS_Map (ACS_Top_Tee));
n := show_1_acs (n, "ACS_Horizontal_Line",
ACS_Map (ACS_Horizontal_Line));
n := show_1_acs (n, "ACS_Vertical_Line", ACS_Map (ACS_Vertical_Line));
n := show_1_acs (n, "ACS_Plus_Symbol", ACS_Map (ACS_Plus_Symbol));
n := show_1_acs (n, "ACS_Scan_Line_1", ACS_Map (ACS_Scan_Line_1));
n := show_1_acs (n, "ACS_Scan_Line_9", ACS_Map (ACS_Scan_Line_9));
n := show_1_acs (n, "ACS_Diamond", ACS_Map (ACS_Diamond));
n := show_1_acs (n, "ACS_Checker_Board", ACS_Map (ACS_Checker_Board));
n := show_1_acs (n, "ACS_Degree", ACS_Map (ACS_Degree));
n := show_1_acs (n, "ACS_Plus_Minus", ACS_Map (ACS_Plus_Minus));
n := show_1_acs (n, "ACS_Bullet", ACS_Map (ACS_Bullet));
n := show_1_acs (n, "ACS_Left_Arrow", ACS_Map (ACS_Left_Arrow));
n := show_1_acs (n, "ACS_Right_Arrow", ACS_Map (ACS_Right_Arrow));
n := show_1_acs (n, "ACS_Down_Arrow", ACS_Map (ACS_Down_Arrow));
n := show_1_acs (n, "ACS_Up_Arrow", ACS_Map (ACS_Up_Arrow));
n := show_1_acs (n, "ACS_Board_Of_Squares",
ACS_Map (ACS_Board_Of_Squares));
n := show_1_acs (n, "ACS_Lantern", ACS_Map (ACS_Lantern));
n := show_1_acs (n, "ACS_Solid_Block", ACS_Map (ACS_Solid_Block));
n := show_1_acs (n, "ACS_Scan_Line_3", ACS_Map (ACS_Scan_Line_3));
n := show_1_acs (n, "ACS_Scan_Line_7", ACS_Map (ACS_Scan_Line_7));
n := show_1_acs (n, "ACS_Less_Or_Equal", ACS_Map (ACS_Less_Or_Equal));
n := show_1_acs (n, "ACS_Greater_Or_Equal",
ACS_Map (ACS_Greater_Or_Equal));
n := show_1_acs (n, "ACS_PI", ACS_Map (ACS_PI));
n := show_1_acs (n, "ACS_Not_Equal", ACS_Map (ACS_Not_Equal));
n := show_1_acs (n, "ACS_Sterling", ACS_Map (ACS_Sterling));
if n = 0 then
raise Constraint_Error;
end if;
end show_acs_chars;
c1 : Key_Code;
c : Character := 'a';
begin
loop
case c is
when 'a' =>
show_acs_chars;
when '0' | '1' | '2' | '3' =>
show_upper_chars (ctoi (c) * 32 + 128);
when others =>
null;
end case;
Add (Line => Lines - 3, Column => 0,
Str => "Note: ANSI terminals may not display C1 characters.");
Add (Line => Lines - 2, Column => 0,
Str => "Select: a=ACS, 0=C1, 1,2,3=GR characters, q=quit");
Refresh;
c1 := Getchar;
c := Code_To_Char (c1);
exit when c = 'q' or c = 'x';
end loop;
Pause;
Erase;
End_Windows;
end ncurses2.acs_display;
| 45.455696 | 79 | 0.504224 |
39655b5e199f70eeb1967dcca2808259b0ab4395 | 7,318 | ads | Ada | src/keystore-marshallers.ads | thierr26/ada-keystore | 25099a9df3ce9b48a401148eb1b84442011759a0 | [
"Apache-2.0"
] | null | null | null | src/keystore-marshallers.ads | thierr26/ada-keystore | 25099a9df3ce9b48a401148eb1b84442011759a0 | [
"Apache-2.0"
] | null | null | null | src/keystore-marshallers.ads | thierr26/ada-keystore | 25099a9df3ce9b48a401148eb1b84442011759a0 | [
"Apache-2.0"
] | null | null | null | -----------------------------------------------------------------------
-- keystore-marshallers -- Data marshaller for the keystore
-- Copyright (C) 2019 Stephane Carrez
-- Written by Stephane Carrez ([email protected])
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-----------------------------------------------------------------------
with Ada.Streams;
with Ada.Calendar;
with Interfaces;
with Util.Encoders.AES;
with Keystore.Buffers;
private package Keystore.Marshallers is
use Ada.Streams;
BT_TYPE_HEADER_SIZE : constant := 16;
SIZE_U16 : constant := 2;
SIZE_U32 : constant := 4;
SIZE_U64 : constant := 8;
SIZE_DATE : constant := SIZE_U64;
SIZE_HMAC : constant := 32;
SIZE_KIND : constant := SIZE_U32;
SIZE_BLOCK : constant := SIZE_U32;
SIZE_SECRET : constant := 32;
SIZE_IV : constant := 16;
subtype Block_Count is Buffers.Block_Count;
subtype Block_Number is Buffers.Block_Number;
subtype Block_Index is Buffers.Block_Index;
subtype Buffer_Size is Buffers.Buffer_Size;
subtype Block_Type is Stream_Element_Array (Block_Index);
BT_HEADER_START : constant Block_Index := Block_Index'First;
BT_DATA_START : constant Block_Index := BT_HEADER_START + BT_TYPE_HEADER_SIZE;
type Marshaller is limited record
Buffer : Keystore.Buffers.Storage_Buffer;
Pos : Block_Index := Block_Type'First;
end record;
-- Set the block header with the tag and wallet identifier.
procedure Set_Header (Into : in out Marshaller;
Tag : in Interfaces.Unsigned_16;
Id : in Keystore.Wallet_Identifier) with
Post => Into.Pos = BT_DATA_START - 1;
procedure Set_Header (Into : in out Marshaller;
Value : in Interfaces.Unsigned_32) with
Pre => Into.Pos = Block_Type'First;
procedure Put_Unsigned_16 (Into : in out Marshaller;
Value : in Interfaces.Unsigned_16) with
Pre => Into.Pos <= Block_Type'Last - 2;
procedure Put_Unsigned_32 (Into : in out Marshaller;
Value : in Interfaces.Unsigned_32) with
Pre => Into.Pos <= Block_Type'Last - 4;
procedure Put_Unsigned_64 (Into : in out Marshaller;
Value : in Interfaces.Unsigned_64) with
Pre => Into.Pos <= Block_Type'Last - 8;
procedure Put_Kind (Into : in out Marshaller;
Value : in Entry_Type) with
Pre => Into.Pos <= Block_Type'Last - 2;
procedure Put_Block_Number (Into : in out Marshaller;
Value : in Block_Number) with
Pre => Into.Pos <= Block_Type'Last - 4;
procedure Put_Block_Index (Into : in out Marshaller;
Value : in Block_Index) with
Pre => Into.Pos <= Block_Type'Last - 2;
procedure Put_Buffer_Size (Into : in out Marshaller;
Value : in Buffer_Size) with
Pre => Into.Pos <= Block_Type'Last - 2;
procedure Put_String (Into : in out Marshaller;
Value : in String) with
Pre => Into.Pos <= Block_Type'Last - 4 - Value'Length;
procedure Put_Date (Into : in out Marshaller;
Value : in Ada.Calendar.Time) with
Pre => Into.Pos <= Block_Type'Last - 8;
procedure Put_Storage_Block (Into : in out Marshaller;
Value : in Buffers.Storage_Block) with
Pre => Into.Pos <= Block_Type'Last - 8;
procedure Put_Secret (Into : in out Marshaller;
Value : in Secret_Key;
Protect_Key : in Secret_Key;
Protect_IV : in Secret_Key) with
Pre => Into.Pos <= Block_Type'Last - Value.Length;
procedure Put_HMAC_SHA256 (Into : in out Marshaller;
Key : in Secret_Key;
Content : in Ada.Streams.Stream_Element_Array) with
Pre => Into.Pos <= Block_Type'Last - SIZE_HMAC;
procedure Put_UUID (Into : in out Marshaller;
Value : in UUID_Type) with
Pre => Into.Pos <= Block_Type'Last - 16;
function Get_Header (From : in out Marshaller) return Interfaces.Unsigned_32 with
Post => From.Pos = Block_Type'First + 3;
function Get_Header_16 (From : in out Marshaller) return Interfaces.Unsigned_16 with
Post => From.Pos = Block_Type'First + 1;
function Get_Unsigned_16 (From : in out Marshaller) return Interfaces.Unsigned_16 with
Pre => From.Pos <= Block_Type'Last - 2;
function Get_Unsigned_32 (From : in out Marshaller) return Interfaces.Unsigned_32 with
Pre => From.Pos <= Block_Type'Last - 4;
function Get_Unsigned_64 (From : in out Marshaller) return Interfaces.Unsigned_64 with
Pre => From.Pos <= Block_Type'Last - 8;
function Get_String (From : in out Marshaller;
Length : in Natural) return String with
Pre => Stream_Element_Offset (Length) < Block_Type'Last and
From.Pos <= Block_Type'Length - Stream_Element_Offset (Length);
function Get_Date (From : in out Marshaller) return Ada.Calendar.Time with
Pre => From.Pos <= Block_Type'Last - 8;
function Get_Kind (From : in out Marshaller) return Entry_Type with
Pre => From.Pos <= Block_Type'Last - 2;
function Get_Block_Number (From : in out Marshaller) return Block_Count is
(Block_Count (Get_Unsigned_32 (From)));
function Get_Storage_Block (From : in out Marshaller) return Buffers.Storage_Block with
Pre => From.Pos <= Block_Type'Last - 8;
function Get_Block_Index (From : in out Marshaller) return Block_Index is
(Block_Index (Get_Unsigned_16 (From)));
function Get_Buffer_Size (From : in out Marshaller) return Buffer_Size is
(Buffer_Size (Get_Unsigned_16 (From)));
procedure Get_Secret (From : in out Marshaller;
Secret : out Secret_Key;
Protect_Key : in Secret_Key;
Protect_IV : in Secret_Key);
procedure Get_UUID (From : in out Marshaller;
UUID : out UUID_Type) with
Pre => From.Pos <= Block_Type'Last - 16;
procedure Get_Data (From : in out Marshaller;
Size : in Ada.Streams.Stream_Element_Offset;
Data : out Ada.Streams.Stream_Element_Array;
Last : out Ada.Streams.Stream_Element_Offset) with
Pre => From.Pos <= Block_Type'Last - Size;
procedure Skip (From : in out Marshaller;
Count : in Block_Index) with
Pre => From.Pos <= Block_Type'Last - Count;
end Keystore.Marshallers;
| 41.344633 | 90 | 0.616289 |
3d7b6c0365a0583f77509a461e664ff0ca46aecf | 24,602 | adb | Ada | source/amf/uml/amf-internals-uml_create_link_actions.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/uml/amf-internals-uml_create_link_actions.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/uml/amf-internals-uml_create_link_actions.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2011-2012, Vadim Godunko <[email protected]> --
-- All rights reserved. --
-- --
-- Redistribution and use in source and binary forms, with or without --
-- modification, are permitted provided that the following conditions --
-- are met: --
-- --
-- * Redistributions of source code must retain the above copyright --
-- notice, this list of conditions and the following disclaimer. --
-- --
-- * Redistributions in binary form must reproduce the above copyright --
-- notice, this list of conditions and the following disclaimer in the --
-- documentation and/or other materials provided with the distribution. --
-- --
-- * Neither the name of the Vadim Godunko, IE nor the names of its --
-- contributors may be used to endorse or promote products derived from --
-- this software without specific prior written permission. --
-- --
-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --
-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --
-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --
-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --
-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED --
-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --
-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --
-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --
-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --
-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --
-- --
------------------------------------------------------------------------------
-- $Revision$ $Date$
------------------------------------------------------------------------------
with AMF.Elements;
with AMF.Internals.Element_Collections;
with AMF.Internals.Helpers;
with AMF.Internals.Tables.UML_Attributes;
with AMF.Visitors.UML_Iterators;
with AMF.Visitors.UML_Visitors;
with League.Strings.Internals;
with Matreshka.Internals.Strings;
package body AMF.Internals.UML_Create_Link_Actions is
-------------------
-- Enter_Element --
-------------------
overriding procedure Enter_Element
(Self : not null access constant UML_Create_Link_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Enter_Create_Link_Action
(AMF.UML.Create_Link_Actions.UML_Create_Link_Action_Access (Self),
Control);
end if;
end Enter_Element;
-------------------
-- Leave_Element --
-------------------
overriding procedure Leave_Element
(Self : not null access constant UML_Create_Link_Action_Proxy;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Visitor in AMF.Visitors.UML_Visitors.UML_Visitor'Class then
AMF.Visitors.UML_Visitors.UML_Visitor'Class
(Visitor).Leave_Create_Link_Action
(AMF.UML.Create_Link_Actions.UML_Create_Link_Action_Access (Self),
Control);
end if;
end Leave_Element;
-------------------
-- Visit_Element --
-------------------
overriding procedure Visit_Element
(Self : not null access constant UML_Create_Link_Action_Proxy;
Iterator : in out AMF.Visitors.Abstract_Iterator'Class;
Visitor : in out AMF.Visitors.Abstract_Visitor'Class;
Control : in out AMF.Visitors.Traverse_Control) is
begin
if Iterator in AMF.Visitors.UML_Iterators.UML_Iterator'Class then
AMF.Visitors.UML_Iterators.UML_Iterator'Class
(Iterator).Visit_Create_Link_Action
(Visitor,
AMF.UML.Create_Link_Actions.UML_Create_Link_Action_Access (Self),
Control);
end if;
end Visit_Element;
------------------
-- Get_End_Data --
------------------
overriding function Get_End_Data
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Link_End_Creation_Datas.Collections.Set_Of_UML_Link_End_Creation_Data is
begin
return
AMF.UML.Link_End_Creation_Datas.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_End_Data
(Self.Element)));
end Get_End_Data;
------------------
-- Get_End_Data --
------------------
overriding function Get_End_Data
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Link_End_Datas.Collections.Set_Of_UML_Link_End_Data is
begin
return
AMF.UML.Link_End_Datas.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_End_Data
(Self.Element)));
end Get_End_Data;
---------------------
-- Get_Input_Value --
---------------------
overriding function Get_Input_Value
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Input_Pins.Collections.Set_Of_UML_Input_Pin is
begin
return
AMF.UML.Input_Pins.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Input_Value
(Self.Element)));
end Get_Input_Value;
-----------------
-- Get_Context --
-----------------
overriding function Get_Context
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access is
begin
return
AMF.UML.Classifiers.UML_Classifier_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Context
(Self.Element)));
end Get_Context;
---------------
-- Get_Input --
---------------
overriding function Get_Input
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Input_Pins.Collections.Ordered_Set_Of_UML_Input_Pin is
begin
return
AMF.UML.Input_Pins.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Input
(Self.Element)));
end Get_Input;
------------------------------
-- Get_Is_Locally_Reentrant --
------------------------------
overriding function Get_Is_Locally_Reentrant
(Self : not null access constant UML_Create_Link_Action_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Locally_Reentrant
(Self.Element);
end Get_Is_Locally_Reentrant;
------------------------------
-- Set_Is_Locally_Reentrant --
------------------------------
overriding procedure Set_Is_Locally_Reentrant
(Self : not null access UML_Create_Link_Action_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Locally_Reentrant
(Self.Element, To);
end Set_Is_Locally_Reentrant;
-----------------------------
-- Get_Local_Postcondition --
-----------------------------
overriding function Get_Local_Postcondition
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
begin
return
AMF.UML.Constraints.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Postcondition
(Self.Element)));
end Get_Local_Postcondition;
----------------------------
-- Get_Local_Precondition --
----------------------------
overriding function Get_Local_Precondition
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Constraints.Collections.Set_Of_UML_Constraint is
begin
return
AMF.UML.Constraints.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Local_Precondition
(Self.Element)));
end Get_Local_Precondition;
----------------
-- Get_Output --
----------------
overriding function Get_Output
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Output_Pins.Collections.Ordered_Set_Of_UML_Output_Pin is
begin
return
AMF.UML.Output_Pins.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Output
(Self.Element)));
end Get_Output;
-----------------
-- Get_Handler --
-----------------
overriding function Get_Handler
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Exception_Handlers.Collections.Set_Of_UML_Exception_Handler is
begin
return
AMF.UML.Exception_Handlers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Handler
(Self.Element)));
end Get_Handler;
------------------
-- Get_Activity --
------------------
overriding function Get_Activity
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Activities.UML_Activity_Access is
begin
return
AMF.UML.Activities.UML_Activity_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Activity
(Self.Element)));
end Get_Activity;
------------------
-- Set_Activity --
------------------
overriding procedure Set_Activity
(Self : not null access UML_Create_Link_Action_Proxy;
To : AMF.UML.Activities.UML_Activity_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Activity
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Activity;
------------------
-- Get_In_Group --
------------------
overriding function Get_In_Group
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Activity_Groups.Collections.Set_Of_UML_Activity_Group is
begin
return
AMF.UML.Activity_Groups.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Group
(Self.Element)));
end Get_In_Group;
---------------------------------
-- Get_In_Interruptible_Region --
---------------------------------
overriding function Get_In_Interruptible_Region
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Interruptible_Activity_Regions.Collections.Set_Of_UML_Interruptible_Activity_Region is
begin
return
AMF.UML.Interruptible_Activity_Regions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Interruptible_Region
(Self.Element)));
end Get_In_Interruptible_Region;
----------------------
-- Get_In_Partition --
----------------------
overriding function Get_In_Partition
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Activity_Partitions.Collections.Set_Of_UML_Activity_Partition is
begin
return
AMF.UML.Activity_Partitions.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Partition
(Self.Element)));
end Get_In_Partition;
----------------------------
-- Get_In_Structured_Node --
----------------------------
overriding function Get_In_Structured_Node
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access is
begin
return
AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_In_Structured_Node
(Self.Element)));
end Get_In_Structured_Node;
----------------------------
-- Set_In_Structured_Node --
----------------------------
overriding procedure Set_In_Structured_Node
(Self : not null access UML_Create_Link_Action_Proxy;
To : AMF.UML.Structured_Activity_Nodes.UML_Structured_Activity_Node_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_In_Structured_Node
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_In_Structured_Node;
------------------
-- Get_Incoming --
------------------
overriding function Get_Incoming
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge is
begin
return
AMF.UML.Activity_Edges.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Incoming
(Self.Element)));
end Get_Incoming;
------------------
-- Get_Outgoing --
------------------
overriding function Get_Outgoing
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Activity_Edges.Collections.Set_Of_UML_Activity_Edge is
begin
return
AMF.UML.Activity_Edges.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Outgoing
(Self.Element)));
end Get_Outgoing;
------------------------
-- Get_Redefined_Node --
------------------------
overriding function Get_Redefined_Node
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Activity_Nodes.Collections.Set_Of_UML_Activity_Node is
begin
return
AMF.UML.Activity_Nodes.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Node
(Self.Element)));
end Get_Redefined_Node;
-----------------
-- Get_Is_Leaf --
-----------------
overriding function Get_Is_Leaf
(Self : not null access constant UML_Create_Link_Action_Proxy)
return Boolean is
begin
return
AMF.Internals.Tables.UML_Attributes.Internal_Get_Is_Leaf
(Self.Element);
end Get_Is_Leaf;
-----------------
-- Set_Is_Leaf --
-----------------
overriding procedure Set_Is_Leaf
(Self : not null access UML_Create_Link_Action_Proxy;
To : Boolean) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Is_Leaf
(Self.Element, To);
end Set_Is_Leaf;
---------------------------
-- Get_Redefined_Element --
---------------------------
overriding function Get_Redefined_Element
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Redefinable_Elements.Collections.Set_Of_UML_Redefinable_Element is
begin
return
AMF.UML.Redefinable_Elements.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefined_Element
(Self.Element)));
end Get_Redefined_Element;
------------------------------
-- Get_Redefinition_Context --
------------------------------
overriding function Get_Redefinition_Context
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Classifiers.Collections.Set_Of_UML_Classifier is
begin
return
AMF.UML.Classifiers.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Redefinition_Context
(Self.Element)));
end Get_Redefinition_Context;
---------------------------
-- Get_Client_Dependency --
---------------------------
overriding function Get_Client_Dependency
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency is
begin
return
AMF.UML.Dependencies.Collections.Wrap
(AMF.Internals.Element_Collections.Wrap
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Client_Dependency
(Self.Element)));
end Get_Client_Dependency;
-------------------------
-- Get_Name_Expression --
-------------------------
overriding function Get_Name_Expression
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.String_Expressions.UML_String_Expression_Access is
begin
return
AMF.UML.String_Expressions.UML_String_Expression_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Name_Expression
(Self.Element)));
end Get_Name_Expression;
-------------------------
-- Set_Name_Expression --
-------------------------
overriding procedure Set_Name_Expression
(Self : not null access UML_Create_Link_Action_Proxy;
To : AMF.UML.String_Expressions.UML_String_Expression_Access) is
begin
AMF.Internals.Tables.UML_Attributes.Internal_Set_Name_Expression
(Self.Element,
AMF.Internals.Helpers.To_Element
(AMF.Elements.Element_Access (To)));
end Set_Name_Expression;
-------------------
-- Get_Namespace --
-------------------
overriding function Get_Namespace
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
return
AMF.UML.Namespaces.UML_Namespace_Access
(AMF.Internals.Helpers.To_Element
(AMF.Internals.Tables.UML_Attributes.Internal_Get_Namespace
(Self.Element)));
end Get_Namespace;
------------------------
-- Get_Qualified_Name --
------------------------
overriding function Get_Qualified_Name
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.Optional_String is
begin
declare
use type Matreshka.Internals.Strings.Shared_String_Access;
Aux : constant Matreshka.Internals.Strings.Shared_String_Access
:= AMF.Internals.Tables.UML_Attributes.Internal_Get_Qualified_Name (Self.Element);
begin
if Aux = null then
return (Is_Empty => True);
else
return (False, League.Strings.Internals.Create (Aux));
end if;
end;
end Get_Qualified_Name;
-----------------
-- Association --
-----------------
overriding function Association
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Associations.UML_Association_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Association unimplemented");
raise Program_Error with "Unimplemented procedure UML_Create_Link_Action_Proxy.Association";
return Association (Self);
end Association;
-------------
-- Context --
-------------
overriding function Context
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Classifiers.UML_Classifier_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Context unimplemented");
raise Program_Error with "Unimplemented procedure UML_Create_Link_Action_Proxy.Context";
return Context (Self);
end Context;
------------------------
-- Is_Consistent_With --
------------------------
overriding function Is_Consistent_With
(Self : not null access constant UML_Create_Link_Action_Proxy;
Redefinee : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Consistent_With unimplemented");
raise Program_Error with "Unimplemented procedure UML_Create_Link_Action_Proxy.Is_Consistent_With";
return Is_Consistent_With (Self, Redefinee);
end Is_Consistent_With;
-----------------------------------
-- Is_Redefinition_Context_Valid --
-----------------------------------
overriding function Is_Redefinition_Context_Valid
(Self : not null access constant UML_Create_Link_Action_Proxy;
Redefined : AMF.UML.Redefinable_Elements.UML_Redefinable_Element_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Redefinition_Context_Valid unimplemented");
raise Program_Error with "Unimplemented procedure UML_Create_Link_Action_Proxy.Is_Redefinition_Context_Valid";
return Is_Redefinition_Context_Valid (Self, Redefined);
end Is_Redefinition_Context_Valid;
-------------------------
-- All_Owning_Packages --
-------------------------
overriding function All_Owning_Packages
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Packages.Collections.Set_Of_UML_Package is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "All_Owning_Packages unimplemented");
raise Program_Error with "Unimplemented procedure UML_Create_Link_Action_Proxy.All_Owning_Packages";
return All_Owning_Packages (Self);
end All_Owning_Packages;
-----------------------------
-- Is_Distinguishable_From --
-----------------------------
overriding function Is_Distinguishable_From
(Self : not null access constant UML_Create_Link_Action_Proxy;
N : AMF.UML.Named_Elements.UML_Named_Element_Access;
Ns : AMF.UML.Namespaces.UML_Namespace_Access)
return Boolean is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Is_Distinguishable_From unimplemented");
raise Program_Error with "Unimplemented procedure UML_Create_Link_Action_Proxy.Is_Distinguishable_From";
return Is_Distinguishable_From (Self, N, Ns);
end Is_Distinguishable_From;
---------------
-- Namespace --
---------------
overriding function Namespace
(Self : not null access constant UML_Create_Link_Action_Proxy)
return AMF.UML.Namespaces.UML_Namespace_Access is
begin
-- Generated stub: replace with real body!
pragma Compile_Time_Warning (Standard.True, "Namespace unimplemented");
raise Program_Error with "Unimplemented procedure UML_Create_Link_Action_Proxy.Namespace";
return Namespace (Self);
end Namespace;
end AMF.Internals.UML_Create_Link_Actions;
| 37.445967 | 116 | 0.623527 |
3d9080cae97c54330346d4c156e6a9cfb9356fbf | 171 | adb | Ada | Ada/finalize/tester.adb | egustafson/sandbox | 9804e966347b33558b0497a04edb1a591d2d7773 | [
"Apache-2.0"
] | 2 | 2019-09-27T21:25:26.000Z | 2019-12-29T11:26:54.000Z | Ada/finalize/tester.adb | egustafson/sandbox | 9804e966347b33558b0497a04edb1a591d2d7773 | [
"Apache-2.0"
] | 7 | 2020-08-11T17:32:14.000Z | 2020-08-11T17:32:39.000Z | Ada/finalize/tester.adb | egustafson/sandbox | 9804e966347b33558b0497a04edb1a591d2d7773 | [
"Apache-2.0"
] | 2 | 2016-07-18T10:55:50.000Z | 2020-08-19T01:46:08.000Z | with Obj; use Obj;
procedure Tester is
A, B, C : Obj_T;
begin
A := New_Obj( 1 );
B := New_Obj( 2 );
C := New_Obj( 3 );
A := C;
end Tester;
| 10.058824 | 27 | 0.473684 |
41fb04277f6b80a55f99123efa7e24a686ec43cb | 1,052 | adb | Ada | .emacs.d/elpa/wisi-3.1.3/sal-gen_trimmed_image.adb | caqg/linux-home | eed631aae6f5e59e4f46e14f1dff443abca5fa28 | [
"Linux-OpenIB"
] | null | null | null | .emacs.d/elpa/wisi-3.1.3/sal-gen_trimmed_image.adb | caqg/linux-home | eed631aae6f5e59e4f46e14f1dff443abca5fa28 | [
"Linux-OpenIB"
] | null | null | null | .emacs.d/elpa/wisi-3.1.3/sal-gen_trimmed_image.adb | caqg/linux-home | eed631aae6f5e59e4f46e14f1dff443abca5fa28 | [
"Linux-OpenIB"
] | null | null | null | -- Abstract :
--
-- See spec.
--
-- Copyright (C) 2018 Stephen Leake All Rights Reserved.
--
-- This library is free software; you can redistribute it and/or modify it
-- under terms of the GNU General Public License as published by the Free
-- Software Foundation; either version 3, or (at your option) any later
-- version. This library is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
-- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-- As a special exception under Section 7 of GPL version 3, you are granted
-- additional permissions described in the GCC Runtime Library Exception,
-- version 3.1, as published by the Free Software Foundation.
pragma License (Modified_GPL);
with Ada.Strings;
with Ada.Strings.Fixed;
function SAL.Gen_Trimmed_Image (Item : in Element_Type) return String
is
use Ada.Strings;
use Ada.Strings.Fixed;
begin
return Trim (Element_Type'Image (Item), Both);
end SAL.Gen_Trimmed_Image;
| 36.275862 | 77 | 0.723384 |
3d29c487217243aa4231d730108677af7b0a0df3 | 1,017 | ads | Ada | 3-mid/opengl/source/lean/geometry/lit_colored_textured/opengl-geometry-lit_colored_textured.ads | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 20 | 2015-11-04T09:23:59.000Z | 2022-01-14T10:21:42.000Z | 3-mid/opengl/source/lean/geometry/lit_colored_textured/opengl-geometry-lit_colored_textured.ads | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 2 | 2015-11-04T17:05:56.000Z | 2015-12-08T03:16:13.000Z | 3-mid/opengl/source/lean/geometry/lit_colored_textured/opengl-geometry-lit_colored_textured.ads | charlie5/lace | e9b7dc751d500ff3f559617a6fc3089ace9dc134 | [
"0BSD"
] | 1 | 2015-12-07T12:53:52.000Z | 2015-12-07T12:53:52.000Z | package openGL.Geometry.lit_colored_textured
--
-- Supports per-vertex site color, texture and lighting.
--
is
type Item is new openGL.Geometry.item with private;
function new_Geometry (texture_is_Alpha : in Boolean) return access Geometry.lit_colored_textured.item'Class;
----------
-- Vertex
--
type Vertex is
record
Site : Vector_3;
Normal : Vector_3;
Color : lucid_Color;
Coords : Coordinate_2D;
end record;
type Vertex_array is array (Index_t range <>) of aliased Vertex;
--------------
-- Attributes
--
procedure Vertices_are (Self : in out Item; Now : in Vertex_array);
overriding
procedure Indices_are (Self : in out Item; Now : in Indices;
for_Facia : in Positive);
private
type Item is new Geometry.item with null record;
overriding
procedure enable_Texture (Self : in Item);
end openGL.Geometry.lit_colored_textured;
| 22.108696 | 112 | 0.617502 |
06cffc589a6e3304be2ce9149720e731db85da0b | 4,695 | ads | Ada | gcc-gcc-7_3_0-release/gcc/ada/a-stunau.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/a-stunau.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/a-stunau.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . S T R I N G S . U N B O U N D E D . A U X --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2011, 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 child package of Ada.Strings.Unbounded provides some specialized
-- access functions which are intended to allow more efficient use of the
-- facilities of Ada.Strings.Unbounded, particularly by other layered
-- utilities (such as GNAT.SPITBOL.Patterns).
package Ada.Strings.Unbounded.Aux is
pragma Preelaborate;
subtype Big_String is String (1 .. Positive'Last);
pragma Suppress_Initialization (Big_String);
-- Type used to obtain string access to given address. Initialization is
-- suppressed, since we never want to have variables of this type, and
-- we never want to attempt initialiazation of virtual variables of this
-- type (e.g. when pragma Normalize_Scalars is used).
type Big_String_Access is access all Big_String;
for Big_String_Access'Storage_Size use 0;
-- We use this access type to pass a pointer to an area of storage to be
-- accessed as a string. Of course when this pointer is used, it is the
-- responsibility of the accessor to ensure proper bounds. The storage
-- size clause ensures we do not allocate variables of this type.
procedure Get_String
(U : Unbounded_String;
S : out Big_String_Access;
L : out Natural);
pragma Inline (Get_String);
-- This procedure returns the internal string pointer used in the
-- representation of an unbounded string as well as the actual current
-- length (which may be less than S.all'Length because in general there
-- can be extra space assigned). The characters of this string may be
-- not be modified via the returned pointer, and are valid only as
-- long as the original unbounded string is not accessed or modified.
--
-- This procedure is much more efficient than the use of To_String
-- since it avoids the need to copy the string. The lower bound of the
-- referenced string returned by this call is always one, so the actual
-- string data is always accessible as S (1 .. L).
procedure Set_String (UP : in out Unbounded_String; S : String_Access);
pragma Inline (Set_String);
-- This version of Set_Unbounded_String takes a string access value, rather
-- than a string. The lower bound of the string value is required to be
-- one, and this requirement is not checked.
end Ada.Strings.Unbounded.Aux;
| 60.192308 | 79 | 0.54803 |
2fb66a194d63744d49195182ae661b4da764eca1 | 36,524 | ads | Ada | bb-runtimes/arm/nordic/nrf52/nrf52840/svd/i-nrf52-clock.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/arm/nordic/nrf52/nrf52840/svd/i-nrf52-clock.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/arm/nordic/nrf52/nrf52840/svd/i-nrf52-clock.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | --
-- Copyright (C) 2019, AdaCore
--
-- Copyright (c) 2010 - 2018, 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:
--
-- 1. Redistributions of source code must retain the above copyright notice,
-- this list of conditions and the following disclaimer.
--
-- 2. Redistributions in binary form, except as embedded into a Nordic
-- Semiconductor ASA integrated circuit in a product or a software update
-- for such product, 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 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.
--
-- 4. This software, with or without modification, must only be used with a
-- Nordic Semiconductor ASA integrated circuit.
--
-- 5. Any software provided in binary form under this license must not be
-- reverse engineered, decompiled, modified and/or disassembled.
--
-- THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY
-- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-- WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A
-- PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR
-- ASA 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 nrf52840.svd
pragma Ada_2012;
pragma Style_Checks (Off);
with System;
package Interfaces.NRF52.CLOCK is
pragma Preelaborate;
pragma No_Elaboration_Code_All;
---------------
-- Registers --
---------------
subtype TASKS_HFCLKSTART_TASKS_HFCLKSTART_Field is Interfaces.NRF52.Bit;
-- Start HFXO crystal oscillator
type TASKS_HFCLKSTART_Register is record
-- Write-only.
TASKS_HFCLKSTART : TASKS_HFCLKSTART_TASKS_HFCLKSTART_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TASKS_HFCLKSTART_Register use record
TASKS_HFCLKSTART at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype TASKS_HFCLKSTOP_TASKS_HFCLKSTOP_Field is Interfaces.NRF52.Bit;
-- Stop HFXO crystal oscillator
type TASKS_HFCLKSTOP_Register is record
-- Write-only.
TASKS_HFCLKSTOP : TASKS_HFCLKSTOP_TASKS_HFCLKSTOP_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TASKS_HFCLKSTOP_Register use record
TASKS_HFCLKSTOP at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype TASKS_LFCLKSTART_TASKS_LFCLKSTART_Field is Interfaces.NRF52.Bit;
-- Start LFCLK
type TASKS_LFCLKSTART_Register is record
-- Write-only.
TASKS_LFCLKSTART : TASKS_LFCLKSTART_TASKS_LFCLKSTART_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TASKS_LFCLKSTART_Register use record
TASKS_LFCLKSTART at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype TASKS_LFCLKSTOP_TASKS_LFCLKSTOP_Field is Interfaces.NRF52.Bit;
-- Stop LFCLK
type TASKS_LFCLKSTOP_Register is record
-- Write-only.
TASKS_LFCLKSTOP : TASKS_LFCLKSTOP_TASKS_LFCLKSTOP_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TASKS_LFCLKSTOP_Register use record
TASKS_LFCLKSTOP at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype TASKS_CAL_TASKS_CAL_Field is Interfaces.NRF52.Bit;
-- Start calibration of LFRC
type TASKS_CAL_Register is record
-- Write-only.
TASKS_CAL : TASKS_CAL_TASKS_CAL_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TASKS_CAL_Register use record
TASKS_CAL at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype TASKS_CTSTART_TASKS_CTSTART_Field is Interfaces.NRF52.Bit;
-- Start calibration timer
type TASKS_CTSTART_Register is record
-- Write-only.
TASKS_CTSTART : TASKS_CTSTART_TASKS_CTSTART_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TASKS_CTSTART_Register use record
TASKS_CTSTART at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype TASKS_CTSTOP_TASKS_CTSTOP_Field is Interfaces.NRF52.Bit;
-- Stop calibration timer
type TASKS_CTSTOP_Register is record
-- Write-only.
TASKS_CTSTOP : TASKS_CTSTOP_TASKS_CTSTOP_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TASKS_CTSTOP_Register use record
TASKS_CTSTOP at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype EVENTS_HFCLKSTARTED_EVENTS_HFCLKSTARTED_Field is
Interfaces.NRF52.Bit;
-- HFXO crystal oscillator started
type EVENTS_HFCLKSTARTED_Register is record
EVENTS_HFCLKSTARTED : EVENTS_HFCLKSTARTED_EVENTS_HFCLKSTARTED_Field :=
16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EVENTS_HFCLKSTARTED_Register use record
EVENTS_HFCLKSTARTED at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype EVENTS_LFCLKSTARTED_EVENTS_LFCLKSTARTED_Field is
Interfaces.NRF52.Bit;
-- LFCLK started
type EVENTS_LFCLKSTARTED_Register is record
EVENTS_LFCLKSTARTED : EVENTS_LFCLKSTARTED_EVENTS_LFCLKSTARTED_Field :=
16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EVENTS_LFCLKSTARTED_Register use record
EVENTS_LFCLKSTARTED at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype EVENTS_DONE_EVENTS_DONE_Field is Interfaces.NRF52.Bit;
-- Calibration of LFRC completed
type EVENTS_DONE_Register is record
EVENTS_DONE : EVENTS_DONE_EVENTS_DONE_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EVENTS_DONE_Register use record
EVENTS_DONE at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype EVENTS_CTTO_EVENTS_CTTO_Field is Interfaces.NRF52.Bit;
-- Calibration timer timeout
type EVENTS_CTTO_Register is record
EVENTS_CTTO : EVENTS_CTTO_EVENTS_CTTO_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EVENTS_CTTO_Register use record
EVENTS_CTTO at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype EVENTS_CTSTARTED_EVENTS_CTSTARTED_Field is Interfaces.NRF52.Bit;
-- Calibration timer has been started and is ready to process new tasks
type EVENTS_CTSTARTED_Register is record
EVENTS_CTSTARTED : EVENTS_CTSTARTED_EVENTS_CTSTARTED_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EVENTS_CTSTARTED_Register use record
EVENTS_CTSTARTED at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
subtype EVENTS_CTSTOPPED_EVENTS_CTSTOPPED_Field is Interfaces.NRF52.Bit;
-- Calibration timer has been stopped and is ready to process new tasks
type EVENTS_CTSTOPPED_Register is record
EVENTS_CTSTOPPED : EVENTS_CTSTOPPED_EVENTS_CTSTOPPED_Field := 16#0#;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for EVENTS_CTSTOPPED_Register use record
EVENTS_CTSTOPPED at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-- Write '1' to enable interrupt for HFCLKSTARTED event
type INTENSET_HFCLKSTARTED_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENSET_HFCLKSTARTED_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to enable interrupt for HFCLKSTARTED event
type INTENSET_HFCLKSTARTED_Field_1 is
(-- Reset value for the field
Intenset_Hfclkstarted_Field_Reset,
-- Enable
Set)
with Size => 1;
for INTENSET_HFCLKSTARTED_Field_1 use
(Intenset_Hfclkstarted_Field_Reset => 0,
Set => 1);
-- Write '1' to enable interrupt for LFCLKSTARTED event
type INTENSET_LFCLKSTARTED_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENSET_LFCLKSTARTED_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to enable interrupt for LFCLKSTARTED event
type INTENSET_LFCLKSTARTED_Field_1 is
(-- Reset value for the field
Intenset_Lfclkstarted_Field_Reset,
-- Enable
Set)
with Size => 1;
for INTENSET_LFCLKSTARTED_Field_1 use
(Intenset_Lfclkstarted_Field_Reset => 0,
Set => 1);
-- Write '1' to enable interrupt for DONE event
type INTENSET_DONE_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENSET_DONE_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to enable interrupt for DONE event
type INTENSET_DONE_Field_1 is
(-- Reset value for the field
Intenset_Done_Field_Reset,
-- Enable
Set)
with Size => 1;
for INTENSET_DONE_Field_1 use
(Intenset_Done_Field_Reset => 0,
Set => 1);
-- Write '1' to enable interrupt for CTTO event
type INTENSET_CTTO_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENSET_CTTO_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to enable interrupt for CTTO event
type INTENSET_CTTO_Field_1 is
(-- Reset value for the field
Intenset_Ctto_Field_Reset,
-- Enable
Set)
with Size => 1;
for INTENSET_CTTO_Field_1 use
(Intenset_Ctto_Field_Reset => 0,
Set => 1);
-- Write '1' to enable interrupt for CTSTARTED event
type INTENSET_CTSTARTED_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENSET_CTSTARTED_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to enable interrupt for CTSTARTED event
type INTENSET_CTSTARTED_Field_1 is
(-- Reset value for the field
Intenset_Ctstarted_Field_Reset,
-- Enable
Set)
with Size => 1;
for INTENSET_CTSTARTED_Field_1 use
(Intenset_Ctstarted_Field_Reset => 0,
Set => 1);
-- Write '1' to enable interrupt for CTSTOPPED event
type INTENSET_CTSTOPPED_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENSET_CTSTOPPED_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to enable interrupt for CTSTOPPED event
type INTENSET_CTSTOPPED_Field_1 is
(-- Reset value for the field
Intenset_Ctstopped_Field_Reset,
-- Enable
Set)
with Size => 1;
for INTENSET_CTSTOPPED_Field_1 use
(Intenset_Ctstopped_Field_Reset => 0,
Set => 1);
-- Enable interrupt
type INTENSET_Register is record
-- Write '1' to enable interrupt for HFCLKSTARTED event
HFCLKSTARTED : INTENSET_HFCLKSTARTED_Field_1 :=
Intenset_Hfclkstarted_Field_Reset;
-- Write '1' to enable interrupt for LFCLKSTARTED event
LFCLKSTARTED : INTENSET_LFCLKSTARTED_Field_1 :=
Intenset_Lfclkstarted_Field_Reset;
-- unspecified
Reserved_2_2 : Interfaces.NRF52.Bit := 16#0#;
-- Write '1' to enable interrupt for DONE event
DONE : INTENSET_DONE_Field_1 := Intenset_Done_Field_Reset;
-- Write '1' to enable interrupt for CTTO event
CTTO : INTENSET_CTTO_Field_1 := Intenset_Ctto_Field_Reset;
-- unspecified
Reserved_5_9 : Interfaces.NRF52.UInt5 := 16#0#;
-- Write '1' to enable interrupt for CTSTARTED event
CTSTARTED : INTENSET_CTSTARTED_Field_1 :=
Intenset_Ctstarted_Field_Reset;
-- Write '1' to enable interrupt for CTSTOPPED event
CTSTOPPED : INTENSET_CTSTOPPED_Field_1 :=
Intenset_Ctstopped_Field_Reset;
-- unspecified
Reserved_12_31 : Interfaces.NRF52.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for INTENSET_Register use record
HFCLKSTARTED at 0 range 0 .. 0;
LFCLKSTARTED at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
DONE at 0 range 3 .. 3;
CTTO at 0 range 4 .. 4;
Reserved_5_9 at 0 range 5 .. 9;
CTSTARTED at 0 range 10 .. 10;
CTSTOPPED at 0 range 11 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-- Write '1' to disable interrupt for HFCLKSTARTED event
type INTENCLR_HFCLKSTARTED_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENCLR_HFCLKSTARTED_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to disable interrupt for HFCLKSTARTED event
type INTENCLR_HFCLKSTARTED_Field_1 is
(-- Reset value for the field
Intenclr_Hfclkstarted_Field_Reset,
-- Disable
Clear)
with Size => 1;
for INTENCLR_HFCLKSTARTED_Field_1 use
(Intenclr_Hfclkstarted_Field_Reset => 0,
Clear => 1);
-- Write '1' to disable interrupt for LFCLKSTARTED event
type INTENCLR_LFCLKSTARTED_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENCLR_LFCLKSTARTED_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to disable interrupt for LFCLKSTARTED event
type INTENCLR_LFCLKSTARTED_Field_1 is
(-- Reset value for the field
Intenclr_Lfclkstarted_Field_Reset,
-- Disable
Clear)
with Size => 1;
for INTENCLR_LFCLKSTARTED_Field_1 use
(Intenclr_Lfclkstarted_Field_Reset => 0,
Clear => 1);
-- Write '1' to disable interrupt for DONE event
type INTENCLR_DONE_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENCLR_DONE_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to disable interrupt for DONE event
type INTENCLR_DONE_Field_1 is
(-- Reset value for the field
Intenclr_Done_Field_Reset,
-- Disable
Clear)
with Size => 1;
for INTENCLR_DONE_Field_1 use
(Intenclr_Done_Field_Reset => 0,
Clear => 1);
-- Write '1' to disable interrupt for CTTO event
type INTENCLR_CTTO_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENCLR_CTTO_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to disable interrupt for CTTO event
type INTENCLR_CTTO_Field_1 is
(-- Reset value for the field
Intenclr_Ctto_Field_Reset,
-- Disable
Clear)
with Size => 1;
for INTENCLR_CTTO_Field_1 use
(Intenclr_Ctto_Field_Reset => 0,
Clear => 1);
-- Write '1' to disable interrupt for CTSTARTED event
type INTENCLR_CTSTARTED_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENCLR_CTSTARTED_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to disable interrupt for CTSTARTED event
type INTENCLR_CTSTARTED_Field_1 is
(-- Reset value for the field
Intenclr_Ctstarted_Field_Reset,
-- Disable
Clear)
with Size => 1;
for INTENCLR_CTSTARTED_Field_1 use
(Intenclr_Ctstarted_Field_Reset => 0,
Clear => 1);
-- Write '1' to disable interrupt for CTSTOPPED event
type INTENCLR_CTSTOPPED_Field is
(-- Read: Disabled
Disabled,
-- Read: Enabled
Enabled)
with Size => 1;
for INTENCLR_CTSTOPPED_Field use
(Disabled => 0,
Enabled => 1);
-- Write '1' to disable interrupt for CTSTOPPED event
type INTENCLR_CTSTOPPED_Field_1 is
(-- Reset value for the field
Intenclr_Ctstopped_Field_Reset,
-- Disable
Clear)
with Size => 1;
for INTENCLR_CTSTOPPED_Field_1 use
(Intenclr_Ctstopped_Field_Reset => 0,
Clear => 1);
-- Disable interrupt
type INTENCLR_Register is record
-- Write '1' to disable interrupt for HFCLKSTARTED event
HFCLKSTARTED : INTENCLR_HFCLKSTARTED_Field_1 :=
Intenclr_Hfclkstarted_Field_Reset;
-- Write '1' to disable interrupt for LFCLKSTARTED event
LFCLKSTARTED : INTENCLR_LFCLKSTARTED_Field_1 :=
Intenclr_Lfclkstarted_Field_Reset;
-- unspecified
Reserved_2_2 : Interfaces.NRF52.Bit := 16#0#;
-- Write '1' to disable interrupt for DONE event
DONE : INTENCLR_DONE_Field_1 := Intenclr_Done_Field_Reset;
-- Write '1' to disable interrupt for CTTO event
CTTO : INTENCLR_CTTO_Field_1 := Intenclr_Ctto_Field_Reset;
-- unspecified
Reserved_5_9 : Interfaces.NRF52.UInt5 := 16#0#;
-- Write '1' to disable interrupt for CTSTARTED event
CTSTARTED : INTENCLR_CTSTARTED_Field_1 :=
Intenclr_Ctstarted_Field_Reset;
-- Write '1' to disable interrupt for CTSTOPPED event
CTSTOPPED : INTENCLR_CTSTOPPED_Field_1 :=
Intenclr_Ctstopped_Field_Reset;
-- unspecified
Reserved_12_31 : Interfaces.NRF52.UInt20 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for INTENCLR_Register use record
HFCLKSTARTED at 0 range 0 .. 0;
LFCLKSTARTED at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
DONE at 0 range 3 .. 3;
CTTO at 0 range 4 .. 4;
Reserved_5_9 at 0 range 5 .. 9;
CTSTARTED at 0 range 10 .. 10;
CTSTOPPED at 0 range 11 .. 11;
Reserved_12_31 at 0 range 12 .. 31;
end record;
-- HFCLKSTART task triggered or not
type HFCLKRUN_STATUS_Field is
(-- Task not triggered
Nottriggered,
-- Task triggered
Triggered)
with Size => 1;
for HFCLKRUN_STATUS_Field use
(Nottriggered => 0,
Triggered => 1);
-- Status indicating that HFCLKSTART task has been triggered
type HFCLKRUN_Register is record
-- Read-only. HFCLKSTART task triggered or not
STATUS : HFCLKRUN_STATUS_Field;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for HFCLKRUN_Register use record
STATUS at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-- Source of HFCLK
type HFCLKSTAT_SRC_Field is
(-- 64 MHz internal oscillator (HFINT)
Rc,
-- 64 MHz crystal oscillator (HFXO)
Xtal)
with Size => 1;
for HFCLKSTAT_SRC_Field use
(Rc => 0,
Xtal => 1);
-- HFCLK state
type HFCLKSTAT_STATE_Field is
(-- HFCLK not running
Notrunning,
-- HFCLK running
Running)
with Size => 1;
for HFCLKSTAT_STATE_Field use
(Notrunning => 0,
Running => 1);
-- HFCLK status
type HFCLKSTAT_Register is record
-- Read-only. Source of HFCLK
SRC : HFCLKSTAT_SRC_Field;
-- unspecified
Reserved_1_15 : Interfaces.NRF52.UInt15;
-- Read-only. HFCLK state
STATE : HFCLKSTAT_STATE_Field;
-- unspecified
Reserved_17_31 : Interfaces.NRF52.UInt15;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for HFCLKSTAT_Register use record
SRC at 0 range 0 .. 0;
Reserved_1_15 at 0 range 1 .. 15;
STATE at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-- LFCLKSTART task triggered or not
type LFCLKRUN_STATUS_Field is
(-- Task not triggered
Nottriggered,
-- Task triggered
Triggered)
with Size => 1;
for LFCLKRUN_STATUS_Field use
(Nottriggered => 0,
Triggered => 1);
-- Status indicating that LFCLKSTART task has been triggered
type LFCLKRUN_Register is record
-- Read-only. LFCLKSTART task triggered or not
STATUS : LFCLKRUN_STATUS_Field;
-- unspecified
Reserved_1_31 : Interfaces.NRF52.UInt31;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for LFCLKRUN_Register use record
STATUS at 0 range 0 .. 0;
Reserved_1_31 at 0 range 1 .. 31;
end record;
-- Source of LFCLK
type LFCLKSTAT_SRC_Field is
(-- 32.768 kHz RC oscillator (LFRC)
Rc,
-- 32.768 kHz crystal oscillator (LFXO)
Xtal,
-- 32.768 kHz synthesized from HFCLK (LFSYNT)
Synth)
with Size => 2;
for LFCLKSTAT_SRC_Field use
(Rc => 0,
Xtal => 1,
Synth => 2);
-- LFCLK state
type LFCLKSTAT_STATE_Field is
(-- LFCLK not running
Notrunning,
-- LFCLK running
Running)
with Size => 1;
for LFCLKSTAT_STATE_Field use
(Notrunning => 0,
Running => 1);
-- LFCLK status
type LFCLKSTAT_Register is record
-- Read-only. Source of LFCLK
SRC : LFCLKSTAT_SRC_Field;
-- unspecified
Reserved_2_15 : Interfaces.NRF52.UInt14;
-- Read-only. LFCLK state
STATE : LFCLKSTAT_STATE_Field;
-- unspecified
Reserved_17_31 : Interfaces.NRF52.UInt15;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for LFCLKSTAT_Register use record
SRC at 0 range 0 .. 1;
Reserved_2_15 at 0 range 2 .. 15;
STATE at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-- Clock source
type LFCLKSRCCOPY_SRC_Field is
(-- 32.768 kHz RC oscillator (LFRC)
Rc,
-- 32.768 kHz crystal oscillator (LFXO)
Xtal,
-- 32.768 kHz synthesized from HFCLK (LFSYNT)
Synth)
with Size => 2;
for LFCLKSRCCOPY_SRC_Field use
(Rc => 0,
Xtal => 1,
Synth => 2);
-- Copy of LFCLKSRC register, set when LFCLKSTART task was triggered
type LFCLKSRCCOPY_Register is record
-- Read-only. Clock source
SRC : LFCLKSRCCOPY_SRC_Field;
-- unspecified
Reserved_2_31 : Interfaces.NRF52.UInt30;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for LFCLKSRCCOPY_Register use record
SRC at 0 range 0 .. 1;
Reserved_2_31 at 0 range 2 .. 31;
end record;
-- Clock source
type LFCLKSRC_SRC_Field is
(-- 32.768 kHz RC oscillator (LFRC)
Rc,
-- 32.768 kHz crystal oscillator (LFXO)
Xtal,
-- 32.768 kHz synthesized from HFCLK (LFSYNT)
Synth)
with Size => 2;
for LFCLKSRC_SRC_Field use
(Rc => 0,
Xtal => 1,
Synth => 2);
-- Enable or disable bypass of LFCLK crystal oscillator with external clock
-- source
type LFCLKSRC_BYPASS_Field is
(-- Disable (use with Xtal or low-swing external source)
Disabled,
-- Enable (use with rail-to-rail external source)
Enabled)
with Size => 1;
for LFCLKSRC_BYPASS_Field use
(Disabled => 0,
Enabled => 1);
-- Enable or disable external source for LFCLK
type LFCLKSRC_EXTERNAL_Field is
(-- Disable external source (use with Xtal)
Disabled,
-- Enable use of external source instead of Xtal (SRC needs to be set to Xtal)
Enabled)
with Size => 1;
for LFCLKSRC_EXTERNAL_Field use
(Disabled => 0,
Enabled => 1);
-- Clock source for the LFCLK
type LFCLKSRC_Register is record
-- Clock source
SRC : LFCLKSRC_SRC_Field := Interfaces.NRF52.CLOCK.Rc;
-- unspecified
Reserved_2_15 : Interfaces.NRF52.UInt14 := 16#0#;
-- Enable or disable bypass of LFCLK crystal oscillator with external
-- clock source
BYPASS : LFCLKSRC_BYPASS_Field :=
Interfaces.NRF52.CLOCK.Disabled;
-- Enable or disable external source for LFCLK
EXTERNAL : LFCLKSRC_EXTERNAL_Field :=
Interfaces.NRF52.CLOCK.Disabled;
-- unspecified
Reserved_18_31 : Interfaces.NRF52.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for LFCLKSRC_Register use record
SRC at 0 range 0 .. 1;
Reserved_2_15 at 0 range 2 .. 15;
BYPASS at 0 range 16 .. 16;
EXTERNAL at 0 range 17 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
-- HFXO debounce time. Debounce time = HFXODEBOUNCE * 16 us.
type HFXODEBOUNCE_HFXODEBOUNCE_Field is
(-- 256 us debounce time. Recommended for TSX-3225, FA-20H and FA-128 crystals.
Db256US,
-- 1024 us debounce time. Recommended for NX1612AA and NX1210AB crystals.
Db1024US)
with Size => 8;
for HFXODEBOUNCE_HFXODEBOUNCE_Field use
(Db256US => 16,
Db1024US => 64);
-- HFXO debounce time. The HFXO is started by triggering the
-- TASKS_HFCLKSTART task.
type HFXODEBOUNCE_Register is record
-- HFXO debounce time. Debounce time = HFXODEBOUNCE * 16 us.
HFXODEBOUNCE : HFXODEBOUNCE_HFXODEBOUNCE_Field :=
Interfaces.NRF52.CLOCK.Db256US;
-- unspecified
Reserved_8_31 : Interfaces.NRF52.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for HFXODEBOUNCE_Register use record
HFXODEBOUNCE at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype CTIV_CTIV_Field is Interfaces.NRF52.UInt7;
-- Calibration timer interval
type CTIV_Register is record
-- Calibration timer interval in multiple of 0.25 seconds. Range: 0.25
-- seconds to 31.75 seconds.
CTIV : CTIV_CTIV_Field := 16#0#;
-- unspecified
Reserved_7_31 : Interfaces.NRF52.UInt25 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CTIV_Register use record
CTIV at 0 range 0 .. 6;
Reserved_7_31 at 0 range 7 .. 31;
end record;
-- Speed of trace port clock. Note that the TRACECLK pin will output this
-- clock divided by two.
type TRACECONFIG_TRACEPORTSPEED_Field is
(-- 32 MHz trace port clock (TRACECLK = 16 MHz)
Val_32Mhz,
-- 16 MHz trace port clock (TRACECLK = 8 MHz)
Val_16Mhz,
-- 8 MHz trace port clock (TRACECLK = 4 MHz)
Val_8Mhz,
-- 4 MHz trace port clock (TRACECLK = 2 MHz)
Val_4Mhz)
with Size => 2;
for TRACECONFIG_TRACEPORTSPEED_Field use
(Val_32Mhz => 0,
Val_16Mhz => 1,
Val_8Mhz => 2,
Val_4Mhz => 3);
-- Pin multiplexing of trace signals. See pin assignment chapter for more
-- details.
type TRACECONFIG_TRACEMUX_Field is
(-- No trace signals routed to pins. All pins can be used as regular GPIOs.
Gpio,
-- SWO trace signal routed to pin. Remaining pins can be used as regular
-- GPIOs.
Serial,
-- All trace signals (TRACECLK and TRACEDATA[n]) routed to pins.
Parallel)
with Size => 2;
for TRACECONFIG_TRACEMUX_Field use
(Gpio => 0,
Serial => 1,
Parallel => 2);
-- Clocking options for the trace port debug interface
type TRACECONFIG_Register is record
-- Speed of trace port clock. Note that the TRACECLK pin will output
-- this clock divided by two.
TRACEPORTSPEED : TRACECONFIG_TRACEPORTSPEED_Field :=
Interfaces.NRF52.CLOCK.Val_32Mhz;
-- unspecified
Reserved_2_15 : Interfaces.NRF52.UInt14 := 16#0#;
-- Pin multiplexing of trace signals. See pin assignment chapter for
-- more details.
TRACEMUX : TRACECONFIG_TRACEMUX_Field :=
Interfaces.NRF52.CLOCK.Gpio;
-- unspecified
Reserved_18_31 : Interfaces.NRF52.UInt14 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for TRACECONFIG_Register use record
TRACEPORTSPEED at 0 range 0 .. 1;
Reserved_2_15 at 0 range 2 .. 15;
TRACEMUX at 0 range 16 .. 17;
Reserved_18_31 at 0 range 18 .. 31;
end record;
-- Set LFRC mode
type LFRCMODE_MODE_Field is
(-- Normal mode
Normal,
-- Ultra-low power mode (ULP)
Ulp)
with Size => 1;
for LFRCMODE_MODE_Field use
(Normal => 0,
Ulp => 1);
-- Active LFRC mode. This field is read only.
type LFRCMODE_STATUS_Field is
(-- Normal mode
Normal,
-- Ultra-low power mode (ULP)
Ulp)
with Size => 1;
for LFRCMODE_STATUS_Field use
(Normal => 0,
Ulp => 1);
-- LFRC mode configuration
type LFRCMODE_Register is record
-- Set LFRC mode
MODE : LFRCMODE_MODE_Field := Interfaces.NRF52.CLOCK.Normal;
-- unspecified
Reserved_1_15 : Interfaces.NRF52.UInt15 := 16#0#;
-- Active LFRC mode. This field is read only.
STATUS : LFRCMODE_STATUS_Field := Interfaces.NRF52.CLOCK.Normal;
-- unspecified
Reserved_17_31 : Interfaces.NRF52.UInt15 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for LFRCMODE_Register use record
MODE at 0 range 0 .. 0;
Reserved_1_15 at 0 range 1 .. 15;
STATUS at 0 range 16 .. 16;
Reserved_17_31 at 0 range 17 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Clock control
type CLOCK_Peripheral is record
-- Start HFXO crystal oscillator
TASKS_HFCLKSTART : aliased TASKS_HFCLKSTART_Register;
-- Stop HFXO crystal oscillator
TASKS_HFCLKSTOP : aliased TASKS_HFCLKSTOP_Register;
-- Start LFCLK
TASKS_LFCLKSTART : aliased TASKS_LFCLKSTART_Register;
-- Stop LFCLK
TASKS_LFCLKSTOP : aliased TASKS_LFCLKSTOP_Register;
-- Start calibration of LFRC
TASKS_CAL : aliased TASKS_CAL_Register;
-- Start calibration timer
TASKS_CTSTART : aliased TASKS_CTSTART_Register;
-- Stop calibration timer
TASKS_CTSTOP : aliased TASKS_CTSTOP_Register;
-- HFXO crystal oscillator started
EVENTS_HFCLKSTARTED : aliased EVENTS_HFCLKSTARTED_Register;
-- LFCLK started
EVENTS_LFCLKSTARTED : aliased EVENTS_LFCLKSTARTED_Register;
-- Calibration of LFRC completed
EVENTS_DONE : aliased EVENTS_DONE_Register;
-- Calibration timer timeout
EVENTS_CTTO : aliased EVENTS_CTTO_Register;
-- Calibration timer has been started and is ready to process new tasks
EVENTS_CTSTARTED : aliased EVENTS_CTSTARTED_Register;
-- Calibration timer has been stopped and is ready to process new tasks
EVENTS_CTSTOPPED : aliased EVENTS_CTSTOPPED_Register;
-- Enable interrupt
INTENSET : aliased INTENSET_Register;
-- Disable interrupt
INTENCLR : aliased INTENCLR_Register;
-- Status indicating that HFCLKSTART task has been triggered
HFCLKRUN : aliased HFCLKRUN_Register;
-- HFCLK status
HFCLKSTAT : aliased HFCLKSTAT_Register;
-- Status indicating that LFCLKSTART task has been triggered
LFCLKRUN : aliased LFCLKRUN_Register;
-- LFCLK status
LFCLKSTAT : aliased LFCLKSTAT_Register;
-- Copy of LFCLKSRC register, set when LFCLKSTART task was triggered
LFCLKSRCCOPY : aliased LFCLKSRCCOPY_Register;
-- Clock source for the LFCLK
LFCLKSRC : aliased LFCLKSRC_Register;
-- HFXO debounce time. The HFXO is started by triggering the
-- TASKS_HFCLKSTART task.
HFXODEBOUNCE : aliased HFXODEBOUNCE_Register;
-- Calibration timer interval
CTIV : aliased CTIV_Register;
-- Clocking options for the trace port debug interface
TRACECONFIG : aliased TRACECONFIG_Register;
-- LFRC mode configuration
LFRCMODE : aliased LFRCMODE_Register;
end record
with Volatile;
for CLOCK_Peripheral use record
TASKS_HFCLKSTART at 16#0# range 0 .. 31;
TASKS_HFCLKSTOP at 16#4# range 0 .. 31;
TASKS_LFCLKSTART at 16#8# range 0 .. 31;
TASKS_LFCLKSTOP at 16#C# range 0 .. 31;
TASKS_CAL at 16#10# range 0 .. 31;
TASKS_CTSTART at 16#14# range 0 .. 31;
TASKS_CTSTOP at 16#18# range 0 .. 31;
EVENTS_HFCLKSTARTED at 16#100# range 0 .. 31;
EVENTS_LFCLKSTARTED at 16#104# range 0 .. 31;
EVENTS_DONE at 16#10C# range 0 .. 31;
EVENTS_CTTO at 16#110# range 0 .. 31;
EVENTS_CTSTARTED at 16#128# range 0 .. 31;
EVENTS_CTSTOPPED at 16#12C# range 0 .. 31;
INTENSET at 16#304# range 0 .. 31;
INTENCLR at 16#308# range 0 .. 31;
HFCLKRUN at 16#408# range 0 .. 31;
HFCLKSTAT at 16#40C# range 0 .. 31;
LFCLKRUN at 16#414# range 0 .. 31;
LFCLKSTAT at 16#418# range 0 .. 31;
LFCLKSRCCOPY at 16#41C# range 0 .. 31;
LFCLKSRC at 16#518# range 0 .. 31;
HFXODEBOUNCE at 16#528# range 0 .. 31;
CTIV at 16#538# range 0 .. 31;
TRACECONFIG at 16#55C# range 0 .. 31;
LFRCMODE at 16#5B4# range 0 .. 31;
end record;
-- Clock control
CLOCK_Periph : aliased CLOCK_Peripheral
with Import, Address => CLOCK_Base;
end Interfaces.NRF52.CLOCK;
| 33.294439 | 85 | 0.641003 |
0680ba2f60aca522d088e32e9521c1df52643e31 | 175 | ada | Ada | Task/Verify-distribution-uniformity-Chi-squared-test/Ada/verify-distribution-uniformity-chi-squared-test-1.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Verify-distribution-uniformity-Chi-squared-test/Ada/verify-distribution-uniformity-chi-squared-test-1.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Verify-distribution-uniformity-Chi-squared-test/Ada/verify-distribution-uniformity-chi-squared-test-1.ada | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | package Chi_Square is
type Flt is digits 18;
type Bins_Type is array(Positive range <>) of Natural;
function Distance(Bins: Bins_Type) return Flt;
end Chi_Square;
| 19.444444 | 57 | 0.737143 |
2f782dfa4474b927fcc3b8cc2e4440809fe6dc44 | 962 | ads | Ada | arch/ARM/STM32/driversL4x6/stm32-dfsdm.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | arch/ARM/STM32/driversL4x6/stm32-dfsdm.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | arch/ARM/STM32/driversL4x6/stm32-dfsdm.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | with System; use System;
private with STM32_SVD.DFSDM;
package STM32.DFSDM is
type DFSDM_Block is limited private;
type DFSDM_Channel is (Channel_0,
Channel_1,
Channel_2,
Channel_3,
Channel_4,
Channel_5,
Channel_6,
Channel_7
);
procedure Enable
(This : in out DFSDM_Block;
Channel : DFSDM_Channel)
with
Inline,
Post => Enabled (This, Channel);
procedure Disable
(This : in out DFSDM_Block;
Channel : DFSDM_Channel)
with
Inline,
Post => not Enabled (This, Channel);
function Enabled
(This : DFSDM_Block;
Channel : DFSDM_Channel)
return Boolean;
private
type DFSDM_Block is new STM32_SVD.DFSDM.DFSDM1_Peripheral;
end STM32.DFSDM;
| 23.463415 | 61 | 0.516632 |
57205a41bd0340d9aaeb06512807c40316789e15 | 2,804 | ads | Ada | boards/OpenMV2/src/openmv-lcd_shield.ads | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 192 | 2016-06-01T18:32:04.000Z | 2022-03-26T22:52:31.000Z | boards/OpenMV2/src/openmv-lcd_shield.ads | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 239 | 2016-05-26T20:02:01.000Z | 2022-03-31T09:46:56.000Z | boards/OpenMV2/src/openmv-lcd_shield.ads | shakram02/Ada_Drivers_Library | a407ca7ddbc2d9756647016c2f8fd8ef24a239ff | [
"BSD-3-Clause"
] | 142 | 2016-06-05T08:12:20.000Z | 2022-03-24T17:37:17.000Z | ------------------------------------------------------------------------------
-- --
-- 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 HAL.Bitmap;
package OpenMV.LCD_Shield is
Width : constant := 128;
Height : constant := 160;
procedure Initialize;
function Initialized return Boolean;
function Bitmap return not null HAL.Bitmap.Any_Bitmap_Buffer;
procedure Rotate_Screen_180
with Pre => Initialized;
procedure Rotate_Screen_0
with Pre => Initialized;
procedure Display
with Pre => Initialized;
end OpenMV.LCD_Shield;
| 54.980392 | 78 | 0.53816 |
06754faa34cabf70a828589c8cb8581558752cb8 | 290,346 | adb | Ada | source/nodes/program-element_factories.adb | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | null | null | null | source/nodes/program-element_factories.adb | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | null | null | null | source/nodes/program-element_factories.adb | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | 1 | 2019-10-16T09:05:27.000Z | 2019-10-16T09:05:27.000Z | -- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
with Program.Storage_Pools;
with Program.Nodes.Pragmas;
with Program.Nodes.Defining_Identifiers;
with Program.Nodes.Defining_Character_Literals;
with Program.Nodes.Defining_Operator_Symbols;
with Program.Nodes.Defining_Expanded_Names;
with Program.Nodes.Type_Declarations;
with Program.Nodes.Task_Type_Declarations;
with Program.Nodes.Protected_Type_Declarations;
with Program.Nodes.Subtype_Declarations;
with Program.Nodes.Object_Declarations;
with Program.Nodes.Single_Task_Declarations;
with Program.Nodes.Single_Protected_Declarations;
with Program.Nodes.Number_Declarations;
with Program.Nodes.Enumeration_Literal_Specifications;
with Program.Nodes.Discriminant_Specifications;
with Program.Nodes.Component_Declarations;
with Program.Nodes.Loop_Parameter_Specifications;
with Program.Nodes.Generalized_Iterator_Specifications;
with Program.Nodes.Element_Iterator_Specifications;
with Program.Nodes.Procedure_Declarations;
with Program.Nodes.Function_Declarations;
with Program.Nodes.Parameter_Specifications;
with Program.Nodes.Procedure_Body_Declarations;
with Program.Nodes.Function_Body_Declarations;
with Program.Nodes.Return_Object_Specifications;
with Program.Nodes.Package_Declarations;
with Program.Nodes.Package_Body_Declarations;
with Program.Nodes.Object_Renaming_Declarations;
with Program.Nodes.Exception_Renaming_Declarations;
with Program.Nodes.Procedure_Renaming_Declarations;
with Program.Nodes.Function_Renaming_Declarations;
with Program.Nodes.Package_Renaming_Declarations;
with Program.Nodes.Generic_Package_Renaming_Declarations;
with Program.Nodes.Generic_Procedure_Renaming_Declarations;
with Program.Nodes.Generic_Function_Renaming_Declarations;
with Program.Nodes.Task_Body_Declarations;
with Program.Nodes.Protected_Body_Declarations;
with Program.Nodes.Entry_Declarations;
with Program.Nodes.Entry_Body_Declarations;
with Program.Nodes.Entry_Index_Specifications;
with Program.Nodes.Procedure_Body_Stubs;
with Program.Nodes.Function_Body_Stubs;
with Program.Nodes.Package_Body_Stubs;
with Program.Nodes.Task_Body_Stubs;
with Program.Nodes.Protected_Body_Stubs;
with Program.Nodes.Exception_Declarations;
with Program.Nodes.Choice_Parameter_Specifications;
with Program.Nodes.Generic_Package_Declarations;
with Program.Nodes.Generic_Procedure_Declarations;
with Program.Nodes.Generic_Function_Declarations;
with Program.Nodes.Package_Instantiations;
with Program.Nodes.Procedure_Instantiations;
with Program.Nodes.Function_Instantiations;
with Program.Nodes.Formal_Object_Declarations;
with Program.Nodes.Formal_Type_Declarations;
with Program.Nodes.Formal_Procedure_Declarations;
with Program.Nodes.Formal_Function_Declarations;
with Program.Nodes.Formal_Package_Declarations;
with Program.Nodes.Subtype_Indications;
with Program.Nodes.Component_Definitions;
with Program.Nodes.Discrete_Subtype_Indications;
with Program.Nodes.Discrete_Range_Attribute_References;
with Program.Nodes.Discrete_Simple_Expression_Ranges;
with Program.Nodes.Unknown_Discriminant_Parts;
with Program.Nodes.Known_Discriminant_Parts;
with Program.Nodes.Record_Definitions;
with Program.Nodes.Null_Components;
with Program.Nodes.Variant_Parts;
with Program.Nodes.Variants;
with Program.Nodes.Others_Choices;
with Program.Nodes.Anonymous_Access_To_Objects;
with Program.Nodes.Anonymous_Access_To_Procedures;
with Program.Nodes.Anonymous_Access_To_Functions;
with Program.Nodes.Private_Type_Definitions;
with Program.Nodes.Private_Extension_Definitions;
with Program.Nodes.Incomplete_Type_Definitions;
with Program.Nodes.Task_Definitions;
with Program.Nodes.Protected_Definitions;
with Program.Nodes.Aspect_Specifications;
with Program.Nodes.Real_Range_Specifications;
with Program.Nodes.Numeric_Literals;
with Program.Nodes.String_Literals;
with Program.Nodes.Identifiers;
with Program.Nodes.Operator_Symbols;
with Program.Nodes.Character_Literals;
with Program.Nodes.Explicit_Dereferences;
with Program.Nodes.Infix_Operators;
with Program.Nodes.Function_Calls;
with Program.Nodes.Indexed_Components;
with Program.Nodes.Slices;
with Program.Nodes.Selected_Components;
with Program.Nodes.Attribute_References;
with Program.Nodes.Record_Aggregates;
with Program.Nodes.Extension_Aggregates;
with Program.Nodes.Array_Aggregates;
with Program.Nodes.Short_Circuit_Operations;
with Program.Nodes.Membership_Tests;
with Program.Nodes.Null_Literals;
with Program.Nodes.Parenthesized_Expressions;
with Program.Nodes.Raise_Expressions;
with Program.Nodes.Type_Conversions;
with Program.Nodes.Qualified_Expressions;
with Program.Nodes.Allocators;
with Program.Nodes.Case_Expressions;
with Program.Nodes.If_Expressions;
with Program.Nodes.Quantified_Expressions;
with Program.Nodes.Discriminant_Associations;
with Program.Nodes.Record_Component_Associations;
with Program.Nodes.Array_Component_Associations;
with Program.Nodes.Parameter_Associations;
with Program.Nodes.Formal_Package_Associations;
with Program.Nodes.Null_Statements;
with Program.Nodes.Assignment_Statements;
with Program.Nodes.If_Statements;
with Program.Nodes.Case_Statements;
with Program.Nodes.Loop_Statements;
with Program.Nodes.While_Loop_Statements;
with Program.Nodes.For_Loop_Statements;
with Program.Nodes.Block_Statements;
with Program.Nodes.Exit_Statements;
with Program.Nodes.Goto_Statements;
with Program.Nodes.Call_Statements;
with Program.Nodes.Simple_Return_Statements;
with Program.Nodes.Extended_Return_Statements;
with Program.Nodes.Accept_Statements;
with Program.Nodes.Requeue_Statements;
with Program.Nodes.Delay_Statements;
with Program.Nodes.Terminate_Alternative_Statements;
with Program.Nodes.Select_Statements;
with Program.Nodes.Abort_Statements;
with Program.Nodes.Raise_Statements;
with Program.Nodes.Code_Statements;
with Program.Nodes.Elsif_Paths;
with Program.Nodes.Case_Paths;
with Program.Nodes.Select_Paths;
with Program.Nodes.Case_Expression_Paths;
with Program.Nodes.Elsif_Expression_Paths;
with Program.Nodes.Use_Clauses;
with Program.Nodes.With_Clauses;
with Program.Nodes.Component_Clauses;
with Program.Nodes.Derived_Types;
with Program.Nodes.Derived_Record_Extensions;
with Program.Nodes.Enumeration_Types;
with Program.Nodes.Signed_Integer_Types;
with Program.Nodes.Modular_Types;
with Program.Nodes.Root_Types;
with Program.Nodes.Floating_Point_Types;
with Program.Nodes.Ordinary_Fixed_Point_Types;
with Program.Nodes.Decimal_Fixed_Point_Types;
with Program.Nodes.Unconstrained_Array_Types;
with Program.Nodes.Constrained_Array_Types;
with Program.Nodes.Record_Types;
with Program.Nodes.Interface_Types;
with Program.Nodes.Object_Access_Types;
with Program.Nodes.Procedure_Access_Types;
with Program.Nodes.Function_Access_Types;
with Program.Nodes.Formal_Private_Type_Definitions;
with Program.Nodes.Formal_Derived_Type_Definitions;
with Program.Nodes.Formal_Discrete_Type_Definitions;
with Program.Nodes.Formal_Signed_Integer_Type_Definitions;
with Program.Nodes.Formal_Modular_Type_Definitions;
with Program.Nodes.Formal_Floating_Point_Definitions;
with Program.Nodes.Formal_Ordinary_Fixed_Point_Definitions;
with Program.Nodes.Formal_Decimal_Fixed_Point_Definitions;
with Program.Nodes.Formal_Unconstrained_Array_Types;
with Program.Nodes.Formal_Constrained_Array_Types;
with Program.Nodes.Formal_Object_Access_Types;
with Program.Nodes.Formal_Procedure_Access_Types;
with Program.Nodes.Formal_Function_Access_Types;
with Program.Nodes.Formal_Interface_Types;
with Program.Nodes.Range_Attribute_References;
with Program.Nodes.Simple_Expression_Ranges;
with Program.Nodes.Digits_Constraints;
with Program.Nodes.Delta_Constraints;
with Program.Nodes.Index_Constraints;
with Program.Nodes.Discriminant_Constraints;
with Program.Nodes.Attribute_Definition_Clauses;
with Program.Nodes.Enumeration_Representation_Clauses;
with Program.Nodes.Record_Representation_Clauses;
with Program.Nodes.At_Clauses;
with Program.Nodes.Exception_Handlers;
package body Program.Element_Factories is
type Pragma_Access is not null access Program.Nodes.Pragmas.Pragma_Element
with Storage_Pool => Program.Storage_Pools.Pool;
type Defining_Identifier_Access is
not null access Program.Nodes.Defining_Identifiers.Defining_Identifier
with Storage_Pool => Program.Storage_Pools.Pool;
type Defining_Character_Literal_Access is
not null access Program.Nodes.Defining_Character_Literals
.Defining_Character_Literal
with Storage_Pool => Program.Storage_Pools.Pool;
type Defining_Operator_Symbol_Access is
not null access Program.Nodes.Defining_Operator_Symbols
.Defining_Operator_Symbol
with Storage_Pool => Program.Storage_Pools.Pool;
type Defining_Expanded_Name_Access is
not null access Program.Nodes.Defining_Expanded_Names
.Defining_Expanded_Name with Storage_Pool => Program.Storage_Pools.Pool;
type Type_Declaration_Access is
not null access Program.Nodes.Type_Declarations.Type_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Task_Type_Declaration_Access is
not null access Program.Nodes.Task_Type_Declarations.Task_Type_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Protected_Type_Declaration_Access is
not null access Program.Nodes.Protected_Type_Declarations
.Protected_Type_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Subtype_Declaration_Access is
not null access Program.Nodes.Subtype_Declarations.Subtype_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Object_Declaration_Access is
not null access Program.Nodes.Object_Declarations.Object_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Single_Task_Declaration_Access is
not null access Program.Nodes.Single_Task_Declarations
.Single_Task_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Single_Protected_Declaration_Access is
not null access Program.Nodes.Single_Protected_Declarations
.Single_Protected_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Number_Declaration_Access is
not null access Program.Nodes.Number_Declarations.Number_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Enumeration_Literal_Specification_Access is
not null access Program.Nodes.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Discriminant_Specification_Access is
not null access Program.Nodes.Discriminant_Specifications
.Discriminant_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Component_Declaration_Access is
not null access Program.Nodes.Component_Declarations.Component_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Loop_Parameter_Specification_Access is
not null access Program.Nodes.Loop_Parameter_Specifications
.Loop_Parameter_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Generalized_Iterator_Specification_Access is
not null access Program.Nodes.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Element_Iterator_Specification_Access is
not null access Program.Nodes.Element_Iterator_Specifications
.Element_Iterator_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Procedure_Declaration_Access is
not null access Program.Nodes.Procedure_Declarations.Procedure_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Function_Declaration_Access is
not null access Program.Nodes.Function_Declarations.Function_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Parameter_Specification_Access is
not null access Program.Nodes.Parameter_Specifications
.Parameter_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Procedure_Body_Declaration_Access is
not null access Program.Nodes.Procedure_Body_Declarations
.Procedure_Body_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Function_Body_Declaration_Access is
not null access Program.Nodes.Function_Body_Declarations
.Function_Body_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Return_Object_Specification_Access is
not null access Program.Nodes.Return_Object_Specifications
.Return_Object_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Package_Declaration_Access is
not null access Program.Nodes.Package_Declarations.Package_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Package_Body_Declaration_Access is
not null access Program.Nodes.Package_Body_Declarations
.Package_Body_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Object_Renaming_Declaration_Access is
not null access Program.Nodes.Object_Renaming_Declarations
.Object_Renaming_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Exception_Renaming_Declaration_Access is
not null access Program.Nodes.Exception_Renaming_Declarations
.Exception_Renaming_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Procedure_Renaming_Declaration_Access is
not null access Program.Nodes.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Function_Renaming_Declaration_Access is
not null access Program.Nodes.Function_Renaming_Declarations
.Function_Renaming_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Package_Renaming_Declaration_Access is
not null access Program.Nodes.Package_Renaming_Declarations
.Package_Renaming_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Generic_Package_Renaming_Declaration_Access is
not null access Program.Nodes.Generic_Package_Renaming_Declarations
.Generic_Package_Renaming_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Generic_Procedure_Renaming_Declaration_Access is
not null access Program.Nodes.Generic_Procedure_Renaming_Declarations
.Generic_Procedure_Renaming_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Generic_Function_Renaming_Declaration_Access is
not null access Program.Nodes.Generic_Function_Renaming_Declarations
.Generic_Function_Renaming_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Task_Body_Declaration_Access is
not null access Program.Nodes.Task_Body_Declarations.Task_Body_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Protected_Body_Declaration_Access is
not null access Program.Nodes.Protected_Body_Declarations
.Protected_Body_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Entry_Declaration_Access is
not null access Program.Nodes.Entry_Declarations.Entry_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Entry_Body_Declaration_Access is
not null access Program.Nodes.Entry_Body_Declarations
.Entry_Body_Declaration with Storage_Pool => Program.Storage_Pools.Pool;
type Entry_Index_Specification_Access is
not null access Program.Nodes.Entry_Index_Specifications
.Entry_Index_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Procedure_Body_Stub_Access is
not null access Program.Nodes.Procedure_Body_Stubs.Procedure_Body_Stub
with Storage_Pool => Program.Storage_Pools.Pool;
type Function_Body_Stub_Access is
not null access Program.Nodes.Function_Body_Stubs.Function_Body_Stub
with Storage_Pool => Program.Storage_Pools.Pool;
type Package_Body_Stub_Access is
not null access Program.Nodes.Package_Body_Stubs.Package_Body_Stub
with Storage_Pool => Program.Storage_Pools.Pool;
type Task_Body_Stub_Access is
not null access Program.Nodes.Task_Body_Stubs.Task_Body_Stub
with Storage_Pool => Program.Storage_Pools.Pool;
type Protected_Body_Stub_Access is
not null access Program.Nodes.Protected_Body_Stubs.Protected_Body_Stub
with Storage_Pool => Program.Storage_Pools.Pool;
type Exception_Declaration_Access is
not null access Program.Nodes.Exception_Declarations.Exception_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Choice_Parameter_Specification_Access is
not null access Program.Nodes.Choice_Parameter_Specifications
.Choice_Parameter_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Generic_Package_Declaration_Access is
not null access Program.Nodes.Generic_Package_Declarations
.Generic_Package_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Generic_Procedure_Declaration_Access is
not null access Program.Nodes.Generic_Procedure_Declarations
.Generic_Procedure_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Generic_Function_Declaration_Access is
not null access Program.Nodes.Generic_Function_Declarations
.Generic_Function_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Package_Instantiation_Access is
not null access Program.Nodes.Package_Instantiations.Package_Instantiation
with Storage_Pool => Program.Storage_Pools.Pool;
type Procedure_Instantiation_Access is
not null access Program.Nodes.Procedure_Instantiations
.Procedure_Instantiation
with Storage_Pool => Program.Storage_Pools.Pool;
type Function_Instantiation_Access is
not null access Program.Nodes.Function_Instantiations
.Function_Instantiation with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Object_Declaration_Access is
not null access Program.Nodes.Formal_Object_Declarations
.Formal_Object_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Type_Declaration_Access is
not null access Program.Nodes.Formal_Type_Declarations
.Formal_Type_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Procedure_Declaration_Access is
not null access Program.Nodes.Formal_Procedure_Declarations
.Formal_Procedure_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Function_Declaration_Access is
not null access Program.Nodes.Formal_Function_Declarations
.Formal_Function_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Package_Declaration_Access is
not null access Program.Nodes.Formal_Package_Declarations
.Formal_Package_Declaration
with Storage_Pool => Program.Storage_Pools.Pool;
type Subtype_Indication_Access is
not null access Program.Nodes.Subtype_Indications.Subtype_Indication
with Storage_Pool => Program.Storage_Pools.Pool;
type Component_Definition_Access is
not null access Program.Nodes.Component_Definitions.Component_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Discrete_Subtype_Indication_Access is
not null access Program.Nodes.Discrete_Subtype_Indications
.Discrete_Subtype_Indication
with Storage_Pool => Program.Storage_Pools.Pool;
type Discrete_Range_Attribute_Reference_Access is
not null access Program.Nodes.Discrete_Range_Attribute_References
.Discrete_Range_Attribute_Reference
with Storage_Pool => Program.Storage_Pools.Pool;
type Discrete_Simple_Expression_Range_Access is
not null access Program.Nodes.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range
with Storage_Pool => Program.Storage_Pools.Pool;
type Unknown_Discriminant_Part_Access is
not null access Program.Nodes.Unknown_Discriminant_Parts
.Unknown_Discriminant_Part
with Storage_Pool => Program.Storage_Pools.Pool;
type Known_Discriminant_Part_Access is
not null access Program.Nodes.Known_Discriminant_Parts
.Known_Discriminant_Part
with Storage_Pool => Program.Storage_Pools.Pool;
type Record_Definition_Access is
not null access Program.Nodes.Record_Definitions.Record_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Null_Component_Access is
not null access Program.Nodes.Null_Components.Null_Component
with Storage_Pool => Program.Storage_Pools.Pool;
type Variant_Part_Access is
not null access Program.Nodes.Variant_Parts.Variant_Part
with Storage_Pool => Program.Storage_Pools.Pool;
type Variant_Access is not null access Program.Nodes.Variants.Variant
with Storage_Pool => Program.Storage_Pools.Pool;
type Others_Choice_Access is
not null access Program.Nodes.Others_Choices.Others_Choice
with Storage_Pool => Program.Storage_Pools.Pool;
type Anonymous_Access_To_Object_Access is
not null access Program.Nodes.Anonymous_Access_To_Objects
.Anonymous_Access_To_Object
with Storage_Pool => Program.Storage_Pools.Pool;
type Anonymous_Access_To_Procedure_Access is
not null access Program.Nodes.Anonymous_Access_To_Procedures
.Anonymous_Access_To_Procedure
with Storage_Pool => Program.Storage_Pools.Pool;
type Anonymous_Access_To_Function_Access is
not null access Program.Nodes.Anonymous_Access_To_Functions
.Anonymous_Access_To_Function
with Storage_Pool => Program.Storage_Pools.Pool;
type Private_Type_Definition_Access is
not null access Program.Nodes.Private_Type_Definitions
.Private_Type_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Private_Extension_Definition_Access is
not null access Program.Nodes.Private_Extension_Definitions
.Private_Extension_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Incomplete_Type_Definition_Access is
not null access Program.Nodes.Incomplete_Type_Definitions
.Incomplete_Type_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Task_Definition_Access is
not null access Program.Nodes.Task_Definitions.Task_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Protected_Definition_Access is
not null access Program.Nodes.Protected_Definitions.Protected_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Aspect_Specification_Access is
not null access Program.Nodes.Aspect_Specifications.Aspect_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Real_Range_Specification_Access is
not null access Program.Nodes.Real_Range_Specifications
.Real_Range_Specification
with Storage_Pool => Program.Storage_Pools.Pool;
type Numeric_Literal_Access is
not null access Program.Nodes.Numeric_Literals.Numeric_Literal
with Storage_Pool => Program.Storage_Pools.Pool;
type String_Literal_Access is
not null access Program.Nodes.String_Literals.String_Literal
with Storage_Pool => Program.Storage_Pools.Pool;
type Identifier_Access is
not null access Program.Nodes.Identifiers.Identifier
with Storage_Pool => Program.Storage_Pools.Pool;
type Operator_Symbol_Access is
not null access Program.Nodes.Operator_Symbols.Operator_Symbol
with Storage_Pool => Program.Storage_Pools.Pool;
type Character_Literal_Access is
not null access Program.Nodes.Character_Literals.Character_Literal
with Storage_Pool => Program.Storage_Pools.Pool;
type Explicit_Dereference_Access is
not null access Program.Nodes.Explicit_Dereferences.Explicit_Dereference
with Storage_Pool => Program.Storage_Pools.Pool;
type Infix_Operator_Access is
not null access Program.Nodes.Infix_Operators.Infix_Operator
with Storage_Pool => Program.Storage_Pools.Pool;
type Function_Call_Access is
not null access Program.Nodes.Function_Calls.Function_Call
with Storage_Pool => Program.Storage_Pools.Pool;
type Indexed_Component_Access is
not null access Program.Nodes.Indexed_Components.Indexed_Component
with Storage_Pool => Program.Storage_Pools.Pool;
type Slice_Access is not null access Program.Nodes.Slices.Slice
with Storage_Pool => Program.Storage_Pools.Pool;
type Selected_Component_Access is
not null access Program.Nodes.Selected_Components.Selected_Component
with Storage_Pool => Program.Storage_Pools.Pool;
type Attribute_Reference_Access is
not null access Program.Nodes.Attribute_References.Attribute_Reference
with Storage_Pool => Program.Storage_Pools.Pool;
type Record_Aggregate_Access is
not null access Program.Nodes.Record_Aggregates.Record_Aggregate
with Storage_Pool => Program.Storage_Pools.Pool;
type Extension_Aggregate_Access is
not null access Program.Nodes.Extension_Aggregates.Extension_Aggregate
with Storage_Pool => Program.Storage_Pools.Pool;
type Array_Aggregate_Access is
not null access Program.Nodes.Array_Aggregates.Array_Aggregate
with Storage_Pool => Program.Storage_Pools.Pool;
type Short_Circuit_Operation_Access is
not null access Program.Nodes.Short_Circuit_Operations
.Short_Circuit_Operation
with Storage_Pool => Program.Storage_Pools.Pool;
type Membership_Test_Access is
not null access Program.Nodes.Membership_Tests.Membership_Test
with Storage_Pool => Program.Storage_Pools.Pool;
type Null_Literal_Access is
not null access Program.Nodes.Null_Literals.Null_Literal
with Storage_Pool => Program.Storage_Pools.Pool;
type Parenthesized_Expression_Access is
not null access Program.Nodes.Parenthesized_Expressions
.Parenthesized_Expression
with Storage_Pool => Program.Storage_Pools.Pool;
type Raise_Expression_Access is
not null access Program.Nodes.Raise_Expressions.Raise_Expression
with Storage_Pool => Program.Storage_Pools.Pool;
type Type_Conversion_Access is
not null access Program.Nodes.Type_Conversions.Type_Conversion
with Storage_Pool => Program.Storage_Pools.Pool;
type Qualified_Expression_Access is
not null access Program.Nodes.Qualified_Expressions.Qualified_Expression
with Storage_Pool => Program.Storage_Pools.Pool;
type Allocator_Access is not null access Program.Nodes.Allocators.Allocator
with Storage_Pool => Program.Storage_Pools.Pool;
type Case_Expression_Access is
not null access Program.Nodes.Case_Expressions.Case_Expression
with Storage_Pool => Program.Storage_Pools.Pool;
type If_Expression_Access is
not null access Program.Nodes.If_Expressions.If_Expression
with Storage_Pool => Program.Storage_Pools.Pool;
type Quantified_Expression_Access is
not null access Program.Nodes.Quantified_Expressions.Quantified_Expression
with Storage_Pool => Program.Storage_Pools.Pool;
type Discriminant_Association_Access is
not null access Program.Nodes.Discriminant_Associations
.Discriminant_Association
with Storage_Pool => Program.Storage_Pools.Pool;
type Record_Component_Association_Access is
not null access Program.Nodes.Record_Component_Associations
.Record_Component_Association
with Storage_Pool => Program.Storage_Pools.Pool;
type Array_Component_Association_Access is
not null access Program.Nodes.Array_Component_Associations
.Array_Component_Association
with Storage_Pool => Program.Storage_Pools.Pool;
type Parameter_Association_Access is
not null access Program.Nodes.Parameter_Associations.Parameter_Association
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Package_Association_Access is
not null access Program.Nodes.Formal_Package_Associations
.Formal_Package_Association
with Storage_Pool => Program.Storage_Pools.Pool;
type Null_Statement_Access is
not null access Program.Nodes.Null_Statements.Null_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Assignment_Statement_Access is
not null access Program.Nodes.Assignment_Statements.Assignment_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type If_Statement_Access is
not null access Program.Nodes.If_Statements.If_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Case_Statement_Access is
not null access Program.Nodes.Case_Statements.Case_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Loop_Statement_Access is
not null access Program.Nodes.Loop_Statements.Loop_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type While_Loop_Statement_Access is
not null access Program.Nodes.While_Loop_Statements.While_Loop_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type For_Loop_Statement_Access is
not null access Program.Nodes.For_Loop_Statements.For_Loop_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Block_Statement_Access is
not null access Program.Nodes.Block_Statements.Block_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Exit_Statement_Access is
not null access Program.Nodes.Exit_Statements.Exit_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Goto_Statement_Access is
not null access Program.Nodes.Goto_Statements.Goto_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Call_Statement_Access is
not null access Program.Nodes.Call_Statements.Call_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Simple_Return_Statement_Access is
not null access Program.Nodes.Simple_Return_Statements
.Simple_Return_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Extended_Return_Statement_Access is
not null access Program.Nodes.Extended_Return_Statements
.Extended_Return_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Accept_Statement_Access is
not null access Program.Nodes.Accept_Statements.Accept_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Requeue_Statement_Access is
not null access Program.Nodes.Requeue_Statements.Requeue_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Delay_Statement_Access is
not null access Program.Nodes.Delay_Statements.Delay_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Terminate_Alternative_Statement_Access is
not null access Program.Nodes.Terminate_Alternative_Statements
.Terminate_Alternative_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Select_Statement_Access is
not null access Program.Nodes.Select_Statements.Select_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Abort_Statement_Access is
not null access Program.Nodes.Abort_Statements.Abort_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Raise_Statement_Access is
not null access Program.Nodes.Raise_Statements.Raise_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Code_Statement_Access is
not null access Program.Nodes.Code_Statements.Code_Statement
with Storage_Pool => Program.Storage_Pools.Pool;
type Elsif_Path_Access is
not null access Program.Nodes.Elsif_Paths.Elsif_Path
with Storage_Pool => Program.Storage_Pools.Pool;
type Case_Path_Access is not null access Program.Nodes.Case_Paths.Case_Path
with Storage_Pool => Program.Storage_Pools.Pool;
type Select_Path_Access is
not null access Program.Nodes.Select_Paths.Select_Path
with Storage_Pool => Program.Storage_Pools.Pool;
type Case_Expression_Path_Access is
not null access Program.Nodes.Case_Expression_Paths.Case_Expression_Path
with Storage_Pool => Program.Storage_Pools.Pool;
type Elsif_Expression_Path_Access is
not null access Program.Nodes.Elsif_Expression_Paths.Elsif_Expression_Path
with Storage_Pool => Program.Storage_Pools.Pool;
type Use_Clause_Access is
not null access Program.Nodes.Use_Clauses.Use_Clause
with Storage_Pool => Program.Storage_Pools.Pool;
type With_Clause_Access is
not null access Program.Nodes.With_Clauses.With_Clause
with Storage_Pool => Program.Storage_Pools.Pool;
type Component_Clause_Access is
not null access Program.Nodes.Component_Clauses.Component_Clause
with Storage_Pool => Program.Storage_Pools.Pool;
type Derived_Type_Access is
not null access Program.Nodes.Derived_Types.Derived_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Derived_Record_Extension_Access is
not null access Program.Nodes.Derived_Record_Extensions
.Derived_Record_Extension
with Storage_Pool => Program.Storage_Pools.Pool;
type Enumeration_Type_Access is
not null access Program.Nodes.Enumeration_Types.Enumeration_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Signed_Integer_Type_Access is
not null access Program.Nodes.Signed_Integer_Types.Signed_Integer_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Modular_Type_Access is
not null access Program.Nodes.Modular_Types.Modular_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Root_Type_Access is not null access Program.Nodes.Root_Types.Root_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Floating_Point_Type_Access is
not null access Program.Nodes.Floating_Point_Types.Floating_Point_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Ordinary_Fixed_Point_Type_Access is
not null access Program.Nodes.Ordinary_Fixed_Point_Types
.Ordinary_Fixed_Point_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Decimal_Fixed_Point_Type_Access is
not null access Program.Nodes.Decimal_Fixed_Point_Types
.Decimal_Fixed_Point_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Unconstrained_Array_Type_Access is
not null access Program.Nodes.Unconstrained_Array_Types
.Unconstrained_Array_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Constrained_Array_Type_Access is
not null access Program.Nodes.Constrained_Array_Types
.Constrained_Array_Type with Storage_Pool => Program.Storage_Pools.Pool;
type Record_Type_Access is
not null access Program.Nodes.Record_Types.Record_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Interface_Type_Access is
not null access Program.Nodes.Interface_Types.Interface_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Object_Access_Type_Access is
not null access Program.Nodes.Object_Access_Types.Object_Access_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Procedure_Access_Type_Access is
not null access Program.Nodes.Procedure_Access_Types.Procedure_Access_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Function_Access_Type_Access is
not null access Program.Nodes.Function_Access_Types.Function_Access_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Private_Type_Definition_Access is
not null access Program.Nodes.Formal_Private_Type_Definitions
.Formal_Private_Type_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Derived_Type_Definition_Access is
not null access Program.Nodes.Formal_Derived_Type_Definitions
.Formal_Derived_Type_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Discrete_Type_Definition_Access is
not null access Program.Nodes.Formal_Discrete_Type_Definitions
.Formal_Discrete_Type_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Signed_Integer_Type_Definition_Access is
not null access Program.Nodes.Formal_Signed_Integer_Type_Definitions
.Formal_Signed_Integer_Type_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Modular_Type_Definition_Access is
not null access Program.Nodes.Formal_Modular_Type_Definitions
.Formal_Modular_Type_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Floating_Point_Definition_Access is
not null access Program.Nodes.Formal_Floating_Point_Definitions
.Formal_Floating_Point_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Ordinary_Fixed_Point_Definition_Access is
not null access Program.Nodes.Formal_Ordinary_Fixed_Point_Definitions
.Formal_Ordinary_Fixed_Point_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Decimal_Fixed_Point_Definition_Access is
not null access Program.Nodes.Formal_Decimal_Fixed_Point_Definitions
.Formal_Decimal_Fixed_Point_Definition
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Unconstrained_Array_Type_Access is
not null access Program.Nodes.Formal_Unconstrained_Array_Types
.Formal_Unconstrained_Array_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Constrained_Array_Type_Access is
not null access Program.Nodes.Formal_Constrained_Array_Types
.Formal_Constrained_Array_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Object_Access_Type_Access is
not null access Program.Nodes.Formal_Object_Access_Types
.Formal_Object_Access_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Procedure_Access_Type_Access is
not null access Program.Nodes.Formal_Procedure_Access_Types
.Formal_Procedure_Access_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Function_Access_Type_Access is
not null access Program.Nodes.Formal_Function_Access_Types
.Formal_Function_Access_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Formal_Interface_Type_Access is
not null access Program.Nodes.Formal_Interface_Types.Formal_Interface_Type
with Storage_Pool => Program.Storage_Pools.Pool;
type Range_Attribute_Reference_Access is
not null access Program.Nodes.Range_Attribute_References
.Range_Attribute_Reference
with Storage_Pool => Program.Storage_Pools.Pool;
type Simple_Expression_Range_Access is
not null access Program.Nodes.Simple_Expression_Ranges
.Simple_Expression_Range
with Storage_Pool => Program.Storage_Pools.Pool;
type Digits_Constraint_Access is
not null access Program.Nodes.Digits_Constraints.Digits_Constraint
with Storage_Pool => Program.Storage_Pools.Pool;
type Delta_Constraint_Access is
not null access Program.Nodes.Delta_Constraints.Delta_Constraint
with Storage_Pool => Program.Storage_Pools.Pool;
type Index_Constraint_Access is
not null access Program.Nodes.Index_Constraints.Index_Constraint
with Storage_Pool => Program.Storage_Pools.Pool;
type Discriminant_Constraint_Access is
not null access Program.Nodes.Discriminant_Constraints
.Discriminant_Constraint
with Storage_Pool => Program.Storage_Pools.Pool;
type Attribute_Definition_Clause_Access is
not null access Program.Nodes.Attribute_Definition_Clauses
.Attribute_Definition_Clause
with Storage_Pool => Program.Storage_Pools.Pool;
type Enumeration_Representation_Clause_Access is
not null access Program.Nodes.Enumeration_Representation_Clauses
.Enumeration_Representation_Clause
with Storage_Pool => Program.Storage_Pools.Pool;
type Record_Representation_Clause_Access is
not null access Program.Nodes.Record_Representation_Clauses
.Record_Representation_Clause
with Storage_Pool => Program.Storage_Pools.Pool;
type At_Clause_Access is not null access Program.Nodes.At_Clauses.At_Clause
with Storage_Pool => Program.Storage_Pools.Pool;
type Exception_Handler_Access is
not null access Program.Nodes.Exception_Handlers.Exception_Handler
with Storage_Pool => Program.Storage_Pools.Pool;
not overriding function Create_Pragma
(Self : Element_Factory;
Pragma_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Identifiers
.Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Arguments : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Pragmas.Pragma_Access is
Result : constant Pragma_Access :=
new (Self.Subpool) Program.Nodes.Pragmas.Pragma_Element'
(Program.Nodes.Pragmas.Create
(Pragma_Token => Pragma_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Arguments => Arguments,
Right_Bracket_Token => Right_Bracket_Token,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Pragmas.Pragma_Access (Result);
end Create_Pragma;
not overriding function Create_Defining_Identifier
(Self : Element_Factory;
Identifier_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access is
Result : constant Defining_Identifier_Access :=
new (Self.Subpool) Program.Nodes.Defining_Identifiers
.Defining_Identifier'
(Program.Nodes.Defining_Identifiers.Create
(Identifier_Token => Identifier_Token));
begin
return Program.Elements.Defining_Identifiers.Defining_Identifier_Access
(Result);
end Create_Defining_Identifier;
not overriding function Create_Defining_Character_Literal
(Self : Element_Factory;
Character_Literal_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Defining_Character_Literals
.Defining_Character_Literal_Access is
Result : constant Defining_Character_Literal_Access :=
new (Self.Subpool) Program.Nodes.Defining_Character_Literals
.Defining_Character_Literal'
(Program.Nodes.Defining_Character_Literals.Create
(Character_Literal_Token => Character_Literal_Token));
begin
return Program.Elements.Defining_Character_Literals
.Defining_Character_Literal_Access
(Result);
end Create_Defining_Character_Literal;
not overriding function Create_Defining_Operator_Symbol
(Self : Element_Factory;
Operator_Symbol_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Defining_Operator_Symbols
.Defining_Operator_Symbol_Access is
Result : constant Defining_Operator_Symbol_Access :=
new (Self.Subpool) Program.Nodes.Defining_Operator_Symbols
.Defining_Operator_Symbol'
(Program.Nodes.Defining_Operator_Symbols.Create
(Operator_Symbol_Token => Operator_Symbol_Token));
begin
return Program.Elements.Defining_Operator_Symbols
.Defining_Operator_Symbol_Access
(Result);
end Create_Defining_Operator_Symbol;
not overriding function Create_Defining_Expanded_Name
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions.Expression_Access;
Dot_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Selector : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access)
return not null Program.Elements.Defining_Expanded_Names
.Defining_Expanded_Name_Access is
Result : constant Defining_Expanded_Name_Access :=
new (Self.Subpool) Program.Nodes.Defining_Expanded_Names
.Defining_Expanded_Name'
(Program.Nodes.Defining_Expanded_Names.Create
(Prefix => Prefix, Dot_Token => Dot_Token,
Selector => Selector));
begin
return Program.Elements.Defining_Expanded_Names
.Defining_Expanded_Name_Access
(Result);
end Create_Defining_Expanded_Name;
not overriding function Create_Type_Declaration
(Self : Element_Factory;
Type_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Definitions.Definition_Access;
Is_Token : Program.Lexical_Elements.Lexical_Element_Access;
Definition : not null Program.Elements.Definitions
.Definition_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Type_Declarations
.Type_Declaration_Access is
Result : constant Type_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Type_Declarations.Type_Declaration'
(Program.Nodes.Type_Declarations.Create
(Type_Token => Type_Token, Name => Name,
Discriminant_Part => Discriminant_Part, Is_Token => Is_Token,
Definition => Definition, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Type_Declarations.Type_Declaration_Access
(Result);
end Create_Type_Declaration;
not overriding function Create_Task_Type_Declaration
(Self : Element_Factory;
Task_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Type_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
New_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions.Expression_Vector_Access;
With_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Definition : not null Program.Elements.Task_Definitions
.Task_Definition_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Task_Type_Declarations
.Task_Type_Declaration_Access is
Result : constant Task_Type_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Task_Type_Declarations
.Task_Type_Declaration'
(Program.Nodes.Task_Type_Declarations.Create
(Task_Token => Task_Token, Type_Token => Type_Token,
Name => Name, Discriminant_Part => Discriminant_Part,
With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token, New_Token => New_Token,
Progenitors => Progenitors, With_Token_2 => With_Token_2,
Definition => Definition, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Task_Type_Declarations
.Task_Type_Declaration_Access
(Result);
end Create_Task_Type_Declaration;
not overriding function Create_Protected_Type_Declaration
(Self : Element_Factory;
Protected_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Type_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
New_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions.Expression_Vector_Access;
With_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Definition : not null Program.Elements.Protected_Definitions
.Protected_Definition_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Protected_Type_Declarations
.Protected_Type_Declaration_Access is
Result : constant Protected_Type_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Protected_Type_Declarations
.Protected_Type_Declaration'
(Program.Nodes.Protected_Type_Declarations.Create
(Protected_Token => Protected_Token, Type_Token => Type_Token,
Name => Name, Discriminant_Part => Discriminant_Part,
With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token, New_Token => New_Token,
Progenitors => Progenitors, With_Token_2 => With_Token_2,
Definition => Definition, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Protected_Type_Declarations
.Protected_Type_Declaration_Access
(Result);
end Create_Protected_Type_Declaration;
not overriding function Create_Subtype_Declaration
(Self : Element_Factory;
Subtype_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Subtype_Indication : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Subtype_Declarations
.Subtype_Declaration_Access is
Result : constant Subtype_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Subtype_Declarations
.Subtype_Declaration'
(Program.Nodes.Subtype_Declarations.Create
(Subtype_Token => Subtype_Token, Name => Name,
Is_Token => Is_Token, Subtype_Indication => Subtype_Indication,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Subtype_Declarations.Subtype_Declaration_Access
(Result);
end Create_Subtype_Declaration;
not overriding function Create_Object_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Aliased_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Constant_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Object_Subtype : not null Program.Elements.Definitions
.Definition_Access;
Assignment_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Initialization_Expression : Program.Elements.Expressions
.Expression_Access;
With_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Object_Declarations
.Object_Declaration_Access is
Result : constant Object_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Object_Declarations
.Object_Declaration'
(Program.Nodes.Object_Declarations.Create
(Names => Names, Colon_Token => Colon_Token,
Aliased_Token => Aliased_Token,
Constant_Token => Constant_Token,
Object_Subtype => Object_Subtype,
Assignment_Token => Assignment_Token,
Initialization_Expression => Initialization_Expression,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Object_Declarations.Object_Declaration_Access
(Result);
end Create_Object_Declaration;
not overriding function Create_Single_Task_Declaration
(Self : Element_Factory;
Task_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
New_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions.Expression_Vector_Access;
With_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Definition : not null Program.Elements.Task_Definitions
.Task_Definition_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Single_Task_Declarations
.Single_Task_Declaration_Access is
Result : constant Single_Task_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Single_Task_Declarations
.Single_Task_Declaration'
(Program.Nodes.Single_Task_Declarations.Create
(Task_Token => Task_Token, Name => Name,
With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token, New_Token => New_Token,
Progenitors => Progenitors, With_Token_2 => With_Token_2,
Definition => Definition, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Single_Task_Declarations
.Single_Task_Declaration_Access
(Result);
end Create_Single_Task_Declaration;
not overriding function Create_Single_Protected_Declaration
(Self : Element_Factory;
Protected_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
New_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions.Expression_Vector_Access;
With_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Definition : not null Program.Elements.Protected_Definitions
.Protected_Definition_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration_Access is
Result : constant Single_Protected_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Single_Protected_Declarations
.Single_Protected_Declaration'
(Program.Nodes.Single_Protected_Declarations.Create
(Protected_Token => Protected_Token, Name => Name,
With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token, New_Token => New_Token,
Progenitors => Progenitors, With_Token_2 => With_Token_2,
Definition => Definition, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Single_Protected_Declarations
.Single_Protected_Declaration_Access
(Result);
end Create_Single_Protected_Declaration;
not overriding function Create_Number_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Constant_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Assignment_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Number_Declarations
.Number_Declaration_Access is
Result : constant Number_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Number_Declarations
.Number_Declaration'
(Program.Nodes.Number_Declarations.Create
(Names => Names, Colon_Token => Colon_Token,
Constant_Token => Constant_Token,
Assignment_Token => Assignment_Token, Expression => Expression,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Number_Declarations.Number_Declaration_Access
(Result);
end Create_Number_Declaration;
not overriding function Create_Enumeration_Literal_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Names.Defining_Name_Access)
return not null Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Access is
Result : constant Enumeration_Literal_Specification_Access :=
new (Self.Subpool) Program.Nodes.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification'
(Program.Nodes.Enumeration_Literal_Specifications.Create
(Name => Name));
begin
return Program.Elements.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Access
(Result);
end Create_Enumeration_Literal_Specification;
not overriding function Create_Discriminant_Specification
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Object_Subtype : not null Program.Elements.Element_Access;
Assignment_Token : Program.Lexical_Elements.Lexical_Element_Access;
Default_Expression : Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Access is
Result : constant Discriminant_Specification_Access :=
new (Self.Subpool) Program.Nodes.Discriminant_Specifications
.Discriminant_Specification'
(Program.Nodes.Discriminant_Specifications.Create
(Names => Names, Colon_Token => Colon_Token,
Not_Token => Not_Token, Null_Token => Null_Token,
Object_Subtype => Object_Subtype,
Assignment_Token => Assignment_Token,
Default_Expression => Default_Expression));
begin
return Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Access
(Result);
end Create_Discriminant_Specification;
not overriding function Create_Component_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Object_Subtype : not null Program.Elements.Component_Definitions
.Component_Definition_Access;
Assignment_Token : Program.Lexical_Elements.Lexical_Element_Access;
Default_Expression : Program.Elements.Expressions.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Component_Declarations
.Component_Declaration_Access is
Result : constant Component_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Component_Declarations
.Component_Declaration'
(Program.Nodes.Component_Declarations.Create
(Names => Names, Colon_Token => Colon_Token,
Object_Subtype => Object_Subtype,
Assignment_Token => Assignment_Token,
Default_Expression => Default_Expression,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Component_Declarations
.Component_Declaration_Access
(Result);
end Create_Component_Declaration;
not overriding function Create_Loop_Parameter_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
In_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Reverse_Token : Program.Lexical_Elements.Lexical_Element_Access;
Definition : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Access)
return not null Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access is
Result : constant Loop_Parameter_Specification_Access :=
new (Self.Subpool) Program.Nodes.Loop_Parameter_Specifications
.Loop_Parameter_Specification'
(Program.Nodes.Loop_Parameter_Specifications.Create
(Name => Name, In_Token => In_Token,
Reverse_Token => Reverse_Token, Definition => Definition));
begin
return Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access
(Result);
end Create_Loop_Parameter_Specification;
not overriding function Create_Generalized_Iterator_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
In_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Reverse_Token : Program.Lexical_Elements.Lexical_Element_Access;
Iterator_Name : not null Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access is
Result : constant Generalized_Iterator_Specification_Access :=
new (Self.Subpool) Program.Nodes.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification'
(Program.Nodes.Generalized_Iterator_Specifications.Create
(Name => Name, In_Token => In_Token,
Reverse_Token => Reverse_Token,
Iterator_Name => Iterator_Name));
begin
return Program.Elements.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access
(Result);
end Create_Generalized_Iterator_Specification;
not overriding function Create_Element_Iterator_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Subtype_Indication : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Of_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Reverse_Token : Program.Lexical_Elements.Lexical_Element_Access;
Iterable_Name : not null Program.Elements.Expressions
.Expression_Access)
return not null Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification_Access is
Result : constant Element_Iterator_Specification_Access :=
new (Self.Subpool) Program.Nodes.Element_Iterator_Specifications
.Element_Iterator_Specification'
(Program.Nodes.Element_Iterator_Specifications.Create
(Name => Name, Colon_Token => Colon_Token,
Subtype_Indication => Subtype_Indication, Of_Token => Of_Token,
Reverse_Token => Reverse_Token,
Iterable_Name => Iterable_Name));
begin
return Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification_Access
(Result);
end Create_Element_Iterator_Specification;
not overriding function Create_Procedure_Declaration
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Is_Token : Program.Lexical_Elements.Lexical_Element_Access;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Procedure_Declarations
.Procedure_Declaration_Access is
Result : constant Procedure_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Procedure_Declarations
.Procedure_Declaration'
(Program.Nodes.Procedure_Declarations.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Procedure_Token => Procedure_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Is_Token => Is_Token, Abstract_Token => Abstract_Token,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Procedure_Declarations
.Procedure_Declaration_Access
(Result);
end Create_Procedure_Declaration;
not overriding function Create_Function_Declaration
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Is_Token : Program.Lexical_Elements.Lexical_Element_Access;
Result_Expression : Program.Elements.Parenthesized_Expressions
.Parenthesized_Expression_Access;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Function_Declarations
.Function_Declaration_Access is
Result : constant Function_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Function_Declarations
.Function_Declaration'
(Program.Nodes.Function_Declarations.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Function_Token => Function_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Return_Token => Return_Token, Not_Token_2 => Not_Token_2,
Null_Token => Null_Token, Result_Subtype => Result_Subtype,
Is_Token => Is_Token, Result_Expression => Result_Expression,
Abstract_Token => Abstract_Token, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Function_Declarations.Function_Declaration_Access
(Result);
end Create_Function_Declaration;
not overriding function Create_Parameter_Specification
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Aliased_Token : Program.Lexical_Elements.Lexical_Element_Access;
In_Token : Program.Lexical_Elements.Lexical_Element_Access;
Out_Token : Program.Lexical_Elements.Lexical_Element_Access;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameter_Subtype : not null Program.Elements.Element_Access;
Assignment_Token : Program.Lexical_Elements.Lexical_Element_Access;
Default_Expression : Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Parameter_Specifications
.Parameter_Specification_Access is
Result : constant Parameter_Specification_Access :=
new (Self.Subpool) Program.Nodes.Parameter_Specifications
.Parameter_Specification'
(Program.Nodes.Parameter_Specifications.Create
(Names => Names, Colon_Token => Colon_Token,
Aliased_Token => Aliased_Token, In_Token => In_Token,
Out_Token => Out_Token, Not_Token => Not_Token,
Null_Token => Null_Token,
Parameter_Subtype => Parameter_Subtype,
Assignment_Token => Assignment_Token,
Default_Expression => Default_Expression));
begin
return Program.Elements.Parameter_Specifications
.Parameter_Specification_Access
(Result);
end Create_Parameter_Specification;
not overriding function Create_Procedure_Body_Declaration
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Begin_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration_Access is
Result : constant Procedure_Body_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Procedure_Body_Declarations
.Procedure_Body_Declaration'
(Program.Nodes.Procedure_Body_Declarations.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Procedure_Token => Procedure_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token, Declarations => Declarations,
Begin_Token => Begin_Token, Statements => Statements,
Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers,
End_Token => End_Token, End_Name => End_Name,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Procedure_Body_Declarations
.Procedure_Body_Declaration_Access
(Result);
end Create_Procedure_Body_Declaration;
not overriding function Create_Function_Body_Declaration
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Result_Subtype : not null Program.Elements.Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Begin_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Function_Body_Declarations
.Function_Body_Declaration_Access is
Result : constant Function_Body_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Function_Body_Declarations
.Function_Body_Declaration'
(Program.Nodes.Function_Body_Declarations.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Function_Token => Function_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Return_Token => Return_Token, Not_Token_2 => Not_Token_2,
Null_Token => Null_Token, Result_Subtype => Result_Subtype,
With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token, Declarations => Declarations,
Begin_Token => Begin_Token, Statements => Statements,
Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers,
End_Token => End_Token, End_Name => End_Name,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Function_Body_Declarations
.Function_Body_Declaration_Access
(Result);
end Create_Function_Body_Declaration;
not overriding function Create_Return_Object_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Aliased_Token : Program.Lexical_Elements.Lexical_Element_Access;
Constant_Token : Program.Lexical_Elements.Lexical_Element_Access;
Object_Subtype : not null Program.Elements.Element_Access;
Assignment_Token : Program.Lexical_Elements.Lexical_Element_Access;
Expression : Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Return_Object_Specifications
.Return_Object_Specification_Access is
Result : constant Return_Object_Specification_Access :=
new (Self.Subpool) Program.Nodes.Return_Object_Specifications
.Return_Object_Specification'
(Program.Nodes.Return_Object_Specifications.Create
(Name => Name, Colon_Token => Colon_Token,
Aliased_Token => Aliased_Token,
Constant_Token => Constant_Token,
Object_Subtype => Object_Subtype,
Assignment_Token => Assignment_Token,
Expression => Expression));
begin
return Program.Elements.Return_Object_Specifications
.Return_Object_Specification_Access
(Result);
end Create_Return_Object_Specification;
not overriding function Create_Package_Declaration
(Self : Element_Factory;
Package_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Token : Program.Lexical_Elements.Lexical_Element_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Package_Declarations
.Package_Declaration_Access is
Result : constant Package_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Package_Declarations
.Package_Declaration'
(Program.Nodes.Package_Declarations.Create
(Package_Token => Package_Token, Name => Name,
With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token,
Visible_Declarations => Visible_Declarations,
Private_Token => Private_Token,
Private_Declarations => Private_Declarations,
End_Token => End_Token, End_Name => End_Name,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Package_Declarations.Package_Declaration_Access
(Result);
end Create_Package_Declaration;
not overriding function Create_Package_Body_Declaration
(Self : Element_Factory;
Package_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Body_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Begin_Token : Program.Lexical_Elements.Lexical_Element_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Package_Body_Declarations
.Package_Body_Declaration_Access is
Result : constant Package_Body_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Package_Body_Declarations
.Package_Body_Declaration'
(Program.Nodes.Package_Body_Declarations.Create
(Package_Token => Package_Token, Body_Token => Body_Token,
Name => Name, With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token, Declarations => Declarations,
Begin_Token => Begin_Token, Statements => Statements,
Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers,
End_Token => End_Token, End_Name => End_Name,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Package_Body_Declarations
.Package_Body_Declaration_Access
(Result);
end Create_Package_Body_Declaration;
not overriding function Create_Object_Renaming_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Object_Subtype : not null Program.Elements.Element_Access;
Renames_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Renamed_Object : not null Program.Elements.Expressions.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Object_Renaming_Declarations
.Object_Renaming_Declaration_Access is
Result : constant Object_Renaming_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Object_Renaming_Declarations
.Object_Renaming_Declaration'
(Program.Nodes.Object_Renaming_Declarations.Create
(Names => Names, Colon_Token => Colon_Token,
Not_Token => Not_Token, Null_Token => Null_Token,
Object_Subtype => Object_Subtype,
Renames_Token => Renames_Token,
Renamed_Object => Renamed_Object, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Object_Renaming_Declarations
.Object_Renaming_Declaration_Access
(Result);
end Create_Object_Renaming_Declaration;
not overriding function Create_Exception_Renaming_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Exception_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Renames_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Renamed_Exception : not null Program.Elements.Expressions
.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Exception_Renaming_Declarations
.Exception_Renaming_Declaration_Access is
Result : constant Exception_Renaming_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Exception_Renaming_Declarations
.Exception_Renaming_Declaration'
(Program.Nodes.Exception_Renaming_Declarations.Create
(Names => Names, Colon_Token => Colon_Token,
Exception_Token => Exception_Token,
Renames_Token => Renames_Token,
Renamed_Exception => Renamed_Exception,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Exception_Renaming_Declarations
.Exception_Renaming_Declaration_Access
(Result);
end Create_Exception_Renaming_Declaration;
not overriding function Create_Procedure_Renaming_Declaration
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Renames_Token : Program.Lexical_Elements.Lexical_Element_Access;
Renamed_Procedure : Program.Elements.Expressions.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration_Access is
Result : constant Procedure_Renaming_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration'
(Program.Nodes.Procedure_Renaming_Declarations.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Procedure_Token => Procedure_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Renames_Token => Renames_Token,
Renamed_Procedure => Renamed_Procedure,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Procedure_Renaming_Declarations
.Procedure_Renaming_Declaration_Access
(Result);
end Create_Procedure_Renaming_Declaration;
not overriding function Create_Function_Renaming_Declaration
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Renames_Token : Program.Lexical_Elements.Lexical_Element_Access;
Renamed_Function : Program.Elements.Expressions.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Function_Renaming_Declarations
.Function_Renaming_Declaration_Access is
Result : constant Function_Renaming_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Function_Renaming_Declarations
.Function_Renaming_Declaration'
(Program.Nodes.Function_Renaming_Declarations.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Function_Token => Function_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Return_Token => Return_Token, Not_Token_2 => Not_Token_2,
Null_Token => Null_Token, Result_Subtype => Result_Subtype,
Renames_Token => Renames_Token,
Renamed_Function => Renamed_Function, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Function_Renaming_Declarations
.Function_Renaming_Declaration_Access
(Result);
end Create_Function_Renaming_Declaration;
not overriding function Create_Package_Renaming_Declaration
(Self : Element_Factory;
Package_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Renames_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Renamed_Package : not null Program.Elements.Expressions.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Package_Renaming_Declarations
.Package_Renaming_Declaration_Access is
Result : constant Package_Renaming_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Package_Renaming_Declarations
.Package_Renaming_Declaration'
(Program.Nodes.Package_Renaming_Declarations.Create
(Package_Token => Package_Token, Name => Name,
Renames_Token => Renames_Token,
Renamed_Package => Renamed_Package, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Package_Renaming_Declarations
.Package_Renaming_Declaration_Access
(Result);
end Create_Package_Renaming_Declaration;
not overriding function Create_Generic_Package_Renaming_Declaration
(Self : Element_Factory;
Generic_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Package_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Renames_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Renamed_Package : not null Program.Elements.Expressions.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Generic_Package_Renaming_Declarations
.Generic_Package_Renaming_Declaration_Access is
Result : constant Generic_Package_Renaming_Declaration_Access :=
new (Self.Subpool) Program.Nodes
.Generic_Package_Renaming_Declarations
.Generic_Package_Renaming_Declaration'
(Program.Nodes.Generic_Package_Renaming_Declarations.Create
(Generic_Token => Generic_Token, Package_Token => Package_Token,
Name => Name, Renames_Token => Renames_Token,
Renamed_Package => Renamed_Package, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Generic_Package_Renaming_Declarations
.Generic_Package_Renaming_Declaration_Access
(Result);
end Create_Generic_Package_Renaming_Declaration;
not overriding function Create_Generic_Procedure_Renaming_Declaration
(Self : Element_Factory;
Generic_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Renames_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Renamed_Procedure : not null Program.Elements.Expressions
.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Generic_Procedure_Renaming_Declarations
.Generic_Procedure_Renaming_Declaration_Access is
Result : constant Generic_Procedure_Renaming_Declaration_Access :=
new (Self.Subpool) Program.Nodes
.Generic_Procedure_Renaming_Declarations
.Generic_Procedure_Renaming_Declaration'
(Program.Nodes.Generic_Procedure_Renaming_Declarations.Create
(Generic_Token => Generic_Token,
Procedure_Token => Procedure_Token, Name => Name,
Renames_Token => Renames_Token,
Renamed_Procedure => Renamed_Procedure,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Generic_Procedure_Renaming_Declarations
.Generic_Procedure_Renaming_Declaration_Access
(Result);
end Create_Generic_Procedure_Renaming_Declaration;
not overriding function Create_Generic_Function_Renaming_Declaration
(Self : Element_Factory;
Generic_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Renames_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Renamed_Function : not null Program.Elements.Expressions
.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Generic_Function_Renaming_Declarations
.Generic_Function_Renaming_Declaration_Access is
Result : constant Generic_Function_Renaming_Declaration_Access :=
new (Self.Subpool) Program.Nodes
.Generic_Function_Renaming_Declarations
.Generic_Function_Renaming_Declaration'
(Program.Nodes.Generic_Function_Renaming_Declarations.Create
(Generic_Token => Generic_Token,
Function_Token => Function_Token, Name => Name,
Renames_Token => Renames_Token,
Renamed_Function => Renamed_Function, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Generic_Function_Renaming_Declarations
.Generic_Function_Renaming_Declaration_Access
(Result);
end Create_Generic_Function_Renaming_Declaration;
not overriding function Create_Task_Body_Declaration
(Self : Element_Factory;
Task_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Body_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Begin_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Task_Body_Declarations
.Task_Body_Declaration_Access is
Result : constant Task_Body_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Task_Body_Declarations
.Task_Body_Declaration'
(Program.Nodes.Task_Body_Declarations.Create
(Task_Token => Task_Token, Body_Token => Body_Token,
Name => Name, With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token, Declarations => Declarations,
Begin_Token => Begin_Token, Statements => Statements,
Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers,
End_Token => End_Token, End_Name => End_Name,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Task_Body_Declarations
.Task_Body_Declaration_Access
(Result);
end Create_Task_Body_Declaration;
not overriding function Create_Protected_Body_Declaration
(Self : Element_Factory;
Protected_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Body_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Protected_Operations : not null Program.Element_Vectors
.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Protected_Body_Declarations
.Protected_Body_Declaration_Access is
Result : constant Protected_Body_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Protected_Body_Declarations
.Protected_Body_Declaration'
(Program.Nodes.Protected_Body_Declarations.Create
(Protected_Token => Protected_Token, Body_Token => Body_Token,
Name => Name, With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token,
Protected_Operations => Protected_Operations,
End_Token => End_Token, End_Name => End_Name,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Protected_Body_Declarations
.Protected_Body_Declaration_Access
(Result);
end Create_Protected_Body_Declaration;
not overriding function Create_Entry_Declaration
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Entry_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Entry_Family_Definition : Program.Elements.Discrete_Ranges
.Discrete_Range_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Left_Bracket_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Entry_Declarations
.Entry_Declaration_Access is
Result : constant Entry_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Entry_Declarations
.Entry_Declaration'
(Program.Nodes.Entry_Declarations.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Entry_Token => Entry_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Entry_Family_Definition => Entry_Family_Definition,
Right_Bracket_Token => Right_Bracket_Token,
Left_Bracket_Token_2 => Left_Bracket_Token_2,
Parameters => Parameters,
Right_Bracket_Token_2 => Right_Bracket_Token_2,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Entry_Declarations.Entry_Declaration_Access
(Result);
end Create_Entry_Declaration;
not overriding function Create_Entry_Body_Declaration
(Self : Element_Factory;
Entry_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Entry_Index : not null Program.Elements
.Entry_Index_Specifications.Entry_Index_Specification_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Left_Bracket_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
When_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Barrier : not null Program.Elements.Expressions
.Expression_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Begin_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Entry_Body_Declarations
.Entry_Body_Declaration_Access is
Result : constant Entry_Body_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Entry_Body_Declarations
.Entry_Body_Declaration'
(Program.Nodes.Entry_Body_Declarations.Create
(Entry_Token => Entry_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Entry_Index => Entry_Index,
Right_Bracket_Token => Right_Bracket_Token,
Left_Bracket_Token_2 => Left_Bracket_Token_2,
Parameters => Parameters,
Right_Bracket_Token_2 => Right_Bracket_Token_2,
When_Token => When_Token, Entry_Barrier => Entry_Barrier,
Is_Token => Is_Token, Declarations => Declarations,
Begin_Token => Begin_Token, Statements => Statements,
Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers,
End_Token => End_Token, End_Name => End_Name,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Entry_Body_Declarations
.Entry_Body_Declaration_Access
(Result);
end Create_Entry_Body_Declaration;
not overriding function Create_Entry_Index_Specification
(Self : Element_Factory;
For_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
In_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Index_Subtype : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Access)
return not null Program.Elements.Entry_Index_Specifications
.Entry_Index_Specification_Access is
Result : constant Entry_Index_Specification_Access :=
new (Self.Subpool) Program.Nodes.Entry_Index_Specifications
.Entry_Index_Specification'
(Program.Nodes.Entry_Index_Specifications.Create
(For_Token => For_Token, Name => Name, In_Token => In_Token,
Entry_Index_Subtype => Entry_Index_Subtype));
begin
return Program.Elements.Entry_Index_Specifications
.Entry_Index_Specification_Access
(Result);
end Create_Entry_Index_Specification;
not overriding function Create_Procedure_Body_Stub
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Separate_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Procedure_Body_Stubs
.Procedure_Body_Stub_Access is
Result : constant Procedure_Body_Stub_Access :=
new (Self.Subpool) Program.Nodes.Procedure_Body_Stubs
.Procedure_Body_Stub'
(Program.Nodes.Procedure_Body_Stubs.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Procedure_Token => Procedure_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Is_Token => Is_Token, Separate_Token => Separate_Token,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Procedure_Body_Stubs.Procedure_Body_Stub_Access
(Result);
end Create_Procedure_Body_Stub;
not overriding function Create_Function_Body_Stub
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Separate_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Function_Body_Stubs
.Function_Body_Stub_Access is
Result : constant Function_Body_Stub_Access :=
new (Self.Subpool) Program.Nodes.Function_Body_Stubs
.Function_Body_Stub'
(Program.Nodes.Function_Body_Stubs.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Function_Token => Function_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Return_Token => Return_Token, Not_Token_2 => Not_Token_2,
Null_Token => Null_Token, Result_Subtype => Result_Subtype,
Is_Token => Is_Token, Separate_Token => Separate_Token,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Function_Body_Stubs.Function_Body_Stub_Access
(Result);
end Create_Function_Body_Stub;
not overriding function Create_Package_Body_Stub
(Self : Element_Factory;
Package_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Body_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Separate_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Package_Body_Stubs
.Package_Body_Stub_Access is
Result : constant Package_Body_Stub_Access :=
new (Self.Subpool) Program.Nodes.Package_Body_Stubs
.Package_Body_Stub'
(Program.Nodes.Package_Body_Stubs.Create
(Package_Token => Package_Token, Body_Token => Body_Token,
Name => Name, Is_Token => Is_Token,
Separate_Token => Separate_Token, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Package_Body_Stubs.Package_Body_Stub_Access
(Result);
end Create_Package_Body_Stub;
not overriding function Create_Task_Body_Stub
(Self : Element_Factory;
Task_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Body_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Separate_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Task_Body_Stubs.Task_Body_Stub_Access is
Result : constant Task_Body_Stub_Access :=
new (Self.Subpool) Program.Nodes.Task_Body_Stubs.Task_Body_Stub'
(Program.Nodes.Task_Body_Stubs.Create
(Task_Token => Task_Token, Body_Token => Body_Token,
Name => Name, Is_Token => Is_Token,
Separate_Token => Separate_Token, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Task_Body_Stubs.Task_Body_Stub_Access (Result);
end Create_Task_Body_Stub;
not overriding function Create_Protected_Body_Stub
(Self : Element_Factory;
Protected_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Body_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Separate_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Protected_Body_Stubs
.Protected_Body_Stub_Access is
Result : constant Protected_Body_Stub_Access :=
new (Self.Subpool) Program.Nodes.Protected_Body_Stubs
.Protected_Body_Stub'
(Program.Nodes.Protected_Body_Stubs.Create
(Protected_Token => Protected_Token, Body_Token => Body_Token,
Name => Name, Is_Token => Is_Token,
Separate_Token => Separate_Token, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Protected_Body_Stubs.Protected_Body_Stub_Access
(Result);
end Create_Protected_Body_Stub;
not overriding function Create_Exception_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Exception_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Exception_Declarations
.Exception_Declaration_Access is
Result : constant Exception_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Exception_Declarations
.Exception_Declaration'
(Program.Nodes.Exception_Declarations.Create
(Names => Names, Colon_Token => Colon_Token,
Exception_Token => Exception_Token, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Exception_Declarations
.Exception_Declaration_Access
(Result);
end Create_Exception_Declaration;
not overriding function Create_Choice_Parameter_Specification
(Self : Element_Factory;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Colon_Token : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Choice_Parameter_Specifications
.Choice_Parameter_Specification_Access is
Result : constant Choice_Parameter_Specification_Access :=
new (Self.Subpool) Program.Nodes.Choice_Parameter_Specifications
.Choice_Parameter_Specification'
(Program.Nodes.Choice_Parameter_Specifications.Create
(Name => Name, Colon_Token => Colon_Token));
begin
return Program.Elements.Choice_Parameter_Specifications
.Choice_Parameter_Specification_Access
(Result);
end Create_Choice_Parameter_Specification;
not overriding function Create_Generic_Package_Declaration
(Self : Element_Factory;
Generic_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Formal_Parameters : Program.Element_Vectors.Element_Vector_Access;
Package_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Token : Program.Lexical_Elements.Lexical_Element_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration_Access is
Result : constant Generic_Package_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Generic_Package_Declarations
.Generic_Package_Declaration'
(Program.Nodes.Generic_Package_Declarations.Create
(Generic_Token => Generic_Token,
Formal_Parameters => Formal_Parameters,
Package_Token => Package_Token, Name => Name,
With_Token => With_Token, Aspects => Aspects,
Is_Token => Is_Token,
Visible_Declarations => Visible_Declarations,
Private_Token => Private_Token,
Private_Declarations => Private_Declarations,
End_Token => End_Token, End_Name => End_Name,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Generic_Package_Declarations
.Generic_Package_Declaration_Access
(Result);
end Create_Generic_Package_Declaration;
not overriding function Create_Generic_Procedure_Declaration
(Self : Element_Factory;
Generic_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Formal_Parameters : Program.Element_Vectors.Element_Vector_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Generic_Procedure_Declarations
.Generic_Procedure_Declaration_Access is
Result : constant Generic_Procedure_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Generic_Procedure_Declarations
.Generic_Procedure_Declaration'
(Program.Nodes.Generic_Procedure_Declarations.Create
(Generic_Token => Generic_Token,
Formal_Parameters => Formal_Parameters,
Procedure_Token => Procedure_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Generic_Procedure_Declarations
.Generic_Procedure_Declaration_Access
(Result);
end Create_Generic_Procedure_Declaration;
not overriding function Create_Generic_Function_Declaration
(Self : Element_Factory;
Generic_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Formal_Parameters : Program.Element_Vectors.Element_Vector_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Result_Subtype : not null Program.Elements.Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Generic_Function_Declarations
.Generic_Function_Declaration_Access is
Result : constant Generic_Function_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Generic_Function_Declarations
.Generic_Function_Declaration'
(Program.Nodes.Generic_Function_Declarations.Create
(Generic_Token => Generic_Token,
Formal_Parameters => Formal_Parameters,
Function_Token => Function_Token, Name => Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Return_Token => Return_Token, Not_Token => Not_Token,
Null_Token => Null_Token, Result_Subtype => Result_Subtype,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Generic_Function_Declarations
.Generic_Function_Declaration_Access
(Result);
end Create_Generic_Function_Declaration;
not overriding function Create_Package_Instantiation
(Self : Element_Factory;
Package_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
New_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Generic_Package_Name : not null Program.Elements.Expressions
.Expression_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Package_Instantiations
.Package_Instantiation_Access is
Result : constant Package_Instantiation_Access :=
new (Self.Subpool) Program.Nodes.Package_Instantiations
.Package_Instantiation'
(Program.Nodes.Package_Instantiations.Create
(Package_Token => Package_Token, Name => Name,
Is_Token => Is_Token, New_Token => New_Token,
Generic_Package_Name => Generic_Package_Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Package_Instantiations
.Package_Instantiation_Access
(Result);
end Create_Package_Instantiation;
not overriding function Create_Procedure_Instantiation
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
New_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Generic_Procedure_Name : not null Program.Elements.Expressions
.Expression_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Procedure_Instantiations
.Procedure_Instantiation_Access is
Result : constant Procedure_Instantiation_Access :=
new (Self.Subpool) Program.Nodes.Procedure_Instantiations
.Procedure_Instantiation'
(Program.Nodes.Procedure_Instantiations.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Procedure_Token => Procedure_Token, Name => Name,
Is_Token => Is_Token, New_Token => New_Token,
Generic_Procedure_Name => Generic_Procedure_Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Procedure_Instantiations
.Procedure_Instantiation_Access
(Result);
end Create_Procedure_Instantiation;
not overriding function Create_Function_Instantiation
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Overriding_Token : Program.Lexical_Elements.Lexical_Element_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
New_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Generic_Function_Name : not null Program.Elements.Expressions
.Expression_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Function_Instantiations
.Function_Instantiation_Access is
Result : constant Function_Instantiation_Access :=
new (Self.Subpool) Program.Nodes.Function_Instantiations
.Function_Instantiation'
(Program.Nodes.Function_Instantiations.Create
(Not_Token => Not_Token, Overriding_Token => Overriding_Token,
Function_Token => Function_Token, Name => Name,
Is_Token => Is_Token, New_Token => New_Token,
Generic_Function_Name => Generic_Function_Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Function_Instantiations
.Function_Instantiation_Access
(Result);
end Create_Function_Instantiation;
not overriding function Create_Formal_Object_Declaration
(Self : Element_Factory;
Names : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Vector_Access;
Colon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
In_Token : Program.Lexical_Elements.Lexical_Element_Access;
Out_Token : Program.Lexical_Elements.Lexical_Element_Access;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Object_Subtype : not null Program.Elements.Element_Access;
Assignment_Token : Program.Lexical_Elements.Lexical_Element_Access;
Default_Expression : Program.Elements.Expressions.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Formal_Object_Declarations
.Formal_Object_Declaration_Access is
Result : constant Formal_Object_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Formal_Object_Declarations
.Formal_Object_Declaration'
(Program.Nodes.Formal_Object_Declarations.Create
(Names => Names, Colon_Token => Colon_Token,
In_Token => In_Token, Out_Token => Out_Token,
Not_Token => Not_Token, Null_Token => Null_Token,
Object_Subtype => Object_Subtype,
Assignment_Token => Assignment_Token,
Default_Expression => Default_Expression,
With_Token => With_Token, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Formal_Object_Declarations
.Formal_Object_Declaration_Access
(Result);
end Create_Formal_Object_Declaration;
not overriding function Create_Formal_Type_Declaration
(Self : Element_Factory;
Type_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Discriminant_Part : Program.Elements.Definitions.Definition_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Definition : not null Program.Elements.Formal_Type_Definitions
.Formal_Type_Definition_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Access is
Result : constant Formal_Type_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Formal_Type_Declarations
.Formal_Type_Declaration'
(Program.Nodes.Formal_Type_Declarations.Create
(Type_Token => Type_Token, Name => Name,
Discriminant_Part => Discriminant_Part, Is_Token => Is_Token,
Definition => Definition, With_Token => With_Token,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Formal_Type_Declarations
.Formal_Type_Declaration_Access
(Result);
end Create_Formal_Type_Declaration;
not overriding function Create_Formal_Procedure_Declaration
(Self : Element_Factory;
With_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Is_Token : Program.Lexical_Elements.Lexical_Element_Access;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subprogram_Default : Program.Elements.Expressions.Expression_Access;
Box_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Formal_Procedure_Declarations
.Formal_Procedure_Declaration_Access is
Result : constant Formal_Procedure_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Formal_Procedure_Declarations
.Formal_Procedure_Declaration'
(Program.Nodes.Formal_Procedure_Declarations.Create
(With_Token => With_Token, Procedure_Token => Procedure_Token,
Name => Name, Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Is_Token => Is_Token, Abstract_Token => Abstract_Token,
Null_Token => Null_Token,
Subprogram_Default => Subprogram_Default,
Box_Token => Box_Token, With_Token_2 => With_Token_2,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Formal_Procedure_Declarations
.Formal_Procedure_Declaration_Access
(Result);
end Create_Formal_Procedure_Declaration;
not overriding function Create_Formal_Function_Declaration
(Self : Element_Factory;
With_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Names
.Defining_Name_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Result_Subtype : not null Program.Elements.Element_Access;
Is_Token : Program.Lexical_Elements.Lexical_Element_Access;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subprogram_Default : Program.Elements.Expressions.Expression_Access;
Box_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Formal_Function_Declarations
.Formal_Function_Declaration_Access is
Result : constant Formal_Function_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Formal_Function_Declarations
.Formal_Function_Declaration'
(Program.Nodes.Formal_Function_Declarations.Create
(With_Token => With_Token, Function_Token => Function_Token,
Name => Name, Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Return_Token => Return_Token, Not_Token => Not_Token,
Null_Token => Null_Token, Result_Subtype => Result_Subtype,
Is_Token => Is_Token, Abstract_Token => Abstract_Token,
Subprogram_Default => Subprogram_Default,
Box_Token => Box_Token, With_Token_2 => With_Token_2,
Aspects => Aspects, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Formal_Function_Declarations
.Formal_Function_Declaration_Access
(Result);
end Create_Formal_Function_Declaration;
not overriding function Create_Formal_Package_Declaration
(Self : Element_Factory;
With_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Package_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
New_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Generic_Package_Name : not null Program.Elements.Expressions
.Expression_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Formal_Package_Associations
.Formal_Package_Association_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Aspects : Program.Elements.Aspect_Specifications
.Aspect_Specification_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Formal_Package_Declarations
.Formal_Package_Declaration_Access is
Result : constant Formal_Package_Declaration_Access :=
new (Self.Subpool) Program.Nodes.Formal_Package_Declarations
.Formal_Package_Declaration'
(Program.Nodes.Formal_Package_Declarations.Create
(With_Token => With_Token, Package_Token => Package_Token,
Name => Name, Is_Token => Is_Token, New_Token => New_Token,
Generic_Package_Name => Generic_Package_Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
With_Token_2 => With_Token_2, Aspects => Aspects,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Formal_Package_Declarations
.Formal_Package_Declaration_Access
(Result);
end Create_Formal_Package_Declaration;
not overriding function Create_Subtype_Indication
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subtype_Mark : not null Program.Elements.Expressions.Expression_Access;
Constraint : Program.Elements.Constraints.Constraint_Access)
return not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access is
Result : constant Subtype_Indication_Access :=
new (Self.Subpool) Program.Nodes.Subtype_Indications
.Subtype_Indication'
(Program.Nodes.Subtype_Indications.Create
(Not_Token => Not_Token, Null_Token => Null_Token,
Subtype_Mark => Subtype_Mark, Constraint => Constraint));
begin
return Program.Elements.Subtype_Indications.Subtype_Indication_Access
(Result);
end Create_Subtype_Indication;
not overriding function Create_Component_Definition
(Self : Element_Factory;
Aliased_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subtype_Indication : not null Program.Elements.Element_Access)
return not null Program.Elements.Component_Definitions
.Component_Definition_Access is
Result : constant Component_Definition_Access :=
new (Self.Subpool) Program.Nodes.Component_Definitions
.Component_Definition'
(Program.Nodes.Component_Definitions.Create
(Aliased_Token => Aliased_Token,
Subtype_Indication => Subtype_Indication));
begin
return Program.Elements.Component_Definitions.Component_Definition_Access
(Result);
end Create_Component_Definition;
not overriding function Create_Discrete_Subtype_Indication
(Self : Element_Factory;
Subtype_Mark : not null Program.Elements.Expressions
.Expression_Access;
Constraint : Program.Elements.Constraints
.Constraint_Access;
Is_Discrete_Subtype_Definition : Boolean := False)
return not null Program.Elements.Discrete_Subtype_Indications
.Discrete_Subtype_Indication_Access is
Result : constant Discrete_Subtype_Indication_Access :=
new (Self.Subpool) Program.Nodes.Discrete_Subtype_Indications
.Discrete_Subtype_Indication'
(Program.Nodes.Discrete_Subtype_Indications.Create
(Subtype_Mark => Subtype_Mark, Constraint => Constraint,
Is_Discrete_Subtype_Definition =>
Is_Discrete_Subtype_Definition));
begin
return Program.Elements.Discrete_Subtype_Indications
.Discrete_Subtype_Indication_Access
(Result);
end Create_Discrete_Subtype_Indication;
not overriding function Create_Discrete_Range_Attribute_Reference
(Self : Element_Factory;
Range_Attribute : not null Program.Elements
.Attribute_References.Attribute_Reference_Access;
Is_Discrete_Subtype_Definition : Boolean := False)
return not null Program.Elements.Discrete_Range_Attribute_References
.Discrete_Range_Attribute_Reference_Access is
Result : constant Discrete_Range_Attribute_Reference_Access :=
new (Self.Subpool) Program.Nodes.Discrete_Range_Attribute_References
.Discrete_Range_Attribute_Reference'
(Program.Nodes.Discrete_Range_Attribute_References.Create
(Range_Attribute => Range_Attribute,
Is_Discrete_Subtype_Definition =>
Is_Discrete_Subtype_Definition));
begin
return Program.Elements.Discrete_Range_Attribute_References
.Discrete_Range_Attribute_Reference_Access
(Result);
end Create_Discrete_Range_Attribute_Reference;
not overriding function Create_Discrete_Simple_Expression_Range
(Self : Element_Factory;
Lower_Bound : not null Program.Elements.Expressions
.Expression_Access;
Double_Dot_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Upper_Bound : not null Program.Elements.Expressions
.Expression_Access;
Is_Discrete_Subtype_Definition : Boolean := False)
return not null Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range_Access is
Result : constant Discrete_Simple_Expression_Range_Access :=
new (Self.Subpool) Program.Nodes.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range'
(Program.Nodes.Discrete_Simple_Expression_Ranges.Create
(Lower_Bound => Lower_Bound,
Double_Dot_Token => Double_Dot_Token,
Upper_Bound => Upper_Bound,
Is_Discrete_Subtype_Definition =>
Is_Discrete_Subtype_Definition));
begin
return Program.Elements.Discrete_Simple_Expression_Ranges
.Discrete_Simple_Expression_Range_Access
(Result);
end Create_Discrete_Simple_Expression_Range;
not overriding function Create_Unknown_Discriminant_Part
(Self : Element_Factory;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Box_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Unknown_Discriminant_Parts
.Unknown_Discriminant_Part_Access is
Result : constant Unknown_Discriminant_Part_Access :=
new (Self.Subpool) Program.Nodes.Unknown_Discriminant_Parts
.Unknown_Discriminant_Part'
(Program.Nodes.Unknown_Discriminant_Parts.Create
(Left_Bracket_Token => Left_Bracket_Token,
Box_Token => Box_Token,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Unknown_Discriminant_Parts
.Unknown_Discriminant_Part_Access
(Result);
end Create_Unknown_Discriminant_Part;
not overriding function Create_Known_Discriminant_Part
(Self : Element_Factory;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Discriminants : Program.Elements.Discriminant_Specifications
.Discriminant_Specification_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access is
Result : constant Known_Discriminant_Part_Access :=
new (Self.Subpool) Program.Nodes.Known_Discriminant_Parts
.Known_Discriminant_Part'
(Program.Nodes.Known_Discriminant_Parts.Create
(Left_Bracket_Token => Left_Bracket_Token,
Discriminants => Discriminants,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Known_Discriminant_Parts
.Known_Discriminant_Part_Access
(Result);
end Create_Known_Discriminant_Part;
not overriding function Create_Record_Definition
(Self : Element_Factory;
Record_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Components : not null Program.Element_Vectors.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Record_Token_2 : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Record_Definitions
.Record_Definition_Access is
Result : constant Record_Definition_Access :=
new (Self.Subpool) Program.Nodes.Record_Definitions
.Record_Definition'
(Program.Nodes.Record_Definitions.Create
(Record_Token => Record_Token, Components => Components,
End_Token => End_Token, Record_Token_2 => Record_Token_2));
begin
return Program.Elements.Record_Definitions.Record_Definition_Access
(Result);
end Create_Record_Definition;
not overriding function Create_Null_Component
(Self : Element_Factory;
Null_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Null_Components.Null_Component_Access is
Result : constant Null_Component_Access :=
new (Self.Subpool) Program.Nodes.Null_Components.Null_Component'
(Program.Nodes.Null_Components.Create
(Null_Token => Null_Token, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Null_Components.Null_Component_Access (Result);
end Create_Null_Component;
not overriding function Create_Variant_Part
(Self : Element_Factory;
Case_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Discriminant : not null Program.Elements.Identifiers.Identifier_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Variants : not null Program.Elements.Variants
.Variant_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Case_Token_2 : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Variant_Parts.Variant_Part_Access is
Result : constant Variant_Part_Access :=
new (Self.Subpool) Program.Nodes.Variant_Parts.Variant_Part'
(Program.Nodes.Variant_Parts.Create
(Case_Token => Case_Token, Discriminant => Discriminant,
Is_Token => Is_Token, Variants => Variants,
End_Token => End_Token, Case_Token_2 => Case_Token_2,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Variant_Parts.Variant_Part_Access (Result);
end Create_Variant_Part;
not overriding function Create_Variant
(Self : Element_Factory;
When_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Choices : not null Program.Element_Vectors.Element_Vector_Access;
Arrow_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Components : not null Program.Element_Vectors.Element_Vector_Access)
return not null Program.Elements.Variants.Variant_Access is
Result : constant Variant_Access :=
new (Self.Subpool) Program.Nodes.Variants.Variant'
(Program.Nodes.Variants.Create
(When_Token => When_Token, Choices => Choices,
Arrow_Token => Arrow_Token, Components => Components));
begin
return Program.Elements.Variants.Variant_Access (Result);
end Create_Variant;
not overriding function Create_Others_Choice
(Self : Element_Factory;
Others_Token : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Others_Choices.Others_Choice_Access is
Result : constant Others_Choice_Access :=
new (Self.Subpool) Program.Nodes.Others_Choices.Others_Choice'
(Program.Nodes.Others_Choices.Create
(Others_Token => Others_Token));
begin
return Program.Elements.Others_Choices.Others_Choice_Access (Result);
end Create_Others_Choice;
not overriding function Create_Anonymous_Access_To_Object
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Access_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
All_Token : Program.Lexical_Elements.Lexical_Element_Access;
Constant_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subtype_Indication : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access)
return not null Program.Elements.Anonymous_Access_To_Objects
.Anonymous_Access_To_Object_Access is
Result : constant Anonymous_Access_To_Object_Access :=
new (Self.Subpool) Program.Nodes.Anonymous_Access_To_Objects
.Anonymous_Access_To_Object'
(Program.Nodes.Anonymous_Access_To_Objects.Create
(Not_Token => Not_Token, Null_Token => Null_Token,
Access_Token => Access_Token, All_Token => All_Token,
Constant_Token => Constant_Token,
Subtype_Indication => Subtype_Indication));
begin
return Program.Elements.Anonymous_Access_To_Objects
.Anonymous_Access_To_Object_Access
(Result);
end Create_Anonymous_Access_To_Object;
not overriding function Create_Anonymous_Access_To_Procedure
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Access_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Anonymous_Access_To_Procedures
.Anonymous_Access_To_Procedure_Access is
Result : constant Anonymous_Access_To_Procedure_Access :=
new (Self.Subpool) Program.Nodes.Anonymous_Access_To_Procedures
.Anonymous_Access_To_Procedure'
(Program.Nodes.Anonymous_Access_To_Procedures.Create
(Not_Token => Not_Token, Null_Token => Null_Token,
Access_Token => Access_Token,
Protected_Token => Protected_Token,
Procedure_Token => Procedure_Token,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Anonymous_Access_To_Procedures
.Anonymous_Access_To_Procedure_Access
(Result);
end Create_Anonymous_Access_To_Procedure;
not overriding function Create_Anonymous_Access_To_Function
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Access_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Result_Subtype : not null Program.Elements.Element_Access)
return not null Program.Elements.Anonymous_Access_To_Functions
.Anonymous_Access_To_Function_Access is
Result : constant Anonymous_Access_To_Function_Access :=
new (Self.Subpool) Program.Nodes.Anonymous_Access_To_Functions
.Anonymous_Access_To_Function'
(Program.Nodes.Anonymous_Access_To_Functions.Create
(Not_Token => Not_Token, Null_Token => Null_Token,
Access_Token => Access_Token,
Protected_Token => Protected_Token,
Function_Token => Function_Token,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Return_Token => Return_Token, Not_Token_2 => Not_Token_2,
Null_Token_2 => Null_Token_2,
Result_Subtype => Result_Subtype));
begin
return Program.Elements.Anonymous_Access_To_Functions
.Anonymous_Access_To_Function_Access
(Result);
end Create_Anonymous_Access_To_Function;
not overriding function Create_Private_Type_Definition
(Self : Element_Factory;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
Tagged_Token : Program.Lexical_Elements.Lexical_Element_Access;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Private_Token : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Private_Type_Definitions
.Private_Type_Definition_Access is
Result : constant Private_Type_Definition_Access :=
new (Self.Subpool) Program.Nodes.Private_Type_Definitions
.Private_Type_Definition'
(Program.Nodes.Private_Type_Definitions.Create
(Abstract_Token => Abstract_Token, Tagged_Token => Tagged_Token,
Limited_Token => Limited_Token,
Private_Token => Private_Token));
begin
return Program.Elements.Private_Type_Definitions
.Private_Type_Definition_Access
(Result);
end Create_Private_Type_Definition;
not overriding function Create_Private_Extension_Definition
(Self : Element_Factory;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Synchronized_Token : Program.Lexical_Elements.Lexical_Element_Access;
New_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Ancestor : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
And_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
With_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Private_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Private_Extension_Definitions
.Private_Extension_Definition_Access is
Result : constant Private_Extension_Definition_Access :=
new (Self.Subpool) Program.Nodes.Private_Extension_Definitions
.Private_Extension_Definition'
(Program.Nodes.Private_Extension_Definitions.Create
(Abstract_Token => Abstract_Token,
Limited_Token => Limited_Token,
Synchronized_Token => Synchronized_Token,
New_Token => New_Token, Ancestor => Ancestor,
And_Token => And_Token, Progenitors => Progenitors,
With_Token => With_Token, Private_Token => Private_Token));
begin
return Program.Elements.Private_Extension_Definitions
.Private_Extension_Definition_Access
(Result);
end Create_Private_Extension_Definition;
not overriding function Create_Incomplete_Type_Definition
(Self : Element_Factory;
Tagged_Token : Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Incomplete_Type_Definitions
.Incomplete_Type_Definition_Access is
Result : constant Incomplete_Type_Definition_Access :=
new (Self.Subpool) Program.Nodes.Incomplete_Type_Definitions
.Incomplete_Type_Definition'
(Program.Nodes.Incomplete_Type_Definitions.Create
(Tagged_Token => Tagged_Token));
begin
return Program.Elements.Incomplete_Type_Definitions
.Incomplete_Type_Definition_Access
(Result);
end Create_Incomplete_Type_Definition;
not overriding function Create_Task_Definition
(Self : Element_Factory;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Identifiers.Identifier_Access)
return not null Program.Elements.Task_Definitions
.Task_Definition_Access is
Result : constant Task_Definition_Access :=
new (Self.Subpool) Program.Nodes.Task_Definitions.Task_Definition'
(Program.Nodes.Task_Definitions.Create
(Visible_Declarations => Visible_Declarations,
Private_Token => Private_Token,
Private_Declarations => Private_Declarations,
End_Token => End_Token, End_Name => End_Name));
begin
return Program.Elements.Task_Definitions.Task_Definition_Access (Result);
end Create_Task_Definition;
not overriding function Create_Protected_Definition
(Self : Element_Factory;
Visible_Declarations : Program.Element_Vectors.Element_Vector_Access;
Private_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Private_Declarations : Program.Element_Vectors.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Name : Program.Elements.Identifiers.Identifier_Access)
return not null Program.Elements.Protected_Definitions
.Protected_Definition_Access is
Result : constant Protected_Definition_Access :=
new (Self.Subpool) Program.Nodes.Protected_Definitions
.Protected_Definition'
(Program.Nodes.Protected_Definitions.Create
(Visible_Declarations => Visible_Declarations,
Private_Token => Private_Token,
Private_Declarations => Private_Declarations,
End_Token => End_Token, End_Name => End_Name));
begin
return Program.Elements.Protected_Definitions.Protected_Definition_Access
(Result);
end Create_Protected_Definition;
not overriding function Create_Aspect_Specification
(Self : Element_Factory;
Aspect_Mark : not null Program.Elements.Expressions
.Expression_Access;
Arrow_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Aspect_Definition : not null Program.Elements.Expressions
.Expression_Access)
return not null Program.Elements.Aspect_Specifications
.Aspect_Specification_Access is
Result : constant Aspect_Specification_Access :=
new (Self.Subpool) Program.Nodes.Aspect_Specifications
.Aspect_Specification'
(Program.Nodes.Aspect_Specifications.Create
(Aspect_Mark => Aspect_Mark, Arrow_Token => Arrow_Token,
Aspect_Definition => Aspect_Definition));
begin
return Program.Elements.Aspect_Specifications.Aspect_Specification_Access
(Result);
end Create_Aspect_Specification;
not overriding function Create_Real_Range_Specification
(Self : Element_Factory;
Range_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Lower_Bound : not null Program.Elements.Expressions
.Expression_Access;
Double_Dot_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Upper_Bound : not null Program.Elements.Expressions
.Expression_Access)
return not null Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access is
Result : constant Real_Range_Specification_Access :=
new (Self.Subpool) Program.Nodes.Real_Range_Specifications
.Real_Range_Specification'
(Program.Nodes.Real_Range_Specifications.Create
(Range_Token => Range_Token, Lower_Bound => Lower_Bound,
Double_Dot_Token => Double_Dot_Token,
Upper_Bound => Upper_Bound));
begin
return Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access
(Result);
end Create_Real_Range_Specification;
not overriding function Create_Numeric_Literal
(Self : Element_Factory;
Numeric_Literal_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Numeric_Literals
.Numeric_Literal_Access is
Result : constant Numeric_Literal_Access :=
new (Self.Subpool) Program.Nodes.Numeric_Literals.Numeric_Literal'
(Program.Nodes.Numeric_Literals.Create
(Numeric_Literal_Token => Numeric_Literal_Token));
begin
return Program.Elements.Numeric_Literals.Numeric_Literal_Access (Result);
end Create_Numeric_Literal;
not overriding function Create_String_Literal
(Self : Element_Factory;
String_Literal_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.String_Literals.String_Literal_Access is
Result : constant String_Literal_Access :=
new (Self.Subpool) Program.Nodes.String_Literals.String_Literal'
(Program.Nodes.String_Literals.Create
(String_Literal_Token => String_Literal_Token));
begin
return Program.Elements.String_Literals.String_Literal_Access (Result);
end Create_String_Literal;
not overriding function Create_Identifier
(Self : Element_Factory;
Identifier_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Identifiers.Identifier_Access is
Result : constant Identifier_Access :=
new (Self.Subpool) Program.Nodes.Identifiers.Identifier'
(Program.Nodes.Identifiers.Create
(Identifier_Token => Identifier_Token));
begin
return Program.Elements.Identifiers.Identifier_Access (Result);
end Create_Identifier;
not overriding function Create_Operator_Symbol
(Self : Element_Factory;
Operator_Symbol_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Operator_Symbols
.Operator_Symbol_Access is
Result : constant Operator_Symbol_Access :=
new (Self.Subpool) Program.Nodes.Operator_Symbols.Operator_Symbol'
(Program.Nodes.Operator_Symbols.Create
(Operator_Symbol_Token => Operator_Symbol_Token));
begin
return Program.Elements.Operator_Symbols.Operator_Symbol_Access (Result);
end Create_Operator_Symbol;
not overriding function Create_Character_Literal
(Self : Element_Factory;
Character_Literal_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Character_Literals
.Character_Literal_Access is
Result : constant Character_Literal_Access :=
new (Self.Subpool) Program.Nodes.Character_Literals
.Character_Literal'
(Program.Nodes.Character_Literals.Create
(Character_Literal_Token => Character_Literal_Token));
begin
return Program.Elements.Character_Literals.Character_Literal_Access
(Result);
end Create_Character_Literal;
not overriding function Create_Explicit_Dereference
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions.Expression_Access;
Dot_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
All_Token : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Explicit_Dereferences
.Explicit_Dereference_Access is
Result : constant Explicit_Dereference_Access :=
new (Self.Subpool) Program.Nodes.Explicit_Dereferences
.Explicit_Dereference'
(Program.Nodes.Explicit_Dereferences.Create
(Prefix => Prefix, Dot_Token => Dot_Token,
All_Token => All_Token));
begin
return Program.Elements.Explicit_Dereferences.Explicit_Dereference_Access
(Result);
end Create_Explicit_Dereference;
not overriding function Create_Infix_Operator
(Self : Element_Factory;
Left : Program.Elements.Expressions.Expression_Access;
Operator : not null Program.Elements.Operator_Symbols
.Operator_Symbol_Access;
Right : not null Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Infix_Operators.Infix_Operator_Access is
Result : constant Infix_Operator_Access :=
new (Self.Subpool) Program.Nodes.Infix_Operators.Infix_Operator'
(Program.Nodes.Infix_Operators.Create
(Left => Left, Operator => Operator, Right => Right));
begin
return Program.Elements.Infix_Operators.Infix_Operator_Access (Result);
end Create_Infix_Operator;
not overriding function Create_Function_Call
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Function_Calls.Function_Call_Access is
Result : constant Function_Call_Access :=
new (Self.Subpool) Program.Nodes.Function_Calls.Function_Call'
(Program.Nodes.Function_Calls.Create
(Prefix => Prefix, Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Function_Calls.Function_Call_Access (Result);
end Create_Function_Call;
not overriding function Create_Indexed_Component
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Expressions : Program.Elements.Expressions
.Expression_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Indexed_Components
.Indexed_Component_Access is
Result : constant Indexed_Component_Access :=
new (Self.Subpool) Program.Nodes.Indexed_Components
.Indexed_Component'
(Program.Nodes.Indexed_Components.Create
(Prefix => Prefix, Left_Bracket_Token => Left_Bracket_Token,
Expressions => Expressions,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Indexed_Components.Indexed_Component_Access
(Result);
end Create_Indexed_Component;
not overriding function Create_Slice
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Slice_Range : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Slices.Slice_Access is
Result : constant Slice_Access :=
new (Self.Subpool) Program.Nodes.Slices.Slice'
(Program.Nodes.Slices.Create
(Prefix => Prefix, Left_Bracket_Token => Left_Bracket_Token,
Slice_Range => Slice_Range,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Slices.Slice_Access (Result);
end Create_Slice;
not overriding function Create_Selected_Component
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions.Expression_Access;
Dot_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Selector : not null Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Selected_Components
.Selected_Component_Access is
Result : constant Selected_Component_Access :=
new (Self.Subpool) Program.Nodes.Selected_Components
.Selected_Component'
(Program.Nodes.Selected_Components.Create
(Prefix => Prefix, Dot_Token => Dot_Token,
Selector => Selector));
begin
return Program.Elements.Selected_Components.Selected_Component_Access
(Result);
end Create_Selected_Component;
not overriding function Create_Attribute_Reference
(Self : Element_Factory;
Prefix : not null Program.Elements.Expressions
.Expression_Access;
Apostrophe_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Attribute_Designator : not null Program.Elements.Identifiers
.Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Expressions : Program.Elements.Expressions.Expression_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Attribute_References
.Attribute_Reference_Access is
Result : constant Attribute_Reference_Access :=
new (Self.Subpool) Program.Nodes.Attribute_References
.Attribute_Reference'
(Program.Nodes.Attribute_References.Create
(Prefix => Prefix, Apostrophe_Token => Apostrophe_Token,
Attribute_Designator => Attribute_Designator,
Left_Bracket_Token => Left_Bracket_Token,
Expressions => Expressions,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Attribute_References.Attribute_Reference_Access
(Result);
end Create_Attribute_Reference;
not overriding function Create_Record_Aggregate
(Self : Element_Factory;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Components : Program.Elements.Record_Component_Associations
.Record_Component_Association_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Record_Aggregates
.Record_Aggregate_Access is
Result : constant Record_Aggregate_Access :=
new (Self.Subpool) Program.Nodes.Record_Aggregates.Record_Aggregate'
(Program.Nodes.Record_Aggregates.Create
(Left_Bracket_Token => Left_Bracket_Token,
Components => Components,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Record_Aggregates.Record_Aggregate_Access
(Result);
end Create_Record_Aggregate;
not overriding function Create_Extension_Aggregate
(Self : Element_Factory;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Ancestor : not null Program.Elements.Expressions
.Expression_Access;
With_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Components : Program.Elements.Record_Component_Associations
.Record_Component_Association_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Extension_Aggregates
.Extension_Aggregate_Access is
Result : constant Extension_Aggregate_Access :=
new (Self.Subpool) Program.Nodes.Extension_Aggregates
.Extension_Aggregate'
(Program.Nodes.Extension_Aggregates.Create
(Left_Bracket_Token => Left_Bracket_Token, Ancestor => Ancestor,
With_Token => With_Token, Components => Components,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Extension_Aggregates.Extension_Aggregate_Access
(Result);
end Create_Extension_Aggregate;
not overriding function Create_Array_Aggregate
(Self : Element_Factory;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Components : Program.Elements.Array_Component_Associations
.Array_Component_Association_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Array_Aggregates
.Array_Aggregate_Access is
Result : constant Array_Aggregate_Access :=
new (Self.Subpool) Program.Nodes.Array_Aggregates.Array_Aggregate'
(Program.Nodes.Array_Aggregates.Create
(Left_Bracket_Token => Left_Bracket_Token,
Components => Components,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Array_Aggregates.Array_Aggregate_Access (Result);
end Create_Array_Aggregate;
not overriding function Create_Short_Circuit_Operation
(Self : Element_Factory;
Left : not null Program.Elements.Expressions.Expression_Access;
And_Token : Program.Lexical_Elements.Lexical_Element_Access;
Then_Token : Program.Lexical_Elements.Lexical_Element_Access;
Or_Token : Program.Lexical_Elements.Lexical_Element_Access;
Else_Token : Program.Lexical_Elements.Lexical_Element_Access;
Right : not null Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Short_Circuit_Operations
.Short_Circuit_Operation_Access is
Result : constant Short_Circuit_Operation_Access :=
new (Self.Subpool) Program.Nodes.Short_Circuit_Operations
.Short_Circuit_Operation'
(Program.Nodes.Short_Circuit_Operations.Create
(Left => Left, And_Token => And_Token, Then_Token => Then_Token,
Or_Token => Or_Token, Else_Token => Else_Token,
Right => Right));
begin
return Program.Elements.Short_Circuit_Operations
.Short_Circuit_Operation_Access
(Result);
end Create_Short_Circuit_Operation;
not overriding function Create_Membership_Test
(Self : Element_Factory;
Expression : not null Program.Elements.Expressions.Expression_Access;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
In_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Choices : not null Program.Element_Vectors.Element_Vector_Access)
return not null Program.Elements.Membership_Tests
.Membership_Test_Access is
Result : constant Membership_Test_Access :=
new (Self.Subpool) Program.Nodes.Membership_Tests.Membership_Test'
(Program.Nodes.Membership_Tests.Create
(Expression => Expression, Not_Token => Not_Token,
In_Token => In_Token, Choices => Choices));
begin
return Program.Elements.Membership_Tests.Membership_Test_Access (Result);
end Create_Membership_Test;
not overriding function Create_Null_Literal
(Self : Element_Factory;
Null_Literal_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Null_Literals.Null_Literal_Access is
Result : constant Null_Literal_Access :=
new (Self.Subpool) Program.Nodes.Null_Literals.Null_Literal'
(Program.Nodes.Null_Literals.Create
(Null_Literal_Token => Null_Literal_Token));
begin
return Program.Elements.Null_Literals.Null_Literal_Access (Result);
end Create_Null_Literal;
not overriding function Create_Parenthesized_Expression
(Self : Element_Factory;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Parenthesized_Expressions
.Parenthesized_Expression_Access is
Result : constant Parenthesized_Expression_Access :=
new (Self.Subpool) Program.Nodes.Parenthesized_Expressions
.Parenthesized_Expression'
(Program.Nodes.Parenthesized_Expressions.Create
(Left_Bracket_Token => Left_Bracket_Token,
Expression => Expression,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Parenthesized_Expressions
.Parenthesized_Expression_Access
(Result);
end Create_Parenthesized_Expression;
not overriding function Create_Raise_Expression
(Self : Element_Factory;
Raise_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Exception_Name : not null Program.Elements.Expressions
.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Associated_Message : Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Raise_Expressions
.Raise_Expression_Access is
Result : constant Raise_Expression_Access :=
new (Self.Subpool) Program.Nodes.Raise_Expressions.Raise_Expression'
(Program.Nodes.Raise_Expressions.Create
(Raise_Token => Raise_Token, Exception_Name => Exception_Name,
With_Token => With_Token,
Associated_Message => Associated_Message));
begin
return Program.Elements.Raise_Expressions.Raise_Expression_Access
(Result);
end Create_Raise_Expression;
not overriding function Create_Type_Conversion
(Self : Element_Factory;
Subtype_Mark : not null Program.Elements.Expressions
.Expression_Access;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Operand : not null Program.Elements.Expressions
.Expression_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Type_Conversions
.Type_Conversion_Access is
Result : constant Type_Conversion_Access :=
new (Self.Subpool) Program.Nodes.Type_Conversions.Type_Conversion'
(Program.Nodes.Type_Conversions.Create
(Subtype_Mark => Subtype_Mark,
Left_Bracket_Token => Left_Bracket_Token, Operand => Operand,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Type_Conversions.Type_Conversion_Access (Result);
end Create_Type_Conversion;
not overriding function Create_Qualified_Expression
(Self : Element_Factory;
Subtype_Mark : not null Program.Elements.Expressions
.Expression_Access;
Apostrophe_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Operand : not null Program.Elements.Expressions
.Expression_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Qualified_Expressions
.Qualified_Expression_Access is
Result : constant Qualified_Expression_Access :=
new (Self.Subpool) Program.Nodes.Qualified_Expressions
.Qualified_Expression'
(Program.Nodes.Qualified_Expressions.Create
(Subtype_Mark => Subtype_Mark,
Apostrophe_Token => Apostrophe_Token,
Left_Bracket_Token => Left_Bracket_Token, Operand => Operand,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Qualified_Expressions.Qualified_Expression_Access
(Result);
end Create_Qualified_Expression;
not overriding function Create_Allocator
(Self : Element_Factory;
New_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subpool_Name : Program.Elements.Expressions.Expression_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subtype_Indication : Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
Qualified_Expression : Program.Elements.Qualified_Expressions
.Qualified_Expression_Access)
return not null Program.Elements.Allocators.Allocator_Access is
Result : constant Allocator_Access :=
new (Self.Subpool) Program.Nodes.Allocators.Allocator'
(Program.Nodes.Allocators.Create
(New_Token => New_Token,
Left_Bracket_Token => Left_Bracket_Token,
Subpool_Name => Subpool_Name,
Right_Bracket_Token => Right_Bracket_Token,
Subtype_Indication => Subtype_Indication,
Qualified_Expression => Qualified_Expression));
begin
return Program.Elements.Allocators.Allocator_Access (Result);
end Create_Allocator;
not overriding function Create_Case_Expression
(Self : Element_Factory;
Case_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Selecting_Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Paths : not null Program.Elements.Case_Expression_Paths
.Case_Expression_Path_Vector_Access)
return not null Program.Elements.Case_Expressions
.Case_Expression_Access is
Result : constant Case_Expression_Access :=
new (Self.Subpool) Program.Nodes.Case_Expressions.Case_Expression'
(Program.Nodes.Case_Expressions.Create
(Case_Token => Case_Token,
Selecting_Expression => Selecting_Expression,
Is_Token => Is_Token, Paths => Paths));
begin
return Program.Elements.Case_Expressions.Case_Expression_Access (Result);
end Create_Case_Expression;
not overriding function Create_If_Expression
(Self : Element_Factory;
If_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Condition : not null Program.Elements.Expressions.Expression_Access;
Then_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Then_Expression : not null Program.Elements.Expressions.Expression_Access;
Elsif_Paths : Program.Elements.Elsif_Paths.Elsif_Path_Vector_Access;
Else_Token : Program.Lexical_Elements.Lexical_Element_Access;
Else_Expression : Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.If_Expressions.If_Expression_Access is
Result : constant If_Expression_Access :=
new (Self.Subpool) Program.Nodes.If_Expressions.If_Expression'
(Program.Nodes.If_Expressions.Create
(If_Token => If_Token, Condition => Condition,
Then_Token => Then_Token, Then_Expression => Then_Expression,
Elsif_Paths => Elsif_Paths, Else_Token => Else_Token,
Else_Expression => Else_Expression));
begin
return Program.Elements.If_Expressions.If_Expression_Access (Result);
end Create_If_Expression;
not overriding function Create_Quantified_Expression
(Self : Element_Factory;
For_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
All_Token : Program.Lexical_Elements.Lexical_Element_Access;
Some_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameter : Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access;
Generalized_Iterator : Program.Elements
.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access;
Element_Iterator : Program.Elements.Element_Iterator_Specifications
.Element_Iterator_Specification_Access;
Arrow_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Predicate : not null Program.Elements.Expressions
.Expression_Access)
return not null Program.Elements.Quantified_Expressions
.Quantified_Expression_Access is
Result : constant Quantified_Expression_Access :=
new (Self.Subpool) Program.Nodes.Quantified_Expressions
.Quantified_Expression'
(Program.Nodes.Quantified_Expressions.Create
(For_Token => For_Token, All_Token => All_Token,
Some_Token => Some_Token, Parameter => Parameter,
Generalized_Iterator => Generalized_Iterator,
Element_Iterator => Element_Iterator,
Arrow_Token => Arrow_Token, Predicate => Predicate));
begin
return Program.Elements.Quantified_Expressions
.Quantified_Expression_Access
(Result);
end Create_Quantified_Expression;
not overriding function Create_Discriminant_Association
(Self : Element_Factory;
Selector_Names : Program.Elements.Identifiers
.Identifier_Vector_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
Discriminant_Value : not null Program.Elements.Expressions
.Expression_Access)
return not null Program.Elements.Discriminant_Associations
.Discriminant_Association_Access is
Result : constant Discriminant_Association_Access :=
new (Self.Subpool) Program.Nodes.Discriminant_Associations
.Discriminant_Association'
(Program.Nodes.Discriminant_Associations.Create
(Selector_Names => Selector_Names, Arrow_Token => Arrow_Token,
Discriminant_Value => Discriminant_Value));
begin
return Program.Elements.Discriminant_Associations
.Discriminant_Association_Access
(Result);
end Create_Discriminant_Association;
not overriding function Create_Record_Component_Association
(Self : Element_Factory;
Choices : Program.Element_Vectors.Element_Vector_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
Component_Value : Program.Elements.Expressions.Expression_Access;
Box_Token : Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Record_Component_Associations
.Record_Component_Association_Access is
Result : constant Record_Component_Association_Access :=
new (Self.Subpool) Program.Nodes.Record_Component_Associations
.Record_Component_Association'
(Program.Nodes.Record_Component_Associations.Create
(Choices => Choices, Arrow_Token => Arrow_Token,
Component_Value => Component_Value, Box_Token => Box_Token));
begin
return Program.Elements.Record_Component_Associations
.Record_Component_Association_Access
(Result);
end Create_Record_Component_Association;
not overriding function Create_Array_Component_Association
(Self : Element_Factory;
Choices : Program.Element_Vectors.Element_Vector_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
Component_Value : Program.Elements.Expressions.Expression_Access;
Box_Token : Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Array_Component_Associations
.Array_Component_Association_Access is
Result : constant Array_Component_Association_Access :=
new (Self.Subpool) Program.Nodes.Array_Component_Associations
.Array_Component_Association'
(Program.Nodes.Array_Component_Associations.Create
(Choices => Choices, Arrow_Token => Arrow_Token,
Component_Value => Component_Value, Box_Token => Box_Token));
begin
return Program.Elements.Array_Component_Associations
.Array_Component_Association_Access
(Result);
end Create_Array_Component_Association;
not overriding function Create_Parameter_Association
(Self : Element_Factory;
Formal_Parameter : Program.Elements.Expressions.Expression_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
Actual_Parameter : not null Program.Elements.Expressions
.Expression_Access)
return not null Program.Elements.Parameter_Associations
.Parameter_Association_Access is
Result : constant Parameter_Association_Access :=
new (Self.Subpool) Program.Nodes.Parameter_Associations
.Parameter_Association'
(Program.Nodes.Parameter_Associations.Create
(Formal_Parameter => Formal_Parameter,
Arrow_Token => Arrow_Token,
Actual_Parameter => Actual_Parameter));
begin
return Program.Elements.Parameter_Associations
.Parameter_Association_Access
(Result);
end Create_Parameter_Association;
not overriding function Create_Formal_Package_Association
(Self : Element_Factory;
Formal_Parameter : Program.Elements.Expressions.Expression_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
Actual_Parameter : Program.Elements.Expressions.Expression_Access;
Box_Token : Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Formal_Package_Associations
.Formal_Package_Association_Access is
Result : constant Formal_Package_Association_Access :=
new (Self.Subpool) Program.Nodes.Formal_Package_Associations
.Formal_Package_Association'
(Program.Nodes.Formal_Package_Associations.Create
(Formal_Parameter => Formal_Parameter,
Arrow_Token => Arrow_Token,
Actual_Parameter => Actual_Parameter, Box_Token => Box_Token));
begin
return Program.Elements.Formal_Package_Associations
.Formal_Package_Association_Access
(Result);
end Create_Formal_Package_Association;
not overriding function Create_Null_Statement
(Self : Element_Factory;
Null_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Null_Statements.Null_Statement_Access is
Result : constant Null_Statement_Access :=
new (Self.Subpool) Program.Nodes.Null_Statements.Null_Statement'
(Program.Nodes.Null_Statements.Create
(Null_Token => Null_Token, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Null_Statements.Null_Statement_Access (Result);
end Create_Null_Statement;
not overriding function Create_Assignment_Statement
(Self : Element_Factory;
Variable_Name : not null Program.Elements.Expressions
.Expression_Access;
Assignment_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Expression : not null Program.Elements.Expressions
.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Assignment_Statements
.Assignment_Statement_Access is
Result : constant Assignment_Statement_Access :=
new (Self.Subpool) Program.Nodes.Assignment_Statements
.Assignment_Statement'
(Program.Nodes.Assignment_Statements.Create
(Variable_Name => Variable_Name,
Assignment_Token => Assignment_Token, Expression => Expression,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Assignment_Statements.Assignment_Statement_Access
(Result);
end Create_Assignment_Statement;
not overriding function Create_If_Statement
(Self : Element_Factory;
If_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Condition : not null Program.Elements.Expressions.Expression_Access;
Then_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Then_Statements : not null Program.Element_Vectors.Element_Vector_Access;
Elsif_Paths : Program.Elements.Elsif_Paths.Elsif_Path_Vector_Access;
Else_Token : Program.Lexical_Elements.Lexical_Element_Access;
Else_Statements : Program.Element_Vectors.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
If_Token_2 : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.If_Statements.If_Statement_Access is
Result : constant If_Statement_Access :=
new (Self.Subpool) Program.Nodes.If_Statements.If_Statement'
(Program.Nodes.If_Statements.Create
(If_Token => If_Token, Condition => Condition,
Then_Token => Then_Token, Then_Statements => Then_Statements,
Elsif_Paths => Elsif_Paths, Else_Token => Else_Token,
Else_Statements => Else_Statements, End_Token => End_Token,
If_Token_2 => If_Token_2, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.If_Statements.If_Statement_Access (Result);
end Create_If_Statement;
not overriding function Create_Case_Statement
(Self : Element_Factory;
Case_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Selecting_Expression : not null Program.Elements.Expressions
.Expression_Access;
Is_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Paths : not null Program.Elements.Case_Paths
.Case_Path_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Case_Token_2 : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Case_Statements.Case_Statement_Access is
Result : constant Case_Statement_Access :=
new (Self.Subpool) Program.Nodes.Case_Statements.Case_Statement'
(Program.Nodes.Case_Statements.Create
(Case_Token => Case_Token,
Selecting_Expression => Selecting_Expression,
Is_Token => Is_Token, Paths => Paths, End_Token => End_Token,
Case_Token_2 => Case_Token_2,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Case_Statements.Case_Statement_Access (Result);
end Create_Case_Statement;
not overriding function Create_Loop_Statement
(Self : Element_Factory;
Statement_Identifier : Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Colon_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Loop_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Loop_Token_2 : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Loop_Statements.Loop_Statement_Access is
Result : constant Loop_Statement_Access :=
new (Self.Subpool) Program.Nodes.Loop_Statements.Loop_Statement'
(Program.Nodes.Loop_Statements.Create
(Statement_Identifier => Statement_Identifier,
Colon_Token => Colon_Token, Loop_Token => Loop_Token,
Statements => Statements, End_Token => End_Token,
Loop_Token_2 => Loop_Token_2,
End_Statement_Identifier => End_Statement_Identifier,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Loop_Statements.Loop_Statement_Access (Result);
end Create_Loop_Statement;
not overriding function Create_While_Loop_Statement
(Self : Element_Factory;
Statement_Identifier : Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Colon_Token : Program.Lexical_Elements
.Lexical_Element_Access;
While_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Condition : not null Program.Elements.Expressions
.Expression_Access;
Loop_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Loop_Token_2 : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.While_Loop_Statements
.While_Loop_Statement_Access is
Result : constant While_Loop_Statement_Access :=
new (Self.Subpool) Program.Nodes.While_Loop_Statements
.While_Loop_Statement'
(Program.Nodes.While_Loop_Statements.Create
(Statement_Identifier => Statement_Identifier,
Colon_Token => Colon_Token, While_Token => While_Token,
Condition => Condition, Loop_Token => Loop_Token,
Statements => Statements, End_Token => End_Token,
Loop_Token_2 => Loop_Token_2,
End_Statement_Identifier => End_Statement_Identifier,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.While_Loop_Statements.While_Loop_Statement_Access
(Result);
end Create_While_Loop_Statement;
not overriding function Create_For_Loop_Statement
(Self : Element_Factory;
Statement_Identifier : Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Colon_Token : Program.Lexical_Elements
.Lexical_Element_Access;
For_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Loop_Parameter : Program.Elements.Loop_Parameter_Specifications
.Loop_Parameter_Specification_Access;
Generalized_Iterator : Program.Elements
.Generalized_Iterator_Specifications
.Generalized_Iterator_Specification_Access;
Element_Iterator : Program.Elements
.Element_Iterator_Specifications
.Element_Iterator_Specification_Access;
Loop_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Loop_Token_2 : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.For_Loop_Statements
.For_Loop_Statement_Access is
Result : constant For_Loop_Statement_Access :=
new (Self.Subpool) Program.Nodes.For_Loop_Statements
.For_Loop_Statement'
(Program.Nodes.For_Loop_Statements.Create
(Statement_Identifier => Statement_Identifier,
Colon_Token => Colon_Token, For_Token => For_Token,
Loop_Parameter => Loop_Parameter,
Generalized_Iterator => Generalized_Iterator,
Element_Iterator => Element_Iterator, Loop_Token => Loop_Token,
Statements => Statements, End_Token => End_Token,
Loop_Token_2 => Loop_Token_2,
End_Statement_Identifier => End_Statement_Identifier,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.For_Loop_Statements.For_Loop_Statement_Access
(Result);
end Create_For_Loop_Statement;
not overriding function Create_Block_Statement
(Self : Element_Factory;
Statement_Identifier : Program.Elements.Defining_Identifiers
.Defining_Identifier_Access;
Colon_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Declare_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Declarations : Program.Element_Vectors.Element_Vector_Access;
Begin_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Statements : not null Program.Element_Vectors
.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Block_Statements
.Block_Statement_Access is
Result : constant Block_Statement_Access :=
new (Self.Subpool) Program.Nodes.Block_Statements.Block_Statement'
(Program.Nodes.Block_Statements.Create
(Statement_Identifier => Statement_Identifier,
Colon_Token => Colon_Token, Declare_Token => Declare_Token,
Declarations => Declarations, Begin_Token => Begin_Token,
Statements => Statements, Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers,
End_Token => End_Token,
End_Statement_Identifier => End_Statement_Identifier,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Block_Statements.Block_Statement_Access (Result);
end Create_Block_Statement;
not overriding function Create_Exit_Statement
(Self : Element_Factory;
Exit_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Exit_Loop_Name : Program.Elements.Expressions.Expression_Access;
When_Token : Program.Lexical_Elements.Lexical_Element_Access;
Condition : Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Exit_Statements.Exit_Statement_Access is
Result : constant Exit_Statement_Access :=
new (Self.Subpool) Program.Nodes.Exit_Statements.Exit_Statement'
(Program.Nodes.Exit_Statements.Create
(Exit_Token => Exit_Token, Exit_Loop_Name => Exit_Loop_Name,
When_Token => When_Token, Condition => Condition,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Exit_Statements.Exit_Statement_Access (Result);
end Create_Exit_Statement;
not overriding function Create_Goto_Statement
(Self : Element_Factory;
Goto_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Goto_Label : not null Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Goto_Statements.Goto_Statement_Access is
Result : constant Goto_Statement_Access :=
new (Self.Subpool) Program.Nodes.Goto_Statements.Goto_Statement'
(Program.Nodes.Goto_Statements.Create
(Goto_Token => Goto_Token, Goto_Label => Goto_Label,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Goto_Statements.Goto_Statement_Access (Result);
end Create_Goto_Statement;
not overriding function Create_Call_Statement
(Self : Element_Factory;
Called_Name : not null Program.Elements.Expressions
.Expression_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Associations
.Parameter_Association_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Call_Statements.Call_Statement_Access is
Result : constant Call_Statement_Access :=
new (Self.Subpool) Program.Nodes.Call_Statements.Call_Statement'
(Program.Nodes.Call_Statements.Create
(Called_Name => Called_Name,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Call_Statements.Call_Statement_Access (Result);
end Create_Call_Statement;
not overriding function Create_Simple_Return_Statement
(Self : Element_Factory;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Expression : Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Simple_Return_Statements
.Simple_Return_Statement_Access is
Result : constant Simple_Return_Statement_Access :=
new (Self.Subpool) Program.Nodes.Simple_Return_Statements
.Simple_Return_Statement'
(Program.Nodes.Simple_Return_Statements.Create
(Return_Token => Return_Token, Expression => Expression,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Simple_Return_Statements
.Simple_Return_Statement_Access
(Result);
end Create_Simple_Return_Statement;
not overriding function Create_Extended_Return_Statement
(Self : Element_Factory;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Return_Object : not null Program.Elements
.Return_Object_Specifications.Return_Object_Specification_Access;
Do_Token : Program.Lexical_Elements.Lexical_Element_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : Program.Lexical_Elements.Lexical_Element_Access;
Return_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Extended_Return_Statements
.Extended_Return_Statement_Access is
Result : constant Extended_Return_Statement_Access :=
new (Self.Subpool) Program.Nodes.Extended_Return_Statements
.Extended_Return_Statement'
(Program.Nodes.Extended_Return_Statements.Create
(Return_Token => Return_Token, Return_Object => Return_Object,
Do_Token => Do_Token, Statements => Statements,
Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers,
End_Token => End_Token, Return_Token_2 => Return_Token_2,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Extended_Return_Statements
.Extended_Return_Statement_Access
(Result);
end Create_Extended_Return_Statement;
not overriding function Create_Accept_Statement
(Self : Element_Factory;
Accept_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Name : not null Program.Elements.Identifiers
.Identifier_Access;
Left_Bracket_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Index : Program.Elements.Expressions.Expression_Access;
Right_Bracket_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token_2 : Program.Lexical_Elements
.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token_2 : Program.Lexical_Elements
.Lexical_Element_Access;
Do_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Statements : Program.Element_Vectors.Element_Vector_Access;
Exception_Token : Program.Lexical_Elements
.Lexical_Element_Access;
Exception_Handlers : Program.Elements.Exception_Handlers
.Exception_Handler_Vector_Access;
End_Token : Program.Lexical_Elements
.Lexical_Element_Access;
End_Statement_Identifier : Program.Elements.Identifiers.Identifier_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Accept_Statements
.Accept_Statement_Access is
Result : constant Accept_Statement_Access :=
new (Self.Subpool) Program.Nodes.Accept_Statements.Accept_Statement'
(Program.Nodes.Accept_Statements.Create
(Accept_Token => Accept_Token, Entry_Name => Entry_Name,
Left_Bracket_Token => Left_Bracket_Token,
Entry_Index => Entry_Index,
Right_Bracket_Token => Right_Bracket_Token,
Left_Bracket_Token_2 => Left_Bracket_Token_2,
Parameters => Parameters,
Right_Bracket_Token_2 => Right_Bracket_Token_2,
Do_Token => Do_Token, Statements => Statements,
Exception_Token => Exception_Token,
Exception_Handlers => Exception_Handlers,
End_Token => End_Token,
End_Statement_Identifier => End_Statement_Identifier,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Accept_Statements.Accept_Statement_Access
(Result);
end Create_Accept_Statement;
not overriding function Create_Requeue_Statement
(Self : Element_Factory;
Requeue_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Entry_Name : not null Program.Elements.Expressions.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Abort_Token : Program.Lexical_Elements.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Requeue_Statements
.Requeue_Statement_Access is
Result : constant Requeue_Statement_Access :=
new (Self.Subpool) Program.Nodes.Requeue_Statements
.Requeue_Statement'
(Program.Nodes.Requeue_Statements.Create
(Requeue_Token => Requeue_Token, Entry_Name => Entry_Name,
With_Token => With_Token, Abort_Token => Abort_Token,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Requeue_Statements.Requeue_Statement_Access
(Result);
end Create_Requeue_Statement;
not overriding function Create_Delay_Statement
(Self : Element_Factory;
Delay_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Until_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Expression : not null Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Delay_Statements
.Delay_Statement_Access is
Result : constant Delay_Statement_Access :=
new (Self.Subpool) Program.Nodes.Delay_Statements.Delay_Statement'
(Program.Nodes.Delay_Statements.Create
(Delay_Token => Delay_Token, Until_Token => Until_Token,
Expression => Expression, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Delay_Statements.Delay_Statement_Access (Result);
end Create_Delay_Statement;
not overriding function Create_Terminate_Alternative_Statement
(Self : Element_Factory;
Terminate_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Terminate_Alternative_Statements
.Terminate_Alternative_Statement_Access is
Result : constant Terminate_Alternative_Statement_Access :=
new (Self.Subpool) Program.Nodes.Terminate_Alternative_Statements
.Terminate_Alternative_Statement'
(Program.Nodes.Terminate_Alternative_Statements.Create
(Terminate_Token => Terminate_Token,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Terminate_Alternative_Statements
.Terminate_Alternative_Statement_Access
(Result);
end Create_Terminate_Alternative_Statement;
not overriding function Create_Select_Statement
(Self : Element_Factory;
Select_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Paths : not null Program.Elements.Select_Paths
.Select_Path_Vector_Access;
Then_Token : Program.Lexical_Elements.Lexical_Element_Access;
Abort_Token : Program.Lexical_Elements.Lexical_Element_Access;
Then_Abort_Statements : Program.Element_Vectors.Element_Vector_Access;
Else_Token : Program.Lexical_Elements.Lexical_Element_Access;
Else_Statements : Program.Element_Vectors.Element_Vector_Access;
End_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Select_Token_2 : not null Program.Lexical_Elements
.Lexical_Element_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Select_Statements
.Select_Statement_Access is
Result : constant Select_Statement_Access :=
new (Self.Subpool) Program.Nodes.Select_Statements.Select_Statement'
(Program.Nodes.Select_Statements.Create
(Select_Token => Select_Token, Paths => Paths,
Then_Token => Then_Token, Abort_Token => Abort_Token,
Then_Abort_Statements => Then_Abort_Statements,
Else_Token => Else_Token, Else_Statements => Else_Statements,
End_Token => End_Token, Select_Token_2 => Select_Token_2,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Select_Statements.Select_Statement_Access
(Result);
end Create_Select_Statement;
not overriding function Create_Abort_Statement
(Self : Element_Factory;
Abort_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Aborted_Tasks : not null Program.Elements.Expressions
.Expression_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Abort_Statements
.Abort_Statement_Access is
Result : constant Abort_Statement_Access :=
new (Self.Subpool) Program.Nodes.Abort_Statements.Abort_Statement'
(Program.Nodes.Abort_Statements.Create
(Abort_Token => Abort_Token, Aborted_Tasks => Aborted_Tasks,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Abort_Statements.Abort_Statement_Access (Result);
end Create_Abort_Statement;
not overriding function Create_Raise_Statement
(Self : Element_Factory;
Raise_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Raised_Exception : Program.Elements.Expressions.Expression_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Associated_Message : Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Raise_Statements
.Raise_Statement_Access is
Result : constant Raise_Statement_Access :=
new (Self.Subpool) Program.Nodes.Raise_Statements.Raise_Statement'
(Program.Nodes.Raise_Statements.Create
(Raise_Token => Raise_Token,
Raised_Exception => Raised_Exception, With_Token => With_Token,
Associated_Message => Associated_Message,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Raise_Statements.Raise_Statement_Access (Result);
end Create_Raise_Statement;
not overriding function Create_Code_Statement
(Self : Element_Factory;
Expression : not null Program.Elements.Qualified_Expressions
.Qualified_Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Code_Statements.Code_Statement_Access is
Result : constant Code_Statement_Access :=
new (Self.Subpool) Program.Nodes.Code_Statements.Code_Statement'
(Program.Nodes.Code_Statements.Create
(Expression => Expression, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Code_Statements.Code_Statement_Access (Result);
end Create_Code_Statement;
not overriding function Create_Elsif_Path
(Self : Element_Factory;
Elsif_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Condition : not null Program.Elements.Expressions.Expression_Access;
Then_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Statements : not null Program.Element_Vectors.Element_Vector_Access)
return not null Program.Elements.Elsif_Paths.Elsif_Path_Access is
Result : constant Elsif_Path_Access :=
new (Self.Subpool) Program.Nodes.Elsif_Paths.Elsif_Path'
(Program.Nodes.Elsif_Paths.Create
(Elsif_Token => Elsif_Token, Condition => Condition,
Then_Token => Then_Token, Statements => Statements));
begin
return Program.Elements.Elsif_Paths.Elsif_Path_Access (Result);
end Create_Elsif_Path;
not overriding function Create_Case_Path
(Self : Element_Factory;
When_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Choices : not null Program.Element_Vectors.Element_Vector_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
Statements : not null Program.Element_Vectors.Element_Vector_Access)
return not null Program.Elements.Case_Paths.Case_Path_Access is
Result : constant Case_Path_Access :=
new (Self.Subpool) Program.Nodes.Case_Paths.Case_Path'
(Program.Nodes.Case_Paths.Create
(When_Token => When_Token, Choices => Choices,
Arrow_Token => Arrow_Token, Statements => Statements));
begin
return Program.Elements.Case_Paths.Case_Path_Access (Result);
end Create_Case_Path;
not overriding function Create_Select_Path
(Self : Element_Factory;
When_Token : Program.Lexical_Elements.Lexical_Element_Access;
Guard : Program.Elements.Expressions.Expression_Access;
Arrow_Token : Program.Lexical_Elements.Lexical_Element_Access;
Statements : not null Program.Element_Vectors.Element_Vector_Access)
return not null Program.Elements.Select_Paths.Select_Path_Access is
Result : constant Select_Path_Access :=
new (Self.Subpool) Program.Nodes.Select_Paths.Select_Path'
(Program.Nodes.Select_Paths.Create
(When_Token => When_Token, Guard => Guard,
Arrow_Token => Arrow_Token, Statements => Statements));
begin
return Program.Elements.Select_Paths.Select_Path_Access (Result);
end Create_Select_Path;
not overriding function Create_Case_Expression_Path
(Self : Element_Factory;
When_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Choices : not null Program.Element_Vectors.Element_Vector_Access;
Arrow_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Expression : not null Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Case_Expression_Paths
.Case_Expression_Path_Access is
Result : constant Case_Expression_Path_Access :=
new (Self.Subpool) Program.Nodes.Case_Expression_Paths
.Case_Expression_Path'
(Program.Nodes.Case_Expression_Paths.Create
(When_Token => When_Token, Choices => Choices,
Arrow_Token => Arrow_Token, Expression => Expression));
begin
return Program.Elements.Case_Expression_Paths.Case_Expression_Path_Access
(Result);
end Create_Case_Expression_Path;
not overriding function Create_Elsif_Expression_Path
(Self : Element_Factory;
Elsif_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Condition : not null Program.Elements.Expressions.Expression_Access;
Then_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Expression : not null Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Elsif_Expression_Paths
.Elsif_Expression_Path_Access is
Result : constant Elsif_Expression_Path_Access :=
new (Self.Subpool) Program.Nodes.Elsif_Expression_Paths
.Elsif_Expression_Path'
(Program.Nodes.Elsif_Expression_Paths.Create
(Elsif_Token => Elsif_Token, Condition => Condition,
Then_Token => Then_Token, Expression => Expression));
begin
return Program.Elements.Elsif_Expression_Paths
.Elsif_Expression_Path_Access
(Result);
end Create_Elsif_Expression_Path;
not overriding function Create_Use_Clause
(Self : Element_Factory;
Use_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
All_Token : Program.Lexical_Elements.Lexical_Element_Access;
Type_Token : Program.Lexical_Elements.Lexical_Element_Access;
Clause_Names : not null Program.Elements.Expressions
.Expression_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Use_Clauses.Use_Clause_Access is
Result : constant Use_Clause_Access :=
new (Self.Subpool) Program.Nodes.Use_Clauses.Use_Clause'
(Program.Nodes.Use_Clauses.Create
(Use_Token => Use_Token, All_Token => All_Token,
Type_Token => Type_Token, Clause_Names => Clause_Names,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Use_Clauses.Use_Clause_Access (Result);
end Create_Use_Clause;
not overriding function Create_With_Clause
(Self : Element_Factory;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Private_Token : Program.Lexical_Elements.Lexical_Element_Access;
With_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Clause_Names : not null Program.Elements.Expressions
.Expression_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.With_Clauses.With_Clause_Access is
Result : constant With_Clause_Access :=
new (Self.Subpool) Program.Nodes.With_Clauses.With_Clause'
(Program.Nodes.With_Clauses.Create
(Limited_Token => Limited_Token, Private_Token => Private_Token,
With_Token => With_Token, Clause_Names => Clause_Names,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.With_Clauses.With_Clause_Access (Result);
end Create_With_Clause;
not overriding function Create_Component_Clause
(Self : Element_Factory;
Clause_Name : not null Program.Elements.Identifiers.Identifier_Access;
At_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Position : not null Program.Elements.Expressions.Expression_Access;
Range_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Clause_Range : not null Program.Elements.Simple_Expression_Ranges
.Simple_Expression_Range_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Component_Clauses
.Component_Clause_Access is
Result : constant Component_Clause_Access :=
new (Self.Subpool) Program.Nodes.Component_Clauses.Component_Clause'
(Program.Nodes.Component_Clauses.Create
(Clause_Name => Clause_Name, At_Token => At_Token,
Position => Position, Range_Token => Range_Token,
Clause_Range => Clause_Range,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Component_Clauses.Component_Clause_Access
(Result);
end Create_Component_Clause;
not overriding function Create_Derived_Type
(Self : Element_Factory;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
New_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Parent : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access)
return not null Program.Elements.Derived_Types.Derived_Type_Access is
Result : constant Derived_Type_Access :=
new (Self.Subpool) Program.Nodes.Derived_Types.Derived_Type'
(Program.Nodes.Derived_Types.Create
(Abstract_Token => Abstract_Token,
Limited_Token => Limited_Token, New_Token => New_Token,
Parent => Parent));
begin
return Program.Elements.Derived_Types.Derived_Type_Access (Result);
end Create_Derived_Type;
not overriding function Create_Derived_Record_Extension
(Self : Element_Factory;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
New_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Parent : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access;
And_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions.Expression_Vector_Access;
With_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Record_Definition : not null Program.Elements.Definitions
.Definition_Access)
return not null Program.Elements.Derived_Record_Extensions
.Derived_Record_Extension_Access is
Result : constant Derived_Record_Extension_Access :=
new (Self.Subpool) Program.Nodes.Derived_Record_Extensions
.Derived_Record_Extension'
(Program.Nodes.Derived_Record_Extensions.Create
(Abstract_Token => Abstract_Token,
Limited_Token => Limited_Token, New_Token => New_Token,
Parent => Parent, And_Token => And_Token,
Progenitors => Progenitors, With_Token => With_Token,
Record_Definition => Record_Definition));
begin
return Program.Elements.Derived_Record_Extensions
.Derived_Record_Extension_Access
(Result);
end Create_Derived_Record_Extension;
not overriding function Create_Enumeration_Type
(Self : Element_Factory;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Literals : not null Program.Elements
.Enumeration_Literal_Specifications
.Enumeration_Literal_Specification_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Enumeration_Types
.Enumeration_Type_Access is
Result : constant Enumeration_Type_Access :=
new (Self.Subpool) Program.Nodes.Enumeration_Types.Enumeration_Type'
(Program.Nodes.Enumeration_Types.Create
(Left_Bracket_Token => Left_Bracket_Token, Literals => Literals,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Enumeration_Types.Enumeration_Type_Access
(Result);
end Create_Enumeration_Type;
not overriding function Create_Signed_Integer_Type
(Self : Element_Factory;
Range_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Lower_Bound : not null Program.Elements.Expressions
.Expression_Access;
Double_Dot_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Upper_Bound : not null Program.Elements.Expressions
.Expression_Access)
return not null Program.Elements.Signed_Integer_Types
.Signed_Integer_Type_Access is
Result : constant Signed_Integer_Type_Access :=
new (Self.Subpool) Program.Nodes.Signed_Integer_Types
.Signed_Integer_Type'
(Program.Nodes.Signed_Integer_Types.Create
(Range_Token => Range_Token, Lower_Bound => Lower_Bound,
Double_Dot_Token => Double_Dot_Token,
Upper_Bound => Upper_Bound));
begin
return Program.Elements.Signed_Integer_Types.Signed_Integer_Type_Access
(Result);
end Create_Signed_Integer_Type;
not overriding function Create_Modular_Type
(Self : Element_Factory;
Mod_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Modulus : not null Program.Elements.Expressions.Expression_Access)
return not null Program.Elements.Modular_Types.Modular_Type_Access is
Result : constant Modular_Type_Access :=
new (Self.Subpool) Program.Nodes.Modular_Types.Modular_Type'
(Program.Nodes.Modular_Types.Create
(Mod_Token => Mod_Token, Modulus => Modulus));
begin
return Program.Elements.Modular_Types.Modular_Type_Access (Result);
end Create_Modular_Type;
not overriding function Create_Root_Type
(Self : Element_Factory)
return not null Program.Elements.Root_Types.Root_Type_Access is
Result : constant Root_Type_Access :=
new (Self.Subpool) Program.Nodes.Root_Types.Root_Type;
begin
return Program.Elements.Root_Types.Root_Type_Access (Result);
end Create_Root_Type;
not overriding function Create_Floating_Point_Type
(Self : Element_Factory;
Digits_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Digits_Expression : not null Program.Elements.Expressions
.Expression_Access;
Real_Range : Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access)
return not null Program.Elements.Floating_Point_Types
.Floating_Point_Type_Access is
Result : constant Floating_Point_Type_Access :=
new (Self.Subpool) Program.Nodes.Floating_Point_Types
.Floating_Point_Type'
(Program.Nodes.Floating_Point_Types.Create
(Digits_Token => Digits_Token,
Digits_Expression => Digits_Expression,
Real_Range => Real_Range));
begin
return Program.Elements.Floating_Point_Types.Floating_Point_Type_Access
(Result);
end Create_Floating_Point_Type;
not overriding function Create_Ordinary_Fixed_Point_Type
(Self : Element_Factory;
Delta_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Delta_Expression : not null Program.Elements.Expressions
.Expression_Access;
Real_Range : not null Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access)
return not null Program.Elements.Ordinary_Fixed_Point_Types
.Ordinary_Fixed_Point_Type_Access is
Result : constant Ordinary_Fixed_Point_Type_Access :=
new (Self.Subpool) Program.Nodes.Ordinary_Fixed_Point_Types
.Ordinary_Fixed_Point_Type'
(Program.Nodes.Ordinary_Fixed_Point_Types.Create
(Delta_Token => Delta_Token,
Delta_Expression => Delta_Expression,
Real_Range => Real_Range));
begin
return Program.Elements.Ordinary_Fixed_Point_Types
.Ordinary_Fixed_Point_Type_Access
(Result);
end Create_Ordinary_Fixed_Point_Type;
not overriding function Create_Decimal_Fixed_Point_Type
(Self : Element_Factory;
Delta_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Delta_Expression : not null Program.Elements.Expressions
.Expression_Access;
Digits_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Digits_Expression : not null Program.Elements.Expressions
.Expression_Access;
Real_Range : Program.Elements.Real_Range_Specifications
.Real_Range_Specification_Access)
return not null Program.Elements.Decimal_Fixed_Point_Types
.Decimal_Fixed_Point_Type_Access is
Result : constant Decimal_Fixed_Point_Type_Access :=
new (Self.Subpool) Program.Nodes.Decimal_Fixed_Point_Types
.Decimal_Fixed_Point_Type'
(Program.Nodes.Decimal_Fixed_Point_Types.Create
(Delta_Token => Delta_Token,
Delta_Expression => Delta_Expression,
Digits_Token => Digits_Token,
Digits_Expression => Digits_Expression,
Real_Range => Real_Range));
begin
return Program.Elements.Decimal_Fixed_Point_Types
.Decimal_Fixed_Point_Type_Access
(Result);
end Create_Decimal_Fixed_Point_Type;
not overriding function Create_Unconstrained_Array_Type
(Self : Element_Factory;
Array_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Index_Subtypes : not null Program.Elements.Expressions
.Expression_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Of_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Component_Definition : not null Program.Elements.Component_Definitions
.Component_Definition_Access)
return not null Program.Elements.Unconstrained_Array_Types
.Unconstrained_Array_Type_Access is
Result : constant Unconstrained_Array_Type_Access :=
new (Self.Subpool) Program.Nodes.Unconstrained_Array_Types
.Unconstrained_Array_Type'
(Program.Nodes.Unconstrained_Array_Types.Create
(Array_Token => Array_Token,
Left_Bracket_Token => Left_Bracket_Token,
Index_Subtypes => Index_Subtypes,
Right_Bracket_Token => Right_Bracket_Token,
Of_Token => Of_Token,
Component_Definition => Component_Definition));
begin
return Program.Elements.Unconstrained_Array_Types
.Unconstrained_Array_Type_Access
(Result);
end Create_Unconstrained_Array_Type;
not overriding function Create_Constrained_Array_Type
(Self : Element_Factory;
Array_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Index_Subtypes : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Of_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Component_Definition : not null Program.Elements.Component_Definitions
.Component_Definition_Access)
return not null Program.Elements.Constrained_Array_Types
.Constrained_Array_Type_Access is
Result : constant Constrained_Array_Type_Access :=
new (Self.Subpool) Program.Nodes.Constrained_Array_Types
.Constrained_Array_Type'
(Program.Nodes.Constrained_Array_Types.Create
(Array_Token => Array_Token,
Left_Bracket_Token => Left_Bracket_Token,
Index_Subtypes => Index_Subtypes,
Right_Bracket_Token => Right_Bracket_Token,
Of_Token => Of_Token,
Component_Definition => Component_Definition));
begin
return Program.Elements.Constrained_Array_Types
.Constrained_Array_Type_Access
(Result);
end Create_Constrained_Array_Type;
not overriding function Create_Record_Type
(Self : Element_Factory;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
Tagged_Token : Program.Lexical_Elements.Lexical_Element_Access;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Record_Definition : not null Program.Elements.Definitions
.Definition_Access)
return not null Program.Elements.Record_Types.Record_Type_Access is
Result : constant Record_Type_Access :=
new (Self.Subpool) Program.Nodes.Record_Types.Record_Type'
(Program.Nodes.Record_Types.Create
(Abstract_Token => Abstract_Token, Tagged_Token => Tagged_Token,
Limited_Token => Limited_Token,
Record_Definition => Record_Definition));
begin
return Program.Elements.Record_Types.Record_Type_Access (Result);
end Create_Record_Type;
not overriding function Create_Interface_Type
(Self : Element_Factory;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Task_Token : Program.Lexical_Elements.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Synchronized_Token : Program.Lexical_Elements.Lexical_Element_Access;
Interface_Token : Program.Lexical_Elements.Lexical_Element_Access;
And_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access)
return not null Program.Elements.Interface_Types.Interface_Type_Access is
Result : constant Interface_Type_Access :=
new (Self.Subpool) Program.Nodes.Interface_Types.Interface_Type'
(Program.Nodes.Interface_Types.Create
(Limited_Token => Limited_Token, Task_Token => Task_Token,
Protected_Token => Protected_Token,
Synchronized_Token => Synchronized_Token,
Interface_Token => Interface_Token, And_Token => And_Token,
Progenitors => Progenitors));
begin
return Program.Elements.Interface_Types.Interface_Type_Access (Result);
end Create_Interface_Type;
not overriding function Create_Object_Access_Type
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Access_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
All_Token : Program.Lexical_Elements.Lexical_Element_Access;
Constant_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subtype_Indication : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access)
return not null Program.Elements.Object_Access_Types
.Object_Access_Type_Access is
Result : constant Object_Access_Type_Access :=
new (Self.Subpool) Program.Nodes.Object_Access_Types
.Object_Access_Type'
(Program.Nodes.Object_Access_Types.Create
(Not_Token => Not_Token, Null_Token => Null_Token,
Access_Token => Access_Token, All_Token => All_Token,
Constant_Token => Constant_Token,
Subtype_Indication => Subtype_Indication));
begin
return Program.Elements.Object_Access_Types.Object_Access_Type_Access
(Result);
end Create_Object_Access_Type;
not overriding function Create_Procedure_Access_Type
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Access_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Procedure_Access_Types
.Procedure_Access_Type_Access is
Result : constant Procedure_Access_Type_Access :=
new (Self.Subpool) Program.Nodes.Procedure_Access_Types
.Procedure_Access_Type'
(Program.Nodes.Procedure_Access_Types.Create
(Not_Token => Not_Token, Null_Token => Null_Token,
Access_Token => Access_Token,
Protected_Token => Protected_Token,
Procedure_Token => Procedure_Token,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Procedure_Access_Types
.Procedure_Access_Type_Access
(Result);
end Create_Procedure_Access_Type;
not overriding function Create_Function_Access_Type
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Access_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Result_Subtype : not null Program.Elements.Element_Access)
return not null Program.Elements.Function_Access_Types
.Function_Access_Type_Access is
Result : constant Function_Access_Type_Access :=
new (Self.Subpool) Program.Nodes.Function_Access_Types
.Function_Access_Type'
(Program.Nodes.Function_Access_Types.Create
(Not_Token => Not_Token, Null_Token => Null_Token,
Access_Token => Access_Token,
Protected_Token => Protected_Token,
Function_Token => Function_Token,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Return_Token => Return_Token, Not_Token_2 => Not_Token_2,
Null_Token_2 => Null_Token_2,
Result_Subtype => Result_Subtype));
begin
return Program.Elements.Function_Access_Types.Function_Access_Type_Access
(Result);
end Create_Function_Access_Type;
not overriding function Create_Formal_Private_Type_Definition
(Self : Element_Factory;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
Tagged_Token : Program.Lexical_Elements.Lexical_Element_Access;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Private_Token : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Formal_Private_Type_Definitions
.Formal_Private_Type_Definition_Access is
Result : constant Formal_Private_Type_Definition_Access :=
new (Self.Subpool) Program.Nodes.Formal_Private_Type_Definitions
.Formal_Private_Type_Definition'
(Program.Nodes.Formal_Private_Type_Definitions.Create
(Abstract_Token => Abstract_Token, Tagged_Token => Tagged_Token,
Limited_Token => Limited_Token,
Private_Token => Private_Token));
begin
return Program.Elements.Formal_Private_Type_Definitions
.Formal_Private_Type_Definition_Access
(Result);
end Create_Formal_Private_Type_Definition;
not overriding function Create_Formal_Derived_Type_Definition
(Self : Element_Factory;
Abstract_Token : Program.Lexical_Elements.Lexical_Element_Access;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Synchronized_Token : Program.Lexical_Elements.Lexical_Element_Access;
New_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Subtype_Mark : not null Program.Elements.Expressions
.Expression_Access;
And_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
With_Token : Program.Lexical_Elements.Lexical_Element_Access;
Private_Token : Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Formal_Derived_Type_Definitions
.Formal_Derived_Type_Definition_Access is
Result : constant Formal_Derived_Type_Definition_Access :=
new (Self.Subpool) Program.Nodes.Formal_Derived_Type_Definitions
.Formal_Derived_Type_Definition'
(Program.Nodes.Formal_Derived_Type_Definitions.Create
(Abstract_Token => Abstract_Token,
Limited_Token => Limited_Token,
Synchronized_Token => Synchronized_Token,
New_Token => New_Token, Subtype_Mark => Subtype_Mark,
And_Token => And_Token, Progenitors => Progenitors,
With_Token => With_Token, Private_Token => Private_Token));
begin
return Program.Elements.Formal_Derived_Type_Definitions
.Formal_Derived_Type_Definition_Access
(Result);
end Create_Formal_Derived_Type_Definition;
not overriding function Create_Formal_Discrete_Type_Definition
(Self : Element_Factory;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Box_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Formal_Discrete_Type_Definitions
.Formal_Discrete_Type_Definition_Access is
Result : constant Formal_Discrete_Type_Definition_Access :=
new (Self.Subpool) Program.Nodes.Formal_Discrete_Type_Definitions
.Formal_Discrete_Type_Definition'
(Program.Nodes.Formal_Discrete_Type_Definitions.Create
(Left_Bracket_Token => Left_Bracket_Token,
Box_Token => Box_Token,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Formal_Discrete_Type_Definitions
.Formal_Discrete_Type_Definition_Access
(Result);
end Create_Formal_Discrete_Type_Definition;
not overriding function Create_Formal_Signed_Integer_Type_Definition
(Self : Element_Factory;
Range_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Box_Token : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Formal_Signed_Integer_Type_Definitions
.Formal_Signed_Integer_Type_Definition_Access is
Result : constant Formal_Signed_Integer_Type_Definition_Access :=
new (Self.Subpool) Program.Nodes
.Formal_Signed_Integer_Type_Definitions
.Formal_Signed_Integer_Type_Definition'
(Program.Nodes.Formal_Signed_Integer_Type_Definitions.Create
(Range_Token => Range_Token, Box_Token => Box_Token));
begin
return Program.Elements.Formal_Signed_Integer_Type_Definitions
.Formal_Signed_Integer_Type_Definition_Access
(Result);
end Create_Formal_Signed_Integer_Type_Definition;
not overriding function Create_Formal_Modular_Type_Definition
(Self : Element_Factory;
Mod_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Box_Token : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Formal_Modular_Type_Definitions
.Formal_Modular_Type_Definition_Access is
Result : constant Formal_Modular_Type_Definition_Access :=
new (Self.Subpool) Program.Nodes.Formal_Modular_Type_Definitions
.Formal_Modular_Type_Definition'
(Program.Nodes.Formal_Modular_Type_Definitions.Create
(Mod_Token => Mod_Token, Box_Token => Box_Token));
begin
return Program.Elements.Formal_Modular_Type_Definitions
.Formal_Modular_Type_Definition_Access
(Result);
end Create_Formal_Modular_Type_Definition;
not overriding function Create_Formal_Floating_Point_Definition
(Self : Element_Factory;
Digits_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Box_Token : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Formal_Floating_Point_Definitions
.Formal_Floating_Point_Definition_Access is
Result : constant Formal_Floating_Point_Definition_Access :=
new (Self.Subpool) Program.Nodes.Formal_Floating_Point_Definitions
.Formal_Floating_Point_Definition'
(Program.Nodes.Formal_Floating_Point_Definitions.Create
(Digits_Token => Digits_Token, Box_Token => Box_Token));
begin
return Program.Elements.Formal_Floating_Point_Definitions
.Formal_Floating_Point_Definition_Access
(Result);
end Create_Formal_Floating_Point_Definition;
not overriding function Create_Formal_Ordinary_Fixed_Point_Definition
(Self : Element_Factory;
Delta_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Box_Token : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Formal_Ordinary_Fixed_Point_Definitions
.Formal_Ordinary_Fixed_Point_Definition_Access is
Result : constant Formal_Ordinary_Fixed_Point_Definition_Access :=
new (Self.Subpool) Program.Nodes
.Formal_Ordinary_Fixed_Point_Definitions
.Formal_Ordinary_Fixed_Point_Definition'
(Program.Nodes.Formal_Ordinary_Fixed_Point_Definitions.Create
(Delta_Token => Delta_Token, Box_Token => Box_Token));
begin
return Program.Elements.Formal_Ordinary_Fixed_Point_Definitions
.Formal_Ordinary_Fixed_Point_Definition_Access
(Result);
end Create_Formal_Ordinary_Fixed_Point_Definition;
not overriding function Create_Formal_Decimal_Fixed_Point_Definition
(Self : Element_Factory;
Delta_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Box_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Digits_Token : not null Program.Lexical_Elements.Lexical_Element_Access;
Box_Token_2 : not null Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Formal_Decimal_Fixed_Point_Definitions
.Formal_Decimal_Fixed_Point_Definition_Access is
Result : constant Formal_Decimal_Fixed_Point_Definition_Access :=
new (Self.Subpool) Program.Nodes
.Formal_Decimal_Fixed_Point_Definitions
.Formal_Decimal_Fixed_Point_Definition'
(Program.Nodes.Formal_Decimal_Fixed_Point_Definitions.Create
(Delta_Token => Delta_Token, Box_Token => Box_Token,
Digits_Token => Digits_Token, Box_Token_2 => Box_Token_2));
begin
return Program.Elements.Formal_Decimal_Fixed_Point_Definitions
.Formal_Decimal_Fixed_Point_Definition_Access
(Result);
end Create_Formal_Decimal_Fixed_Point_Definition;
not overriding function Create_Formal_Unconstrained_Array_Type
(Self : Element_Factory;
Array_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Index_Subtypes : not null Program.Elements.Expressions
.Expression_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Of_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Component_Definition : not null Program.Elements.Component_Definitions
.Component_Definition_Access)
return not null Program.Elements.Formal_Unconstrained_Array_Types
.Formal_Unconstrained_Array_Type_Access is
Result : constant Formal_Unconstrained_Array_Type_Access :=
new (Self.Subpool) Program.Nodes.Formal_Unconstrained_Array_Types
.Formal_Unconstrained_Array_Type'
(Program.Nodes.Formal_Unconstrained_Array_Types.Create
(Array_Token => Array_Token,
Left_Bracket_Token => Left_Bracket_Token,
Index_Subtypes => Index_Subtypes,
Right_Bracket_Token => Right_Bracket_Token,
Of_Token => Of_Token,
Component_Definition => Component_Definition));
begin
return Program.Elements.Formal_Unconstrained_Array_Types
.Formal_Unconstrained_Array_Type_Access
(Result);
end Create_Formal_Unconstrained_Array_Type;
not overriding function Create_Formal_Constrained_Array_Type
(Self : Element_Factory;
Array_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Index_Subtypes : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Of_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Component_Definition : not null Program.Elements.Component_Definitions
.Component_Definition_Access)
return not null Program.Elements.Formal_Constrained_Array_Types
.Formal_Constrained_Array_Type_Access is
Result : constant Formal_Constrained_Array_Type_Access :=
new (Self.Subpool) Program.Nodes.Formal_Constrained_Array_Types
.Formal_Constrained_Array_Type'
(Program.Nodes.Formal_Constrained_Array_Types.Create
(Array_Token => Array_Token,
Left_Bracket_Token => Left_Bracket_Token,
Index_Subtypes => Index_Subtypes,
Right_Bracket_Token => Right_Bracket_Token,
Of_Token => Of_Token,
Component_Definition => Component_Definition));
begin
return Program.Elements.Formal_Constrained_Array_Types
.Formal_Constrained_Array_Type_Access
(Result);
end Create_Formal_Constrained_Array_Type;
not overriding function Create_Formal_Object_Access_Type
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Access_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
All_Token : Program.Lexical_Elements.Lexical_Element_Access;
Constant_Token : Program.Lexical_Elements.Lexical_Element_Access;
Subtype_Indication : not null Program.Elements.Subtype_Indications
.Subtype_Indication_Access)
return not null Program.Elements.Formal_Object_Access_Types
.Formal_Object_Access_Type_Access is
Result : constant Formal_Object_Access_Type_Access :=
new (Self.Subpool) Program.Nodes.Formal_Object_Access_Types
.Formal_Object_Access_Type'
(Program.Nodes.Formal_Object_Access_Types.Create
(Not_Token => Not_Token, Null_Token => Null_Token,
Access_Token => Access_Token, All_Token => All_Token,
Constant_Token => Constant_Token,
Subtype_Indication => Subtype_Indication));
begin
return Program.Elements.Formal_Object_Access_Types
.Formal_Object_Access_Type_Access
(Result);
end Create_Formal_Object_Access_Type;
not overriding function Create_Formal_Procedure_Access_Type
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Access_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Procedure_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access)
return not null Program.Elements.Formal_Procedure_Access_Types
.Formal_Procedure_Access_Type_Access is
Result : constant Formal_Procedure_Access_Type_Access :=
new (Self.Subpool) Program.Nodes.Formal_Procedure_Access_Types
.Formal_Procedure_Access_Type'
(Program.Nodes.Formal_Procedure_Access_Types.Create
(Not_Token => Not_Token, Null_Token => Null_Token,
Access_Token => Access_Token,
Protected_Token => Protected_Token,
Procedure_Token => Procedure_Token,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Formal_Procedure_Access_Types
.Formal_Procedure_Access_Type_Access
(Result);
end Create_Formal_Procedure_Access_Type;
not overriding function Create_Formal_Function_Access_Type
(Self : Element_Factory;
Not_Token : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token : Program.Lexical_Elements.Lexical_Element_Access;
Access_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Function_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Left_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Parameters : Program.Elements.Parameter_Specifications
.Parameter_Specification_Vector_Access;
Right_Bracket_Token : Program.Lexical_Elements.Lexical_Element_Access;
Return_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Not_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Null_Token_2 : Program.Lexical_Elements.Lexical_Element_Access;
Result_Subtype : not null Program.Elements.Element_Access)
return not null Program.Elements.Formal_Function_Access_Types
.Formal_Function_Access_Type_Access is
Result : constant Formal_Function_Access_Type_Access :=
new (Self.Subpool) Program.Nodes.Formal_Function_Access_Types
.Formal_Function_Access_Type'
(Program.Nodes.Formal_Function_Access_Types.Create
(Not_Token => Not_Token, Null_Token => Null_Token,
Access_Token => Access_Token,
Protected_Token => Protected_Token,
Function_Token => Function_Token,
Left_Bracket_Token => Left_Bracket_Token,
Parameters => Parameters,
Right_Bracket_Token => Right_Bracket_Token,
Return_Token => Return_Token, Not_Token_2 => Not_Token_2,
Null_Token_2 => Null_Token_2,
Result_Subtype => Result_Subtype));
begin
return Program.Elements.Formal_Function_Access_Types
.Formal_Function_Access_Type_Access
(Result);
end Create_Formal_Function_Access_Type;
not overriding function Create_Formal_Interface_Type
(Self : Element_Factory;
Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Task_Token : Program.Lexical_Elements.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Synchronized_Token : Program.Lexical_Elements.Lexical_Element_Access;
Interface_Token : Program.Lexical_Elements.Lexical_Element_Access;
And_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access)
return not null Program.Elements.Formal_Interface_Types
.Formal_Interface_Type_Access is
Result : constant Formal_Interface_Type_Access :=
new (Self.Subpool) Program.Nodes.Formal_Interface_Types
.Formal_Interface_Type'
(Program.Nodes.Formal_Interface_Types.Create
(Limited_Token => Limited_Token, Task_Token => Task_Token,
Protected_Token => Protected_Token,
Synchronized_Token => Synchronized_Token,
Interface_Token => Interface_Token, And_Token => And_Token,
Progenitors => Progenitors));
begin
return Program.Elements.Formal_Interface_Types
.Formal_Interface_Type_Access
(Result);
end Create_Formal_Interface_Type;
not overriding function Create_Range_Attribute_Reference
(Self : Element_Factory;
Range_Attribute : not null Program.Elements.Attribute_References
.Attribute_Reference_Access)
return not null Program.Elements.Range_Attribute_References
.Range_Attribute_Reference_Access is
Result : constant Range_Attribute_Reference_Access :=
new (Self.Subpool) Program.Nodes.Range_Attribute_References
.Range_Attribute_Reference'
(Program.Nodes.Range_Attribute_References.Create
(Range_Attribute => Range_Attribute));
begin
return Program.Elements.Range_Attribute_References
.Range_Attribute_Reference_Access
(Result);
end Create_Range_Attribute_Reference;
not overriding function Create_Simple_Expression_Range
(Self : Element_Factory;
Lower_Bound : not null Program.Elements.Expressions
.Expression_Access;
Double_Dot_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Upper_Bound : not null Program.Elements.Expressions
.Expression_Access)
return not null Program.Elements.Simple_Expression_Ranges
.Simple_Expression_Range_Access is
Result : constant Simple_Expression_Range_Access :=
new (Self.Subpool) Program.Nodes.Simple_Expression_Ranges
.Simple_Expression_Range'
(Program.Nodes.Simple_Expression_Ranges.Create
(Lower_Bound => Lower_Bound,
Double_Dot_Token => Double_Dot_Token,
Upper_Bound => Upper_Bound));
begin
return Program.Elements.Simple_Expression_Ranges
.Simple_Expression_Range_Access
(Result);
end Create_Simple_Expression_Range;
not overriding function Create_Digits_Constraint
(Self : Element_Factory;
Digits_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Digits_Expression : not null Program.Elements.Expressions
.Expression_Access;
Range_Token : Program.Lexical_Elements.Lexical_Element_Access;
Real_Range_Constraint : Program.Elements.Constraints.Constraint_Access)
return not null Program.Elements.Digits_Constraints
.Digits_Constraint_Access is
Result : constant Digits_Constraint_Access :=
new (Self.Subpool) Program.Nodes.Digits_Constraints
.Digits_Constraint'
(Program.Nodes.Digits_Constraints.Create
(Digits_Token => Digits_Token,
Digits_Expression => Digits_Expression,
Range_Token => Range_Token,
Real_Range_Constraint => Real_Range_Constraint));
begin
return Program.Elements.Digits_Constraints.Digits_Constraint_Access
(Result);
end Create_Digits_Constraint;
not overriding function Create_Delta_Constraint
(Self : Element_Factory;
Delta_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Delta_Expression : not null Program.Elements.Expressions
.Expression_Access;
Range_Token : Program.Lexical_Elements.Lexical_Element_Access;
Real_Range_Constraint : Program.Elements.Constraints.Constraint_Access)
return not null Program.Elements.Delta_Constraints
.Delta_Constraint_Access is
Result : constant Delta_Constraint_Access :=
new (Self.Subpool) Program.Nodes.Delta_Constraints.Delta_Constraint'
(Program.Nodes.Delta_Constraints.Create
(Delta_Token => Delta_Token,
Delta_Expression => Delta_Expression,
Range_Token => Range_Token,
Real_Range_Constraint => Real_Range_Constraint));
begin
return Program.Elements.Delta_Constraints.Delta_Constraint_Access
(Result);
end Create_Delta_Constraint;
not overriding function Create_Index_Constraint
(Self : Element_Factory;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Ranges : not null Program.Elements.Discrete_Ranges
.Discrete_Range_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Index_Constraints
.Index_Constraint_Access is
Result : constant Index_Constraint_Access :=
new (Self.Subpool) Program.Nodes.Index_Constraints.Index_Constraint'
(Program.Nodes.Index_Constraints.Create
(Left_Bracket_Token => Left_Bracket_Token, Ranges => Ranges,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Index_Constraints.Index_Constraint_Access
(Result);
end Create_Index_Constraint;
not overriding function Create_Discriminant_Constraint
(Self : Element_Factory;
Left_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Discriminants : not null Program.Elements.Discriminant_Associations
.Discriminant_Association_Vector_Access;
Right_Bracket_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Discriminant_Constraints
.Discriminant_Constraint_Access is
Result : constant Discriminant_Constraint_Access :=
new (Self.Subpool) Program.Nodes.Discriminant_Constraints
.Discriminant_Constraint'
(Program.Nodes.Discriminant_Constraints.Create
(Left_Bracket_Token => Left_Bracket_Token,
Discriminants => Discriminants,
Right_Bracket_Token => Right_Bracket_Token));
begin
return Program.Elements.Discriminant_Constraints
.Discriminant_Constraint_Access
(Result);
end Create_Discriminant_Constraint;
not overriding function Create_Attribute_Definition_Clause
(Self : Element_Factory;
For_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Expressions.Expression_Access;
Use_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Expression : not null Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause_Access is
Result : constant Attribute_Definition_Clause_Access :=
new (Self.Subpool) Program.Nodes.Attribute_Definition_Clauses
.Attribute_Definition_Clause'
(Program.Nodes.Attribute_Definition_Clauses.Create
(For_Token => For_Token, Name => Name, Use_Token => Use_Token,
Expression => Expression, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Attribute_Definition_Clauses
.Attribute_Definition_Clause_Access
(Result);
end Create_Attribute_Definition_Clause;
not overriding function Create_Enumeration_Representation_Clause
(Self : Element_Factory;
For_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Expressions.Expression_Access;
Use_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Expression : not null Program.Elements.Array_Aggregates
.Array_Aggregate_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Enumeration_Representation_Clauses
.Enumeration_Representation_Clause_Access is
Result : constant Enumeration_Representation_Clause_Access :=
new (Self.Subpool) Program.Nodes.Enumeration_Representation_Clauses
.Enumeration_Representation_Clause'
(Program.Nodes.Enumeration_Representation_Clauses.Create
(For_Token => For_Token, Name => Name, Use_Token => Use_Token,
Expression => Expression, Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Enumeration_Representation_Clauses
.Enumeration_Representation_Clause_Access
(Result);
end Create_Enumeration_Representation_Clause;
not overriding function Create_Record_Representation_Clause
(Self : Element_Factory;
For_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Expressions
.Expression_Access;
Use_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Record_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
At_Token : Program.Lexical_Elements.Lexical_Element_Access;
Mod_Token : Program.Lexical_Elements.Lexical_Element_Access;
Mod_Clause_Expression : Program.Elements.Expressions.Expression_Access;
Mod_Semicolon_Token : Program.Lexical_Elements.Lexical_Element_Access;
Component_Clauses : not null Program.Elements.Component_Clauses
.Component_Clause_Vector_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.Record_Representation_Clauses
.Record_Representation_Clause_Access is
Result : constant Record_Representation_Clause_Access :=
new (Self.Subpool) Program.Nodes.Record_Representation_Clauses
.Record_Representation_Clause'
(Program.Nodes.Record_Representation_Clauses.Create
(For_Token => For_Token, Name => Name, Use_Token => Use_Token,
Record_Token => Record_Token, At_Token => At_Token,
Mod_Token => Mod_Token,
Mod_Clause_Expression => Mod_Clause_Expression,
Mod_Semicolon_Token => Mod_Semicolon_Token,
Component_Clauses => Component_Clauses,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.Record_Representation_Clauses
.Record_Representation_Clause_Access
(Result);
end Create_Record_Representation_Clause;
not overriding function Create_At_Clause
(Self : Element_Factory;
For_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Name : not null Program.Elements.Identifiers.Identifier_Access;
Use_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
At_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Expression : not null Program.Elements.Expressions.Expression_Access;
Semicolon_Token : not null Program.Lexical_Elements
.Lexical_Element_Access)
return not null Program.Elements.At_Clauses.At_Clause_Access is
Result : constant At_Clause_Access :=
new (Self.Subpool) Program.Nodes.At_Clauses.At_Clause'
(Program.Nodes.At_Clauses.Create
(For_Token => For_Token, Name => Name, Use_Token => Use_Token,
At_Token => At_Token, Expression => Expression,
Semicolon_Token => Semicolon_Token));
begin
return Program.Elements.At_Clauses.At_Clause_Access (Result);
end Create_At_Clause;
not overriding function Create_Exception_Handler
(Self : Element_Factory;
When_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Choice_Parameter : Program.Elements.Choice_Parameter_Specifications
.Choice_Parameter_Specification_Access;
Choices : not null Program.Element_Vectors.Element_Vector_Access;
Arrow_Token : not null Program.Lexical_Elements
.Lexical_Element_Access;
Statements : not null Program.Element_Vectors.Element_Vector_Access)
return not null Program.Elements.Exception_Handlers
.Exception_Handler_Access is
Result : constant Exception_Handler_Access :=
new (Self.Subpool) Program.Nodes.Exception_Handlers
.Exception_Handler'
(Program.Nodes.Exception_Handlers.Create
(When_Token => When_Token, Choice_Parameter => Choice_Parameter,
Choices => Choices, Arrow_Token => Arrow_Token,
Statements => Statements));
begin
return Program.Elements.Exception_Handlers.Exception_Handler_Access
(Result);
end Create_Exception_Handler;
end Program.Element_Factories;
| 47.683692 | 79 | 0.719617 |
1d3e8265a1335d21e2c495b9e5fa966892536b02 | 2,911 | adb | Ada | src/natools-s_expressions.adb | faelys/natools | 947c004e6f69ca144942c6af40e102d089223cf8 | [
"0BSD"
] | null | null | null | src/natools-s_expressions.adb | faelys/natools | 947c004e6f69ca144942c6af40e102d089223cf8 | [
"0BSD"
] | null | null | null | src/natools-s_expressions.adb | faelys/natools | 947c004e6f69ca144942c6af40e102d089223cf8 | [
"0BSD"
] | null | null | null | ------------------------------------------------------------------------------
-- Copyright (c) 2013-2014, Natacha Porté --
-- --
-- Permission to use, copy, modify, and distribute this software for any --
-- purpose with or without fee is hereby granted, provided that the above --
-- copyright notice and this permission notice appear in all copies. --
-- --
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --
-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF --
-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR --
-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES --
-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN --
-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF --
-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --
------------------------------------------------------------------------------
package body Natools.S_Expressions is
function To_String (Data : in Atom) return String is
begin
return Result : String (1 .. Data'Length) do
for I in Result'Range loop
Result (I) := Character'Val (Data (Data'First + Offset (I - 1)));
end loop;
end return;
end To_String;
function To_Atom (Data : in String) return Atom is
begin
return Result : Atom (0 .. Data'Length - 1) do
for I in Result'Range loop
Result (I) := Character'Pos (Data (Data'First + Integer (I)));
end loop;
end return;
end To_Atom;
function Less_Than (Left, Right : Atom) return Boolean is
begin
return Left'Length < Right'Length
or else (Left'Length = Right'Length and then Left < Right);
end Less_Than;
procedure Next (Object : in out Descriptor'Class) is
Discarded : Events.Event;
pragma Unreferenced (Discarded);
begin
Next (Object, Discarded);
end Next;
procedure Close_Current_List (Object : in out Descriptor'Class) is
Level : Natural := 0;
Event : Events.Event := Object.Current_Event;
begin
if Object.Current_Event in Events.Error | Events.End_Of_Input then
return;
end if;
loop
Object.Next (Event);
case Event is
when Events.Error | Events.End_Of_Input =>
exit;
when Events.Open_List =>
Level := Level + 1;
when Events.Close_List =>
exit when Level = 0;
Level := Level - 1;
when Events.Add_Atom =>
null;
end case;
end loop;
end Close_Current_List;
end Natools.S_Expressions;
| 35.072289 | 78 | 0.551013 |
1d3711fbda017d19b9b35deeb40e143cec77319e | 62 | ads | Ada | tlsf/src/tlsf.ads | vasil-sd/ada-tlsf | c30cfaf5f0b87ebb6e4dd479e50b3f9b11381ddd | [
"MIT"
] | 3 | 2020-02-21T15:42:14.000Z | 2020-04-08T09:42:32.000Z | tlsf/src/tlsf.ads | vasil-sd/ada-tlsf | c30cfaf5f0b87ebb6e4dd479e50b3f9b11381ddd | [
"MIT"
] | null | null | null | tlsf/src/tlsf.ads | vasil-sd/ada-tlsf | c30cfaf5f0b87ebb6e4dd479e50b3f9b11381ddd | [
"MIT"
] | 1 | 2020-02-21T15:29:26.000Z | 2020-02-21T15:29:26.000Z | package TLSF with SPARK_Mode, Pure, Preelaborate is
end TLSF;
| 20.666667 | 51 | 0.806452 |
3d6570df0c56429b3212c10d7de083a64ce43c6b | 487 | ads | Ada | tests/tests.ads | JeremyGrosser/notcursesada | 01c895ffe6b27069aaeca842bd6d01b27aead011 | [
"Apache-2.0"
] | 5 | 2021-05-14T10:02:36.000Z | 2021-11-03T18:53:58.000Z | tests/tests.ads | JeremyGrosser/notcursesada | 01c895ffe6b27069aaeca842bd6d01b27aead011 | [
"Apache-2.0"
] | null | null | null | tests/tests.ads | JeremyGrosser/notcursesada | 01c895ffe6b27069aaeca842bd6d01b27aead011 | [
"Apache-2.0"
] | null | null | null | --
-- Copyright 2021 (C) Jeremy Grosser <[email protected]>
--
-- SPDX-License-Identifier: Apache-2.0
--
package Tests is
procedure Test_Version;
procedure Test_Hello_World;
procedure Test_Colors;
procedure Test_Palette;
procedure Test_Dimensions;
procedure Test_Input;
procedure Test_Plane_Split;
procedure Test_Progress_Bar;
procedure Test_Visual_File;
procedure Test_Visual_Bitmap;
procedure Test_Visual_Pixel;
procedure Test_Direct;
end Tests;
| 22.136364 | 56 | 0.761807 |
2f6c2cc3fe29b5282439d4b011b36f33bbc56b7e | 1,733 | ads | Ada | tier-1/xcb/source/thin/xcb-xcb_selection_notify_event_t.ads | charlie5/cBound | 741be08197a61ad9c72553e3302f3b669902216d | [
"0BSD"
] | 2 | 2015-11-12T11:16:20.000Z | 2021-08-24T22:32:04.000Z | tier-1/xcb/source/thin/xcb-xcb_selection_notify_event_t.ads | charlie5/cBound | 741be08197a61ad9c72553e3302f3b669902216d | [
"0BSD"
] | 1 | 2018-06-05T05:19:35.000Z | 2021-11-20T01:13:23.000Z | tier-1/xcb/source/thin/xcb-xcb_selection_notify_event_t.ads | charlie5/cBound | 741be08197a61ad9c72553e3302f3b669902216d | [
"0BSD"
] | null | null | null | -- This file is generated by SWIG. Please do not modify by hand.
--
with Interfaces;
with Interfaces.C;
with Interfaces.C.Pointers;
package xcb.xcb_selection_notify_event_t is
-- Item
--
type Item is record
response_type : aliased Interfaces.Unsigned_8;
pad0 : aliased Interfaces.Unsigned_8;
sequence : aliased Interfaces.Unsigned_16;
time : aliased xcb.xcb_timestamp_t;
requestor : aliased xcb.xcb_window_t;
selection : aliased xcb.xcb_atom_t;
target : aliased xcb.xcb_atom_t;
property : aliased xcb.xcb_atom_t;
end record;
-- Item_Array
--
type Item_Array is
array
(Interfaces.C
.size_t range <>) of aliased xcb.xcb_selection_notify_event_t
.Item;
-- Pointer
--
package C_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_selection_notify_event_t.Item,
Element_Array => xcb.xcb_selection_notify_event_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_selection_notify_event_t
.Pointer;
-- Pointer_Pointer
--
package C_Pointer_Pointers is new Interfaces.C.Pointers
(Index => Interfaces.C.size_t,
Element => xcb.xcb_selection_notify_event_t.Pointer,
Element_Array => xcb.xcb_selection_notify_event_t.Pointer_Array,
Default_Terminator => null);
subtype Pointer_Pointer is C_Pointer_Pointers.Pointer;
end xcb.xcb_selection_notify_event_t;
| 28.883333 | 75 | 0.656665 |
1288ad7b9ecaac24a518a938fba47a2da6dd48d5 | 8,098 | adb | Ada | testsuite/ada_lexer_test.adb | reznikmm/increment | 0edff267d468f005f28b5d2c0c0fe23f4ff3164c | [
"MIT"
] | 5 | 2017-10-20T08:40:59.000Z | 2021-05-15T16:55:39.000Z | testsuite/ada_lexer_test.adb | reznikmm/increment | 0edff267d468f005f28b5d2c0c0fe23f4ff3164c | [
"MIT"
] | null | null | null | testsuite/ada_lexer_test.adb | reznikmm/increment | 0edff267d468f005f28b5d2c0c0fe23f4ff3164c | [
"MIT"
] | null | null | null | -- Copyright (c) 2015-2017 Maxim Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-- License-Filename: LICENSE
-------------------------------------------------------------
with Ada.Characters.Wide_Wide_Latin_1;
with Ada.Wide_Wide_Text_IO;
with League.Strings;
with Incr.Ada_Lexers;
with Incr.Lexers.Batch_Lexers;
procedure Ada_Lexer_Test is
type File_Source is new Incr.Lexers.Batch_Lexers.Abstract_Source with record
Text : League.Strings.Universal_String;
Index : Positive := 1;
end record;
overriding function Get_Next (Self : not null access File_Source)
return Wide_Wide_Character;
function Debug_Image
(Value : Incr.Ada_Lexers.Token) return Wide_Wide_String;
function Debug_Image
(Value : Incr.Ada_Lexers.Token) return Wide_Wide_String
is
use Incr.Ada_Lexers;
begin
case Value is
when Arrow_Token => return "Arrow_Token";
when Double_Dot_Token => return "Double_Dot_Token";
when Double_Star_Token => return "Double_Star_Token";
when Assignment_Token => return "Assignment_Token";
when Inequality_Token => return "Inequality_Token";
when Greater_Or_Equal_Token => return "Greater_Or_Equal_Token";
when Less_Or_Equal_Token => return "Less_Or_Equal_Token";
when Left_Label_Token => return "Left_Label_Token";
when Right_Label_Token => return "Right_Label_Token";
when Box_Token => return "Box_Token";
when Ampersand_Token => return "Ampersand_Token";
when Apostrophe_Token => return "Apostrophe_Token";
when Left_Parenthesis_Token => return "Left_Parenthesis_Token";
when Right_Parenthesis_Token => return "Right_Parenthesis_Token";
when Star_Token => return "Star_Token";
when Plus_Token => return "Plus_Token";
when Comma_Token => return "Comma_Token";
when Hyphen_Token => return "Hyphen_Token";
when Dot_Token => return "Dot_Token";
when Slash_Token => return "Slash_Token";
when Colon_Token => return "Colon_Token";
when Semicolon_Token => return "Semicolon_Token";
when Less_Token => return "Less_Token";
when Equal_Token => return "Equal_Token";
when Greater_Token => return "Greater_Token";
when Vertical_Line_Token => return "Vertical_Line_Token";
when Identifier_Token => return "Identifier_Token";
when Numeric_Literal_Token => return "Numeric_Literal_Token";
when Character_Literal_Token => return "Character_Literal_Token";
when String_Literal_Token => return "String_Literal_Token";
when Comment_Token => return "Comment_Token";
when Space_Token => return "Space_Token";
when New_Line_Token => return "New_Line_Token";
when Error_Token => return "Error_Token";
when Abort_Token => return "Abort_Token";
when Abs_Token => return "Abs_Token";
when Abstract_Token => return "Abstract_Token";
when Accept_Token => return "Accept_Token";
when Access_Token => return "Access_Token";
when Aliased_Token => return "Aliased_Token";
when All_Token => return "All_Token";
when And_Token => return "And_Token";
when Array_Token => return "Array_Token";
when At_Token => return "At_Token";
when Begin_Token => return "Begin_Token";
when Body_Token => return "Body_Token";
when Case_Token => return "Case_Token";
when Constant_Token => return "Constant_Token";
when Declare_Token => return "Declare_Token";
when Delay_Token => return "Delay_Token";
when Delta_Token => return "Delta_Token";
when Digits_Token => return "Digits_Token";
when Do_Token => return "Do_Token";
when Else_Token => return "Else_Token";
when Elsif_Token => return "Elsif_Token";
when End_Token => return "End_Token";
when Entry_Token => return "Entry_Token";
when Exception_Token => return "Exception_Token";
when Exit_Token => return "Exit_Token";
when For_Token => return "For_Token";
when Function_Token => return "Function_Token";
when Generic_Token => return "Generic_Token";
when Goto_Token => return "Goto_Token";
when If_Token => return "If_Token";
when In_Token => return "In_Token";
when Interface_Token => return "Interface_Token";
when Is_Token => return "Is_Token";
when Limited_Token => return "Limited_Token";
when Loop_Token => return "Loop_Token";
when Mod_Token => return "Mod_Token";
when New_Token => return "New_Token";
when Not_Token => return "Not_Token";
when Null_Token => return "Null_Token";
when Of_Token => return "Of_Token";
when Or_Token => return "Or_Token";
when Others_Token => return "Others_Token";
when Out_Token => return "Out_Token";
when Overriding_Token => return "Overriding_Token";
when Package_Token => return "Package_Token";
when Pragma_Token => return "Pragma_Token";
when Private_Token => return "Private_Token";
when Procedure_Token => return "Procedure_Token";
when Protected_Token => return "Protected_Token";
when Raise_Token => return "Raise_Token";
when Range_Token => return "Range_Token";
when Record_Token => return "Record_Token";
when Rem_Token => return "Rem_Token";
when Renames_Token => return "Renames_Token";
when Requeue_Token => return "Requeue_Token";
when Return_Token => return "Return_Token";
when Reverse_Token => return "Reverse_Token";
when Select_Token => return "Select_Token";
when Separate_Token => return "Separate_Token";
when Some_Token => return "Some_Token";
when Subtype_Token => return "Subtype_Token";
when Synchronized_Token => return "Synchronized_Token";
when Tagged_Token => return "Tagged_Token";
when Task_Token => return "Task_Token";
when Terminate_Token => return "Terminate_Token";
when Then_Token => return "Then_Token";
when Type_Token => return "Type_Token";
when Until_Token => return "Until_Token";
when Use_Token => return "Use_Token";
when When_Token => return "When_Token";
when While_Token => return "While_Token";
when With_Token => return "With_Token";
when Xor_Token => return "Xor_Token";
when others =>
return Token'Wide_Wide_Image (Value);
end case;
end Debug_Image;
--------------
-- Get_Next --
--------------
overriding function Get_Next (Self : not null access File_Source)
return Wide_Wide_Character is
begin
if Self.Index < Self.Text.Length then
return Result : constant Wide_Wide_Character :=
Self.Text.Element (Self.Index).To_Wide_Wide_Character
do
Self.Index := Self.Index + 1;
end return;
else
return Incr.Lexers.Batch_Lexers.End_Of_Input;
end if;
end Get_Next;
use type Incr.Ada_Lexers.Token;
Token : Incr.Ada_Lexers.Token;
Source : aliased File_Source;
Batch_Lexer : constant Incr.Lexers.Batch_Lexers.Batch_Lexer_Access :=
new Incr.Ada_Lexers.Batch_Lexer;
begin
while not Ada.Wide_Wide_Text_IO.End_Of_File loop
declare
Line : constant Wide_Wide_String := Ada.Wide_Wide_Text_IO.Get_Line;
begin
Source.Text.Append (Line);
Source.Text.Append (Ada.Characters.Wide_Wide_Latin_1.LF);
end;
end loop;
Batch_Lexer.Set_Source (Source'Unchecked_Access);
loop
Batch_Lexer.Get_Token (Token);
exit when Token = 0;
Ada.Wide_Wide_Text_IO.Put (Debug_Image (Token));
Ada.Wide_Wide_Text_IO.Put (' ');
Ada.Wide_Wide_Text_IO.Put_Line
(Batch_Lexer.Get_Text.To_Wide_Wide_String);
end loop;
end Ada_Lexer_Test;
| 42.397906 | 79 | 0.651148 |
416732dc2beb3ebeb722fc2c1fa24edb625cd599 | 802 | ads | Ada | firmware/coreboot/src/mainboard/gigabyte/ga-b75m-d3v/gma-mainboard.ads | fabiojna02/OpenCellular | 45b6a202d6b2e2485c89955b9a6da920c4d56ddb | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 1 | 2019-11-04T07:11:25.000Z | 2019-11-04T07:11:25.000Z | firmware/coreboot/src/mainboard/gigabyte/ga-b75m-d3v/gma-mainboard.ads | aimin-wang/OpenCellular | 5308146bf7edf43cc81c0e4d15305b711117070a | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 13 | 2018-10-12T21:29:09.000Z | 2018-10-25T20:06:51.000Z | firmware/coreboot/src/mainboard/gigabyte/ga-b75m-d3v/gma-mainboard.ads | aimin-wang/OpenCellular | 5308146bf7edf43cc81c0e4d15305b711117070a | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | --
-- Copyright (C) 2017 Bill XIE [email protected]
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
with HW.GFX.GMA;
with HW.GFX.GMA.Display_Probing;
use HW.GFX.GMA;
use HW.GFX.GMA.Display_Probing;
private package GMA.Mainboard is
ports : constant Port_List :=
(HDMI1,
Analog,
others => Disabled);
end GMA.Mainboard;
| 27.655172 | 71 | 0.730673 |
12c7508f6a9bf489ba8dd94d670bcb25d9f8164e | 737 | ads | Ada | orka_simd/src/x86/gnat/fma/orka-simd-fma-doubles.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 52 | 2016-07-30T23:00:28.000Z | 2022-02-05T11:54:55.000Z | orka_simd/src/x86/gnat/fma/orka-simd-fma-doubles.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 79 | 2016-08-01T18:36:48.000Z | 2022-02-27T12:14:20.000Z | orka_simd/src/x86/gnat/fma/orka-simd-fma-doubles.ads | onox/orka | 9edf99559a16ffa96dfdb208322f4d18efbcbac6 | [
"Apache-2.0"
] | 4 | 2018-04-28T22:36:26.000Z | 2020-11-14T23:00:29.000Z | -- SPDX-License-Identifier: Apache-2.0
--
-- Copyright (c) 2020 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.FMA.Doubles is
pragma Pure;
end Orka.SIMD.FMA.Doubles;
| 36.85 | 76 | 0.729986 |
3d7950f55974932a30e29bbb75aacac923bbabfc | 31,056 | adb | Ada | 3-mid/opengl/source/lean/io/opengl-io.adb | charlie5/lace-alire | 9ace9682cf4daac7adb9f980c2868d6225b8111c | [
"0BSD"
] | 1 | 2022-01-20T07:13:42.000Z | 2022-01-20T07:13:42.000Z | 3-mid/opengl/source/lean/io/opengl-io.adb | charlie5/lace-alire | 9ace9682cf4daac7adb9f980c2868d6225b8111c | [
"0BSD"
] | null | null | null | 3-mid/opengl/source/lean/io/opengl-io.adb | charlie5/lace-alire | 9ace9682cf4daac7adb9f980c2868d6225b8111c | [
"0BSD"
] | null | null | null | with
openGL.Images,
openGL.Viewport,
openGL.Tasks,
openGL.Errors,
GID,
GL.Binding,
GL.safe,
GL.Pointers,
ada.unchecked_Conversion,
ada.Calendar,
ada.Characters.handling,
System;
package body openGL.IO
is
use ada.Characters.handling,
ada.Streams.Stream_IO;
use type Index_t;
--------
-- Face
--
function Vertices_of (Self : in Face) return Vertices
is
begin
case Self.Kind
is
when Triangle => return Self.Tri;
when Quad => return Self.Quad;
when Polygon => return Self.Poly.all;
end case;
end Vertices_of;
procedure set_Vertex_in (Self : in out Face; Which : in long_Index_t;
To : in Vertex)
is
begin
case Self.Kind
is
when Triangle => Self.Tri (Which) := To;
when Quad => Self.Quad (Which) := To;
when Polygon => Self.Poly (Which) := To;
end case;
end set_Vertex_in;
procedure destroy (Self : in out Face)
is
procedure free is new ada.unchecked_Deallocation (Vertices, Vertices_view);
begin
if Self.Kind = Polygon
then
free (Self.Poly);
end if;
end destroy;
-------------
-- Operations
--
function current_Frame return Image
is
use GL,
GL.Binding,
GL.Pointers,
Texture;
Extent : constant Extent_2d := openGL.Viewport.Extent;
Frame : Image (1 .. Index_t (Extent.Width),
1 .. Index_t (Extent.Height));
begin
glReadPixels (0, 0,
GLsizei (Extent.Width),
GLsizei (Extent.Height),
to_GL (Format' (Texture.RGB)),
GL_UNSIGNED_BYTE,
to_GLvoid_access (Frame (1, 1).Red'Access));
return Frame;
end current_Frame;
---------
-- Forge
--
function to_height_Map (image_Filename : in asset_Name;
Scale : in Real := 1.0) return height_Map_view
is
File : Ada.Streams.Stream_IO.File_Type;
Image : GID.Image_Descriptor;
up_Name : constant String := To_Upper (to_String (image_Filename));
next_Frame : ada.Calendar.Day_Duration := 0.0;
begin
open (File, in_File, to_String (image_Filename));
GID.load_Image_Header (Image,
Stream (File).all,
try_tga => image_Filename'Length >= 4
and then up_Name (up_Name'Last - 3 .. up_Name'Last) = ".TGA");
declare
image_Width : constant Positive := GID.Pixel_Width (Image);
image_Height : constant Positive := GID.Pixel_Height (Image);
the_Heights : constant access height_Map := new height_Map' (1 .. Index_t (image_height) =>
(1 .. Index_t (image_width) => <>));
procedure load_raw_Image
is
subtype primary_Color_range is GL.GLubyte;
Row, Col : Index_t;
procedure set_X_Y (x, y : Natural)
is
begin
Col := Index_t (X + 1);
Row := Index_t (Y + 1);
end Set_X_Y;
procedure put_Pixel (Red, Green, Blue : primary_Color_range;
Alpha : primary_Color_range)
is
pragma Warnings (Off, alpha); -- Alpha is just ignored.
use type GL.GLubyte, Real;
begin
the_Heights (Row, Col) := (Real (Red) + Real (Green) + Real (Blue))
/ (3.0 * 255.0)
* Scale;
if Col = Index_t (image_Width)
then
Row := Row + 1;
Col := 1;
else
Col := Col + 1;
end if;
-- ^ GID requires us to look to next pixel on the right for next time.
end put_Pixel;
procedure Feedback (Percents : Natural) is null;
procedure load_Image is new GID.load_Image_contents (primary_Color_range,
set_X_Y,
put_Pixel,
Feedback,
GID.fast);
begin
load_Image (Image, next_Frame);
end load_Raw_image;
begin
load_raw_Image;
close (File);
return the_Heights.all'unchecked_Access;
end;
end to_height_Map;
function fetch_Image (Stream : in ada.Streams.Stream_IO.Stream_access;
try_TGA : in Boolean) return Image
is
begin
return Images.fetch_Image (Stream, try_TGA);
end fetch_Image;
function to_Image (image_Filename : in asset_Name) return Image
is
File : ada.Streams.Stream_IO.File_type;
up_Name : constant String := to_Upper (to_String (image_Filename));
begin
open (File, In_File, to_String (image_Filename));
declare
the_Image : constant Image
:= fetch_Image (Stream (File),
try_TGA => image_Filename'Length >= 4
and then up_Name (up_Name'Last - 3 .. up_Name'Last) = ".TGA");
begin
close (File);
return the_Image;
end;
end to_Image;
function to_lucid_Image (image_Filename : in asset_Name) return lucid_Image
is
Unused : aliased Boolean;
begin
return to_lucid_Image (image_Filename, Unused'Access);
end to_lucid_Image;
function to_lucid_Image (image_Filename : in asset_Name;
is_Lucid : access Boolean) return lucid_Image
is
File : ada.Streams.Stream_IO.File_type;
the_Image : GID.Image_Descriptor;
up_Name : constant String := to_Upper (to_String (image_Filename));
next_Frame : ada.Calendar.Day_Duration := 0.0;
begin
open (File, in_File, to_String (image_Filename));
GID.load_Image_Header (the_Image,
Stream (File).all,
try_TGA => image_Filename'Length >= 4
and then up_Name (up_Name'Last - 3 .. up_Name'Last) = ".TGA");
declare
image_Width : constant Positive := GID.Pixel_Width (the_Image);
image_Height : constant Positive := GID.Pixel_Height (the_Image);
Frame : lucid_Image (1 .. Index_t (image_Height),
1 .. Index_t (image_Width));
procedure load_raw_Image
is
subtype primary_Color_range is GL.GLubyte;
Row, Col : Index_t;
procedure set_X_Y (X, Y : Natural)
is
begin
Col := Index_t (X + 1);
Row := Index_t (Y + 1);
end set_X_Y;
procedure put_Pixel (Red, Green, Blue : primary_Color_range;
Alpha : primary_Color_range)
is
use type GL.GLubyte, Real;
begin
Frame (Row, Col) := ((Red, Green, Blue), Alpha);
if Col = Index_t (image_Width)
then -- GID requires us to look to next pixel on the right for next time.
Row := Row + 1;
Col := 1;
else
Col := Col + 1;
end if;
if Alpha /= opaque_Value
then
is_Lucid.all := True;
end if;
end put_Pixel;
procedure Feedback (Percents : Natural) is null;
procedure load_Image is new GID.load_Image_contents (primary_Color_range,
set_X_Y,
put_Pixel,
Feedback,
GID.fast);
begin
load_Image (the_Image, next_Frame);
end Load_raw_image;
begin
is_Lucid.all := False;
load_raw_Image;
close (File);
return Frame;
end;
end to_lucid_Image;
function to_Texture (image_Filename : in asset_Name) return Texture.Object
is
use Texture;
is_Lucid : aliased Boolean;
the_lucid_Image : constant lucid_Image := to_lucid_Image (image_Filename, is_Lucid'Access);
the_Texture : Texture.Object := Forge.to_Texture (Texture.Dimensions' (the_lucid_Image'Length (2),
the_lucid_Image'Length (1)));
begin
if is_Lucid
then
set_Image (the_Texture, the_lucid_Image);
else
declare
the_opaque_Image : constant Image := to_Image (the_lucid_Image);
begin
set_Image (the_Texture, the_opaque_Image);
end;
end if;
return the_Texture;
end to_Texture;
procedure destroy (Self : in out Model)
is
procedure free is new ada.unchecked_Deallocation (bone_Weights, bone_Weights_view);
procedure free is new ada.unchecked_Deallocation (bone_Weights_array, bone_Weights_array_view);
begin
free (Self.Sites);
free (Self.Coords);
free (Self.Normals);
if Self.Weights /= null
then
for Each in Self.Weights'Range
loop
free (Self.Weights (Each));
end loop;
free (Self.Weights);
end if;
for Each in Self.Faces'Range
loop
destroy (Self.Faces (Each));
end loop;
free (Self.Faces);
end destroy;
--------------------------------
--- Screenshot and Video Capture
--
type U8 is mod 2 ** 8; for U8 'Size use 8;
type U16 is mod 2 ** 16; for U16'Size use 16;
type U32 is mod 2 ** 32; for U32'Size use 32;
type I32 is range -2 ** 31 .. 2 ** 31 - 1;
for I32'Size use 32;
generic
type Number is mod <>;
S : Stream_Access;
procedure write_Intel_x86_Number (N : in Number);
procedure write_Intel_x86_Number (N : in Number)
is
M : Number := N;
Bytes : constant Integer := Number'Size / 8;
begin
for i in 1 .. bytes
loop
U8'write (S, U8 (M mod 256));
M := M / 256;
end loop;
end write_Intel_x86_Number;
procedure write_raw_BGR_Frame (Stream : Stream_Access;
Width, Height : Natural)
is
use GL,
GL.Binding,
openGL.Texture;
-- 4-byte padding for .bmp/.avi formats is the same as GL's default
-- padding: see glPixelStore, GL_[UN]PACK_ALIGNMENT = 4 as initial value.
-- http://www.openGL.org/sdk/docs/man/xhtml/glPixelStore.xml
--
padded_row_Size : constant Positive := 4 * Integer (Float'Ceiling (Float (Width) * 3.0 / 4.0));
-- (in bytes)
type temp_Bitmap_type is array (Natural range <>) of aliased gl.GLUbyte;
PicData: temp_Bitmap_type (0 .. (padded_row_Size + 4) * (Height + 4) - 1);
-- No dynamic allocation needed!
-- The "+4" are there to avoid parity address problems when GL writes to the buffer.
type Loc_pointer is new gl.safe.GLvoid_Pointer;
function convert is new ada.unchecked_Conversion (System.Address, Loc_pointer);
-- This method is functionally identical as GNAT's Unrestricted_Access
-- but has no type safety (cf GNAT Docs).
pragma no_strict_Aliasing (Loc_pointer); -- Recommended by GNAT 2005+.
pPicData : Loc_pointer;
data_Max : constant Integer := padded_row_Size * Height - 1;
-- Workaround for the severe xxx'Read xxx'Write performance
-- problems in the GNAT and ObjectAda compilers (as in 2009)
-- This is possible if and only if Byte = Stream_Element and
-- arrays types are both packed the same way.
--
type Byte_array is array (Integer range <>) of aliased GLUByte;
subtype Size_Test_a is Byte_array (1 .. 19);
subtype Size_Test_b is ada.Streams.Stream_Element_array (1 .. 19);
workaround_possible: constant Boolean := Size_Test_a'Size = Size_Test_b'Size
and then Size_Test_a'Alignment = Size_Test_b'Alignment;
begin
Tasks.check;
pPicData:= Convert (PicData (0)'Address);
GLReadPixels (0, 0,
GLSizei (Width),
GLSizei (Height),
to_GL (Texture.BGR),
GL.GL_UNSIGNED_BYTE,
pPicData);
Errors.log;
if workaround_possible
then
declare
use ada.Streams;
SE_Buffer : Stream_Element_array (0 .. Stream_Element_Offset (PicData'Last));
for SE_Buffer'Address use PicData'Address;
pragma import (Ada, SE_Buffer);
begin
ada.Streams.write (Stream.all, SE_Buffer (0 .. Stream_Element_Offset (data_Max)));
end;
else
temp_Bitmap_type'write (Stream, PicData (0 .. data_Max));
end if;
end write_raw_BGR_Frame;
procedure write_raw_BGRA_Frame (Stream : Stream_access;
Width, Height : Natural)
is
use GL,
GL.Binding,
Texture;
-- 4-byte padding for .bmp/.avi formats is the same as GL's default
-- padding: see glPixelStore, GL_[UN]PACK_ALIGNMENT = 4 as initial value.
-- http://www.openGL.org/sdk/docs/man/xhtml/glPixelStore.xml
--
padded_row_Size : constant Positive:= 4 * Integer (Float'Ceiling (Float (Width)));
-- (in bytes)
type temp_Bitmap_type is array (Natural range <>) of aliased gl.GLUbyte;
PicData: temp_Bitmap_type (0.. (padded_row_size + 4) * (height + 4) - 1);
-- No dynamic allocation needed!
-- The "+4" are there to avoid parity address problems when GL writes
-- to the buffer.
type Loc_pointer is new gl.safe.GLvoid_Pointer;
function convert is new ada.unchecked_Conversion (System.Address, Loc_pointer);
-- This method is functionally identical as GNAT's Unrestricted_Access
-- but has no type safety (cf GNAT Docs).
pragma no_strict_Aliasing (loc_pointer); -- Recommended by GNAT 2005+.
pPicData : Loc_pointer;
data_Max : constant Integer := padded_row_Size * Height - 1;
-- Workaround for the severe xxx'Read xxx'Write performance
-- problems in the GNAT and ObjectAda compilers (as in 2009)
-- This is possible if and only if Byte = Stream_Element and
-- arrays types are both packed the same way.
--
type Byte_array is array (Integer range <>) of aliased GLUByte;
subtype Size_Test_a is Byte_Array (1..19);
subtype Size_Test_b is ada.Streams.Stream_Element_array (1 .. 19);
workaround_possible: constant Boolean := Size_Test_a'Size = Size_Test_b'Size
and then Size_Test_a'Alignment = Size_Test_b'Alignment;
begin
Tasks.check;
pPicData:= convert (PicData (0)'Address);
GLReadPixels (0, 0,
GLSizei (width),
GLSizei (height),
to_GL (openGL.Texture.BGRA),
GL.GL_UNSIGNED_BYTE,
pPicData);
Errors.log;
if workaround_possible
then
declare
use ada.Streams;
SE_Buffer : Stream_Element_array (0 .. Stream_Element_Offset (PicData'Last));
for SE_Buffer'Address use PicData'Address;
pragma Import (Ada, SE_Buffer);
begin
ada.Streams.write (Stream.all, SE_Buffer (0 .. Stream_Element_Offset (data_Max)));
end;
else
temp_Bitmap_type'write (Stream, PicData (0 .. data_Max));
end if;
end write_raw_BGRA_Frame;
-------------
-- Screenshot
--
subtype FXPT2DOT30 is U32;
type CIEXYZ is
record
ciexyzX : FXPT2DOT30;
ciexyzY : FXPT2DOT30;
ciexyzZ : FXPT2DOT30;
end record;
type CIEXYZTRIPLE is
record
ciexyzRed : CIEXYZ;
ciexyzGreen : CIEXYZ;
ciexyzBlue : CIEXYZ;
end record;
type BITMAPFILEHEADER is
record
bfType : U16;
bfSize : U32;
bfReserved1 : U16 := 0;
bfReserved2 : U16 := 0;
bfOffBits : U32;
end record;
pragma pack (BITMAPFILEHEADER);
for BITMAPFILEHEADER'Size use 8 * 14;
type BITMAPINFOHEADER is
record
biSize : U32;
biWidth : I32;
biHeight : I32;
biPlanes : U16;
biBitCount : U16;
biCompression : U32;
biSizeImage : U32;
biXPelsPerMeter : I32 := 0;
biYPelsPerMeter : I32 := 0;
biClrUsed : U32 := 0;
biClrImportant : U32 := 0;
end record;
pragma pack (BITMAPINFOHEADER);
for BITMAPINFOHEADER'Size use 8 * 40;
type BITMAPV4HEADER is
record
Core : BITMAPINFOHEADER;
bV4RedMask : U32;
bV4GreenMask : U32;
bV4BlueMask : U32;
bV4AlphaMask : U32;
bV4CSType : U32;
bV4Endpoints : CIEXYZTRIPLE;
bV4GammaRed : U32;
bV4GammaGreen : U32;
bV4GammaBlue : U32;
end record;
pragma pack (BITMAPV4HEADER);
for BITMAPV4HEADER'Size use 8 * 108;
procedure opaque_Screenshot (Filename : in String)
is
use GL,
GL.Binding;
File : ada.Streams.Stream_IO.File_Type;
FileInfo : BITMAPINFOHEADER;
FileHeader : BITMAPFILEHEADER;
Viewport : array (0 .. 3) of aliased GLint;
begin
Tasks.check;
glGetIntegerv (GL_VIEWPORT,
Viewport (0)'Unchecked_Access);
Errors.log;
FileHeader.bfType := 16#4D42#; -- 'BM'
FileHeader.bfOffBits := BITMAPINFOHEADER'Size / 8
+ BITMAPFILEHEADER'Size / 8;
FileInfo.biSize := BITMAPINFOHEADER'Size / 8;
FileInfo.biWidth := I32 (Viewport (2));
FileInfo.biHeight := I32 (Viewport (3));
FileInfo.biPlanes := 1;
FileInfo.biBitCount := 24;
FileInfo.biCompression := 0;
FileInfo.biSizeImage := U32 ( 4
* Integer (Float'Ceiling (Float (FileInfo.biWidth) * 3.0 / 4.0))
* Integer (FileInfo.biHeight));
FileHeader.bfSize := FileHeader.bfOffBits + FileInfo.biSizeImage;
create (File, out_File, Filename);
declare
procedure write_Intel is new write_Intel_x86_Number (U16, Stream (File));
procedure write_Intel is new write_Intel_x86_Number (U32, Stream (File));
function convert is new ada.unchecked_Conversion (I32, U32);
begin
-- ** Endian-safe: ** --
write_Intel (FileHeader.bfType);
write_Intel (FileHeader.bfSize);
write_Intel (FileHeader.bfReserved1);
write_Intel (FileHeader.bfReserved2);
write_Intel (FileHeader.bfOffBits);
--
write_Intel ( FileInfo.biSize);
write_Intel (convert (FileInfo.biWidth));
write_Intel (convert (FileInfo.biHeight));
write_Intel ( FileInfo.biPlanes);
write_Intel ( FileInfo.biBitCount);
write_Intel ( FileInfo.biCompression);
write_Intel ( FileInfo.biSizeImage);
write_Intel (convert (FileInfo.biXPelsPerMeter));
write_Intel (convert (FileInfo.biYPelsPerMeter));
write_Intel ( FileInfo.biClrUsed);
write_Intel ( FileInfo.biClrImportant);
--
write_raw_BGR_Frame (Stream (File),
Integer (Viewport (2)),
Integer (Viewport (3)));
Close (File);
exception
when others =>
Close (File);
raise;
end;
end opaque_Screenshot;
procedure lucid_Screenshot (Filename : in String)
is
use GL,
GL.Binding;
File : ada.Streams.Stream_IO.File_type;
FileHeader : BITMAPFILEHEADER;
FileInfo : BITMAPV4HEADER;
Viewport : array (0 .. 3) of aliased GLint;
begin
Tasks.check;
glGetIntegerv (GL_VIEWPORT,
Viewport (0)'Unchecked_Access);
Errors.log;
FileHeader.bfType := 16#4D42#; -- 'BM'
FileHeader.bfOffBits := BITMAPV4HEADER 'Size / 8
+ BITMAPFILEHEADER'Size / 8;
FileInfo.Core.biSize := BITMAPV4HEADER'Size / 8;
FileInfo.Core.biWidth := I32 (Viewport (2));
FileInfo.Core.biHeight := I32 (Viewport (3));
FileInfo.Core.biPlanes := 1;
FileInfo.Core.biBitCount := 32;
FileInfo.Core.biCompression := 3;
FileInfo.Core.biSizeImage := U32 ( 4 -- 4-byte padding for '.bmp/.avi' formats.
* Integer (Float'Ceiling (Float (FileInfo.Core.biWidth)))
* Integer (FileInfo.Core.biHeight));
FileInfo.bV4RedMask := 16#00FF0000#;
FileInfo.bV4GreenMask := 16#0000FF00#;
FileInfo.bV4BlueMask := 16#000000FF#;
FileInfo.bV4AlphaMask := 16#FF000000#;
FileInfo.bV4CSType := 0;
FileInfo.bV4Endpoints := (others => (others => 0));
FileInfo.bV4GammaRed := 0;
FileInfo.bV4GammaGreen := 0;
FileInfo.bV4GammaBlue := 0;
FileHeader.bfSize := FileHeader.bfOffBits + FileInfo.Core.biSizeImage;
Create (File, out_File, Filename);
declare
procedure write_Intel is new write_Intel_x86_Number (U16, Stream (File));
procedure write_Intel is new write_Intel_x86_Number (U32, Stream (File));
function convert is new ada.unchecked_Conversion (I32, U32);
begin
-- ** Endian-safe: ** --
write_Intel (FileHeader.bfType);
write_Intel (FileHeader.bfSize);
write_Intel (FileHeader.bfReserved1);
write_Intel (FileHeader.bfReserved2);
write_Intel (FileHeader.bfOffBits);
--
write_Intel ( FileInfo.Core.biSize);
write_Intel (convert (FileInfo.Core.biWidth));
write_Intel (convert (FileInfo.Core.biHeight));
write_Intel ( FileInfo.Core.biPlanes);
write_Intel ( FileInfo.Core.biBitCount);
write_Intel ( FileInfo.Core.biCompression);
write_Intel ( FileInfo.Core.biSizeImage);
write_Intel (convert (FileInfo.Core.biXPelsPerMeter));
write_Intel (convert (FileInfo.Core.biYPelsPerMeter));
write_Intel ( FileInfo.Core.biClrUsed);
write_Intel ( FileInfo.Core.biClrImportant);
write_Intel (FileInfo.bV4RedMask);
write_Intel (FileInfo.bV4GreenMask);
write_Intel (FileInfo.bV4BlueMask);
write_Intel (FileInfo.bV4AlphaMask);
write_Intel (FileInfo.bV4CSType);
write_Intel (FileInfo.bV4Endpoints.ciexyzRed.ciexyzX);
write_Intel (FileInfo.bV4Endpoints.ciexyzRed.ciexyzY);
write_Intel (FileInfo.bV4Endpoints.ciexyzRed.ciexyzZ);
write_Intel (FileInfo.bV4Endpoints.ciexyzGreen.ciexyzX);
write_Intel (FileInfo.bV4Endpoints.ciexyzGreen.ciexyzY);
write_Intel (FileInfo.bV4Endpoints.ciexyzGreen.ciexyzZ);
write_Intel (FileInfo.bV4Endpoints.ciexyzBlue.ciexyzX);
write_Intel (FileInfo.bV4Endpoints.ciexyzBlue.ciexyzY);
write_Intel (FileInfo.bV4Endpoints.ciexyzBlue.ciexyzZ);
write_Intel (FileInfo.bV4GammaRed);
write_Intel (FileInfo.bV4GammaGreen);
write_Intel (FileInfo.bV4GammaBlue);
write_raw_BGRA_Frame (Stream (File),
Integer (Viewport (2)),
Integer (Viewport (3)));
close (File);
exception
when others =>
Close (File);
raise;
end;
end lucid_Screenshot;
procedure Screenshot (Filename : in String; with_Alpha : in Boolean := False)
is
begin
if with_Alpha
then lucid_Screenshot (Filename);
else opaque_Screenshot (Filename);
end if;
end Screenshot;
----------------
-- Video Capture
--
-- We define global variables since it is not expected
-- that more that one capture is taken at the same time.
--
avi : ada.Streams.Stream_IO.File_type;
frames : Natural;
rate : Positive;
width, height : Positive;
bmp_size : U32;
procedure write_RIFF_Headers
is
-- Written 1st time to take place (but # of frames unknown)
-- Written 2nd time for setting # of frames, sizes, etc.
--
calc_bmp_size : constant U32 := U32 (((width)) * height * 3);
-- !! stuff to multiple of 4 !!
index_size : constant U32 := U32 (frames) * 16;
movie_size : constant U32 := 4 + U32 (frames) * (calc_bmp_size + 8);
second_list_size : constant U32 := 4 + 64 + 48;
first_list_size : constant U32 := (4 + 64) + (8 + second_list_size);
file_size : constant U32 := 8 + (8 + first_list_size) + (4 + movie_size) + (8 + index_size);
Stream : constant Stream_access := ada.Streams.Stream_IO.Stream (avi);
procedure write_Intel is new write_Intel_x86_Number (U16, Stream);
procedure write_Intel is new write_Intel_x86_Number (U32, Stream);
microseconds_per_frame : constant U32 := U32 (1_000_000.0 / long_Float (rate));
begin
bmp_size := calc_bmp_size;
String'write (Stream, "RIFF");
U32 'write (Stream, file_size);
String'write (Stream, "AVI ");
String'write (Stream, "LIST");
write_Intel (first_list_size);
String'write (Stream, "hdrl");
String'write (Stream, "avih");
write_Intel (U32' (56));
-- Begin of AVI Header
write_Intel (microseconds_per_frame);
write_Intel (U32'(0)); -- MaxBytesPerSec
write_Intel (U32'(0)); -- Reserved1
write_Intel (U32'(16)); -- Flags (16 = has an index)
write_Intel (U32 (frames));
write_Intel (U32'(0)); -- InitialFrames
write_Intel (U32'(1)); -- Streams
write_Intel (bmp_size);
write_Intel (U32 (width));
write_Intel (U32 (height));
write_Intel (U32'(0)); -- Scale
write_Intel (U32'(0)); -- Rate
write_Intel (U32'(0)); -- Start
write_Intel (U32'(0)); -- Length
-- End of AVI Header
String'write (Stream, "LIST");
write_Intel (second_list_size);
String'write (Stream, "strl");
-- Begin of Str
String'write (Stream, "strh");
write_Intel (U32'(56));
String'write (Stream, "vids");
String'write (Stream, "DIB ");
write_Intel (U32'(0)); -- flags
write_Intel (U32'(0)); -- priority
write_Intel (U32'(0)); -- initial frames
write_Intel (microseconds_per_frame); -- Scale
write_Intel (U32'(1_000_000)); -- Rate
write_Intel (U32'(0)); -- Start
write_Intel (U32 (frames)); -- Length
write_Intel (bmp_size); -- SuggestedBufferSize
write_Intel (U32'(0)); -- Quality
write_Intel (U32'(0)); -- SampleSize
write_Intel (U32'(0));
write_Intel (U16 (width));
write_Intel (U16 (height));
-- End of Str
String'write (Stream, "strf");
write_Intel (U32'(40));
-- Begin of BMI
write_Intel (U32'(40)); -- BM header size (like BMP)
write_Intel (U32 (width));
write_Intel (U32 (height));
write_Intel (U16'(1)); -- Planes
write_Intel (U16'(24)); -- BitCount
write_Intel (U32'(0)); -- Compression
write_Intel (bmp_size); -- SizeImage
write_Intel (U32'(3780)); -- XPelsPerMeter
write_Intel (U32'(3780)); -- YPelsPerMeter
write_Intel (U32'(0)); -- ClrUsed
write_Intel (U32'(0)); -- ClrImportant
-- End of BMI
String'write (Stream, "LIST");
write_Intel (movie_size);
String'write (Stream, "movi");
end Write_RIFF_headers;
procedure start_Capture (AVI_Name : String;
frame_Rate : Positive)
is
use GL,
GL.Binding;
Viewport : array (0 .. 3) of aliased GLint;
begin
Tasks.check;
create (Avi, out_File, AVI_Name);
Frames := 0;
Rate := frame_Rate;
glGetIntegerv (GL_VIEWPORT,
Viewport (0)'unchecked_Access);
Errors.log;
Width := Positive (Viewport (2));
Height := Positive (Viewport (3));
-- NB: GL viewport resizing should be blocked during the video capture !
write_RIFF_Headers;
end start_Capture;
procedure capture_Frame
is
S : constant Stream_Access := Stream (Avi);
procedure Write_Intel is new Write_Intel_x86_number (U32, s);
begin
String'write (S, "00db");
write_Intel (bmp_Size);
write_raw_BGR_frame (S, Width, Height);
Frames := Frames + 1;
end capture_Frame;
procedure stop_Capture
is
index_Size : constant U32 := U32 (Frames) * 16;
S : constant Stream_Access := Stream (Avi);
ChunkOffset : U32 := 4;
procedure write_Intel is new write_Intel_x86_Number (U32, S);
begin
-- Write the index section
--
String'write (S, "idx1");
write_Intel (index_Size);
for f in 1 .. Frames
loop
String'write (S, "00db");
write_Intel (U32'(16)); -- Keyframe.
write_Intel (ChunkOffset);
ChunkOffset := ChunkOffset + bmp_Size + 8;
write_Intel (bmp_Size);
end loop;
Set_Index (avi, 1); -- Go back to file beginning.
write_RIFF_Headers; -- Rewrite headers with correct data.
close (Avi);
end stop_Capture;
end openGL.IO;
| 32.082645 | 119 | 0.548332 |
4161241698012775e1a2394d4127f0a7bc8c8aed | 3,379 | adb | Ada | software/kernel/crash.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 12 | 2017-06-08T14:19:57.000Z | 2022-03-09T02:48:59.000Z | software/kernel/crash.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 6 | 2017-06-08T13:13:50.000Z | 2020-05-15T09:32:43.000Z | software/kernel/crash.adb | TUM-EI-RCS/StratoX | 5fdd04e01a25efef6052376f43ce85b5bc973392 | [
"BSD-3-Clause"
] | 3 | 2017-06-30T14:05:06.000Z | 2022-02-17T12:20:45.000Z | with System.Machine_Reset;
with Ada.Real_Time; use Ada.Real_Time;
with System.Task_Primitives.Operations;
with Config.Tasking;
with Bounded_Image; use Bounded_Image;
with Logger;
with NVRAM;
with HIL;
with Interfaces; use Interfaces;
with Unchecked_Conversion;
-- @summary Catches all exceptions, logs them to NVRAM and reboots.
package body Crash with SPARK_Mode => Off is
-- XXX! SPARK must be off here, otherwise this function is not being implemented.
-- Reasons see below.
function To_Unsigned is new Unchecked_Conversion (System.Address, Unsigned_32);
-- SPARK RM 6.5.1: a call to a non-returning procedure introduces the
-- obligation to prove that the statement will not be executed.
-- This is the same as a run-time check that fails unconditionally.
-- RM 11.3: ...must provably never be executed.
procedure Last_Chance_Handler(location : System.Address; line : Integer) is
now : constant Time := Clock;
line16 : constant Unsigned_16 := (if line >= 0 and line <= Integer (Unsigned_16'Last)
then Unsigned_16 (line)
else Unsigned_16'Last);
begin
-- if the task which called this handler is not flight critical,
-- silently hang here. as an effect, the system lives on without this task.
declare
use System.Task_Primitives.Operations;
prio : constant ST.Extended_Priority := Get_Priority (Self);
begin
if prio < Config.Tasking.TASK_PRIO_FLIGHTCRITICAL then
Logger.log (Logger.ERROR, "Non-critical task crashed");
loop
null;
end loop;
-- FIXME: there exists a "sleep infinite" procedure...just can't find it
-- but that'll do. at least it doesn't block flight-critical tasks
end if;
end;
-- first log to NVRAM
declare
ba : constant HIL.Byte_Array := HIL.toBytes (line16);
begin
NVRAM.Store (NVRAM.VAR_EXCEPTION_LINE_L, ba (1));
NVRAM.Store (NVRAM.VAR_EXCEPTION_LINE_H, ba (2));
NVRAM.Store (NVRAM.VAR_EXCEPTION_ADDR_A, To_Unsigned (location));
end;
-- now write to console (which might fail)
Logger.log (Logger.ERROR, "Exception: Addr: " & Unsigned_Img (To_Unsigned (location))
& ", line " & Integer_Img (line));
-- wait until write finished (interrupt based)
delay until now + Milliseconds(80);
-- DEBUG ONLY: hang here to let us read the console output
-- loop
-- null;
-- end loop;
-- XXX! A last chance handler must always terminate or suspend the
-- thread that executes the handler. Suspending cannot be used here,
-- because we cannot distinguish the tasks (?). So we reboot.
-- Abruptly stop the program.
-- On bareboard platform, this returns to the monitor or reset the board.
-- In the context of an OS, this terminates the process.
System.Machine_Reset.Stop; -- this is a non-returning function. SPARK assumes it is never executed.
-- The following junk raise of Program_Error is required because
-- this is a No_Return function, and unfortunately Suspend can
-- return (although this particular call won't).
raise Program_Error;
end Last_Chance_Handler;
end Crash;
| 39.290698 | 105 | 0.653448 |
3d71f95e0d6485ed9ad068b1f306552fe2316182 | 1,504 | adb | Ada | Ada/Benchmark/src/main.adb | kkirstein/proglang-playground | d00be09ba2bb2351c6f5287cc4d93fcaf21f75fd | [
"MIT"
] | null | null | null | Ada/Benchmark/src/main.adb | kkirstein/proglang-playground | d00be09ba2bb2351c6f5287cc4d93fcaf21f75fd | [
"MIT"
] | null | null | null | Ada/Benchmark/src/main.adb | kkirstein/proglang-playground | d00be09ba2bb2351c6f5287cc4d93fcaf21f75fd | [
"MIT"
] | null | null | null |
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Calendar; use Ada.Calendar;
with Ada.Numerics.Big_Numbers.Big_Integers;
use Ada.Numerics.Big_Numbers.Big_Integers;
with Fibonacci;
with Perfect_Number;
with Primes;
with Aux_Image; use Aux_Image;
procedure Main is
package Fib renames Fibonacci;
package Pn renames Perfect_Number;
procedure Put_Elapsed (Tic : Time; Toc : Time := Clock) is
begin
Put_Line (" elapsed time: " & Duration'Image(Toc - Tic) & "s");
end Put_Elapsed;
Tic : Time;
begin
Put_Line ("Benchmark");
Put_Line ("=========");
New_Line;
Put_Line ("Fibonacci Numbers");
Put_Line ("-----------------");
Tic := Clock;
Put ("Fib_Naive (35) = " & Img (Fib.Fib_Naive (35)));
Put_Elapsed (Tic);
Tic := Clock;
Put ("Fib_Iter (1000) = " & Img (Fib.Fib_Iter (1000)));
Put_Elapsed (Tic);
Tic := Clock;
Put ("Fib_Recur (1000) = " & Img (Fib.Fib_Recur (1000)));
Put_Elapsed (Tic);
New_Line;
Put_Line ("Perfect Numbers");
Put_Line ("---------------");
Tic := Clock;
Put ("Perfect_Numbers (10000) = " & Img (Pn.Get_Perfect_Numbers (10000)));
Put_Elapsed (Tic);
New_line;
Put_Line ("Prime Numbers");
Put_Line ("-------------");
Tic := Clock;
Put ("Get_Primes (10000): (" & Img (Primes.Get_Primes (Integer (10_000))) & ")");
Put_Elapsed (Tic);
Tic := Clock;
Put ("Get_Primes (10000): (" & Img (Primes.Get_Primes (To_Big_Integer (10_000))) & ")");
Put_Elapsed (Tic);
New_Line;
end Main;
| 25.931034 | 91 | 0.613697 |
a19457eee0fcdf59154982538d88d0b70de4b5d7 | 1,027 | adb | Ada | workshop/tests/src/workshop_suite.adb | TNO/Rejuvenation-Ada | 8113ec28da3923ccde40d76cbab70e0e614f4b75 | [
"BSD-3-Clause"
] | null | null | null | workshop/tests/src/workshop_suite.adb | TNO/Rejuvenation-Ada | 8113ec28da3923ccde40d76cbab70e0e614f4b75 | [
"BSD-3-Clause"
] | null | null | null | workshop/tests/src/workshop_suite.adb | TNO/Rejuvenation-Ada | 8113ec28da3923ccde40d76cbab70e0e614f4b75 | [
"BSD-3-Clause"
] | null | null | null | with AUnit.Simple_Test_Cases; use AUnit.Simple_Test_Cases;
with Test_Examples; use Test_Examples;
with Test_Exercises_Intro; use Test_Exercises_Intro;
with Test_Exercises_Navigate; use Test_Exercises_Navigate;
with Test_Exercises_Match; use Test_Exercises_Match;
with Test_Exercises_Rewrite; use Test_Exercises_Rewrite;
package body Workshop_Suite is
function Suite return Access_Test_Suite is
Ret : constant Access_Test_Suite := new Test_Suite;
WTC : constant Test_Case_Access := new Example_Test_Case;
EITC : constant Test_Case_Access := new Exercise_Intro_Test_Case;
ENTC : constant Test_Case_Access := new Exercise_Navigate_Test_Case;
EMTC : constant Test_Case_Access := new Exercise_Match_Test_Case;
ERTC : constant Test_Case_Access := new Exercise_Rewrite_Test_Case;
begin
Ret.Add_Test (WTC);
Ret.Add_Test (EITC);
Ret.Add_Test (ENTC);
Ret.Add_Test (EMTC);
Ret.Add_Test (ERTC);
return Ret;
end Suite;
end Workshop_Suite;
| 38.037037 | 74 | 0.752678 |
59c315e9c07676c1e3d668f75e616c8a57160ab4 | 30,574 | ads | Ada | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-tags.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-tags.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | bb-runtimes/runtimes/ravenscar-full-stm32f3x4/gnat/a-tags.ads | JCGobbi/Nucleo-STM32F334R8 | 2a0b1b4b2664c92773703ac5e95dcb71979d051c | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . T A G S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2021, 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. --
-- --
-- --
-- --
-- --
-- --
-- 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. --
-- --
------------------------------------------------------------------------------
-- For performance analysis, take into account that the operations in this
-- package provide the guarantee that all dispatching calls on primitive
-- operations of tagged types and interfaces take constant time (in terms
-- of source lines executed), that is to say, the cost of these calls is
-- independent of the number of primitives of the type or interface, and
-- independent of the number of ancestors or interface progenitors that a
-- tagged type may have.
-- The following subprograms of the public part of this package take constant
-- time (in terms of source lines executed):
-- Expanded_Name, Wide_Expanded_Name, Wide_Wide_Expanded_Name, External_Tag,
-- Is_Abstract, Is_Descendant_At_Same_Level, Parent_Tag,
-- Descendant_Tag (when used with a library-level tagged type),
-- Internal_Tag (when used with a library-level tagged type).
-- The following subprograms of the public part of this package execute in
-- time that is not constant (in terms of sources line executed):
-- Internal_Tag (when used with a locally defined tagged type), because in
-- such cases this routine processes the external tag, extracts from it an
-- address available there, and converts it into the tag value returned by
-- this function. The number of instructions executed is not constant since
-- it depends on the length of the external tag string.
-- Descendant_Tag (when used with a locally defined tagged type), because
-- it relies on the subprogram Internal_Tag() to provide its functionality.
-- Interface_Ancestor_Tags, because this function returns a table whose
-- length depends on the number of interfaces covered by a tagged type.
with System.Storage_Elements;
with Ada.Unchecked_Conversion;
package Ada.Tags is
pragma Preelaborate;
-- In accordance with Ada 2005 AI-362
type Tag is private;
pragma Preelaborable_Initialization (Tag);
No_Tag : constant Tag;
function Expanded_Name (T : Tag) return String;
function Wide_Expanded_Name (T : Tag) return Wide_String;
pragma Ada_05 (Wide_Expanded_Name);
function Wide_Wide_Expanded_Name (T : Tag) return Wide_Wide_String;
pragma Ada_05 (Wide_Wide_Expanded_Name);
function External_Tag (T : Tag) return String;
function Internal_Tag (External : String) return Tag;
function Descendant_Tag
(External : String;
Ancestor : Tag) return Tag;
pragma Ada_05 (Descendant_Tag);
function Is_Descendant_At_Same_Level
(Descendant : Tag;
Ancestor : Tag) return Boolean;
pragma Ada_05 (Is_Descendant_At_Same_Level);
function Parent_Tag (T : Tag) return Tag;
pragma Ada_05 (Parent_Tag);
type Tag_Array is array (Positive range <>) of Tag;
function Interface_Ancestor_Tags (T : Tag) return Tag_Array;
pragma Ada_05 (Interface_Ancestor_Tags);
function Is_Abstract (T : Tag) return Boolean;
pragma Ada_2012 (Is_Abstract);
Tag_Error : exception;
private
-- Structure of the GNAT Primary Dispatch Table
-- +--------------------+
-- | Signature |
-- +--------------------+
-- | Tagged_Kind |
-- +--------------------+ Predef Prims
-- | Predef_Prims -----------------------------> +------------+
-- +--------------------+ | table of |
-- | Offset_To_Top | | predefined |
-- +--------------------+ | primitives |
-- |Typeinfo_Ptr/TSD_Ptr---> Type Specific Data +------------+
-- Tag ---> +--------------------+ +-------------------+
-- | table of | | inheritance depth |
-- : primitive ops : +-------------------+
-- | pointers | | access level |
-- +--------------------+ +-------------------+
-- | alignment |
-- +-------------------+
-- | expanded name |
-- +-------------------+
-- | external tag |
-- +-------------------+
-- | hash table link |
-- +-------------------+
-- | transportable |
-- +-------------------+
-- | is_abstract |
-- +-------------------+
-- | needs finalization|
-- +-------------------+
-- | Ifaces_Table ---> Interface Data
-- +-------------------+ +------------+
-- Select Specific Data <---- SSD | | Nb_Ifaces |
-- +------------------+ +-------------------+ +------------+
-- |table of primitive| | table of | | table |
-- : operation : : ancestor : : of :
-- | kinds | | tags | | interfaces |
-- +------------------+ +-------------------+ +------------+
-- |table of |
-- : entry :
-- | indexes |
-- +------------------+
-- Structure of the GNAT Secondary Dispatch Table
-- +--------------------+
-- | Signature |
-- +--------------------+
-- | Tagged_Kind |
-- +--------------------+ Predef Prims
-- | Predef_Prims -----------------------------> +------------+
-- +--------------------+ | table of |
-- | Offset_To_Top | | predefined |
-- +--------------------+ | primitives |
-- | OSD_Ptr |---> Object Specific Data | thunks |
-- Tag ---> +--------------------+ +---------------+ +------------+
-- | table of | | num prim ops |
-- : primitive op : +---------------+
-- | thunk pointers | | table of |
-- +--------------------+ + primitive |
-- | op offsets |
-- +---------------+
-- The runtime information kept for each tagged type is separated into two
-- objects: the Dispatch Table and the Type Specific Data record.
package SSE renames System.Storage_Elements;
subtype Cstring is String (Positive);
type Cstring_Ptr is access all Cstring;
pragma No_Strict_Aliasing (Cstring_Ptr);
-- Declarations for the table of interfaces
type Offset_To_Top_Function_Ptr is
access function (This : System.Address) return SSE.Storage_Offset;
-- Type definition used to call the function that is generated by the
-- expander in case of tagged types with discriminants that have secondary
-- dispatch tables. This function provides the Offset_To_Top value in this
-- specific case.
type Interface_Data_Element is record
Iface_Tag : Tag;
Static_Offset_To_Top : Boolean;
Offset_To_Top_Value : SSE.Storage_Offset;
Offset_To_Top_Func : Offset_To_Top_Function_Ptr;
Secondary_DT : Tag;
end record;
-- If some ancestor of the tagged type has discriminants the field
-- Static_Offset_To_Top is False and the field Offset_To_Top_Func
-- is used to store the access to the function generated by the
-- expander which provides this value; otherwise Static_Offset_To_Top
-- is True and such value is stored in the Offset_To_Top_Value field.
-- Secondary_DT references a secondary dispatch table whose contents
-- are pointers to the primitives of the tagged type that cover the
-- interface primitives. Secondary_DT gives support to dispatching
-- calls through interface types associated with Generic Dispatching
-- Constructors.
type Interfaces_Array is array (Natural range <>) of Interface_Data_Element;
type Interface_Data (Nb_Ifaces : Positive) is record
Ifaces_Table : Interfaces_Array (1 .. Nb_Ifaces);
end record;
type Interface_Data_Ptr is access all Interface_Data;
-- Table of abstract interfaces used to give support to backward interface
-- conversions and also to IW_Membership.
-- Primitive operation kinds. These values differentiate the kinds of
-- callable entities stored in the dispatch table. Certain kinds may
-- not be used, but are added for completeness.
type Prim_Op_Kind is
(POK_Function,
POK_Procedure,
POK_Protected_Entry,
POK_Protected_Function,
POK_Protected_Procedure,
POK_Task_Entry,
POK_Task_Function,
POK_Task_Procedure);
-- Select specific data types
type Select_Specific_Data_Element is record
Index : Positive;
Kind : Prim_Op_Kind;
end record;
type Select_Specific_Data_Array is
array (Positive range <>) of Select_Specific_Data_Element;
type Select_Specific_Data (Nb_Prim : Positive) is record
SSD_Table : Select_Specific_Data_Array (1 .. Nb_Prim);
-- NOTE: Nb_Prim is the number of non-predefined primitive operations
end record;
type Select_Specific_Data_Ptr is access all Select_Specific_Data;
-- A table used to store the primitive operation kind and entry index of
-- primitive subprograms of a type that implements a limited interface.
-- The Select Specific Data table resides in the Type Specific Data of a
-- type. This construct is used in the handling of dispatching triggers
-- in select statements.
type Prim_Ptr is access procedure;
type Address_Array is array (Positive range <>) of Prim_Ptr;
subtype Dispatch_Table is Address_Array (1 .. 1);
-- Used by GDB to identify the _tags and traverse the run-time structure
-- associated with tagged types. For compatibility with older versions of
-- gdb, its name must not be changed.
type Tag is access all Dispatch_Table;
pragma No_Strict_Aliasing (Tag);
type Interface_Tag is access all Dispatch_Table;
No_Tag : constant Tag := null;
-- The expander ensures that Tag objects reference the Prims_Ptr component
-- of the wrapper.
type Tag_Ptr is access all Tag;
pragma No_Strict_Aliasing (Tag_Ptr);
type Offset_To_Top_Ptr is access all SSE.Storage_Offset;
pragma No_Strict_Aliasing (Offset_To_Top_Ptr);
type Tag_Table is array (Natural range <>) of Tag;
type Size_Ptr is
access function (A : System.Address) return Long_Long_Integer;
type Type_Specific_Data (Idepth : Natural) is record
-- The discriminant Idepth is the Inheritance Depth Level: Used to
-- implement the membership test associated with single inheritance of
-- tagged types in constant-time. It also indicates the size of the
-- Tags_Table component.
Access_Level : Natural;
-- Accessibility level required to give support to Ada 2005 nested type
-- extensions. This feature allows safe nested type extensions by
-- shifting the accessibility checks to certain operations, rather than
-- being enforced at the type declaration. In particular, by performing
-- run-time accessibility checks on class-wide allocators, class-wide
-- function return, and class-wide stream I/O, the danger of objects
-- outliving their type declaration can be eliminated (Ada 2005: AI-344)
Alignment : Natural;
Expanded_Name : Cstring_Ptr;
External_Tag : Cstring_Ptr;
HT_Link : Tag_Ptr;
-- Components used to support to the Ada.Tags subprograms in RM 3.9
-- Note: Expanded_Name is referenced by GDB to determine the actual name
-- of the tagged type. Its requirements are: 1) it must have this exact
-- name, and 2) its contents must point to a C-style Nul terminated
-- string containing its expanded name. GDB has no requirement on a
-- given position inside the record.
Transportable : Boolean;
-- Used to check RM E.4(18), set for types that satisfy the requirements
-- for being used in remote calls as actuals for classwide formals or as
-- return values for classwide functions.
Is_Abstract : Boolean;
-- True if the type is abstract (Ada 2012: AI05-0173)
Needs_Finalization : Boolean;
-- Used to dynamically check whether an object is controlled or not
Size_Func : Size_Ptr;
-- Pointer to the subprogram computing the _size of the object. Used by
-- the run-time whenever a call to the 'size primitive is required. We
-- cannot assume that the contents of dispatch tables are addresses
-- because in some architectures the ABI allows descriptors.
Interfaces_Table : Interface_Data_Ptr;
-- Pointer to the table of interface tags. It is used to implement the
-- membership test associated with interfaces and also for backward
-- abstract interface type conversions (Ada 2005:AI-251)
SSD : Select_Specific_Data_Ptr;
-- Pointer to a table of records used in dispatching selects. This field
-- has a meaningful value for all tagged types that implement a limited,
-- protected, synchronized or task interfaces and have non-predefined
-- primitive operations.
Tags_Table : Tag_Table (0 .. Idepth);
-- Table of ancestor tags. Its size actually depends on the inheritance
-- depth level of the tagged type.
end record;
type Type_Specific_Data_Ptr is access all Type_Specific_Data;
pragma No_Strict_Aliasing (Type_Specific_Data_Ptr);
-- Declarations for the dispatch table record
type Signature_Kind is
(Unknown,
Primary_DT,
Secondary_DT);
-- Tagged type kinds with respect to concurrency and limitedness
type Tagged_Kind is
(TK_Abstract_Limited_Tagged,
TK_Abstract_Tagged,
TK_Limited_Tagged,
TK_Protected,
TK_Tagged,
TK_Task);
type Dispatch_Table_Wrapper (Num_Prims : Natural) is record
Signature : Signature_Kind;
Tag_Kind : Tagged_Kind;
Predef_Prims : System.Address;
-- Pointer to the dispatch table of predefined Ada primitives
-- According to the C++ ABI the components Offset_To_Top and TSD are
-- stored just "before" the dispatch table, and they are referenced with
-- negative offsets referring to the base of the dispatch table. The
-- _Tag (or the VTable_Ptr in C++ terminology) must point to the base
-- of the virtual table, just after these components, to point to the
-- Prims_Ptr table.
Offset_To_Top : SSE.Storage_Offset;
-- Offset between the _Tag field and the field that contains the
-- reference to this dispatch table. For primary dispatch tables it is
-- zero. For secondary dispatch tables: if the parent record type (if
-- any) has a compile-time-known size, then Offset_To_Top contains the
-- expected value, otherwise it contains SSE.Storage_Offset'Last and the
-- actual offset is to be found in the tagged record, right after the
-- field that contains the reference to this dispatch table. See the
-- implementation of Ada.Tags.Offset_To_Top for the corresponding logic.
TSD : System.Address;
Prims_Ptr : aliased Address_Array (1 .. Num_Prims);
-- The size of the Prims_Ptr array actually depends on the tagged type
-- to which it applies. For each tagged type, the expander computes the
-- actual array size, allocating the Dispatch_Table record accordingly.
end record;
type Dispatch_Table_Ptr is access all Dispatch_Table_Wrapper;
pragma No_Strict_Aliasing (Dispatch_Table_Ptr);
-- The following type declaration is used by the compiler when the program
-- is compiled with restriction No_Dispatching_Calls. It is also used with
-- interface types to generate the tag and run-time information associated
-- with them.
type No_Dispatch_Table_Wrapper is record
NDT_TSD : System.Address;
NDT_Prims_Ptr : Natural;
end record;
DT_Predef_Prims_Size : constant SSE.Storage_Count :=
SSE.Storage_Count
(1 * (Standard'Address_Size /
System.Storage_Unit));
-- Size of the Predef_Prims field of the Dispatch_Table
DT_Offset_To_Top_Size : constant SSE.Storage_Count :=
SSE.Storage_Count
(1 * (Standard'Address_Size /
System.Storage_Unit));
-- Size of the Offset_To_Top field of the Dispatch Table
DT_Typeinfo_Ptr_Size : constant SSE.Storage_Count :=
SSE.Storage_Count
(1 * (Standard'Address_Size /
System.Storage_Unit));
-- Size of the Typeinfo_Ptr field of the Dispatch Table
use type System.Storage_Elements.Storage_Offset;
DT_Offset_To_Top_Offset : constant SSE.Storage_Count :=
DT_Typeinfo_Ptr_Size
+ DT_Offset_To_Top_Size;
DT_Predef_Prims_Offset : constant SSE.Storage_Count :=
DT_Typeinfo_Ptr_Size
+ DT_Offset_To_Top_Size
+ DT_Predef_Prims_Size;
-- Offset from Prims_Ptr to Predef_Prims component
-- Object Specific Data record of secondary dispatch tables
type Object_Specific_Data_Array is array (Positive range <>) of Positive;
type Object_Specific_Data (OSD_Num_Prims : Positive) is record
OSD_Table : Object_Specific_Data_Array (1 .. OSD_Num_Prims);
-- Table used in secondary DT to reference their counterpart in the
-- select specific data (in the TSD of the primary DT). This construct
-- is used in the handling of dispatching triggers in select statements.
-- Nb_Prim is the number of non-predefined primitive operations.
end record;
type Object_Specific_Data_Ptr is access all Object_Specific_Data;
pragma No_Strict_Aliasing (Object_Specific_Data_Ptr);
-- The following subprogram specifications are placed here instead of the
-- package body to see them from the frontend through rtsfind.
function Base_Address (This : System.Address) return System.Address;
-- Ada 2005 (AI-251): Displace "This" to point to the base address of the
-- object (that is, the address of the primary tag of the object).
procedure Check_TSD (TSD : Type_Specific_Data_Ptr);
-- Ada 2012 (AI-113): Raise Program_Error if the external tag of this TSD
-- is the same as the external tag for some other tagged type declaration.
function Displace (This : System.Address; T : Tag) return System.Address;
-- Ada 2005 (AI-251): Displace "This" to point to the secondary dispatch
-- table of T.
function Secondary_Tag (T, Iface : Tag) return Tag;
-- Ada 2005 (AI-251): Given a primary tag T associated with a tagged type
-- Typ, search for the secondary tag of the interface type Iface covered
-- by Typ.
function DT (T : Tag) return Dispatch_Table_Ptr;
-- Return the pointer to the TSD record associated with T
function Get_Entry_Index (T : Tag; Position : Positive) return Positive;
-- Ada 2005 (AI-251): Return a primitive operation's entry index (if entry)
-- given a dispatch table T and a position of a primitive operation in T.
function Get_Offset_Index
(T : Tag;
Position : Positive) return Positive;
-- Ada 2005 (AI-251): Given a pointer to a secondary dispatch table (T)
-- and a position of an operation in the DT, retrieve the corresponding
-- operation's position in the primary dispatch table from the Offset
-- Specific Data table of T.
function Get_Prim_Op_Kind
(T : Tag;
Position : Positive) return Prim_Op_Kind;
-- Ada 2005 (AI-251): Return a primitive operation's kind given a dispatch
-- table T and a position of a primitive operation in T.
function Get_Tagged_Kind (T : Tag) return Tagged_Kind;
-- Ada 2005 (AI-345): Given a pointer to either a primary or a secondary
-- dispatch table, return the tagged kind of a type in the context of
-- concurrency and limitedness.
function IW_Membership (This : System.Address; T : Tag) return Boolean;
-- Ada 2005 (AI-251): General routine that checks if a given object
-- implements a tagged type. Its common usage is to check if Obj is in
-- Iface'Class, but it is also used to check if a class-wide interface
-- implements a given type (Iface_CW_Typ in T'Class). For example:
--
-- type I is interface;
-- type T is tagged ...
--
-- function Test (O : I'Class) is
-- begin
-- return O in T'Class.
-- end Test;
function Offset_To_Top
(This : System.Address) return SSE.Storage_Offset;
-- Ada 2005 (AI-251): Returns the current value of the Offset_To_Top
-- component available in the prologue of the dispatch table. If the parent
-- of the tagged type has discriminants this value is stored in a record
-- component just immediately after the tag component.
function Needs_Finalization (T : Tag) return Boolean;
-- A helper routine used in conjunction with finalization collections which
-- service class-wide types. The function dynamically determines whether an
-- object is controlled or has controlled components.
function Parent_Size
(Obj : System.Address;
T : Tag) return SSE.Storage_Count;
-- Computes the size the ancestor part of a tagged extension object whose
-- address is 'obj' by calling indirectly the ancestor _size function. The
-- ancestor is the parent of the type represented by tag T. This function
-- assumes that _size is always in slot one of the dispatch table.
procedure Register_Interface_Offset
(Prim_T : Tag;
Interface_T : Tag;
Is_Static : Boolean;
Offset_Value : SSE.Storage_Offset;
Offset_Func : Offset_To_Top_Function_Ptr);
-- Register in the table of interfaces of the tagged type associated with
-- Prim_T the offset of the record component associated with the progenitor
-- Interface_T (that is, the distance from "This" to the object component
-- containing the tag of the secondary dispatch table). In case of constant
-- offset, Is_Static is true and Offset_Value has such value. In case of
-- variable offset, Is_Static is false and Offset_Func is an access to
-- function that must be called to evaluate the offset.
procedure Register_Tag (T : Tag);
-- Insert the Tag and its associated external_tag in a table for the sake
-- of Internal_Tag.
procedure Set_Dynamic_Offset_To_Top
(This : System.Address;
Prim_T : Tag;
Interface_T : Tag;
Offset_Value : SSE.Storage_Offset;
Offset_Func : Offset_To_Top_Function_Ptr);
-- Ada 2005 (AI-251): The compiler generates calls to this routine only
-- when initializing the Offset_To_Top field of dispatch tables of tagged
-- types that cover interface types whose parent type has variable size
-- components.
--
-- "This" is the object whose dispatch table is being initialized. Prim_T
-- is the primary tag of such object. Interface_T is the interface tag for
-- which the secondary dispatch table is being initialized. Offset_Value
-- is the distance from "This" to the object component containing the tag
-- of the secondary dispatch table (a zero value means that this interface
-- shares the primary dispatch table). Offset_Func references a function
-- that must be called to evaluate the offset at run time. This routine
-- also takes care of registering these values in the table of interfaces
-- of the type.
procedure Set_Entry_Index (T : Tag; Position : Positive; Value : Positive);
-- Ada 2005 (AI-345): Set the entry index of a primitive operation in T's
-- TSD table indexed by Position.
procedure Set_Prim_Op_Kind
(T : Tag;
Position : Positive;
Value : Prim_Op_Kind);
-- Ada 2005 (AI-251): Set the kind of a primitive operation in T's TSD
-- table indexed by Position.
procedure Unregister_Tag (T : Tag);
-- Remove a particular tag from the external tag hash table
Max_Predef_Prims : constant Positive := 16;
-- Number of reserved slots for the following predefined ada primitives:
--
-- 1. Size
-- 2. Read
-- 3. Write
-- 4. Input
-- 5. Output
-- 6. "="
-- 7. assignment
-- 8. deep adjust
-- 9. deep finalize
-- 10. Put_Image
-- 11. async select
-- 12. conditional select
-- 13. prim_op kind
-- 14. task_id
-- 15. dispatching requeue
-- 16. timed select
--
-- The compiler checks that the value here is correct
subtype Predef_Prims_Table is Address_Array (1 .. Max_Predef_Prims);
type Predef_Prims_Table_Ptr is access Predef_Prims_Table;
pragma No_Strict_Aliasing (Predef_Prims_Table_Ptr);
type Addr_Ptr is access System.Address;
pragma No_Strict_Aliasing (Addr_Ptr);
-- This type is used by the frontend to generate the code that handles
-- dispatch table slots of types declared at the local level.
-------------------
-- CW_Membership --
-------------------
function To_Address is
new Ada.Unchecked_Conversion (Tag, System.Address);
function To_Addr_Ptr is
new Ada.Unchecked_Conversion (System.Address, Addr_Ptr);
function To_Type_Specific_Data_Ptr is
new Ada.Unchecked_Conversion (System.Address, Type_Specific_Data_Ptr);
-- Canonical implementation of Classwide Membership corresponding to:
-- Obj in Typ'Class
-- Each dispatch table contains a reference to a table of ancestors (stored
-- in the first part of the Tags_Table) and a count of the level of
-- inheritance "Idepth".
-- Obj is in Typ'Class if Typ'Tag is in the table of ancestors that are
-- contained in the dispatch table referenced by Obj'Tag . Knowing the
-- level of inheritance of both types, this can be computed in constant
-- time by the formula:
-- TSD (Obj'tag).Tags_Table (TSD (Obj'tag).Idepth - TSD (Typ'tag).Idepth)
-- = Typ'tag
function CW_Membership (Obj_Tag : Tag; Typ_Tag : Tag) return Boolean is
(declare
Obj_TSD_Ptr : constant Addr_Ptr :=
To_Addr_Ptr (To_Address (Obj_Tag) - DT_Typeinfo_Ptr_Size);
Typ_TSD_Ptr : constant Addr_Ptr :=
To_Addr_Ptr (To_Address (Typ_Tag) - DT_Typeinfo_Ptr_Size);
Obj_TSD : constant Type_Specific_Data_Ptr :=
To_Type_Specific_Data_Ptr (Obj_TSD_Ptr.all);
Typ_TSD : constant Type_Specific_Data_Ptr :=
To_Type_Specific_Data_Ptr (Typ_TSD_Ptr.all);
Pos : constant Integer := Obj_TSD.Idepth - Typ_TSD.Idepth;
begin
Pos >= 0 and then Obj_TSD.Tags_Table (Pos) = Typ_Tag);
-- Given the tag of an object and the tag associated to a type, return
-- true if Obj is in Typ'Class.
end Ada.Tags;
| 45.701046 | 79 | 0.600118 |
20c6c840a87218d2bc3de547f79db3577fc6dd17 | 16,335 | ads | Ada | src/bbs-units.ads | BrentSeidel/BBS-Ada | d63c5e609e6e5c119405f27c2f10f34732000acc | [
"Unlicense"
] | 1 | 2018-03-25T18:24:19.000Z | 2018-03-25T18:24:19.000Z | src/bbs-units.ads | BrentSeidel/BBS-Ada | d63c5e609e6e5c119405f27c2f10f34732000acc | [
"Unlicense"
] | null | null | null | src/bbs-units.ads | BrentSeidel/BBS-Ada | d63c5e609e6e5c119405f27c2f10f34732000acc | [
"Unlicense"
] | null | null | null | --
-- Author: Brent Seidel
-- Version: V00.01
-- Date: 6-Apr-2016
--
-- This package defines a number of types for physical units. These are
-- generally based off of the Float type since in most cases, 6 digits is
-- pretty good for a physical measurement. If you need more precision, go
-- ahead and change it to whatever you need.
--
-- Conversion routines are provided to convert between different units. Due to
-- the number of different units, conversion between two may not be directly
-- possible, but should be possible through intermediate units. The ones present
-- are the ones that I use most. More will probably be added in the future. For
-- each type of measurement, there is a base unit. Conversions to and from this
-- unit to other units are provided.
--
-- While addition and subtraction of units generally provides a meaningful result,
-- multiplication and division may not. For example meters*meters should provide
-- a result in meters^2. In some cases (ones that I use) multiplication and
-- division will be provided. Most of these routines are trivial and can be
-- added as needed.
--
-- Ada provides Ada.Calendar to cover time related items. Therefor, there is
-- not much time support here.
--
-- The naming convention of the units is a prefix indicating what kind of unit,
-- an underscore, and the the S.I. code for the unit (if applicable) or a common
-- abbreviation (eg. vel_mph for velocity in mile per hour). Since "/" is not
-- valid in indentifiers, it will be replaced by an underscore (eg vel_m_s) for
-- velocity in meters per second. Exponentiation is indicated by a number (eg
-- accel_m_s2).
--
-- License:
-- This is free and unencumbered software released into the public domain.
--
-- Anyone is free to copy, modify, publish, use, compile, sell, or
-- distribute this software, either in source code form or as a compiled
-- binary, for any purpose, commercial or non-commercial, and by any
-- means.
--
-- In jurisdictions that recognize copyright laws, the author or authors
-- of this software dedicate any and all copyright interest in the
-- software to the public domain. We make this dedication for the benefit
-- of the public at large and to the detriment of our heirs and
-- successors. We intend this dedication to be an overt act of
-- relinquishment in perpetuity of all present and future rights to this
-- software under copyright law.
--
-- 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 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.
--
-- For more information, please refer to <http://unlicense.org>
--
--
with Ada.Numerics;
with Ada.Numerics.Generic_Elementary_Functions;
package BBS.units with SPARK_Mode => on is
pragma Pure;
--
-- Index of type prefixes:
-- Length types. Prefix := "len". Base unit is meters.
-- Area types. Prefix := "area". Base unit is meters^2.
-- Volume types. Prefix := "vol". Base unit is liters.
-- Mass types. Prefix := "mass". Base unit is kilograms.
-- Force types. Prefix := "force". Base unit is newtons.
-- Temperature types. Prefix := "temp". Base unit is celsius.
-- Pressure types. Prefix := "press". Base unit is pascal.
-- Velocity types. Prefix := "vel". Base unit is m/s.
-- Acceleration types. Prefix := "accel". Base unit is m/(s^2).
-- Angular type. Prefix := "ang". Base unit is radians.
-- Rotation rate types. Prefix := "rot". Base unit is radians/second.
-- Magnetic types. Prefix := "mag". Base unit is Gauss.
-- Electromotive force types. Prefix := "emf". Base unit is Volt.
-- Electrical current types. Prefix := "curr". Base unit is Amper.
-- Electrical resistance types. Prefix := "res". Base unit is Ohms.
-- Frequency types. Prefix := "freq". Base unit is Hertz.
-- Time types. Prefix := "time". Base unit is Seconds.
--
-- Forward declaration of types, as needed.
--
type vel_m_s;
type accel_m_s2;
--
-- Length types. Prefix := "len". Base unit is meters.
--
-- length in meters
type len_m is new Float;
-- length in feet
type len_ft is new Float;
-- length in Ångstroms
type len_A is new Float;
--
feet_to_meter : constant := 3.28084;
Angstrom_to_meter : constant := 10_000_000_000.0;
function to_feet(dist : len_m) return len_ft is (len_ft(float(dist) * feet_to_meter))
with
Global => null;
function to_Angstroms(dist : len_m) return len_A is (len_A(Float(dist) * Angstrom_to_meter))
with
Global => null;
function to_meters(dist : len_ft) return len_m is (len_m(float(dist) / feet_to_meter))
with
Global => null;
function to_meters(dist : len_A) return len_m is (len_m(dist / Angstrom_to_meter))
with
Global => null;
--
function "/"(Left : len_m; Right : Duration) return vel_m_s
with
Global => null,
pre => (Right /= 0.0);
--
-- Area types. Prefix := "area". Base unit is meters^2.
--
-- area in square meters
type area_m2 is new Float;
-- With only one unit, there are no conversion functions.
function "*"(Left, Right : len_m) return area_m2 is (area_m2(Float(Left) * Float(Right)))
with
Global => null;
--
-- Volume types. Prefix := "vol". Base unit is liters.
--
-- volume in liters
type vol_l is new Float;
-- volume in cubic meters
type vol_m3 is new Float;
--
m3_to_liter : constant := 1000.0;
function to_liters(vol : vol_m3) return vol_l is (vol_l(vol * m3_to_liter))
with
Global => null;
function to_meters3(vol : vol_l) return vol_m3 is (vol_m3(vol / m3_to_liter))
with
Global => null;
function "*"(Left : len_m; Right : area_m2) return vol_m3 is (vol_m3(Float(Left) * Float(right)))
with
Global => null;
function "*"(Left : area_m2; Right : len_m) return vol_m3 is (vol_m3(Float(Left) * Float(right)))
with
Global => null;
--
-- Mass types. Prefix := "mass". Base unit is kilograms.
--
-- mass in kilograms
type mass_kg is new Float;
-- mass in pounds
type mass_lb is new Float;
--
pound_to_kilogram : constant := 0.4535924;
function to_pounds(mass : mass_kg) return mass_lb is (mass_lb(Float(mass) / pound_to_kilogram))
with
Global => null;
function to_kilograms(mass : mass_lb) return mass_kg is (mass_kg(Float(mass) * pound_to_kilogram))
with
Global => null;
--
-- Force types. Prefix := "force". Base unit is newtons.
--
-- force in newtons
type force_n is new Float;
-- with no other units there are no conversion functions
-- Newtons law, F=MA
function "*"(Left : mass_kg; Right : accel_m_s2) return force_n
with
Global => null;
function "*"(Left : accel_m_s2; Right : mass_kg) return force_n
with
Global => null;
function "/"(Left : force_n; Right : accel_m_s2) return mass_kg
with
Global => null,
pre => (Right /= 0.0);
function "/"(Left : force_n; Right : mass_kg) return accel_m_s2
with
Global => null,
pre => (Right /= 0.0);
--
-- Temperature types. Prefix := "temp". Base unit is celsius.
--
-- temperature in kelvin
type temp_k is new Float;
-- temperature in celsius
type temp_c is new Float;
-- temperature in farenheit
type temp_f is new Float;
--
function to_Farenheit(temp : temp_c) return temp_f is (temp_f(float(temp)*9.0/5.0 + 32.0))
with
Global => null;
function to_Kelvin(temp : temp_c) return temp_k is (temp_k(float(temp) + 273.15))
with
Global => null;
function to_Celsius(temp : temp_f) return temp_c is (temp_c(float(temp - 32.0)*5.0/9.0))
with
Global => null;
function to_Celsius(temp : temp_k) return temp_c is (temp_c(float(temp) - 273.15))
with
Global => null;
--
-- Pressure types. Prefix := "press". Base unit is pascal.
--
-- pressure in pascals
type press_p is new Float;
-- pressure in millibars
type press_mb is new Float;
-- pressure in atmospheres
type press_atm is new Float;
-- pressure in inches of mercury
type press_inHg is new Float;
--
millibar_to_pascal : constant := 100.0;
atm_to_pascal : constant := 101325.0;
inHg_to_pascal : constant := 3386.39;
function to_milliBar(pressure : press_p) return press_mb is
(press_mb(float(pressure) / millibar_to_pascal))
with
Global => null;
function to_Atmosphere(pressure : press_p) return press_atm is
(press_atm(float(pressure) / atm_to_pascal))
with
Global => null;
function to_inHg(pressure : press_p) return press_inHg is
(press_inHg(float(pressure) / inHg_to_pascal))
with
Global => null;
function to_Pascal(pressure : press_mb) return press_p is
(press_p(float(pressure) * millibar_to_pascal))
with
Global => null;
function to_Pascal(pressure : press_atm) return press_p is
(press_p(float(pressure) * atm_to_pascal))
with
Global => null;
function to_Pascal(pressure : press_inHg) return press_p is
(press_p(float(pressure) * inHg_to_pascal))
with
Global => null;
--
-- Given local pressure and altimeter setting, determine the pressure
-- altitude. Given local pressure and altitude, determine the altimeter
-- setting.
--
function pressure_altitude(pressure : press_p; altm : press_p) return len_m;
function altimeter(pressure : press_p; altitude : len_m) return press_p;
--
-- Velocity types. Prefix := "vel". Base unit is m/s.
--
-- velocity in meters/second
type vel_m_s is new Float;
-- velocity in miles per hour
type vel_mph is new Float;
-- velocity in kilometers/hour
type vel_km_h is new Float;
-- velocity in knots
type vel_knots is new Float;
--
m_s_to_mph : constant := 2.2369_3629_11;
m_s_to_km_h : constant := 3.6;
m_s_to_knots : constant := 1.9438_4449_24;
function to_mph(vel : vel_m_s) return vel_mph is (vel_mph(float(vel) * m_s_to_mph))
with
Global => null;
function to_km_h(vel : vel_m_s) return vel_km_h is (vel_km_h(float(vel) * m_s_to_km_h))
with
Global => null;
function to_knots(vel : vel_m_s) return vel_knots is (vel_knots(float(vel) * m_s_to_knots))
with
Global => null;
function to_m_s(vel : vel_knots) return vel_m_s is (vel_m_s(float(vel) / m_s_to_knots))
with
Global => null;
function to_m_s(vel : vel_km_h) return vel_m_s is (vel_m_s(float(vel) / m_s_to_km_h))
with
Global => null;
function to_m_s(vel : vel_mph) return vel_m_s is (vel_m_s(float(vel) / m_s_to_mph))
with
Global => null;
--
function "*"(Left : vel_m_s; Right : Duration) return len_m is (len_m(Float(Left) * Float(Right)))
with
Global => null;
function "*"(Left : Duration; Right : vel_m_s) return len_m is (len_m(Float(Left) * Float(Right)))
with
Global => null;
function "/"(Left : vel_m_s; Right : Duration) return accel_m_s2
with
Global => null,
pre => (Right /= 0.0);
--
-- Acceleration types. Prefix := "accel". Base unit is m/(s^2).
--
-- acceleration in meters per second squared
type accel_m_s2 is new Float;
-- acceleration in units of Earth gravity
type accel_g is new Float;
--
gravity_to_m_s2 : constant := 9.80665;
function to_m_s2(accel : accel_g) return accel_m_s2 is (accel_m_s2(Float(accel) * gravity_to_m_s2))
with
Global => null;
function to_g(accel : accel_m_s2) return accel_g is (accel_g(Float(accel) / gravity_to_m_s2))
with
Global => null;
--
function "*"(Left : accel_m_s2; Right : Duration) return vel_m_s is (vel_m_s(Float(Left) * Float(Right)))
with
Global => null;
function "*"(Left : Duration; Right : accel_m_s2) return vel_m_s is (vel_m_s(Float(Left) * Float(Right)))
with
Global => null;
--
-- Angular type. Prefix := "ang". Base unit is radians.
--
-- angle in radians
type ang_r is new Float;
-- angle in degrees
type ang_d is new Float;
--
function to_degrees(ang : ang_r) return ang_d is (ang_d(float(ang) * 180.0 / Ada.Numerics.Pi))
with
Global => null;
function to_radians(ang : ang_d) return ang_r is (ang_r(float(ang) * Ada.Numerics.Pi / 180.0))
with
Global => null;
--
-- Rotation rate types. Prefix := "rot". Base unit is radians/second.
--
-- rotation in radians per second
type rot_r_s is new Float;
-- rotation in degrees per second
type rot_d_s is new Float;
--
function to_r_s(rot : rot_d_s) return rot_r_s is (rot_r_s(float(rot) * Ada.Numerics.Pi / 180.0))
with
Global => null;
function to_d_s(rot : rot_r_s) return rot_d_s is (rot_d_s(float(rot) * 180.0 / Ada.Numerics.Pi))
with
Global => null;
--
function "*"(Left : rot_d_s; Right : Duration) return ang_d is (ang_d(Float(Left) * Float(Right)))
with
Global => null;
function "*"(Left : Duration; Right : rot_d_s) return ang_d is (ang_d(Float(Left) * Float(Right)))
with
Global => null;
--
-- Magnetic types. Prefix := "mag". Base unit is Gauss.
--
-- magnetic field in gauss
type mag_g is new Float;
-- With only one unit, there are no conversions functions.
--
-- Electromotive force types. Prefix := "emf". Base unit is Volt.
--
-- electromotive force in volts
type emf_v is new Float;
-- With only one unit, there are no conversion functions.
--
-- Electrical current types. Prefix := "curr". Base unit is Amper.
--
-- electrical current in amps
type curr_a is new Float;
-- With only one unit, there are no conversions functions.
--
-- Electrical resistance types. Prefix := "res". Base unit is Ohms.
type res_o is new Float;
--
-- Variations of Ohms law
--
function "*"(Left : curr_a; Right : res_o) return emf_v is (emf_v(Float(Left) * Float(Right)))
with
Global => null;
function "*"(Left : res_o; Right : curr_a) return emf_v is (emf_v(Float(Left) * Float(Right)))
with
Global => null;
function "/"(Left : emf_v; Right : curr_a) return res_o is (res_o(Float(Left) / Float(Right)))
with
Global => null,
pre => (Right /= 0.0);
function "/"(Left : emf_v; Right : res_o) return curr_a is (curr_a(Float(Left) / Float(Right)))
with
Global => null,
pre => (Right /= 0.0);
--
-- Frequency types. Prefix := "freq". Base unit is Hertz.
-- Time types. Prefix := "time". Base unit is Seconds.
--
-- Note that Ada has a predefined Duration type that is a fixed point type
-- Seconds is defined as a subtype of this. The other times (minutes and
-- hours) are derivative types so as to maintain similar precision. If needed,
-- they could be changed to Float or something else.
--
-- frequency in Herts
type freq_hz is new Float;
-- time in seconds (use subtype because seconds is identical to duration)
subtype time_s is Duration;
-- time in minutes
type time_m is new Duration;
-- time in hours
type time_h is new Duration;
--
function to_hz(period : time_s) return freq_hz is (freq_hz(1.0 / Float(period)))
with
Global => null,
pre => (period /= 0.0);
function to_minutes(period : time_s) return time_m is (time_m(period / 60.0))
with
Global => null;
function to_hours(period : time_s) return time_h is (time_h(period / 3600.0))
with
Global => null;
function to_seconds(freq : freq_hz) return time_s is (time_s(1.0 / Float(freq)))
with
Global => null,
pre => (freq /= 0.0);
function to_seconds(period : time_m) return time_s is (time_s(period * 60.0))
with
Global => null;
function to_seconds(period : time_h) return time_s is (time_s(period * 3600.0))
with
Global => null;
--
end;
| 37.8125 | 108 | 0.65479 |
1d9d59c6bbdafef9601f7035f88e7f813b3a4283 | 852 | ads | Ada | src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/null_record/bar.ads | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 31 | 2018-08-01T21:25:24.000Z | 2022-02-14T07:52:34.000Z | src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/null_record/bar.ads | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 40 | 2018-12-03T19:48:52.000Z | 2021-03-10T06:34:26.000Z | src/gdb/gdb-8.3/gdb/testsuite/gdb.ada/null_record/bar.ads | alrooney/unum-sdk | bbccb10b0cd3500feccbbef22e27ea111c3d18eb | [
"Apache-2.0"
] | 20 | 2018-11-16T21:19:22.000Z | 2021-10-18T23:08:24.000Z | -- Copyright 2004-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 Bar is
type Empty is null record;
type Void_Star is access all Empty;
procedure Do_Nothing (E : Void_Star);
end Bar;
| 35.5 | 73 | 0.733568 |
31926b98eacb52c6affbc4df78a0328333975c02 | 7,279 | adb | Ada | source/nodes/program-nodes-formal_interface_types.adb | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | null | null | null | source/nodes/program-nodes-formal_interface_types.adb | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | null | null | null | source/nodes/program-nodes-formal_interface_types.adb | reznikmm/gela | 20134f1d154fb763812e73860c6f4b04f353df79 | [
"MIT"
] | 1 | 2019-10-16T09:05:27.000Z | 2019-10-16T09:05:27.000Z | -- SPDX-FileCopyrightText: 2019 Max Reznik <[email protected]>
--
-- SPDX-License-Identifier: MIT
-------------------------------------------------------------
package body Program.Nodes.Formal_Interface_Types is
function Create
(Limited_Token : Program.Lexical_Elements.Lexical_Element_Access;
Task_Token : Program.Lexical_Elements.Lexical_Element_Access;
Protected_Token : Program.Lexical_Elements.Lexical_Element_Access;
Synchronized_Token : Program.Lexical_Elements.Lexical_Element_Access;
Interface_Token : Program.Lexical_Elements.Lexical_Element_Access;
And_Token : Program.Lexical_Elements.Lexical_Element_Access;
Progenitors : Program.Elements.Expressions
.Expression_Vector_Access)
return Formal_Interface_Type is
begin
return Result : Formal_Interface_Type :=
(Limited_Token => Limited_Token, Task_Token => Task_Token,
Protected_Token => Protected_Token,
Synchronized_Token => Synchronized_Token,
Interface_Token => Interface_Token, And_Token => And_Token,
Progenitors => Progenitors, Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
function Create
(Progenitors : Program.Elements.Expressions
.Expression_Vector_Access;
Is_Part_Of_Implicit : Boolean := False;
Is_Part_Of_Inherited : Boolean := False;
Is_Part_Of_Instance : Boolean := False;
Has_Limited : Boolean := False;
Has_Task : Boolean := False;
Has_Protected : Boolean := False;
Has_Synchronized : Boolean := False)
return Implicit_Formal_Interface_Type is
begin
return Result : Implicit_Formal_Interface_Type :=
(Progenitors => Progenitors,
Is_Part_Of_Implicit => Is_Part_Of_Implicit,
Is_Part_Of_Inherited => Is_Part_Of_Inherited,
Is_Part_Of_Instance => Is_Part_Of_Instance,
Has_Limited => Has_Limited, Has_Task => Has_Task,
Has_Protected => Has_Protected, Has_Synchronized => Has_Synchronized,
Enclosing_Element => null)
do
Initialize (Result);
end return;
end Create;
overriding function Progenitors
(Self : Base_Formal_Interface_Type)
return Program.Elements.Expressions.Expression_Vector_Access is
begin
return Self.Progenitors;
end Progenitors;
overriding function Limited_Token
(Self : Formal_Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Limited_Token;
end Limited_Token;
overriding function Task_Token
(Self : Formal_Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Task_Token;
end Task_Token;
overriding function Protected_Token
(Self : Formal_Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Protected_Token;
end Protected_Token;
overriding function Synchronized_Token
(Self : Formal_Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Synchronized_Token;
end Synchronized_Token;
overriding function Interface_Token
(Self : Formal_Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.Interface_Token;
end Interface_Token;
overriding function And_Token
(Self : Formal_Interface_Type)
return Program.Lexical_Elements.Lexical_Element_Access is
begin
return Self.And_Token;
end And_Token;
overriding function Has_Limited
(Self : Formal_Interface_Type)
return Boolean is
begin
return Self.Limited_Token.Assigned;
end Has_Limited;
overriding function Has_Task
(Self : Formal_Interface_Type)
return Boolean is
begin
return Self.Task_Token.Assigned;
end Has_Task;
overriding function Has_Protected
(Self : Formal_Interface_Type)
return Boolean is
begin
return Self.Protected_Token.Assigned;
end Has_Protected;
overriding function Has_Synchronized
(Self : Formal_Interface_Type)
return Boolean is
begin
return Self.Synchronized_Token.Assigned;
end Has_Synchronized;
overriding function Is_Part_Of_Implicit
(Self : Implicit_Formal_Interface_Type)
return Boolean is
begin
return Self.Is_Part_Of_Implicit;
end Is_Part_Of_Implicit;
overriding function Is_Part_Of_Inherited
(Self : Implicit_Formal_Interface_Type)
return Boolean is
begin
return Self.Is_Part_Of_Inherited;
end Is_Part_Of_Inherited;
overriding function Is_Part_Of_Instance
(Self : Implicit_Formal_Interface_Type)
return Boolean is
begin
return Self.Is_Part_Of_Instance;
end Is_Part_Of_Instance;
overriding function Has_Limited
(Self : Implicit_Formal_Interface_Type)
return Boolean is
begin
return Self.Has_Limited;
end Has_Limited;
overriding function Has_Task
(Self : Implicit_Formal_Interface_Type)
return Boolean is
begin
return Self.Has_Task;
end Has_Task;
overriding function Has_Protected
(Self : Implicit_Formal_Interface_Type)
return Boolean is
begin
return Self.Has_Protected;
end Has_Protected;
overriding function Has_Synchronized
(Self : Implicit_Formal_Interface_Type)
return Boolean is
begin
return Self.Has_Synchronized;
end Has_Synchronized;
procedure Initialize (Self : in out Base_Formal_Interface_Type'Class) is
begin
for Item in Self.Progenitors.Each_Element loop
Set_Enclosing_Element (Item.Element, Self'Unchecked_Access);
end loop;
null;
end Initialize;
overriding function Is_Formal_Interface_Type
(Self : Base_Formal_Interface_Type)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Formal_Interface_Type;
overriding function Is_Formal_Type_Definition
(Self : Base_Formal_Interface_Type)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Formal_Type_Definition;
overriding function Is_Definition
(Self : Base_Formal_Interface_Type)
return Boolean is
pragma Unreferenced (Self);
begin
return True;
end Is_Definition;
overriding procedure Visit
(Self : not null access Base_Formal_Interface_Type;
Visitor : in out Program.Element_Visitors.Element_Visitor'Class) is
begin
Visitor.Formal_Interface_Type (Self);
end Visit;
overriding function To_Formal_Interface_Type_Text
(Self : in out Formal_Interface_Type)
return Program.Elements.Formal_Interface_Types
.Formal_Interface_Type_Text_Access is
begin
return Self'Unchecked_Access;
end To_Formal_Interface_Type_Text;
overriding function To_Formal_Interface_Type_Text
(Self : in out Implicit_Formal_Interface_Type)
return Program.Elements.Formal_Interface_Types
.Formal_Interface_Type_Text_Access is
pragma Unreferenced (Self);
begin
return null;
end To_Formal_Interface_Type_Text;
end Program.Nodes.Formal_Interface_Types;
| 30.584034 | 78 | 0.720841 |
59f41fb8e63bca4bddfe63692d8c9a1953fdf138 | 16,370 | adb | Ada | contrib/ayacc/src/string_pkg.adb | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | 4 | 2016-02-05T15:51:56.000Z | 2022-03-25T20:38:32.000Z | contrib/ayacc/src/string_pkg.adb | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | null | null | null | contrib/ayacc/src/string_pkg.adb | faelys/gela-asis | 48a3bee90eda9f0c9d958b4e3c80a5a9b1c65253 | [
"BSD-3-Clause"
] | null | null | null |
-- Module : string_pkg.ada
-- Component of : common_library
-- Version : 1.2
-- Date : 11/21/86 16:35:20
-- SCCS File : disk21~/rschm/hasee/sccs/common_library/sccs/sxstring_pkg.ada
-- $Source: /nosc/work/abstractions/string/RCS/string.bdy,v $
-- $Revision: 209 $ -- $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ -- $Author: ron $
-- $Source: /nosc/work/abstractions/string/RCS/string.bdy,v $
-- $Revision: 209 $ -- $Date: 2013-11-30 21:03:24 +0200 (Сб., 30 нояб. 2013) $ -- $Author: ron $
with unchecked_deallocation;
with lists, stack_pkg;
package body string_pkg is
SCCS_ID : constant String := "@(#) string_pkg.ada, Version 1.2";
--| Overview:
--| The implementation for most operations is fairly straightforward.
--| The interesting aspects involve the allocation and deallocation of
--| heap space. This is done as follows:
--|
--| 1. A stack of accesses to lists of string_type values is set up
--| so that the top of the stack always refers to a list of values
--| that were allocated since the last invocation of mark.
--| The stack is called scopes, referring to the dynamic scopes
--| defined by the invocations of mark and release.
--| There is an implicit invocation of mark when the
--| package body is elaborated; this is implemented with an explicit
--| invocation in the package initialization code.
--|
--| 2. At each invocation of mark, a pointer to an empty list
--| is pushed onto the stack.
--|
--| 3. At each invocation of release, all of the values in the
--| list referred to by the pointer at the top of the stack are
--| returned to the heap. Then the list, and the pointer to it,
--| are returned to the heap. Finally, the stack is popped.
package string_list_pkg is new lists(string_type);
subtype string_list is string_list_pkg.list;
type string_list_ptr is access string_list;
package scope_stack_pkg is new stack_pkg(string_list_ptr);
subtype scope_stack is scope_stack_pkg.stack;
use string_list_pkg;
use scope_stack_pkg;
scopes: scope_stack; -- See package body overview.
-- Utility functions/procedures:
function enter(s: string_type)
return string_type;
--| Raises: illegal_alloc
--| Effects:
--| Stores s, the address of s.all, in current scope list (top(scopes)),
--| and returns s. Useful for functions that create and return new
--| string_type values.
--| Raises illegal_alloc if the scopes stack is empty.
function match_string(s1, s2: string; start: positive := 1)
return natural;
--| Raises: no_match
--| Effects:
--| Returns the minimum index, i, in s1'range such that
--| s1(i..i + s2'length - 1) = s2. Returns 0 if no such index.
--| Requires:
--| s1'first = 1.
-- Constructors:
function Empty_String return String_Type is
begin
return Create ("");
end Empty_String;
function create(s: string)
return string_type is
subtype constr_str is string(1..s'length);
dec_s: constr_str := s;
begin
return enter(new constr_str'(dec_s));
-- DECada bug; above code (and decl of dec_s) replaces the following:
-- return enter(new constr_str'(s));
end create;
function "&"(s1, s2: string_type)
return string_type is
begin
if is_empty(s1) then return enter(make_persistent(s2)); end if;
if is_empty(s2) then return enter(make_persistent(s1)); end if;
return create(s1.all & s2.all);
end "&";
function "&"(s1: string_type; s2: string)
return string_type is
begin
if s1 = null then return create(s2); end if;
return create(s1.all & s2);
end "&";
function "&"(s1: string; s2: string_type)
return string_type is
begin
if s2 = null then return create(s1); end if;
return create(s1 & s2.all);
end "&";
function substr(s: string_type; i: positive; len: natural)
return string_type is
begin
if len = 0 then return null; end if;
return create(s(i..(i + len - 1)));
exception
when constraint_error => -- on array fetch or null deref
raise bounds;
end substr;
function splice(s: string_type; i: positive; len: natural)
return string_type is
begin
if len = 0 then return enter(make_persistent(s)); end if;
if i + len - 1 > length(s) then raise bounds; end if;
return create(s(1..(i - 1)) & s((i + len)..length(s)));
end splice;
function insert(s1, s2: string_type; i: positive)
return string_type is
begin
if i > length(s1) then raise bounds; end if;
if is_empty(s2) then return create(s1.all); end if;
return create(s1(1..(i - 1)) & s2.all & s1(i..s1'last));
end insert;
function insert(s1: string_type; s2: string; i: positive)
return string_type is
begin
if i > length(s1) then raise bounds; end if;
return create(s1(1..(i - 1)) & s2 & s1(i..s1'last));
end insert;
function insert(s1: string; s2: string_type; i: positive)
return string_type is
begin
if not (i in s1'range) then raise bounds; end if;
if s2 = null then return create(s1); end if;
return create(s1(s1'first..(i - 1)) & s2.all & s1(i..s1'last));
end insert;
procedure lc(c: in out character) is
begin
if ('A' <= c) and then (c <= 'Z') then
c := character'val(character'pos(c) - character'pos('A')
+ character'pos('a'));
end if;
end lc;
procedure uc(c: in out character) is
begin
if ('a' <= c) and then (c <= 'z') then
c := character'val(character'pos(c) - character'pos('a')
+ character'pos('A'));
end if;
end uc;
function lower(s: string)
return string_type is
s2: string_type := create(s);
begin
for i in s2'range loop
lc(s2(i));
end loop;
return s2;
end lower;
function lower(s: string_type)
return string_type is
begin
if s = null then return null; end if;
return lower(s.all);
end lower;
function Mixed (S: String) return String_Type is
Mixed_String : String_Type := Create (S);
begin
if Mixed_String'Length /= 0 then
UC (Mixed_String(Mixed_String'First));
for i in Mixed_String'First + 1 .. Mixed_String'Last
loop
if Mixed_String(i-1) = '_' or else Mixed_String(i-1) = '.' then
UC (Mixed_String(i));
else
LC (Mixed_String(i));
end if;
end loop;
return Mixed_String;
else
return Empty_String;
end if;
end Mixed;
function Mixed (S : String_Type) return String_Type is
begin
if s = null then
return Empty_String;
else
return Mixed (S.all);
end if;
end Mixed;
function upper(s: string)
return string_type is
s2: string_type := create(s);
begin
for i in s2'range loop
uc(s2(i));
end loop;
return s2;
end upper;
function upper(s: string_type)
return string_type is
begin
if s = null then return null; end if;
return upper(s.all);
end upper;
-- Heap Management:
function make_persistent(s: string_type)
return string_type is
subtype constr_str is string(1..length(s));
begin
if s = null or else s.all = "" then return null;
else return new constr_str'(s.all);
end if;
end make_persistent;
function make_persistent(s: string)
return string_type is
subtype constr_str is string(1..s'length);
begin
if s = "" then return null;
else return new constr_str'(s); end if;
end make_persistent;
procedure real_flush is new unchecked_deallocation(string,
string_type);
--| Effect:
--| Return space used by argument to heap. Does nothing if null.
--| Notes:
--| This procedure is actually the body for the flush procedure,
--| but a generic instantiation cannot be used as a body for another
--| procedure. You tell me why.
procedure flush(s: in out string_type) is
begin
if s /= null then real_flush(s); end if;
-- Actually, the if isn't needed; however, DECada compiler chokes
-- on deallocation of null.
end flush;
procedure mark is
begin
push(scopes, new string_list'(create));
end mark;
procedure release is
procedure flush_list_ptr is
new unchecked_deallocation(string_list, string_list_ptr);
iter: string_list_pkg.ListIter;
top_list: string_list_ptr;
s: string_type;
begin
pop(scopes, top_list);
iter := MakeListIter(top_list.all);
while more(iter) loop
next(iter, s);
flush(s); -- real_flush is bad, DECada bug
-- real_flush(s);
end loop;
destroy(top_list.all);
flush_list_ptr(top_list);
exception
when empty_stack =>
raise illegal_dealloc;
end release;
-- Queries:
function is_empty(s: string_type)
return boolean is
begin
return (s = null) or else (s.all = "");
end is_empty;
function length(s: string_type)
return natural is
begin
if s = null then return 0; end if;
return(s.all'length);
end length;
function value(s: string_type)
return string is
subtype null_range is positive range 1..0;
subtype null_string is string(null_range);
begin
if s = null then return null_string'(""); end if;
return s.all;
end value;
function fetch(s: string_type; i: positive)
return character is
begin
if is_empty(s) or else (not (i in s'range)) then raise bounds; end if;
return s(i);
end fetch;
function equal(s1, s2: string_type)
return boolean is
begin
if is_empty(s1) then return is_empty(s2); end if;
return (s2 /= null) and then (s1.all = s2.all);
-- The above code replaces the following. (DECada buggy)
-- return s1.all = s2.all;
-- exception
-- when constraint_error => -- s is null
-- return is_empty(s1) and is_empty(s2);
end equal;
function equal(s1: string_type; s2: string)
return boolean is
begin
if s1 = null then return s2 = ""; end if;
return s1.all = s2;
end equal;
function equal(s1: string; s2: string_type)
return boolean is
begin
if s2 = null then return s1 = ""; end if;
return s1 = s2.all;
end equal;
--|========================================================================
function Equivalent (Left, Right : in String_Type) return Boolean is
begin
return Equal (Upper (Left), Upper (Right));
end Equivalent;
function Equivalent (Left : in String;
Right : in String_Type) return Boolean is
begin
return Equivalent (Create (Left), Right);
end Equivalent;
function Equivalent (Left : in String_Type;
Right : in String) return Boolean is
begin
return Equivalent (Left, Create (Right));
end Equivalent;
--|========================================================================
function "<" (s1: string_type; s2: string_type)
return boolean is
begin
if is_empty(s1) then
return (not is_empty(s2));
else
return (s1.all < s2);
end if;
-- Got rid of the following code: (Think that DECada is buggy)
--return s1.all < s2.all;
--exception
--when constraint_error => -- on null deref
--return (not is_empty(s2));
-- one of them must be empty
end "<";
function "<"(s1: string_type; s2: string)
return boolean is
begin
if s1 = null then return s2 /= ""; end if;
return s1.all < s2;
end "<";
function "<"(s1: string; s2: string_type)
return boolean is
begin
if s2 = null then return false; end if;
return s1 < s2.all;
end "<";
function "<="(s1: string_type; s2: string_type)
return boolean is
begin
if is_empty(s1) then return true; end if;
return (s1.all <= s2);
-- Replaces the following: (I think DECada is buggy)
--return s1.all <= s2.all;
--exception
--when constraint_error => -- on null deref
--return is_empty(s1); -- one must be empty, so s1<=s2 iff s1 = ""
end "<=";
function "<="(s1: string_type; s2: string)
return boolean is
begin
if s1 = null then return true; end if;
return s1.all <= s2;
end "<=";
function "<="(s1: string; s2: string_type)
return boolean is
begin
if s2 = null then return s1 = ""; end if;
return s1 <= s2.all;
end "<=";
function match_c(s: string_type; c: character; start: positive := 1)
return natural is
begin
if s = null then return 0; end if;
for i in start..s.all'last loop
if s(i) = c then
return i;
end if;
end loop;
return 0;
end match_c;
function match_not_c(s: string_type; c: character; start: positive := 1)
return natural is
begin
if s = null then return 0; end if;
for i in start..s.all'last loop
if s(i) /= c then
return i;
end if;
end loop;
return 0;
end match_not_c;
function match_s(s1, s2: string_type; start: positive := 1)
return natural is
begin
if (s1 = null) or else (s2 = null) then return 0; end if;
return match_string(s1.all, s2.all, start);
end match_s;
function match_s(s1: string_type; s2: string; start: positive := 1)
return natural is
begin
if s1 = null then return 0; end if;
return match_string(s1.all, s2, start);
end match_s;
function match_any(s, any: string_type; start: positive := 1)
return natural is
begin
if any = null then raise any_empty; end if;
return match_any(s, any.all, start);
end match_any;
function match_any(s: string_type; any: string; start: positive := 1)
return natural is
begin
if any = "" then raise any_empty; end if;
if s = null then return 0; end if;
for i in start..s.all'last loop
for j in any'range loop
if s(i) = any(j) then
return i;
end if;
end loop;
end loop;
return 0;
end match_any;
function match_none(s, none: string_type; start: positive := 1)
return natural is
begin
if is_empty(s) then return 0; end if;
if is_empty(none) then return 1; end if;
return match_none(s, none.all, start);
end match_none;
function match_none(s: string_type; none: string; start: positive := 1)
return natural is
found: boolean;
begin
if is_empty(s) then return 0; end if;
for i in start..s.all'last loop
found := true;
for j in none'range loop
if s(i) = none(j) then
found := false;
exit;
end if;
end loop;
if found then return i; end if;
end loop;
return 0;
end match_none;
-- Utilities:
function enter(s: string_type)
return string_type is
begin
-- ATTACHING TO THE END OF THE LIST IS ENTIRELY TOO SLOW AND UNNECESSARY
-- top(scopes).all := attach(top(scopes).all, s);
top(scopes).all := attach(s, top(scopes).all);
return s;
exception
when empty_stack =>
raise illegal_alloc;
end enter;
function match_string(s1, s2: string; start: positive := 1)
return natural is
offset: natural;
begin
offset := s2'length - 1;
for i in start..(s1'last - offset) loop
if s1(i..(i + offset)) = s2 then
return i;
end if;
end loop;
return 0;
exception when constraint_error => -- on offset := s2'length (= 0)
return 0;
end match_string;
begin -- Initialize the scopes stack with an implicit mark.
scopes := create;
mark;
end string_pkg;
| 28.820423 | 96 | 0.591387 |
5771031db4971eaec45967f12f7d6ca1dd52aafb | 6,077 | adb | Ada | source/numerics/generic/a-nusfge.adb | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 33 | 2015-04-04T09:19:36.000Z | 2021-11-10T05:33:34.000Z | source/numerics/generic/a-nusfge.adb | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 8 | 2017-11-14T13:05:07.000Z | 2018-08-09T15:28:49.000Z | source/numerics/generic/a-nusfge.adb | ytomino/drake | 4e4bdcd8b8e23a11a29b31d3a8861fdf60090ea2 | [
"MIT"
] | 9 | 2015-02-03T17:09:53.000Z | 2021-11-12T01:16:05.000Z | package body Ada.Numerics.SFMT.Generating is
-- no SIMD version
use type Unsigned_32;
use type Unsigned_64;
procedure rshift128 (
Out_Item : out w128_t;
In_Item : w128_t;
shift : Integer)
with Convention => Intrinsic;
procedure lshift128 (
Out_Item : out w128_t;
In_Item : w128_t;
shift : Integer)
with Convention => Intrinsic;
pragma Inline_Always (rshift128);
pragma Inline_Always (lshift128);
procedure do_recursion (r : out w128_t; a, b, c, d : w128_t)
with Convention => Intrinsic;
pragma Inline_Always (do_recursion);
-- This function simulates SIMD 128-bit right shift by the standard C.
-- The 128-bit integer given in in is shifted by (shift * 8) bits.
-- This function simulates the LITTLE ENDIAN SIMD.
procedure rshift128 (
Out_Item : out w128_t;
In_Item : w128_t;
shift : Integer)
is
th, tl, oh, ol : Unsigned_64;
begin
th := Interfaces.Shift_Left (Unsigned_64 (In_Item (3)), 32)
or Unsigned_64 (In_Item (2));
tl := Interfaces.Shift_Left (Unsigned_64 (In_Item (1)), 32)
or Unsigned_64 (In_Item (0));
oh := Interfaces.Shift_Right (th, shift * 8);
ol := Interfaces.Shift_Right (tl, shift * 8);
ol := ol or Interfaces.Shift_Left (th, 64 - shift * 8);
Out_Item (1) := Unsigned_32'Mod (Interfaces.Shift_Right (ol, 32));
Out_Item (0) := Unsigned_32'Mod (ol);
Out_Item (3) := Unsigned_32'Mod (Interfaces.Shift_Right (oh, 32));
Out_Item (2) := Unsigned_32'Mod (oh);
end rshift128;
-- This function simulates SIMD 128-bit left shift by the standard C.
-- The 128-bit integer given in in is shifted by (shift * 8) bits.
-- This function simulates the LITTLE ENDIAN SIMD.
procedure lshift128 (
Out_Item : out w128_t;
In_Item : w128_t;
shift : Integer)
is
th, tl, oh, ol : Unsigned_64;
begin
th := Interfaces.Shift_Left (Unsigned_64 (In_Item (3)), 32)
or Unsigned_64 (In_Item (2));
tl := Interfaces.Shift_Left (Unsigned_64 (In_Item (1)), 32)
or Unsigned_64 (In_Item (0));
oh := Interfaces.Shift_Left (th, shift * 8);
ol := Interfaces.Shift_Left (tl, shift * 8);
oh := oh or Interfaces.Shift_Right (tl, 64 - shift * 8);
Out_Item (1) := Unsigned_32'Mod (Interfaces.Shift_Right (ol, 32));
Out_Item (0) := Unsigned_32'Mod (ol);
Out_Item (3) := Unsigned_32'Mod (Interfaces.Shift_Right (oh, 32));
Out_Item (2) := Unsigned_32'Mod (oh);
end lshift128;
-- This function represents the recursion formula.
procedure do_recursion (r : out w128_t; a, b, c, d : w128_t) is
x : w128_t;
y : w128_t;
begin
lshift128 (x, a, SL2);
rshift128 (y, c, SR2);
r (0) := a (0) xor x (0)
xor (Interfaces.Shift_Right (b (0), SR1) and MSK1) xor y (0)
xor Interfaces.Shift_Left (d (0), SL1);
r (1) := a (1) xor x (1)
xor (Interfaces.Shift_Right (b (1), SR1) and MSK2) xor y (1)
xor Interfaces.Shift_Left (d (1), SL1);
r (2) := a (2) xor x (2)
xor (Interfaces.Shift_Right (b (2), SR1) and MSK3) xor y (2)
xor Interfaces.Shift_Left (d (2), SL1);
r (3) := a (3) xor x (3)
xor (Interfaces.Shift_Right (b (3), SR1) and MSK4) xor y (3)
xor Interfaces.Shift_Left (d (3), SL1);
end do_recursion;
-- implementation
-- This function fills the internal state array with pseudorandom
-- integers.
procedure gen_rand_all (
sfmt : in out w128_t_Array_N)
is
i : Integer;
r1, r2 : access w128_t;
begin
r1 := sfmt (N - 2)'Access;
r2 := sfmt (N - 1)'Access;
i := 0;
while i < N - POS1 loop
do_recursion (
sfmt (i),
sfmt (i),
sfmt (i + POS1),
r1.all,
r2.all);
r1 := r2;
r2 := sfmt (i)'Access;
i := i + 1;
end loop;
while i < N loop
do_recursion (
sfmt (i),
sfmt (i),
sfmt (i - (N - POS1)),
r1.all,
r2.all);
r1 := r2;
r2 := sfmt (i)'Access;
i := i + 1;
end loop;
end gen_rand_all;
-- This function fills the user-specified array with pseudorandom
-- integers.
procedure gen_rand_array (
sfmt : in out w128_t_Array_N;
Item : in out w128_t_Array_1;
size : Integer)
is
the_array : w128_t_Array (0 .. size - 1);
for the_array'Address use Item'Address;
i, j : Integer;
r1, r2 : access w128_t;
begin
r1 := sfmt (N - 2)'Access;
r2 := sfmt (N - 1)'Access;
i := 0;
while i < N - POS1 loop
do_recursion (
the_array (i),
sfmt (i),
sfmt (i + POS1),
r1.all,
r2.all);
r1 := r2;
r2 := the_array (i)'Access;
i := i + 1;
end loop;
while i < N loop
do_recursion (
the_array (i),
sfmt (i),
the_array (i - (N - POS1)),
r1.all,
r2.all);
r1 := r2;
r2 := the_array (i)'Access;
i := i + 1;
end loop;
while i < size - N loop
do_recursion (
the_array (i),
the_array (i - N),
the_array (i - (N - POS1)),
r1.all,
r2.all);
r1 := r2;
r2 := the_array (i)'Access;
i := i + 1;
end loop;
j := 0;
while j < N - (size - N) loop
sfmt (j) := the_array (j + (size - N));
j := j + 1;
end loop;
while i < size loop
do_recursion (
the_array (i),
the_array (i - N),
the_array (i - (N - POS1)),
r1.all,
r2.all);
r1 := r2;
r2 := the_array (i)'Access;
sfmt (j) := the_array (i);
i := i + 1;
j := j + 1;
end loop;
end gen_rand_array;
end Ada.Numerics.SFMT.Generating;
| 30.847716 | 74 | 0.528715 |
31fab2b6f229c7f6a6d59c38e6956d3deda0297d | 2,163 | ads | Ada | gcc-gcc-7_3_0-release/gcc/ada/a-wtcoio.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 7 | 2020-05-02T17:34:05.000Z | 2021-10-17T10:15:18.000Z | gcc-gcc-7_3_0-release/gcc/ada/a-wtcoio.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | null | null | null | gcc-gcc-7_3_0-release/gcc/ada/a-wtcoio.ads | best08618/asylo | 5a520a9f5c461ede0f32acc284017b737a43898c | [
"Apache-2.0"
] | 2 | 2020-07-27T00:22:36.000Z | 2021-04-01T09:41:02.000Z | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- A D A . W I D E _ T E X T _ IO . C O M P L E X _ I O --
-- --
-- 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.Generic_Complex_Types;
generic
with package Complex_Types is new Ada.Numerics.Generic_Complex_Types (<>);
package Ada.Wide_Text_IO.Complex_IO is
use Complex_Types;
Default_Fore : Field := 2;
Default_Aft : Field := Real'Digits - 1;
Default_Exp : Field := 3;
procedure Get
(File : File_Type;
Item : out Complex;
Width : Field := 0);
procedure Get
(Item : out Complex;
Width : Field := 0);
procedure Put
(File : File_Type;
Item : Complex;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
procedure Put
(Item : Complex;
Fore : Field := Default_Fore;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
procedure Get
(From : Wide_String;
Item : out Complex;
Last : out Positive);
procedure Put
(To : out Wide_String;
Item : Complex;
Aft : Field := Default_Aft;
Exp : Field := Default_Exp);
end Ada.Wide_Text_IO.Complex_IO;
| 34.333333 | 78 | 0.429496 |
57066b99ca55ae06d25371eba36bdf4ce5cf5006 | 5,598 | adb | Ada | firmware/coreboot/3rdparty/libgfxinit/common/haswell/hw-gfx-gma-connectors-ddi-buffers.adb | fabiojna02/OpenCellular | 45b6a202d6b2e2485c89955b9a6da920c4d56ddb | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 1 | 2019-02-05T09:50:07.000Z | 2019-02-05T09:50:07.000Z | firmware/coreboot/3rdparty/libgfxinit/common/haswell/hw-gfx-gma-connectors-ddi-buffers.adb | aimin-wang/OpenCellular | 5308146bf7edf43cc81c0e4d15305b711117070a | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 13 | 2018-10-12T21:29:09.000Z | 2018-10-25T20:06:51.000Z | firmware/coreboot/3rdparty/libgfxinit/common/haswell/hw-gfx-gma-connectors-ddi-buffers.adb | aimin-wang/OpenCellular | 5308146bf7edf43cc81c0e4d15305b711117070a | [
"CC-BY-4.0",
"BSD-3-Clause"
] | null | null | null | --
-- Copyright (C) 2017 secunet Security Networks AG
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
with HW.GFX.GMA.Config;
package body HW.GFX.GMA.Connectors.DDI.Buffers
is
subtype Haswell_HDMI_Range is DDI_HDMI_Buf_Trans_Range range 0 .. 11;
subtype Broadwell_HDMI_Range is DDI_HDMI_Buf_Trans_Range range 0 .. 9;
type HDMI_Buf_Trans is record
Trans1 : Word32;
Trans2 : Word32;
end record;
type HDMI_Buf_Trans_Array is array (Haswell_HDMI_Range) of HDMI_Buf_Trans;
----------------------------------------------------------------------------
Haswell_Trans_DP : constant Buf_Trans_Array :=
(16#00ff_ffff#, 16#0006_000e#,
16#00d7_5fff#, 16#0005_000a#,
16#00c3_0fff#, 16#0004_0006#,
16#80aa_afff#, 16#000b_0000#,
16#00ff_ffff#, 16#0005_000a#,
16#00d7_5fff#, 16#000c_0004#,
16#80c3_0fff#, 16#000b_0000#,
16#00ff_ffff#, 16#0004_0006#,
16#80d7_5fff#, 16#000b_0000#,
others => 0);
Haswell_Trans_FDI : constant Buf_Trans_Array :=
(16#00ff_ffff#, 16#0007_000e#,
16#00d7_5fff#, 16#000f_000a#,
16#00c3_0fff#, 16#0006_0006#,
16#00aa_afff#, 16#001e_0000#,
16#00ff_ffff#, 16#000f_000a#,
16#00d7_5fff#, 16#0016_0004#,
16#00c3_0fff#, 16#001e_0000#,
16#00ff_ffff#, 16#0006_0006#,
16#00d7_5fff#, 16#001e_0000#,
others => 0);
Haswell_Trans_HDMI : constant HDMI_Buf_Trans_Array :=
((16#00ff_ffff#, 16#0006_000e#),
(16#00e7_9fff#, 16#000e_000c#),
(16#00d7_5fff#, 16#0005_000a#),
(16#00ff_ffff#, 16#0005_000a#),
(16#00e7_9fff#, 16#001d_0007#),
(16#00d7_5fff#, 16#000c_0004#),
(16#00ff_ffff#, 16#0004_0006#),
(16#80e7_9fff#, 16#0003_0002#),
(16#00ff_ffff#, 16#0014_0005#),
(16#00ff_ffff#, 16#000c_0004#),
(16#00ff_ffff#, 16#001c_0003#),
(16#80ff_ffff#, 16#0003_0002#));
Broadwell_Trans_EDP : constant Buf_Trans_Array :=
(16#00ff_ffff#, 16#0000_0012#,
16#00eb_afff#, 16#0002_0011#,
16#00c7_1fff#, 16#0006_000f#,
16#00aa_afff#, 16#000e_000a#,
16#00ff_ffff#, 16#0002_0011#,
16#00db_6fff#, 16#0005_000f#,
16#00be_efff#, 16#000a_000c#,
16#00ff_ffff#, 16#0005_000f#,
16#00db_6fff#, 16#000a_000c#,
others => 0);
Broadwell_Trans_DP : constant Buf_Trans_Array :=
(16#00ff_ffff#, 16#0007_000e#,
16#00d7_5fff#, 16#000e_000a#,
16#00be_ffff#, 16#0014_0006#,
16#80b2_cfff#, 16#001b_0002#,
16#00ff_ffff#, 16#000e_000a#,
16#00db_6fff#, 16#0016_0005#,
16#80c7_1fff#, 16#001a_0002#,
16#00f7_dfff#, 16#0018_0004#,
16#80d7_5fff#, 16#001b_0002#,
others => 0);
Broadwell_Trans_FDI : constant Buf_Trans_Array :=
(16#00ff_ffff#, 16#0001_000e#,
16#00d7_5fff#, 16#0004_000a#,
16#00c3_0fff#, 16#0007_0006#,
16#00aa_afff#, 16#000c_0000#,
16#00ff_ffff#, 16#0004_000a#,
16#00d7_5fff#, 16#0009_0004#,
16#00c3_0fff#, 16#000c_0000#,
16#00ff_ffff#, 16#0007_0006#,
16#00d7_5fff#, 16#000c_0000#,
others => 0);
Broadwell_Trans_HDMI : constant HDMI_Buf_Trans_Array :=
((16#00ff_ffff#, 16#0007_000e#),
(16#00d7_5fff#, 16#000e_000a#),
(16#00be_ffff#, 16#0014_0006#),
(16#00ff_ffff#, 16#0009_000d#),
(16#00ff_ffff#, 16#000e_000a#),
(16#00d7_ffff#, 16#0014_0006#),
(16#80cb_2fff#, 16#001b_0002#),
(16#00ff_ffff#, 16#0014_0006#),
(16#80e7_9fff#, 16#001b_0002#),
(16#80ff_ffff#, 16#001b_0002#),
others => (0, 0));
----------------------------------------------------------------------------
procedure Translations (Trans : out Buf_Trans_Array; Port : Digital_Port)
is
HDMI_Trans : constant DDI_HDMI_Buf_Trans_Range :=
(if (Config.CPU = Broadwell and
Config.DDI_HDMI_Buffer_Translation in Broadwell_HDMI_Range)
or
(Config.CPU /= Broadwell and
Config.DDI_HDMI_Buffer_Translation in Haswell_HDMI_Range)
then Config.DDI_HDMI_Buffer_Translation
else Config.Default_DDI_HDMI_Buffer_Translation);
begin
Trans :=
(case Config.CPU is
when Broadwell =>
(case Port is
when DIGI_A =>
(if Config.EDP_Low_Voltage_Swing
then Broadwell_Trans_EDP
else Broadwell_Trans_DP),
when DIGI_B .. DIGI_D => Broadwell_Trans_DP,
when DIGI_E => Broadwell_Trans_FDI),
when others =>
(case Port is
when DIGI_A .. DIGI_D => Haswell_Trans_DP,
when DIGI_E => Haswell_Trans_FDI));
case Config.CPU is
when Broadwell =>
Trans (18) := Broadwell_Trans_HDMI (HDMI_Trans).Trans1;
Trans (19) := Broadwell_Trans_HDMI (HDMI_Trans).Trans2;
when others =>
Trans (18) := Haswell_Trans_HDMI (HDMI_Trans).Trans1;
Trans (19) := Haswell_Trans_HDMI (HDMI_Trans).Trans2;
end case;
end Translations;
end HW.GFX.GMA.Connectors.DDI.Buffers;
| 35.884615 | 79 | 0.609503 |
4146cb4845c43c02d018a4f558f124a364765e4c | 561 | ads | Ada | applet/aide/source/aide.ads | charlie5/aIDE | fab406dbcd9b72a4cb215ffebb05166c788d6365 | [
"MIT"
] | 3 | 2017-04-29T14:25:22.000Z | 2017-09-29T10:15:28.000Z | applet/aide/source/aide.ads | charlie5/aIDE | fab406dbcd9b72a4cb215ffebb05166c788d6365 | [
"MIT"
] | null | null | null | applet/aide/source/aide.ads | charlie5/aIDE | fab406dbcd9b72a4cb215ffebb05166c788d6365 | [
"MIT"
] | null | null | null | private
with
AdaM.Subprogram,
AdaM.a_Package,
AdaM.Environment;
package aIDE
is
procedure start;
procedure stop;
private
-- the_Environ : AdaM.Environment.item;
all_Apps : AdaM.Subprogram.vector;
the_selected_App : AdaM.Subprogram.view;
procedure build_Project;
function fetch_App (Named : in AdaM.Identifier) return adam.Subprogram.view;
anonymous_Procedure : constant String := "Anon";
the_applet_Package : adam.a_Package.view;
the_entity_Environ : AdaM.Environment.item;
end aIDE;
| 15.162162 | 80 | 0.698752 |
57a2aa7f331ac9fb43bc3cce522aeaa4a34e2947 | 1,946 | adb | Ada | Assets/Animations/Mannequin/ADB/Character.adb | Battledrake/CryShooter | 42184444606e1dfd41c963c87f8d16bfef8656a1 | [
"MIT"
] | 1 | 2021-10-11T12:46:59.000Z | 2021-10-11T12:46:59.000Z | Assets/Animations/Mannequin/ADB/Character.adb | Battledrake/CryShooter | 42184444606e1dfd41c963c87f8d16bfef8656a1 | [
"MIT"
] | null | null | null | Assets/Animations/Mannequin/ADB/Character.adb | Battledrake/CryShooter | 42184444606e1dfd41c963c87f8d16bfef8656a1 | [
"MIT"
] | null | null | null | <AnimDB FragDef="Animations/Mannequin/ADB/CharacterFragmentIds.xml" TagDef="Animations/Mannequin/ADB/CharacterTags.xml">
<FragmentList>
<Jump>
<Fragment BlendOutDuration="0.2" Tags="Rifle">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0.2"/>
<Animation name="unarmed_jump_loop" flags="Loop"/>
</AnimLayer>
</Fragment>
<Fragment BlendOutDuration="0.2" Tags="Pistol">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0.00077056885"/>
<Animation name="unarmed_jump_begin"/>
<Blend ExitTime="0" StartTime="0" Duration="0.25077054"/>
<Animation name="unarmed_jump_loop" flags="Loop"/>
</AnimLayer>
</Fragment>
<Fragment BlendOutDuration="0.2" Tags="">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0.00077056885"/>
<Animation name="unarmed_jump_begin"/>
<Blend ExitTime="0" StartTime="0" Duration="0.25077054"/>
<Animation name="unarmed_jump_loop" flags="Loop"/>
</AnimLayer>
</Fragment>
</Jump>
<Locomotion>
<Fragment BlendOutDuration="0.2" Tags="Rifle">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="1.7881393e-07"/>
<Animation name="BSpace_MoveStrafe_Rifle" flags="Loop"/>
</AnimLayer>
</Fragment>
<Fragment BlendOutDuration="0.2" Tags="Pistol">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0"/>
<Animation name="BSpace_MoveStrafe_Pistol" flags="Loop"/>
</AnimLayer>
</Fragment>
<Fragment BlendOutDuration="0.2" Tags="">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0"/>
<Animation name="BSpace_MoveStrafe_Unarmed" flags="Loop"/>
</AnimLayer>
</Fragment>
</Locomotion>
<Fire>
<Fragment BlendOutDuration="0.2" Tags="">
<AnimLayer>
<Blend ExitTime="0" StartTime="0" Duration="0"/>
<Animation name="rifle_aim_fire" flags="Loop"/>
</AnimLayer>
</Fragment>
</Fire>
</FragmentList>
</AnimDB>
| 34.140351 | 120 | 0.658273 |
3d1582286b67677e047dd8774d014e02a2de713a | 4,305 | ads | Ada | source/amf/ocl/amf-ocl-tuple_literal_parts.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/ocl/amf-ocl-tuple_literal_parts.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/ocl/amf-ocl-tuple_literal_parts.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Ada Modeling Framework --
-- --
-- Runtime Library Component --
-- --
------------------------------------------------------------------------------
-- --
-- Copyright © 2012-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$
------------------------------------------------------------------------------
-- This file is generated, don't edit it.
------------------------------------------------------------------------------
limited with AMF.UML.Properties;
with AMF.UML.Typed_Elements;
package AMF.OCL.Tuple_Literal_Parts is
pragma Preelaborate;
type OCL_Tuple_Literal_Part is limited interface
and AMF.UML.Typed_Elements.UML_Typed_Element;
type OCL_Tuple_Literal_Part_Access is
access all OCL_Tuple_Literal_Part'Class;
for OCL_Tuple_Literal_Part_Access'Storage_Size use 0;
not overriding function Get_Attribute
(Self : not null access constant OCL_Tuple_Literal_Part)
return AMF.UML.Properties.UML_Property_Access is abstract;
-- Getter of TupleLiteralPart::attribute.
--
not overriding procedure Set_Attribute
(Self : not null access OCL_Tuple_Literal_Part;
To : AMF.UML.Properties.UML_Property_Access) is abstract;
-- Setter of TupleLiteralPart::attribute.
--
end AMF.OCL.Tuple_Literal_Parts;
| 58.972603 | 78 | 0.460163 |
573aa5deb8d342f33bdda5cc90e6e62524549c91 | 10,865 | adb | Ada | ada_launch.adb | micahwelf/ada_launch | 0854bb6da07566416451f4dfff55a38362ba1b3e | [
"MIT"
] | null | null | null | ada_launch.adb | micahwelf/ada_launch | 0854bb6da07566416451f4dfff55a38362ba1b3e | [
"MIT"
] | null | null | null | ada_launch.adb | micahwelf/ada_launch | 0854bb6da07566416451f4dfff55a38362ba1b3e | [
"MIT"
] | null | null | null | with GNAT.OS_Lib;
package body Ada_Launch is
function Current_Os return Os_Type is
Detected_Os : Os_Type := Other_Os;
function Windows_Test return Boolean is
begin
if Full_Name
(Env.Value ("USERDRIVE", "C:") & Env.Value ("USERPATH", "\")) =
Env.Value ("USERDRIVE", "C:") & Env.Value ("USERPATH", "\")
then
return True;
else
return False;
end if;
exception
when Name_Error =>
return False;
end Windows_Test;
function Unix_Test return Boolean is
begin
if Full_Name
(Env.Value ("USERDRIVE", "C:") & Env.Value ("USERPATH", "\")) =
Env.Value ("USERDRIVE", "C:") & Env.Value ("USERPATH", "\")
then
return True;
else
return False;
end if;
exception
when Name_Error =>
return False;
end Unix_Test;
function Mac_Test return Boolean is
begin
if Full_Name (Env.Value ("HOME", "/home")) =
Env.Value ("HOME", "/home") and
String (Env.Value ("HOME", " ")) (1 .. 6) = "/Users"
then
return True;
else
return False;
end if;
exception
when Name_Error =>
return False;
end Mac_Test;
begin
if Saved_Os = Other_Os then
if Windows_Test then
Detected_Os := Dos;
elsif Unix_Test then
Detected_Os := Unix;
elsif Mac_Test then
Detected_Os := Other_Os;
end if;
else
Detected_Os := Saved_Os;
end if;
return Detected_Os;
end Current_Os;
function Current_Environment return App_Env.Map is
New_Env : App_Env.Map := App_Env.Empty_Map.Copy;
procedure Copy_Env (Name : String; Value : String) is
begin
New_Env (Name) := Value;
end Copy_Env;
begin
Env.Iterate (Copy_Env'Access);
return New_Env;
end Current_Environment;
procedure Set_Environment (New_Env : App_Env.Map) is
procedure Set_Item (C : App_Env.Cursor) is
begin
Env.Set (App_Env.Key (C), App_Env.Element (C));
end Set_Item;
begin
Env.Clear;
New_Env.Iterate (Set_Item'Access);
end Set_Environment;
function "+" (Right : String) return Arguments.Vector is
New_Vector : Arguments.Vector := Arguments.Empty_Vector.Copy;
begin
New_Vector.Append (Right);
return New_Vector;
end "+";
-- This '&' is provided as a more traditional Ada style for a list/vector.
function "&"
(Left : Arguments.Vector;
Right : String) return Arguments.Vector is
begin
return Left & Arguments.Vector'(+Right);
end "&";
function "+"
(Left : Arguments.Vector;
Right : String) return Arguments.Vector is
begin
return Left & Arguments.Vector'(+Right);
end "+";
function "+"
(Left : String;
Right : Arguments.Vector) return Arguments.Vector is
begin
return Arguments.Vector'(+Left) & Right;
end "+";
function "+" (S : String) return Os.String_Access is
New_String_Access : Os.String_Access := new String'(S);
begin
return New_String_Access;
end "+";
function "+" (S : String) return Os.Argument_List is
New_Argument_List : Os.Argument_List (1 .. 1);
begin
New_Argument_List (1) := new String'(S);
return New_Argument_List;
end "+";
function "+" (V : Arguments.Vector) return Os.Argument_List is
New_Argument_List : Os.Argument_List (V.First_Index .. V.Last_Index);
begin
for I in V.First_Index .. V.Last_Index loop
New_Argument_List (I) := new String'(V (I));
end loop;
return New_Argument_List;
end "+";
function Clone_Arguments return Arguments.Vector is
New_Arguments : Arguments.Vector := Arguments.Empty_Vector.Copy;
begin
for I in 1 .. Argument_Count loop
New_Arguments.Append (Argument (I));
end loop;
return New_Arguments;
end Clone_Arguments;
---------------
-- Put_Error --
---------------
procedure Put_Error (Message : String := "") is
begin
Ada.Text_IO.Put_Line
(File => Ada.Text_IO.Standard_Error,
Item => Message);
end Put_Error;
------------------
-- Chromium_App --
------------------
procedure Chromium_App
(Profile : in String := "";
App_Id : in Id_String := Null_Id;
Url : in String := "";
New_Window : in Boolean := True;
Options : in Arguments.Vector := Arguments.Empty_Vector.Copy) is
Search_List : Arguments.Vector :=
(+"/usr/bin/chromium" +
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" +
"chromium" +
"Chrome.exe" +
"google-chrome" +
"google-chrome-stable" +
"google-chrome-beta");
function Get_Executable return String is
Value : Os.String_Access;
begin
for C in Search_List.Iterate loop
Value := Os.Locate_Exec_On_Path (Search_List (C));
if Value /= null then
declare
New_String : String := Value.all;
begin
Free (Value);
return New_String;
end;
end if;
end loop;
return "";
end Get_Executable;
Spawn_Success : Boolean := False;
Executable_Name : String := Get_Executable;
Arg_Vector : Arguments.Vector := Options.Copy;
begin
if New_Window then
Arg_Vector.Prepend (New_Item => "--new-window");
end if;
if App_Id /= Null_Id then
Arg_Vector.Prepend (New_Item => "--app-id=" & String (App_Id));
elsif Url'Length > 0 then
Arg_Vector.Prepend (New_Item => "--app=" & Url);
else
null;
end if;
Arg_Vector.Prepend (New_Item => "--profile-directory=" & Profile);
declare
Spawn_Arguments : Os.Argument_List := +Arg_Vector;
begin
Spawn
(Program_Name => Executable_Name,
Args => Spawn_Arguments,
Success => Spawn_Success);
for X of Spawn_Arguments loop
Os.Free (X);
end loop;
end;
if Spawn_Success then
Ada.Command_Line.Set_Exit_Status (Success);
else
Ada.Command_Line.Set_Exit_Status (Failure);
Put_Error
("Execution of '" & Executable_Name & "' failed. Please fix.");
end if;
end Chromium_App;
----------
-- Xapp --
----------
procedure Xapp
(X_Command : String := "xterm";
Options : Arguments.Vector := Arguments.Empty_Vector.Copy;
New_Env : App_Env.Map := App_Env.Empty_Map.Copy;
Xrm : X_Resources.Map := X_Resources.Empty_Map.Copy) is
Spawn_Success : Boolean := False;
Spawn_Arguments : Arguments.Vector := Options.Copy;
Spawn_Environment : App_Env.Map := New_Env.Copy;
Spawn_Xrm : X_Resources.Map := Xrm.Copy;
Xrm_Index : X_Resources.Cursor := Spawn_Xrm.First;
procedure To_Spawn_Arguments (Item : in X_Resources.Cursor) is
begin
Spawn_Arguments.Prepend
(X_Resources.Key (Item) & ": " & X_Resources.Element (Item));
Spawn_Arguments.Prepend ("-xrm");
end To_Spawn_Arguments;
begin
Spawn_Xrm.Iterate (Process => To_Spawn_Arguments'Access);
--raise Program_Error with "Unimplemented procedure Xapp";
end Xapp;
---------------
-- Xterm_App --
---------------
procedure Xterm_App
(Command : String := "top";
Options : Arguments.Vector := Arguments.Empty_Vector.Copy;
Geometry : String := "";
Managed : Boolean := True;
New_Env : App_Env.Map := App_Env.Empty_Map.Copy;
Xrm : X_Resources.Map := X_Resources.Empty_Map.Copy) is
Spawn_Success : Boolean := False;
Spawn_Arguments : Arguments.Vector := Options.Copy;
Spawn_Environment : App_Env.Map := New_Env.Copy;
Spawn_Xrm : X_Resources.Map := Xrm.Copy;
Test_V : Arguments.Vector;
procedure To_Spawn_Arguments (Item : in X_Resources.Cursor) is
begin
Spawn_Arguments.Prepend
(X_Resources.Key (Item) & ": " & X_Resources.Element (Item));
Spawn_Arguments.Prepend ("-xrm");
end To_Spawn_Arguments;
begin
if Managed then
Spawn_Xrm.Include ("*overrideRedirect", "False");
else
Spawn_Xrm.Include ("*overrideRedirect", "True");
end if;
if New_Env.Contains ("DISPLAY") then
Set_Environment (New_Env);
end if;
if Geometry'Length > 0 then
Spawn_Arguments.Prepend ("-geometry");
end if;
Spawn_Xrm.Iterate (Process => To_Spawn_Arguments'Access);
-- Generated stub: replace with real body!
--pragma Compile_Time_Warning (Standard.True, "Xterm_App unimplemented");
--raise Program_Error with "Unimplemented procedure Xterm_App";
end Xterm_App;
------------------
-- Clone_Launch --
------------------
procedure Clone_Launch
(Command : in String := "/usr/bin/" & Simple_Name (Command_Name);
Prepend_Arguments : in Arguments.Vector := Arguments.Empty_Vector.Copy;
Append_Arguments : in Arguments.Vector := Arguments.Empty_Vector.Copy) is
New_Arguments : Arguments.Vector :=
Prepend_Arguments & Clone_Arguments & Append_Arguments;
begin
Ada_Launch.Command (Command, New_Arguments);
--raise Program_Error with "Unimplemented procedure Clone_Launch";
end Clone_Launch;
-------------
-- Command --
-------------
procedure Command
(Command : String := "true";
Args : Arguments.Vector := Arguments.Empty_Vector.Copy) is
use GNAT.OS_Lib;
Spawn_Success : Boolean := False;
Spawn_Access : Os.String_Access;
begin
Spawn_Access := Os.Locate_Exec_On_Path (Command);
if Spawn_Access /= null then
declare
Executable_Name : String := Spawn_Access.all;
Spawn_Arguments : Os.Argument_List := +Args;
begin
Spawn
(Program_Name => Executable_Name,
Args => Spawn_Arguments,
Success => Spawn_Success);
for X of Spawn_Arguments loop
Os.Free (X);
end loop;
end;
end if;
Os.Free (Spawn_Access);
end Command;
procedure Practice is
begin
Command ("echo", +"this is" + "a test");
end Practice;
end Ada_Launch;
| 30.605634 | 79 | 0.568615 |
591c44d614f375592952f1f3dcec84096468dbfb | 113,047 | adb | Ada | HLS/lab3/dct.prj/solution5/.autopilot/db/read_data.sched.adb | lfVelez/ISPR | 840f41c2053a48642a7b287feecfea79c6f389b3 | [
"MIT"
] | 1 | 2021-03-03T16:53:52.000Z | 2021-03-03T16:53:52.000Z | HLS/lab3/dct.prj/solution6/.autopilot/db/read_data.sched.adb | lfVelez/ISPR | 840f41c2053a48642a7b287feecfea79c6f389b3 | [
"MIT"
] | null | null | null | HLS/lab3/dct.prj/solution6/.autopilot/db/read_data.sched.adb | lfVelez/ISPR | 840f41c2053a48642a7b287feecfea79c6f389b3 | [
"MIT"
] | null | null | null | <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="14">
<syndb class_id="0" tracking_level="0" version="0">
<userIPLatency>-1</userIPLatency>
<userIPName></userIPName>
<cdfg class_id="1" tracking_level="1" version="0" object_id="_0">
<name>read_data</name>
<ret_bitwidth>0</ret_bitwidth>
<ports class_id="2" tracking_level="0" version="0">
<count>9</count>
<item_version>0</item_version>
<item class_id="3" tracking_level="1" version="0" object_id="_1">
<Value class_id="4" tracking_level="0" version="0">
<Obj class_id="5" tracking_level="0" version="0">
<type>1</type>
<id>1</id>
<name>input_r</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo class_id="6" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>input</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>0</direction>
<if_type>1</if_type>
<array_size>64</array_size>
<bit_vecs class_id="7" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_2">
<Value>
<Obj>
<type>1</type>
<id>2</id>
<name>buf_0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buf[0]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_3">
<Value>
<Obj>
<type>1</type>
<id>3</id>
<name>buf_1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buf[1]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_4">
<Value>
<Obj>
<type>1</type>
<id>4</id>
<name>buf_2</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buf[2]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_5">
<Value>
<Obj>
<type>1</type>
<id>5</id>
<name>buf_3</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buf[3]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_6">
<Value>
<Obj>
<type>1</type>
<id>6</id>
<name>buf_4</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buf[4]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_7">
<Value>
<Obj>
<type>1</type>
<id>7</id>
<name>buf_5</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buf[5]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_8">
<Value>
<Obj>
<type>1</type>
<id>8</id>
<name>buf_6</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buf[6]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
<item class_id_reference="3" object_id="_9">
<Value>
<Obj>
<type>1</type>
<id>9</id>
<name>buf_7</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>buf[7]</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<direction>1</direction>
<if_type>1</if_type>
<array_size>8</array_size>
<bit_vecs>
<count>0</count>
<item_version>0</item_version>
</bit_vecs>
</item>
</ports>
<nodes class_id="8" tracking_level="0" version="0">
<count>48</count>
<item_version>0</item_version>
<item class_id="9" tracking_level="1" version="0" object_id="_10">
<Value>
<Obj>
<type>0</type>
<id>10</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>59</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item class_id="10" tracking_level="0" version="0">
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second class_id="11" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="12" tracking_level="0" version="0">
<first class_id="13" tracking_level="0" version="0">
<first>dct.c</first>
<second>read_data</second>
</first>
<second>59</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>77</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_11">
<Value>
<Obj>
<type>0</type>
<id>12</id>
<name>indvar_flatten</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>79</item>
<item>80</item>
<item>81</item>
<item>82</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_12">
<Value>
<Obj>
<type>0</type>
<id>13</id>
<name>r</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>84</item>
<item>85</item>
<item>86</item>
<item>87</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_13">
<Value>
<Obj>
<type>0</type>
<id>14</id>
<name>c</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName>c</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>4</count>
<item_version>0</item_version>
<item>88</item>
<item>89</item>
<item>90</item>
<item>91</item>
</oprand_edges>
<opcode>phi</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_14">
<Value>
<Obj>
<type>0</type>
<id>15</id>
<name>exitcond_flatten</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>92</item>
<item>94</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_15">
<Value>
<Obj>
<type>0</type>
<id>16</id>
<name>indvar_flatten_next</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>95</item>
<item>97</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_16">
<Value>
<Obj>
<type>0</type>
<id>17</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>98</item>
<item>99</item>
<item>100</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_17">
<Value>
<Obj>
<type>0</type>
<id>19</id>
<name>r_2</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>59</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>59</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>r</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>105</item>
<item>106</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_18">
<Value>
<Obj>
<type>0</type>
<id>22</id>
<name>exitcond</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>1</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>107</item>
<item>109</item>
</oprand_edges>
<opcode>icmp</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_19">
<Value>
<Obj>
<type>0</type>
<id>23</id>
<name>c_mid2</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>110</item>
<item>111</item>
<item>112</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_20">
<Value>
<Obj>
<type>0</type>
<id>24</id>
<name>tmp_mid2_v_v</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>113</item>
<item>114</item>
<item>115</item>
</oprand_edges>
<opcode>select</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_21">
<Value>
<Obj>
<type>0</type>
<id>25</id>
<name>tmp</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>116</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_22">
<Value>
<Obj>
<type>0</type>
<id>26</id>
<name>tmp_mid2</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>118</item>
<item>119</item>
<item>121</item>
</oprand_edges>
<opcode>bitconcatenate</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_23">
<Value>
<Obj>
<type>0</type>
<id>27</id>
<name>tmp_7_mid2</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>122</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_24">
<Value>
<Obj>
<type>0</type>
<id>28</id>
<name>c_cast</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>123</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_25">
<Value>
<Obj>
<type>0</type>
<id>32</id>
<name>tmp_9</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>124</item>
<item>125</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_26">
<Value>
<Obj>
<type>0</type>
<id>33</id>
<name>tmp_s</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>126</item>
</oprand_edges>
<opcode>zext</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_27">
<Value>
<Obj>
<type>0</type>
<id>34</id>
<name>input_addr</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>6</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>127</item>
<item>129</item>
<item>130</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_28">
<Value>
<Obj>
<type>0</type>
<id>35</id>
<name>input_load</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>16</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>131</item>
</oprand_edges>
<opcode>load</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_29">
<Value>
<Obj>
<type>0</type>
<id>36</id>
<name>tmp_2</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>132</item>
</oprand_edges>
<opcode>trunc</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_30">
<Value>
<Obj>
<type>0</type>
<id>37</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>16</count>
<item_version>0</item_version>
<item>133</item>
<item>134</item>
<item>135</item>
<item>136</item>
<item>138</item>
<item>139</item>
<item>141</item>
<item>142</item>
<item>144</item>
<item>145</item>
<item>147</item>
<item>148</item>
<item>150</item>
<item>151</item>
<item>153</item>
<item>154</item>
</oprand_edges>
<opcode>switch</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_31">
<Value>
<Obj>
<type>0</type>
<id>39</id>
<name>buf_6_addr</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>191</item>
<item>192</item>
<item>193</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_32">
<Value>
<Obj>
<type>0</type>
<id>40</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>194</item>
<item>195</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_33">
<Value>
<Obj>
<type>0</type>
<id>41</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>196</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_34">
<Value>
<Obj>
<type>0</type>
<id>43</id>
<name>buf_5_addr</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>185</item>
<item>186</item>
<item>187</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_35">
<Value>
<Obj>
<type>0</type>
<id>44</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>188</item>
<item>189</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_36">
<Value>
<Obj>
<type>0</type>
<id>45</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>190</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_37">
<Value>
<Obj>
<type>0</type>
<id>47</id>
<name>buf_4_addr</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>179</item>
<item>180</item>
<item>181</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_38">
<Value>
<Obj>
<type>0</type>
<id>48</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>182</item>
<item>183</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_39">
<Value>
<Obj>
<type>0</type>
<id>49</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>184</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_40">
<Value>
<Obj>
<type>0</type>
<id>51</id>
<name>buf_3_addr</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>173</item>
<item>174</item>
<item>175</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_41">
<Value>
<Obj>
<type>0</type>
<id>52</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>176</item>
<item>177</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_42">
<Value>
<Obj>
<type>0</type>
<id>53</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>178</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_43">
<Value>
<Obj>
<type>0</type>
<id>55</id>
<name>buf_2_addr</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>167</item>
<item>168</item>
<item>169</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_44">
<Value>
<Obj>
<type>0</type>
<id>56</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>170</item>
<item>171</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_45">
<Value>
<Obj>
<type>0</type>
<id>57</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>172</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_46">
<Value>
<Obj>
<type>0</type>
<id>59</id>
<name>buf_1_addr</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>161</item>
<item>162</item>
<item>163</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_47">
<Value>
<Obj>
<type>0</type>
<id>60</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>164</item>
<item>165</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_48">
<Value>
<Obj>
<type>0</type>
<id>61</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>166</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_49">
<Value>
<Obj>
<type>0</type>
<id>63</id>
<name>buf_0_addr</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>155</item>
<item>156</item>
<item>157</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_50">
<Value>
<Obj>
<type>0</type>
<id>64</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>158</item>
<item>159</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_51">
<Value>
<Obj>
<type>0</type>
<id>65</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>160</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_52">
<Value>
<Obj>
<type>0</type>
<id>67</id>
<name>buf_7_addr</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<oprand_edges>
<count>3</count>
<item_version>0</item_version>
<item>197</item>
<item>198</item>
<item>199</item>
</oprand_edges>
<opcode>getelementptr</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_53">
<Value>
<Obj>
<type>0</type>
<id>68</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>200</item>
<item>201</item>
</oprand_edges>
<opcode>store</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_54">
<Value>
<Obj>
<type>0</type>
<id>69</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>62</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>62</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>202</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_55">
<Value>
<Obj>
<type>0</type>
<id>72</id>
<name>c_2</name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>61</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>61</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName>c</originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<oprand_edges>
<count>2</count>
<item_version>0</item_version>
<item>101</item>
<item>103</item>
</oprand_edges>
<opcode>add</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_56">
<Value>
<Obj>
<type>0</type>
<id>73</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>1</count>
<item_version>0</item_version>
<item>104</item>
</oprand_edges>
<opcode>br</opcode>
<m_Display>0</m_Display>
</item>
<item class_id_reference="9" object_id="_57">
<Value>
<Obj>
<type>0</type>
<id>75</id>
<name></name>
<fileName>dct.c</fileName>
<fileDirectory>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</fileDirectory>
<lineNumber>64</lineNumber>
<contextFuncName>read_data</contextFuncName>
<inlineStackInfo>
<count>1</count>
<item_version>0</item_version>
<item>
<first>/home/lfvelez/Documentos/ISPR/HLS/labsource/labs/lab3</first>
<second>
<count>1</count>
<item_version>0</item_version>
<item>
<first>
<first>dct.c</first>
<second>read_data</second>
</first>
<second>64</second>
</item>
</second>
</item>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>0</bitwidth>
</Value>
<oprand_edges>
<count>0</count>
<item_version>0</item_version>
</oprand_edges>
<opcode>ret</opcode>
<m_Display>0</m_Display>
</item>
</nodes>
<consts class_id="15" tracking_level="0" version="0">
<count>14</count>
<item_version>0</item_version>
<item class_id="16" tracking_level="1" version="0" object_id="_58">
<Value>
<Obj>
<type>2</type>
<id>78</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_59">
<Value>
<Obj>
<type>2</type>
<id>83</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_60">
<Value>
<Obj>
<type>2</type>
<id>93</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<const_type>0</const_type>
<content>64</content>
</item>
<item class_id_reference="16" object_id="_61">
<Value>
<Obj>
<type>2</type>
<id>96</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>7</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_62">
<Value>
<Obj>
<type>2</type>
<id>102</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_63">
<Value>
<Obj>
<type>2</type>
<id>108</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>4</bitwidth>
</Value>
<const_type>0</const_type>
<content>8</content>
</item>
<item class_id_reference="16" object_id="_64">
<Value>
<Obj>
<type>2</type>
<id>120</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_65">
<Value>
<Obj>
<type>2</type>
<id>128</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>64</bitwidth>
</Value>
<const_type>0</const_type>
<content>0</content>
</item>
<item class_id_reference="16" object_id="_66">
<Value>
<Obj>
<type>2</type>
<id>137</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<const_type>0</const_type>
<content>1</content>
</item>
<item class_id_reference="16" object_id="_67">
<Value>
<Obj>
<type>2</type>
<id>140</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<const_type>0</const_type>
<content>2</content>
</item>
<item class_id_reference="16" object_id="_68">
<Value>
<Obj>
<type>2</type>
<id>143</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<const_type>0</const_type>
<content>3</content>
</item>
<item class_id_reference="16" object_id="_69">
<Value>
<Obj>
<type>2</type>
<id>146</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<const_type>0</const_type>
<content>4</content>
</item>
<item class_id_reference="16" object_id="_70">
<Value>
<Obj>
<type>2</type>
<id>149</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<const_type>0</const_type>
<content>5</content>
</item>
<item class_id_reference="16" object_id="_71">
<Value>
<Obj>
<type>2</type>
<id>152</id>
<name>empty</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<bitwidth>3</bitwidth>
</Value>
<const_type>0</const_type>
<content>6</content>
</item>
</consts>
<blocks class_id="17" tracking_level="0" version="0">
<count>13</count>
<item_version>0</item_version>
<item class_id="18" tracking_level="1" version="0" object_id="_72">
<Obj>
<type>3</type>
<id>11</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>10</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_73">
<Obj>
<type>3</type>
<id>18</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>6</count>
<item_version>0</item_version>
<item>12</item>
<item>13</item>
<item>14</item>
<item>15</item>
<item>16</item>
<item>17</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_74">
<Obj>
<type>3</type>
<id>38</id>
<name>.reset</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>14</count>
<item_version>0</item_version>
<item>19</item>
<item>22</item>
<item>23</item>
<item>24</item>
<item>25</item>
<item>26</item>
<item>27</item>
<item>28</item>
<item>32</item>
<item>33</item>
<item>34</item>
<item>35</item>
<item>36</item>
<item>37</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_75">
<Obj>
<type>3</type>
<id>42</id>
<name>branch6</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>39</item>
<item>40</item>
<item>41</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_76">
<Obj>
<type>3</type>
<id>46</id>
<name>branch5</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>43</item>
<item>44</item>
<item>45</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_77">
<Obj>
<type>3</type>
<id>50</id>
<name>branch4</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>47</item>
<item>48</item>
<item>49</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_78">
<Obj>
<type>3</type>
<id>54</id>
<name>branch3</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>51</item>
<item>52</item>
<item>53</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_79">
<Obj>
<type>3</type>
<id>58</id>
<name>branch2</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>55</item>
<item>56</item>
<item>57</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_80">
<Obj>
<type>3</type>
<id>62</id>
<name>branch1</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>59</item>
<item>60</item>
<item>61</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_81">
<Obj>
<type>3</type>
<id>66</id>
<name>branch0</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>63</item>
<item>64</item>
<item>65</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_82">
<Obj>
<type>3</type>
<id>70</id>
<name>branch7</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>3</count>
<item_version>0</item_version>
<item>67</item>
<item>68</item>
<item>69</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_83">
<Obj>
<type>3</type>
<id>74</id>
<name>ifBlock</name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>2</count>
<item_version>0</item_version>
<item>72</item>
<item>73</item>
</node_objs>
</item>
<item class_id_reference="18" object_id="_84">
<Obj>
<type>3</type>
<id>76</id>
<name></name>
<fileName></fileName>
<fileDirectory></fileDirectory>
<lineNumber>0</lineNumber>
<contextFuncName></contextFuncName>
<inlineStackInfo>
<count>0</count>
<item_version>0</item_version>
</inlineStackInfo>
<originalName></originalName>
<rtlName></rtlName>
<coreName></coreName>
</Obj>
<node_objs>
<count>1</count>
<item_version>0</item_version>
<item>75</item>
</node_objs>
</item>
</blocks>
<edges class_id="19" tracking_level="0" version="0">
<count>130</count>
<item_version>0</item_version>
<item class_id="20" tracking_level="1" version="0" object_id="_85">
<id>77</id>
<edge_type>2</edge_type>
<source_obj>18</source_obj>
<sink_obj>10</sink_obj>
</item>
<item class_id_reference="20" object_id="_86">
<id>79</id>
<edge_type>1</edge_type>
<source_obj>78</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_87">
<id>80</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_88">
<id>81</id>
<edge_type>1</edge_type>
<source_obj>16</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_89">
<id>82</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>12</sink_obj>
</item>
<item class_id_reference="20" object_id="_90">
<id>84</id>
<edge_type>1</edge_type>
<source_obj>83</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_91">
<id>85</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_92">
<id>86</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_93">
<id>87</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>13</sink_obj>
</item>
<item class_id_reference="20" object_id="_94">
<id>88</id>
<edge_type>1</edge_type>
<source_obj>83</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_95">
<id>89</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_96">
<id>90</id>
<edge_type>1</edge_type>
<source_obj>72</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_97">
<id>91</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>14</sink_obj>
</item>
<item class_id_reference="20" object_id="_98">
<id>92</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_99">
<id>94</id>
<edge_type>1</edge_type>
<source_obj>93</source_obj>
<sink_obj>15</sink_obj>
</item>
<item class_id_reference="20" object_id="_100">
<id>95</id>
<edge_type>1</edge_type>
<source_obj>12</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_101">
<id>97</id>
<edge_type>1</edge_type>
<source_obj>96</source_obj>
<sink_obj>16</sink_obj>
</item>
<item class_id_reference="20" object_id="_102">
<id>98</id>
<edge_type>1</edge_type>
<source_obj>15</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_103">
<id>99</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_104">
<id>100</id>
<edge_type>2</edge_type>
<source_obj>76</source_obj>
<sink_obj>17</sink_obj>
</item>
<item class_id_reference="20" object_id="_105">
<id>101</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>72</sink_obj>
</item>
<item class_id_reference="20" object_id="_106">
<id>103</id>
<edge_type>1</edge_type>
<source_obj>102</source_obj>
<sink_obj>72</sink_obj>
</item>
<item class_id_reference="20" object_id="_107">
<id>104</id>
<edge_type>2</edge_type>
<source_obj>18</source_obj>
<sink_obj>73</sink_obj>
</item>
<item class_id_reference="20" object_id="_108">
<id>105</id>
<edge_type>1</edge_type>
<source_obj>102</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_109">
<id>106</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>19</sink_obj>
</item>
<item class_id_reference="20" object_id="_110">
<id>107</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_111">
<id>109</id>
<edge_type>1</edge_type>
<source_obj>108</source_obj>
<sink_obj>22</sink_obj>
</item>
<item class_id_reference="20" object_id="_112">
<id>110</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_113">
<id>111</id>
<edge_type>1</edge_type>
<source_obj>83</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_114">
<id>112</id>
<edge_type>1</edge_type>
<source_obj>14</source_obj>
<sink_obj>23</sink_obj>
</item>
<item class_id_reference="20" object_id="_115">
<id>113</id>
<edge_type>1</edge_type>
<source_obj>22</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_116">
<id>114</id>
<edge_type>1</edge_type>
<source_obj>19</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_117">
<id>115</id>
<edge_type>1</edge_type>
<source_obj>13</source_obj>
<sink_obj>24</sink_obj>
</item>
<item class_id_reference="20" object_id="_118">
<id>116</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>25</sink_obj>
</item>
<item class_id_reference="20" object_id="_119">
<id>119</id>
<edge_type>1</edge_type>
<source_obj>25</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_120">
<id>121</id>
<edge_type>1</edge_type>
<source_obj>120</source_obj>
<sink_obj>26</sink_obj>
</item>
<item class_id_reference="20" object_id="_121">
<id>122</id>
<edge_type>1</edge_type>
<source_obj>24</source_obj>
<sink_obj>27</sink_obj>
</item>
<item class_id_reference="20" object_id="_122">
<id>123</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>28</sink_obj>
</item>
<item class_id_reference="20" object_id="_123">
<id>124</id>
<edge_type>1</edge_type>
<source_obj>28</source_obj>
<sink_obj>32</sink_obj>
</item>
<item class_id_reference="20" object_id="_124">
<id>125</id>
<edge_type>1</edge_type>
<source_obj>26</source_obj>
<sink_obj>32</sink_obj>
</item>
<item class_id_reference="20" object_id="_125">
<id>126</id>
<edge_type>1</edge_type>
<source_obj>32</source_obj>
<sink_obj>33</sink_obj>
</item>
<item class_id_reference="20" object_id="_126">
<id>127</id>
<edge_type>1</edge_type>
<source_obj>1</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_127">
<id>129</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_128">
<id>130</id>
<edge_type>1</edge_type>
<source_obj>33</source_obj>
<sink_obj>34</sink_obj>
</item>
<item class_id_reference="20" object_id="_129">
<id>131</id>
<edge_type>1</edge_type>
<source_obj>34</source_obj>
<sink_obj>35</sink_obj>
</item>
<item class_id_reference="20" object_id="_130">
<id>132</id>
<edge_type>1</edge_type>
<source_obj>23</source_obj>
<sink_obj>36</sink_obj>
</item>
<item class_id_reference="20" object_id="_131">
<id>133</id>
<edge_type>1</edge_type>
<source_obj>36</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_132">
<id>134</id>
<edge_type>2</edge_type>
<source_obj>70</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_133">
<id>135</id>
<edge_type>1</edge_type>
<source_obj>120</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_134">
<id>136</id>
<edge_type>2</edge_type>
<source_obj>66</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_135">
<id>138</id>
<edge_type>1</edge_type>
<source_obj>137</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_136">
<id>139</id>
<edge_type>2</edge_type>
<source_obj>62</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_137">
<id>141</id>
<edge_type>1</edge_type>
<source_obj>140</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_138">
<id>142</id>
<edge_type>2</edge_type>
<source_obj>58</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_139">
<id>144</id>
<edge_type>1</edge_type>
<source_obj>143</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_140">
<id>145</id>
<edge_type>2</edge_type>
<source_obj>54</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_141">
<id>147</id>
<edge_type>1</edge_type>
<source_obj>146</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_142">
<id>148</id>
<edge_type>2</edge_type>
<source_obj>50</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_143">
<id>150</id>
<edge_type>1</edge_type>
<source_obj>149</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_144">
<id>151</id>
<edge_type>2</edge_type>
<source_obj>46</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_145">
<id>153</id>
<edge_type>1</edge_type>
<source_obj>152</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_146">
<id>154</id>
<edge_type>2</edge_type>
<source_obj>42</source_obj>
<sink_obj>37</sink_obj>
</item>
<item class_id_reference="20" object_id="_147">
<id>155</id>
<edge_type>1</edge_type>
<source_obj>2</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_148">
<id>156</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_149">
<id>157</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>63</sink_obj>
</item>
<item class_id_reference="20" object_id="_150">
<id>158</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_151">
<id>159</id>
<edge_type>1</edge_type>
<source_obj>63</source_obj>
<sink_obj>64</sink_obj>
</item>
<item class_id_reference="20" object_id="_152">
<id>160</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>65</sink_obj>
</item>
<item class_id_reference="20" object_id="_153">
<id>161</id>
<edge_type>1</edge_type>
<source_obj>3</source_obj>
<sink_obj>59</sink_obj>
</item>
<item class_id_reference="20" object_id="_154">
<id>162</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>59</sink_obj>
</item>
<item class_id_reference="20" object_id="_155">
<id>163</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>59</sink_obj>
</item>
<item class_id_reference="20" object_id="_156">
<id>164</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_157">
<id>165</id>
<edge_type>1</edge_type>
<source_obj>59</source_obj>
<sink_obj>60</sink_obj>
</item>
<item class_id_reference="20" object_id="_158">
<id>166</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>61</sink_obj>
</item>
<item class_id_reference="20" object_id="_159">
<id>167</id>
<edge_type>1</edge_type>
<source_obj>4</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_160">
<id>168</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_161">
<id>169</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>55</sink_obj>
</item>
<item class_id_reference="20" object_id="_162">
<id>170</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_163">
<id>171</id>
<edge_type>1</edge_type>
<source_obj>55</source_obj>
<sink_obj>56</sink_obj>
</item>
<item class_id_reference="20" object_id="_164">
<id>172</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>57</sink_obj>
</item>
<item class_id_reference="20" object_id="_165">
<id>173</id>
<edge_type>1</edge_type>
<source_obj>5</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_166">
<id>174</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_167">
<id>175</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>51</sink_obj>
</item>
<item class_id_reference="20" object_id="_168">
<id>176</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_169">
<id>177</id>
<edge_type>1</edge_type>
<source_obj>51</source_obj>
<sink_obj>52</sink_obj>
</item>
<item class_id_reference="20" object_id="_170">
<id>178</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>53</sink_obj>
</item>
<item class_id_reference="20" object_id="_171">
<id>179</id>
<edge_type>1</edge_type>
<source_obj>6</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_172">
<id>180</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_173">
<id>181</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>47</sink_obj>
</item>
<item class_id_reference="20" object_id="_174">
<id>182</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_175">
<id>183</id>
<edge_type>1</edge_type>
<source_obj>47</source_obj>
<sink_obj>48</sink_obj>
</item>
<item class_id_reference="20" object_id="_176">
<id>184</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>49</sink_obj>
</item>
<item class_id_reference="20" object_id="_177">
<id>185</id>
<edge_type>1</edge_type>
<source_obj>7</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_178">
<id>186</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_179">
<id>187</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>43</sink_obj>
</item>
<item class_id_reference="20" object_id="_180">
<id>188</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_181">
<id>189</id>
<edge_type>1</edge_type>
<source_obj>43</source_obj>
<sink_obj>44</sink_obj>
</item>
<item class_id_reference="20" object_id="_182">
<id>190</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>45</sink_obj>
</item>
<item class_id_reference="20" object_id="_183">
<id>191</id>
<edge_type>1</edge_type>
<source_obj>8</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_184">
<id>192</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_185">
<id>193</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>39</sink_obj>
</item>
<item class_id_reference="20" object_id="_186">
<id>194</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>40</sink_obj>
</item>
<item class_id_reference="20" object_id="_187">
<id>195</id>
<edge_type>1</edge_type>
<source_obj>39</source_obj>
<sink_obj>40</sink_obj>
</item>
<item class_id_reference="20" object_id="_188">
<id>196</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>41</sink_obj>
</item>
<item class_id_reference="20" object_id="_189">
<id>197</id>
<edge_type>1</edge_type>
<source_obj>9</source_obj>
<sink_obj>67</sink_obj>
</item>
<item class_id_reference="20" object_id="_190">
<id>198</id>
<edge_type>1</edge_type>
<source_obj>128</source_obj>
<sink_obj>67</sink_obj>
</item>
<item class_id_reference="20" object_id="_191">
<id>199</id>
<edge_type>1</edge_type>
<source_obj>27</source_obj>
<sink_obj>67</sink_obj>
</item>
<item class_id_reference="20" object_id="_192">
<id>200</id>
<edge_type>1</edge_type>
<source_obj>35</source_obj>
<sink_obj>68</sink_obj>
</item>
<item class_id_reference="20" object_id="_193">
<id>201</id>
<edge_type>1</edge_type>
<source_obj>67</source_obj>
<sink_obj>68</sink_obj>
</item>
<item class_id_reference="20" object_id="_194">
<id>202</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>69</sink_obj>
</item>
<item class_id_reference="20" object_id="_195">
<id>234</id>
<edge_type>2</edge_type>
<source_obj>11</source_obj>
<sink_obj>18</sink_obj>
</item>
<item class_id_reference="20" object_id="_196">
<id>235</id>
<edge_type>2</edge_type>
<source_obj>18</source_obj>
<sink_obj>76</sink_obj>
</item>
<item class_id_reference="20" object_id="_197">
<id>236</id>
<edge_type>2</edge_type>
<source_obj>18</source_obj>
<sink_obj>38</sink_obj>
</item>
<item class_id_reference="20" object_id="_198">
<id>237</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>70</sink_obj>
</item>
<item class_id_reference="20" object_id="_199">
<id>238</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>66</sink_obj>
</item>
<item class_id_reference="20" object_id="_200">
<id>239</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>62</sink_obj>
</item>
<item class_id_reference="20" object_id="_201">
<id>240</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>58</sink_obj>
</item>
<item class_id_reference="20" object_id="_202">
<id>241</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>54</sink_obj>
</item>
<item class_id_reference="20" object_id="_203">
<id>242</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>50</sink_obj>
</item>
<item class_id_reference="20" object_id="_204">
<id>243</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>46</sink_obj>
</item>
<item class_id_reference="20" object_id="_205">
<id>244</id>
<edge_type>2</edge_type>
<source_obj>38</source_obj>
<sink_obj>42</sink_obj>
</item>
<item class_id_reference="20" object_id="_206">
<id>245</id>
<edge_type>2</edge_type>
<source_obj>42</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_207">
<id>246</id>
<edge_type>2</edge_type>
<source_obj>46</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_208">
<id>247</id>
<edge_type>2</edge_type>
<source_obj>50</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_209">
<id>248</id>
<edge_type>2</edge_type>
<source_obj>54</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_210">
<id>249</id>
<edge_type>2</edge_type>
<source_obj>58</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_211">
<id>250</id>
<edge_type>2</edge_type>
<source_obj>62</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_212">
<id>251</id>
<edge_type>2</edge_type>
<source_obj>66</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_213">
<id>252</id>
<edge_type>2</edge_type>
<source_obj>70</source_obj>
<sink_obj>74</sink_obj>
</item>
<item class_id_reference="20" object_id="_214">
<id>253</id>
<edge_type>2</edge_type>
<source_obj>74</source_obj>
<sink_obj>18</sink_obj>
</item>
</edges>
</cdfg>
<cdfg_regions class_id="21" tracking_level="0" version="0">
<count>4</count>
<item_version>0</item_version>
<item class_id="22" tracking_level="1" version="0" object_id="_215">
<mId>1</mId>
<mTag>read_data</mTag>
<mType>0</mType>
<sub_regions>
<count>3</count>
<item_version>0</item_version>
<item>2</item>
<item>3</item>
<item>4</item>
</sub_regions>
<basic_blocks>
<count>0</count>
<item_version>0</item_version>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>67</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_216">
<mId>2</mId>
<mTag>Entry</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>11</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_217">
<mId>3</mId>
<mTag>RD_Loop_Row_RD_Loop_Col</mTag>
<mType>1</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>11</count>
<item_version>0</item_version>
<item>18</item>
<item>38</item>
<item>42</item>
<item>46</item>
<item>50</item>
<item>54</item>
<item>58</item>
<item>62</item>
<item>66</item>
<item>70</item>
<item>74</item>
</basic_blocks>
<mII>1</mII>
<mDepth>3</mDepth>
<mMinTripCount>64</mMinTripCount>
<mMaxTripCount>64</mMaxTripCount>
<mMinLatency>65</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
<item class_id_reference="22" object_id="_218">
<mId>4</mId>
<mTag>Return</mTag>
<mType>0</mType>
<sub_regions>
<count>0</count>
<item_version>0</item_version>
</sub_regions>
<basic_blocks>
<count>1</count>
<item_version>0</item_version>
<item>76</item>
</basic_blocks>
<mII>-1</mII>
<mDepth>-1</mDepth>
<mMinTripCount>-1</mMinTripCount>
<mMaxTripCount>-1</mMaxTripCount>
<mMinLatency>0</mMinLatency>
<mMaxLatency>-1</mMaxLatency>
<mIsDfPipe>0</mIsDfPipe>
<mDfPipe class_id="-1"></mDfPipe>
</item>
</cdfg_regions>
<fsm class_id="-1"></fsm>
<res class_id="-1"></res>
<node_label_latency class_id="26" tracking_level="0" version="0">
<count>48</count>
<item_version>0</item_version>
<item class_id="27" tracking_level="0" version="0">
<first>10</first>
<second class_id="28" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>12</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>13</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>14</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>15</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>16</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>17</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>19</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>22</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>23</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>24</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>25</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>26</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>27</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>28</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>32</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>33</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>34</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>35</first>
<second>
<first>2</first>
<second>1</second>
</second>
</item>
<item>
<first>36</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>37</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>39</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>40</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>41</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>43</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>44</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>45</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>47</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>48</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>49</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>51</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>52</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>53</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>55</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>56</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>57</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>59</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>60</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>61</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>63</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>64</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>65</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>67</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>68</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>69</first>
<second>
<first>1</first>
<second>0</second>
</second>
</item>
<item>
<first>72</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
<item>
<first>73</first>
<second>
<first>3</first>
<second>0</second>
</second>
</item>
<item>
<first>75</first>
<second>
<first>2</first>
<second>0</second>
</second>
</item>
</node_label_latency>
<bblk_ent_exit class_id="29" tracking_level="0" version="0">
<count>13</count>
<item_version>0</item_version>
<item class_id="30" tracking_level="0" version="0">
<first>11</first>
<second class_id="31" tracking_level="0" version="0">
<first>0</first>
<second>0</second>
</second>
</item>
<item>
<first>18</first>
<second>
<first>1</first>
<second>1</second>
</second>
</item>
<item>
<first>38</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>42</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>46</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>50</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>54</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>58</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>62</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>66</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>70</first>
<second>
<first>1</first>
<second>3</second>
</second>
</item>
<item>
<first>74</first>
<second>
<first>2</first>
<second>3</second>
</second>
</item>
<item>
<first>76</first>
<second>
<first>2</first>
<second>2</second>
</second>
</item>
</bblk_ent_exit>
<regions class_id="32" tracking_level="0" version="0">
<count>1</count>
<item_version>0</item_version>
<item class_id="33" tracking_level="1" version="0" object_id="_219">
<region_name>RD_Loop_Row_RD_Loop_Col</region_name>
<basic_blocks>
<count>11</count>
<item_version>0</item_version>
<item>18</item>
<item>38</item>
<item>42</item>
<item>46</item>
<item>50</item>
<item>54</item>
<item>58</item>
<item>62</item>
<item>66</item>
<item>70</item>
<item>74</item>
</basic_blocks>
<nodes>
<count>0</count>
<item_version>0</item_version>
</nodes>
<anchor_node>-1</anchor_node>
<region_type>8</region_type>
<interval>1</interval>
<pipe_depth>3</pipe_depth>
</item>
</regions>
<dp_fu_nodes class_id="34" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes>
<dp_fu_nodes_expression class_id="35" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_expression>
<dp_fu_nodes_module>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_module>
<dp_fu_nodes_io>
<count>0</count>
<item_version>0</item_version>
</dp_fu_nodes_io>
<return_ports>
<count>0</count>
<item_version>0</item_version>
</return_ports>
<dp_mem_port_nodes class_id="36" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_mem_port_nodes>
<dp_reg_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_reg_nodes>
<dp_regname_nodes>
<count>0</count>
<item_version>0</item_version>
</dp_regname_nodes>
<dp_reg_phi>
<count>0</count>
<item_version>0</item_version>
</dp_reg_phi>
<dp_regname_phi>
<count>0</count>
<item_version>0</item_version>
</dp_regname_phi>
<dp_port_io_nodes class_id="37" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</dp_port_io_nodes>
<port2core class_id="38" tracking_level="0" version="0">
<count>0</count>
<item_version>0</item_version>
</port2core>
<node2core>
<count>0</count>
<item_version>0</item_version>
</node2core>
</syndb>
</boost_serialization>
| 26.047696 | 90 | 0.586827 |
2f2e7caef5e20b93b5cc1fe3536c0ade86e520cf | 3,960 | adb | Ada | examples/shared/serial_ports/src/serial_io.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | examples/shared/serial_ports/src/serial_io.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | examples/shared/serial_ports/src/serial_io.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- 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 STM32.Device; use STM32.Device;
package body Serial_IO is
----------------
-- Initialize --
----------------
procedure Initialize_Peripheral (Device : access Peripheral_Descriptor) is
Configuration : GPIO_Port_Configuration;
Device_Pins : constant GPIO_Points := Device.Rx_Pin & Device.Tx_Pin;
begin
Enable_Clock (Device_Pins);
Enable_Clock (Device.Transceiver.all);
Configuration.Mode := Mode_AF;
Configuration.Speed := Speed_50MHz;
Configuration.Output_Type := Push_Pull;
Configuration.Resistors := Pull_Up;
Configure_IO (Device_Pins, Configuration);
Configure_Alternate_Function (Device_Pins, Device.Transceiver_AF);
end Initialize_Peripheral;
---------------
-- Configure --
---------------
procedure Configure
(Device : access Peripheral_Descriptor;
Baud_Rate : Baud_Rates;
Parity : Parities := No_Parity;
Data_Bits : Word_Lengths := Word_Length_8;
End_Bits : Stop_Bits := Stopbits_1;
Control : Flow_Control := No_Flow_Control)
is
begin
Disable (Device.Transceiver.all);
Set_Baud_Rate (Device.Transceiver.all, Baud_Rate);
Set_Mode (Device.Transceiver.all, Tx_Rx_Mode);
Set_Stop_Bits (Device.Transceiver.all, End_Bits);
Set_Word_Length (Device.Transceiver.all, Data_Bits);
Set_Parity (Device.Transceiver.all, Parity);
Set_Flow_Control (Device.Transceiver.all, Control);
Enable (Device.Transceiver.all);
end Configure;
end Serial_IO;
| 47.710843 | 78 | 0.563131 |
41e34b08178096b0c609dffd43605745e1732a8c | 40 | ads | Ada | examples/ada/car/car.ads | rewriting/tom | 2918e95c78006f08a2a0919ef440413fa5c2342a | [
"BSD-3-Clause"
] | 36 | 2016-02-19T12:09:49.000Z | 2022-02-03T13:13:21.000Z | examples/ada/car/car.ads | rewriting/tom | 2918e95c78006f08a2a0919ef440413fa5c2342a | [
"BSD-3-Clause"
] | null | null | null | examples/ada/car/car.ads | rewriting/tom | 2918e95c78006f08a2a0919ef440413fa5c2342a | [
"BSD-3-Clause"
] | 6 | 2017-11-30T17:07:10.000Z | 2022-03-12T14:46:21.000Z | package Car is
procedure main;
end Car;
| 10 | 15 | 0.775 |
291ce07e84b56e042345bb9775ea6a726a8003e0 | 115,399 | ads | Ada | arch/ARM/STM32/svd/stm32l4x2/stm32_svd-dfsdm.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | arch/ARM/STM32/svd/stm32l4x2/stm32_svd-dfsdm.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | arch/ARM/STM32/svd/stm32l4x2/stm32_svd-dfsdm.ads | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | -- This spec has been automatically generated from STM32L4x2.svd
pragma Restrictions (No_Elaboration_Code);
pragma Ada_2012;
pragma Style_Checks (Off);
with HAL;
with System;
package STM32_SVD.DFSDM is
pragma Preelaborate;
---------------
-- Registers --
---------------
subtype CHCFG0R1_SITP_Field is HAL.UInt2;
subtype CHCFG0R1_SPICKSEL_Field is HAL.UInt2;
subtype CHCFG0R1_DATMPX_Field is HAL.UInt2;
subtype CHCFG0R1_DATPACK_Field is HAL.UInt2;
subtype CHCFG0R1_CKOUTDIV_Field is HAL.UInt8;
-- channel configuration y register
type CHCFG0R1_Register is record
-- SITP
SITP : CHCFG0R1_SITP_Field := 16#0#;
-- SPICKSEL
SPICKSEL : CHCFG0R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- SCDEN
SCDEN : Boolean := False;
-- CKABEN
CKABEN : Boolean := False;
-- CHEN
CHEN : Boolean := False;
-- CHINSEL
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- DATMPX
DATMPX : CHCFG0R1_DATMPX_Field := 16#0#;
-- DATPACK
DATPACK : CHCFG0R1_DATPACK_Field := 16#0#;
-- CKOUTDIV
CKOUTDIV : CHCFG0R1_CKOUTDIV_Field := 16#0#;
-- unspecified
Reserved_24_29 : HAL.UInt6 := 16#0#;
-- CKOUTSRC
CKOUTSRC : Boolean := False;
-- DFSDMEN
DFSDMEN : Boolean := False;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG0R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
CKOUTDIV at 0 range 16 .. 23;
Reserved_24_29 at 0 range 24 .. 29;
CKOUTSRC at 0 range 30 .. 30;
DFSDMEN at 0 range 31 .. 31;
end record;
subtype CHCFG0R2_DTRBS_Field is HAL.UInt5;
subtype CHCFG0R2_OFFSET_Field is HAL.UInt24;
-- channel configuration y register
type CHCFG0R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- DTRBS
DTRBS : CHCFG0R2_DTRBS_Field := 16#0#;
-- OFFSET
OFFSET : CHCFG0R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG0R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype AWSCD0R_SCDT_Field is HAL.UInt8;
subtype AWSCD0R_BKSCD_Field is HAL.UInt4;
subtype AWSCD0R_AWFOSR_Field is HAL.UInt5;
subtype AWSCD0R_AWFORD_Field is HAL.UInt2;
-- analog watchdog and short-circuit detector register
type AWSCD0R_Register is record
-- SCDT
SCDT : AWSCD0R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- BKSCD
BKSCD : AWSCD0R_BKSCD_Field := 16#0#;
-- AWFOSR
AWFOSR : AWSCD0R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- AWFORD
AWFORD : AWSCD0R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AWSCD0R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CHWDAT0R_WDATA_Field is HAL.UInt16;
-- channel watchdog filter data register
type CHWDAT0R_Register is record
-- WDATA
WDATA : CHWDAT0R_WDATA_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHWDAT0R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- CHDATIN0R_INDAT array element
subtype CHDATIN0R_INDAT_Element is HAL.UInt16;
-- CHDATIN0R_INDAT array
type CHDATIN0R_INDAT_Field_Array is array (0 .. 1)
of CHDATIN0R_INDAT_Element
with Component_Size => 16, Size => 32;
-- channel data input register
type CHDATIN0R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : CHDATIN0R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for CHDATIN0R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype CHCFG1R1_SITP_Field is HAL.UInt2;
subtype CHCFG1R1_SPICKSEL_Field is HAL.UInt2;
subtype CHCFG1R1_DATMPX_Field is HAL.UInt2;
subtype CHCFG1R1_DATPACK_Field is HAL.UInt2;
-- CHCFG1R1
type CHCFG1R1_Register is record
-- SITP
SITP : CHCFG1R1_SITP_Field := 16#0#;
-- SPICKSEL
SPICKSEL : CHCFG1R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- SCDEN
SCDEN : Boolean := False;
-- CKABEN
CKABEN : Boolean := False;
-- CHEN
CHEN : Boolean := False;
-- CHINSEL
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- DATMPX
DATMPX : CHCFG1R1_DATMPX_Field := 16#0#;
-- DATPACK
DATPACK : CHCFG1R1_DATPACK_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG1R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CHCFG1R2_DTRBS_Field is HAL.UInt5;
subtype CHCFG1R2_OFFSET_Field is HAL.UInt24;
-- CHCFG1R2
type CHCFG1R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- DTRBS
DTRBS : CHCFG1R2_DTRBS_Field := 16#0#;
-- OFFSET
OFFSET : CHCFG1R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG1R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype AWSCD1R_SCDT_Field is HAL.UInt8;
subtype AWSCD1R_BKSCD_Field is HAL.UInt4;
subtype AWSCD1R_AWFOSR_Field is HAL.UInt5;
subtype AWSCD1R_AWFORD_Field is HAL.UInt2;
-- AWSCD1R
type AWSCD1R_Register is record
-- SCDT
SCDT : AWSCD1R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- BKSCD
BKSCD : AWSCD1R_BKSCD_Field := 16#0#;
-- AWFOSR
AWFOSR : AWSCD1R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- AWFORD
AWFORD : AWSCD1R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AWSCD1R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CHWDAT1R_WDATA_Field is HAL.UInt16;
-- CHWDAT1R
type CHWDAT1R_Register is record
-- WDATA
WDATA : CHWDAT1R_WDATA_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHWDAT1R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- CHDATIN1R_INDAT array element
subtype CHDATIN1R_INDAT_Element is HAL.UInt16;
-- CHDATIN1R_INDAT array
type CHDATIN1R_INDAT_Field_Array is array (0 .. 1)
of CHDATIN1R_INDAT_Element
with Component_Size => 16, Size => 32;
-- CHDATIN1R
type CHDATIN1R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : CHDATIN1R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for CHDATIN1R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype CHCFG2R1_SITP_Field is HAL.UInt2;
subtype CHCFG2R1_SPICKSEL_Field is HAL.UInt2;
subtype CHCFG2R1_DATMPX_Field is HAL.UInt2;
subtype CHCFG2R1_DATPACK_Field is HAL.UInt2;
-- CHCFG2R1
type CHCFG2R1_Register is record
-- SITP
SITP : CHCFG2R1_SITP_Field := 16#0#;
-- SPICKSEL
SPICKSEL : CHCFG2R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- SCDEN
SCDEN : Boolean := False;
-- CKABEN
CKABEN : Boolean := False;
-- CHEN
CHEN : Boolean := False;
-- CHINSEL
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- DATMPX
DATMPX : CHCFG2R1_DATMPX_Field := 16#0#;
-- DATPACK
DATPACK : CHCFG2R1_DATPACK_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG2R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CHCFG2R2_DTRBS_Field is HAL.UInt5;
subtype CHCFG2R2_OFFSET_Field is HAL.UInt24;
-- CHCFG2R2
type CHCFG2R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- DTRBS
DTRBS : CHCFG2R2_DTRBS_Field := 16#0#;
-- OFFSET
OFFSET : CHCFG2R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG2R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype AWSCD2R_SCDT_Field is HAL.UInt8;
subtype AWSCD2R_BKSCD_Field is HAL.UInt4;
subtype AWSCD2R_AWFOSR_Field is HAL.UInt5;
subtype AWSCD2R_AWFORD_Field is HAL.UInt2;
-- AWSCD2R
type AWSCD2R_Register is record
-- SCDT
SCDT : AWSCD2R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- BKSCD
BKSCD : AWSCD2R_BKSCD_Field := 16#0#;
-- AWFOSR
AWFOSR : AWSCD2R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- AWFORD
AWFORD : AWSCD2R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AWSCD2R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CHWDAT2R_WDATA_Field is HAL.UInt16;
-- CHWDAT2R
type CHWDAT2R_Register is record
-- WDATA
WDATA : CHWDAT2R_WDATA_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHWDAT2R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- CHDATIN2R_INDAT array element
subtype CHDATIN2R_INDAT_Element is HAL.UInt16;
-- CHDATIN2R_INDAT array
type CHDATIN2R_INDAT_Field_Array is array (0 .. 1)
of CHDATIN2R_INDAT_Element
with Component_Size => 16, Size => 32;
-- CHDATIN2R
type CHDATIN2R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : CHDATIN2R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for CHDATIN2R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype CHCFG3R1_SITP_Field is HAL.UInt2;
subtype CHCFG3R1_SPICKSEL_Field is HAL.UInt2;
subtype CHCFG3R1_DATMPX_Field is HAL.UInt2;
subtype CHCFG3R1_DATPACK_Field is HAL.UInt2;
-- CHCFG3R1
type CHCFG3R1_Register is record
-- SITP
SITP : CHCFG3R1_SITP_Field := 16#0#;
-- SPICKSEL
SPICKSEL : CHCFG3R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- SCDEN
SCDEN : Boolean := False;
-- CKABEN
CKABEN : Boolean := False;
-- CHEN
CHEN : Boolean := False;
-- CHINSEL
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- DATMPX
DATMPX : CHCFG3R1_DATMPX_Field := 16#0#;
-- DATPACK
DATPACK : CHCFG3R1_DATPACK_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG3R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CHCFG3R2_DTRBS_Field is HAL.UInt5;
subtype CHCFG3R2_OFFSET_Field is HAL.UInt24;
-- CHCFG3R2
type CHCFG3R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- DTRBS
DTRBS : CHCFG3R2_DTRBS_Field := 16#0#;
-- OFFSET
OFFSET : CHCFG3R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG3R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype AWSCD3R_SCDT_Field is HAL.UInt8;
subtype AWSCD3R_BKSCD_Field is HAL.UInt4;
subtype AWSCD3R_AWFOSR_Field is HAL.UInt5;
subtype AWSCD3R_AWFORD_Field is HAL.UInt2;
-- AWSCD3R
type AWSCD3R_Register is record
-- SCDT
SCDT : AWSCD3R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- BKSCD
BKSCD : AWSCD3R_BKSCD_Field := 16#0#;
-- AWFOSR
AWFOSR : AWSCD3R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- AWFORD
AWFORD : AWSCD3R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AWSCD3R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CHWDAT3R_WDATA_Field is HAL.UInt16;
-- CHWDAT3R
type CHWDAT3R_Register is record
-- WDATA
WDATA : CHWDAT3R_WDATA_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHWDAT3R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- CHDATIN3R_INDAT array element
subtype CHDATIN3R_INDAT_Element is HAL.UInt16;
-- CHDATIN3R_INDAT array
type CHDATIN3R_INDAT_Field_Array is array (0 .. 1)
of CHDATIN3R_INDAT_Element
with Component_Size => 16, Size => 32;
-- CHDATIN3R
type CHDATIN3R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : CHDATIN3R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for CHDATIN3R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype CHCFG4R1_SITP_Field is HAL.UInt2;
subtype CHCFG4R1_SPICKSEL_Field is HAL.UInt2;
subtype CHCFG4R1_DATMPX_Field is HAL.UInt2;
subtype CHCFG4R1_DATPACK_Field is HAL.UInt2;
-- CHCFG4R1
type CHCFG4R1_Register is record
-- SITP
SITP : CHCFG4R1_SITP_Field := 16#0#;
-- SPICKSEL
SPICKSEL : CHCFG4R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- SCDEN
SCDEN : Boolean := False;
-- CKABEN
CKABEN : Boolean := False;
-- CHEN
CHEN : Boolean := False;
-- CHINSEL
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- DATMPX
DATMPX : CHCFG4R1_DATMPX_Field := 16#0#;
-- DATPACK
DATPACK : CHCFG4R1_DATPACK_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG4R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CHCFG4R2_DTRBS_Field is HAL.UInt5;
subtype CHCFG4R2_OFFSET_Field is HAL.UInt24;
-- CHCFG4R2
type CHCFG4R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- DTRBS
DTRBS : CHCFG4R2_DTRBS_Field := 16#0#;
-- OFFSET
OFFSET : CHCFG4R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG4R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype AWSCD4R_SCDT_Field is HAL.UInt8;
subtype AWSCD4R_BKSCD_Field is HAL.UInt4;
subtype AWSCD4R_AWFOSR_Field is HAL.UInt5;
subtype AWSCD4R_AWFORD_Field is HAL.UInt2;
-- AWSCD4R
type AWSCD4R_Register is record
-- SCDT
SCDT : AWSCD4R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- BKSCD
BKSCD : AWSCD4R_BKSCD_Field := 16#0#;
-- AWFOSR
AWFOSR : AWSCD4R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- AWFORD
AWFORD : AWSCD4R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AWSCD4R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CHWDAT4R_WDATA_Field is HAL.UInt16;
-- CHWDAT4R
type CHWDAT4R_Register is record
-- WDATA
WDATA : CHWDAT4R_WDATA_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHWDAT4R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- CHDATIN4R_INDAT array element
subtype CHDATIN4R_INDAT_Element is HAL.UInt16;
-- CHDATIN4R_INDAT array
type CHDATIN4R_INDAT_Field_Array is array (0 .. 1)
of CHDATIN4R_INDAT_Element
with Component_Size => 16, Size => 32;
-- CHDATIN4R
type CHDATIN4R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : CHDATIN4R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for CHDATIN4R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype CHCFG5R1_SITP_Field is HAL.UInt2;
subtype CHCFG5R1_SPICKSEL_Field is HAL.UInt2;
subtype CHCFG5R1_DATMPX_Field is HAL.UInt2;
subtype CHCFG5R1_DATPACK_Field is HAL.UInt2;
-- CHCFG5R1
type CHCFG5R1_Register is record
-- SITP
SITP : CHCFG5R1_SITP_Field := 16#0#;
-- SPICKSEL
SPICKSEL : CHCFG5R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- SCDEN
SCDEN : Boolean := False;
-- CKABEN
CKABEN : Boolean := False;
-- CHEN
CHEN : Boolean := False;
-- CHINSEL
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- DATMPX
DATMPX : CHCFG5R1_DATMPX_Field := 16#0#;
-- DATPACK
DATPACK : CHCFG5R1_DATPACK_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG5R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CHCFG5R2_DTRBS_Field is HAL.UInt5;
subtype CHCFG5R2_OFFSET_Field is HAL.UInt24;
-- CHCFG5R2
type CHCFG5R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- DTRBS
DTRBS : CHCFG5R2_DTRBS_Field := 16#0#;
-- OFFSET
OFFSET : CHCFG5R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG5R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype AWSCD5R_SCDT_Field is HAL.UInt8;
subtype AWSCD5R_BKSCD_Field is HAL.UInt4;
subtype AWSCD5R_AWFOSR_Field is HAL.UInt5;
subtype AWSCD5R_AWFORD_Field is HAL.UInt2;
-- AWSCD5R
type AWSCD5R_Register is record
-- SCDT
SCDT : AWSCD5R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- BKSCD
BKSCD : AWSCD5R_BKSCD_Field := 16#0#;
-- AWFOSR
AWFOSR : AWSCD5R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- AWFORD
AWFORD : AWSCD5R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AWSCD5R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CHWDAT5R_WDATA_Field is HAL.UInt16;
-- CHWDAT5R
type CHWDAT5R_Register is record
-- WDATA
WDATA : CHWDAT5R_WDATA_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHWDAT5R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- CHDATIN5R_INDAT array element
subtype CHDATIN5R_INDAT_Element is HAL.UInt16;
-- CHDATIN5R_INDAT array
type CHDATIN5R_INDAT_Field_Array is array (0 .. 1)
of CHDATIN5R_INDAT_Element
with Component_Size => 16, Size => 32;
-- CHDATIN5R
type CHDATIN5R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : CHDATIN5R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for CHDATIN5R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype CHCFG6R1_SITP_Field is HAL.UInt2;
subtype CHCFG6R1_SPICKSEL_Field is HAL.UInt2;
subtype CHCFG6R1_DATMPX_Field is HAL.UInt2;
subtype CHCFG6R1_DATPACK_Field is HAL.UInt2;
-- CHCFG6R1
type CHCFG6R1_Register is record
-- SITP
SITP : CHCFG6R1_SITP_Field := 16#0#;
-- SPICKSEL
SPICKSEL : CHCFG6R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- SCDEN
SCDEN : Boolean := False;
-- CKABEN
CKABEN : Boolean := False;
-- CHEN
CHEN : Boolean := False;
-- CHINSEL
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- DATMPX
DATMPX : CHCFG6R1_DATMPX_Field := 16#0#;
-- DATPACK
DATPACK : CHCFG6R1_DATPACK_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG6R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CHCFG6R2_DTRBS_Field is HAL.UInt5;
subtype CHCFG6R2_OFFSET_Field is HAL.UInt24;
-- CHCFG6R2
type CHCFG6R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- DTRBS
DTRBS : CHCFG6R2_DTRBS_Field := 16#0#;
-- OFFSET
OFFSET : CHCFG6R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG6R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype AWSCD6R_SCDT_Field is HAL.UInt8;
subtype AWSCD6R_BKSCD_Field is HAL.UInt4;
subtype AWSCD6R_AWFOSR_Field is HAL.UInt5;
subtype AWSCD6R_AWFORD_Field is HAL.UInt2;
-- AWSCD6R
type AWSCD6R_Register is record
-- SCDT
SCDT : AWSCD6R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- BKSCD
BKSCD : AWSCD6R_BKSCD_Field := 16#0#;
-- AWFOSR
AWFOSR : AWSCD6R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- AWFORD
AWFORD : AWSCD6R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AWSCD6R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CHWDAT6R_WDATA_Field is HAL.UInt16;
-- CHWDAT6R
type CHWDAT6R_Register is record
-- WDATA
WDATA : CHWDAT6R_WDATA_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHWDAT6R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- CHDATIN6R_INDAT array element
subtype CHDATIN6R_INDAT_Element is HAL.UInt16;
-- CHDATIN6R_INDAT array
type CHDATIN6R_INDAT_Field_Array is array (0 .. 1)
of CHDATIN6R_INDAT_Element
with Component_Size => 16, Size => 32;
-- CHDATIN6R
type CHDATIN6R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : CHDATIN6R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for CHDATIN6R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype CHCFG7R1_SITP_Field is HAL.UInt2;
subtype CHCFG7R1_SPICKSEL_Field is HAL.UInt2;
subtype CHCFG7R1_DATMPX_Field is HAL.UInt2;
subtype CHCFG7R1_DATPACK_Field is HAL.UInt2;
-- CHCFG7R1
type CHCFG7R1_Register is record
-- SITP
SITP : CHCFG7R1_SITP_Field := 16#0#;
-- SPICKSEL
SPICKSEL : CHCFG7R1_SPICKSEL_Field := 16#0#;
-- unspecified
Reserved_4_4 : HAL.Bit := 16#0#;
-- SCDEN
SCDEN : Boolean := False;
-- CKABEN
CKABEN : Boolean := False;
-- CHEN
CHEN : Boolean := False;
-- CHINSEL
CHINSEL : Boolean := False;
-- unspecified
Reserved_9_11 : HAL.UInt3 := 16#0#;
-- DATMPX
DATMPX : CHCFG7R1_DATMPX_Field := 16#0#;
-- DATPACK
DATPACK : CHCFG7R1_DATPACK_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG7R1_Register use record
SITP at 0 range 0 .. 1;
SPICKSEL at 0 range 2 .. 3;
Reserved_4_4 at 0 range 4 .. 4;
SCDEN at 0 range 5 .. 5;
CKABEN at 0 range 6 .. 6;
CHEN at 0 range 7 .. 7;
CHINSEL at 0 range 8 .. 8;
Reserved_9_11 at 0 range 9 .. 11;
DATMPX at 0 range 12 .. 13;
DATPACK at 0 range 14 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype CHCFG7R2_DTRBS_Field is HAL.UInt5;
subtype CHCFG7R2_OFFSET_Field is HAL.UInt24;
-- CHCFG7R2
type CHCFG7R2_Register is record
-- unspecified
Reserved_0_2 : HAL.UInt3 := 16#0#;
-- DTRBS
DTRBS : CHCFG7R2_DTRBS_Field := 16#0#;
-- OFFSET
OFFSET : CHCFG7R2_OFFSET_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHCFG7R2_Register use record
Reserved_0_2 at 0 range 0 .. 2;
DTRBS at 0 range 3 .. 7;
OFFSET at 0 range 8 .. 31;
end record;
subtype AWSCD7R_SCDT_Field is HAL.UInt8;
subtype AWSCD7R_BKSCD_Field is HAL.UInt4;
subtype AWSCD7R_AWFOSR_Field is HAL.UInt5;
subtype AWSCD7R_AWFORD_Field is HAL.UInt2;
-- AWSCD7R
type AWSCD7R_Register is record
-- SCDT
SCDT : AWSCD7R_SCDT_Field := 16#0#;
-- unspecified
Reserved_8_11 : HAL.UInt4 := 16#0#;
-- BKSCD
BKSCD : AWSCD7R_BKSCD_Field := 16#0#;
-- AWFOSR
AWFOSR : AWSCD7R_AWFOSR_Field := 16#0#;
-- unspecified
Reserved_21_21 : HAL.Bit := 16#0#;
-- AWFORD
AWFORD : AWSCD7R_AWFORD_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for AWSCD7R_Register use record
SCDT at 0 range 0 .. 7;
Reserved_8_11 at 0 range 8 .. 11;
BKSCD at 0 range 12 .. 15;
AWFOSR at 0 range 16 .. 20;
Reserved_21_21 at 0 range 21 .. 21;
AWFORD at 0 range 22 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype CHWDAT7R_WDATA_Field is HAL.UInt16;
-- CHWDAT7R
type CHWDAT7R_Register is record
-- WDATA
WDATA : CHWDAT7R_WDATA_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for CHWDAT7R_Register use record
WDATA at 0 range 0 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
-- CHDATIN7R_INDAT array element
subtype CHDATIN7R_INDAT_Element is HAL.UInt16;
-- CHDATIN7R_INDAT array
type CHDATIN7R_INDAT_Field_Array is array (0 .. 1)
of CHDATIN7R_INDAT_Element
with Component_Size => 16, Size => 32;
-- CHDATIN7R
type CHDATIN7R_Register
(As_Array : Boolean := False)
is record
case As_Array is
when False =>
-- INDAT as a value
Val : HAL.UInt32;
when True =>
-- INDAT as an array
Arr : CHDATIN7R_INDAT_Field_Array;
end case;
end record
with Unchecked_Union, Size => 32, Volatile_Full_Access,
Bit_Order => System.Low_Order_First;
for CHDATIN7R_Register use record
Val at 0 range 0 .. 31;
Arr at 0 range 0 .. 31;
end record;
subtype DFSDM0_CR1_JEXTSEL_Field is HAL.UInt3;
subtype DFSDM0_CR1_JEXTEN_Field is HAL.UInt2;
subtype DFSDM0_CR1_RCH_Field is HAL.UInt3;
-- control register 1
type DFSDM0_CR1_Register is record
-- DFSDM enable
DFEN : Boolean := False;
-- Start a conversion of the injected group of channels
JSWSTART : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Launch an injected conversion synchronously with the DFSDM0 JSWSTART
-- trigger
JSYNC : Boolean := False;
-- Scanning conversion mode for injected conversions
JSCAN : Boolean := False;
-- DMA channel enabled to read data for the injected channel group
JDMAEN : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Trigger signal selection for launching injected conversions
JEXTSEL : DFSDM0_CR1_JEXTSEL_Field := 16#0#;
-- unspecified
Reserved_11_12 : HAL.UInt2 := 16#0#;
-- Trigger enable and trigger edge selection for injected conversions
JEXTEN : DFSDM0_CR1_JEXTEN_Field := 16#0#;
-- unspecified
Reserved_15_16 : HAL.UInt2 := 16#0#;
-- Software start of a conversion on the regular channel
RSWSTART : Boolean := False;
-- Continuous mode selection for regular conversions
RCONT : Boolean := False;
-- Launch regular conversion synchronously with DFSDM0
RSYNC : Boolean := False;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- DMA channel enabled to read data for the regular conversion
RDMAEN : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Regular channel selection
RCH : DFSDM0_CR1_RCH_Field := 16#0#;
-- unspecified
Reserved_27_28 : HAL.UInt2 := 16#0#;
-- Fast conversion mode selection for regular conversions
FAST : Boolean := False;
-- Analog watchdog fast mode select
AWFSEL : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_CR1_Register use record
DFEN at 0 range 0 .. 0;
JSWSTART at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
JSYNC at 0 range 3 .. 3;
JSCAN at 0 range 4 .. 4;
JDMAEN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
JEXTSEL at 0 range 8 .. 10;
Reserved_11_12 at 0 range 11 .. 12;
JEXTEN at 0 range 13 .. 14;
Reserved_15_16 at 0 range 15 .. 16;
RSWSTART at 0 range 17 .. 17;
RCONT at 0 range 18 .. 18;
RSYNC at 0 range 19 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
RDMAEN at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
RCH at 0 range 24 .. 26;
Reserved_27_28 at 0 range 27 .. 28;
FAST at 0 range 29 .. 29;
AWFSEL at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DFSDM0_CR2_EXCH_Field is HAL.UInt8;
subtype DFSDM0_CR2_AWDCH_Field is HAL.UInt8;
-- control register 2
type DFSDM0_CR2_Register is record
-- Injected end of conversion interrupt enable
JEOCIE : Boolean := False;
-- Regular end of conversion interrupt enable
REOCIE : Boolean := False;
-- Injected data overrun interrupt enable
JOVRIE : Boolean := False;
-- Regular data overrun interrupt enable
ROVRIE : Boolean := False;
-- Analog watchdog interrupt enable
AWDIE : Boolean := False;
-- Short-circuit detector interrupt enable
SCDIE : Boolean := False;
-- Clock absence interrupt enable
CKABIE : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Extremes detector channel selection
EXCH : DFSDM0_CR2_EXCH_Field := 16#0#;
-- Analog watchdog channel selection
AWDCH : DFSDM0_CR2_AWDCH_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_CR2_Register use record
JEOCIE at 0 range 0 .. 0;
REOCIE at 0 range 1 .. 1;
JOVRIE at 0 range 2 .. 2;
ROVRIE at 0 range 3 .. 3;
AWDIE at 0 range 4 .. 4;
SCDIE at 0 range 5 .. 5;
CKABIE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
EXCH at 0 range 8 .. 15;
AWDCH at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM0_ISR_CKABF_Field is HAL.UInt8;
subtype DFSDM0_ISR_SCDF_Field is HAL.UInt8;
-- interrupt and status register
type DFSDM0_ISR_Register is record
-- Read-only. End of injected conversion flag
JEOCF : Boolean;
-- Read-only. End of regular conversion flag
REOCF : Boolean;
-- Read-only. Injected conversion overrun flag
JOVRF : Boolean;
-- Read-only. Regular conversion overrun flag
ROVRF : Boolean;
-- Read-only. Analog watchdog
AWDF : Boolean;
-- unspecified
Reserved_5_12 : HAL.UInt8;
-- Read-only. Injected conversion in progress status
JCIP : Boolean;
-- Read-only. Regular conversion in progress status
RCIP : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Clock absence flag
CKABF : DFSDM0_ISR_CKABF_Field;
-- Read-only. short-circuit detector flag
SCDF : DFSDM0_ISR_SCDF_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_ISR_Register use record
JEOCF at 0 range 0 .. 0;
REOCF at 0 range 1 .. 1;
JOVRF at 0 range 2 .. 2;
ROVRF at 0 range 3 .. 3;
AWDF at 0 range 4 .. 4;
Reserved_5_12 at 0 range 5 .. 12;
JCIP at 0 range 13 .. 13;
RCIP at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CKABF at 0 range 16 .. 23;
SCDF at 0 range 24 .. 31;
end record;
subtype DFSDM0_ICR_CLRCKABF_Field is HAL.UInt8;
subtype DFSDM0_ICR_CLRSCDF_Field is HAL.UInt8;
-- interrupt flag clear register
type DFSDM0_ICR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Clear the injected conversion overrun flag
CLRJOVRF : Boolean := False;
-- Clear the regular conversion overrun flag
CLRROVRF : Boolean := False;
-- unspecified
Reserved_4_15 : HAL.UInt12 := 16#0#;
-- Clear the clock absence flag
CLRCKABF : DFSDM0_ICR_CLRCKABF_Field := 16#0#;
-- Clear the short-circuit detector flag
CLRSCDF : DFSDM0_ICR_CLRSCDF_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_ICR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
CLRJOVRF at 0 range 2 .. 2;
CLRROVRF at 0 range 3 .. 3;
Reserved_4_15 at 0 range 4 .. 15;
CLRCKABF at 0 range 16 .. 23;
CLRSCDF at 0 range 24 .. 31;
end record;
subtype DFSDM0_JCHGR_JCHG_Field is HAL.UInt8;
-- injected channel group selection register
type DFSDM0_JCHGR_Register is record
-- Injected channel group selection
JCHG : DFSDM0_JCHGR_JCHG_Field := 16#1#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_JCHGR_Register use record
JCHG at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DFSDM0_FCR_IOSR_Field is HAL.UInt8;
subtype DFSDM0_FCR_FOSR_Field is HAL.UInt10;
subtype DFSDM0_FCR_FORD_Field is HAL.UInt3;
-- filter control register
type DFSDM0_FCR_Register is record
-- Integrator oversampling ratio (averaging length)
IOSR : DFSDM0_FCR_IOSR_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Sinc filter oversampling ratio (decimation rate)
FOSR : DFSDM0_FCR_FOSR_Field := 16#0#;
-- unspecified
Reserved_26_28 : HAL.UInt3 := 16#0#;
-- Sinc filter order
FORD : DFSDM0_FCR_FORD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_FCR_Register use record
IOSR at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
FOSR at 0 range 16 .. 25;
Reserved_26_28 at 0 range 26 .. 28;
FORD at 0 range 29 .. 31;
end record;
subtype DFSDM0_JDATAR_JDATACH_Field is HAL.UInt3;
subtype DFSDM0_JDATAR_JDATA_Field is HAL.UInt24;
-- data register for injected group
type DFSDM0_JDATAR_Register is record
-- Read-only. Injected channel most recently converted
JDATACH : DFSDM0_JDATAR_JDATACH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Injected group conversion data
JDATA : DFSDM0_JDATAR_JDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_JDATAR_Register use record
JDATACH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
JDATA at 0 range 8 .. 31;
end record;
subtype DFSDM0_RDATAR_RDATACH_Field is HAL.UInt3;
subtype DFSDM0_RDATAR_RDATA_Field is HAL.UInt24;
-- data register for the regular channel
type DFSDM0_RDATAR_Register is record
-- Read-only. Regular channel most recently converted
RDATACH : DFSDM0_RDATAR_RDATACH_Field;
-- unspecified
Reserved_3_3 : HAL.Bit;
-- Read-only. Regular channel pending data
RPEND : Boolean;
-- unspecified
Reserved_5_7 : HAL.UInt3;
-- Read-only. Regular channel conversion data
RDATA : DFSDM0_RDATAR_RDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_RDATAR_Register use record
RDATACH at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RPEND at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
RDATA at 0 range 8 .. 31;
end record;
subtype DFSDM0_AWHTR_BKAWH_Field is HAL.UInt4;
subtype DFSDM0_AWHTR_AWHT_Field is HAL.UInt24;
-- analog watchdog high threshold register
type DFSDM0_AWHTR_Register is record
-- Break signal assignment to analog watchdog high threshold event
BKAWH : DFSDM0_AWHTR_BKAWH_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog high threshold
AWHT : DFSDM0_AWHTR_AWHT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_AWHTR_Register use record
BKAWH at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWHT at 0 range 8 .. 31;
end record;
subtype DFSDM0_AWLTR_BKAWL_Field is HAL.UInt4;
subtype DFSDM0_AWLTR_AWLT_Field is HAL.UInt24;
-- analog watchdog low threshold register
type DFSDM0_AWLTR_Register is record
-- Break signal assignment to analog watchdog low threshold event
BKAWL : DFSDM0_AWLTR_BKAWL_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog low threshold
AWLT : DFSDM0_AWLTR_AWLT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_AWLTR_Register use record
BKAWL at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWLT at 0 range 8 .. 31;
end record;
subtype DFSDM0_AWSR_AWLTF_Field is HAL.UInt8;
subtype DFSDM0_AWSR_AWHTF_Field is HAL.UInt8;
-- analog watchdog status register
type DFSDM0_AWSR_Register is record
-- Read-only. Analog watchdog low threshold flag
AWLTF : DFSDM0_AWSR_AWLTF_Field;
-- Read-only. Analog watchdog high threshold flag
AWHTF : DFSDM0_AWSR_AWHTF_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_AWSR_Register use record
AWLTF at 0 range 0 .. 7;
AWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM0_AWCFR_CLRAWLTF_Field is HAL.UInt8;
subtype DFSDM0_AWCFR_CLRAWHTF_Field is HAL.UInt8;
-- analog watchdog clear flag register
type DFSDM0_AWCFR_Register is record
-- Clear the analog watchdog low threshold flag
CLRAWLTF : DFSDM0_AWCFR_CLRAWLTF_Field := 16#0#;
-- Clear the analog watchdog high threshold flag
CLRAWHTF : DFSDM0_AWCFR_CLRAWHTF_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_AWCFR_Register use record
CLRAWLTF at 0 range 0 .. 7;
CLRAWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM0_EXMAX_EXMAXCH_Field is HAL.UInt3;
subtype DFSDM0_EXMAX_EXMAX_Field is HAL.UInt24;
-- Extremes detector maximum register
type DFSDM0_EXMAX_Register is record
-- Read-only. Extremes detector maximum data channel
EXMAXCH : DFSDM0_EXMAX_EXMAXCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector maximum value
EXMAX : DFSDM0_EXMAX_EXMAX_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_EXMAX_Register use record
EXMAXCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMAX at 0 range 8 .. 31;
end record;
subtype DFSDM0_EXMIN_EXMINCH_Field is HAL.UInt3;
subtype DFSDM0_EXMIN_EXMIN_Field is HAL.UInt24;
-- Extremes detector minimum register
type DFSDM0_EXMIN_Register is record
-- Read-only. Extremes detector minimum data channel
EXMINCH : DFSDM0_EXMIN_EXMINCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. EXMIN
EXMIN : DFSDM0_EXMIN_EXMIN_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_EXMIN_Register use record
EXMINCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMIN at 0 range 8 .. 31;
end record;
subtype DFSDM0_CNVTIMR_CNVCNT_Field is HAL.UInt28;
-- conversion timer register
type DFSDM0_CNVTIMR_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4;
-- Read-only. 28-bit timer counting conversion time t = CNVCNT[27:0] /
-- fDFSDM_CKIN
CNVCNT : DFSDM0_CNVTIMR_CNVCNT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM0_CNVTIMR_Register use record
Reserved_0_3 at 0 range 0 .. 3;
CNVCNT at 0 range 4 .. 31;
end record;
subtype DFSDM1_CR1_JEXTSEL_Field is HAL.UInt3;
subtype DFSDM1_CR1_JEXTEN_Field is HAL.UInt2;
subtype DFSDM1_CR1_RCH_Field is HAL.UInt3;
-- control register 1
type DFSDM1_CR1_Register is record
-- DFSDM enable
DFEN : Boolean := False;
-- Start a conversion of the injected group of channels
JSWSTART : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Launch an injected conversion synchronously with the DFSDM0 JSWSTART
-- trigger
JSYNC : Boolean := False;
-- Scanning conversion mode for injected conversions
JSCAN : Boolean := False;
-- DMA channel enabled to read data for the injected channel group
JDMAEN : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Trigger signal selection for launching injected conversions
JEXTSEL : DFSDM1_CR1_JEXTSEL_Field := 16#0#;
-- unspecified
Reserved_11_12 : HAL.UInt2 := 16#0#;
-- Trigger enable and trigger edge selection for injected conversions
JEXTEN : DFSDM1_CR1_JEXTEN_Field := 16#0#;
-- unspecified
Reserved_15_16 : HAL.UInt2 := 16#0#;
-- Software start of a conversion on the regular channel
RSWSTART : Boolean := False;
-- Continuous mode selection for regular conversions
RCONT : Boolean := False;
-- Launch regular conversion synchronously with DFSDM0
RSYNC : Boolean := False;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- DMA channel enabled to read data for the regular conversion
RDMAEN : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Regular channel selection
RCH : DFSDM1_CR1_RCH_Field := 16#0#;
-- unspecified
Reserved_27_28 : HAL.UInt2 := 16#0#;
-- Fast conversion mode selection for regular conversions
FAST : Boolean := False;
-- Analog watchdog fast mode select
AWFSEL : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_CR1_Register use record
DFEN at 0 range 0 .. 0;
JSWSTART at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
JSYNC at 0 range 3 .. 3;
JSCAN at 0 range 4 .. 4;
JDMAEN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
JEXTSEL at 0 range 8 .. 10;
Reserved_11_12 at 0 range 11 .. 12;
JEXTEN at 0 range 13 .. 14;
Reserved_15_16 at 0 range 15 .. 16;
RSWSTART at 0 range 17 .. 17;
RCONT at 0 range 18 .. 18;
RSYNC at 0 range 19 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
RDMAEN at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
RCH at 0 range 24 .. 26;
Reserved_27_28 at 0 range 27 .. 28;
FAST at 0 range 29 .. 29;
AWFSEL at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DFSDM1_CR2_EXCH_Field is HAL.UInt8;
subtype DFSDM1_CR2_AWDCH_Field is HAL.UInt8;
-- control register 2
type DFSDM1_CR2_Register is record
-- Injected end of conversion interrupt enable
JEOCIE : Boolean := False;
-- Regular end of conversion interrupt enable
REOCIE : Boolean := False;
-- Injected data overrun interrupt enable
JOVRIE : Boolean := False;
-- Regular data overrun interrupt enable
ROVRIE : Boolean := False;
-- Analog watchdog interrupt enable
AWDIE : Boolean := False;
-- Short-circuit detector interrupt enable
SCDIE : Boolean := False;
-- Clock absence interrupt enable
CKABIE : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Extremes detector channel selection
EXCH : DFSDM1_CR2_EXCH_Field := 16#0#;
-- Analog watchdog channel selection
AWDCH : DFSDM1_CR2_AWDCH_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_CR2_Register use record
JEOCIE at 0 range 0 .. 0;
REOCIE at 0 range 1 .. 1;
JOVRIE at 0 range 2 .. 2;
ROVRIE at 0 range 3 .. 3;
AWDIE at 0 range 4 .. 4;
SCDIE at 0 range 5 .. 5;
CKABIE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
EXCH at 0 range 8 .. 15;
AWDCH at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM1_ISR_CKABF_Field is HAL.UInt8;
subtype DFSDM1_ISR_SCDF_Field is HAL.UInt8;
-- interrupt and status register
type DFSDM1_ISR_Register is record
-- Read-only. End of injected conversion flag
JEOCF : Boolean;
-- Read-only. End of regular conversion flag
REOCF : Boolean;
-- Read-only. Injected conversion overrun flag
JOVRF : Boolean;
-- Read-only. Regular conversion overrun flag
ROVRF : Boolean;
-- Read-only. Analog watchdog
AWDF : Boolean;
-- unspecified
Reserved_5_12 : HAL.UInt8;
-- Read-only. Injected conversion in progress status
JCIP : Boolean;
-- Read-only. Regular conversion in progress status
RCIP : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Clock absence flag
CKABF : DFSDM1_ISR_CKABF_Field;
-- Read-only. short-circuit detector flag
SCDF : DFSDM1_ISR_SCDF_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_ISR_Register use record
JEOCF at 0 range 0 .. 0;
REOCF at 0 range 1 .. 1;
JOVRF at 0 range 2 .. 2;
ROVRF at 0 range 3 .. 3;
AWDF at 0 range 4 .. 4;
Reserved_5_12 at 0 range 5 .. 12;
JCIP at 0 range 13 .. 13;
RCIP at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CKABF at 0 range 16 .. 23;
SCDF at 0 range 24 .. 31;
end record;
subtype DFSDM1_ICR_CLRCKABF_Field is HAL.UInt8;
subtype DFSDM1_ICR_CLRSCDF_Field is HAL.UInt8;
-- interrupt flag clear register
type DFSDM1_ICR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Clear the injected conversion overrun flag
CLRJOVRF : Boolean := False;
-- Clear the regular conversion overrun flag
CLRROVRF : Boolean := False;
-- unspecified
Reserved_4_15 : HAL.UInt12 := 16#0#;
-- Clear the clock absence flag
CLRCKABF : DFSDM1_ICR_CLRCKABF_Field := 16#0#;
-- Clear the short-circuit detector flag
CLRSCDF : DFSDM1_ICR_CLRSCDF_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_ICR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
CLRJOVRF at 0 range 2 .. 2;
CLRROVRF at 0 range 3 .. 3;
Reserved_4_15 at 0 range 4 .. 15;
CLRCKABF at 0 range 16 .. 23;
CLRSCDF at 0 range 24 .. 31;
end record;
subtype DFSDM1_JCHGR_JCHG_Field is HAL.UInt8;
-- injected channel group selection register
type DFSDM1_JCHGR_Register is record
-- Injected channel group selection
JCHG : DFSDM1_JCHGR_JCHG_Field := 16#1#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_JCHGR_Register use record
JCHG at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DFSDM1_FCR_IOSR_Field is HAL.UInt8;
subtype DFSDM1_FCR_FOSR_Field is HAL.UInt10;
subtype DFSDM1_FCR_FORD_Field is HAL.UInt3;
-- filter control register
type DFSDM1_FCR_Register is record
-- Integrator oversampling ratio (averaging length)
IOSR : DFSDM1_FCR_IOSR_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Sinc filter oversampling ratio (decimation rate)
FOSR : DFSDM1_FCR_FOSR_Field := 16#0#;
-- unspecified
Reserved_26_28 : HAL.UInt3 := 16#0#;
-- Sinc filter order
FORD : DFSDM1_FCR_FORD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_FCR_Register use record
IOSR at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
FOSR at 0 range 16 .. 25;
Reserved_26_28 at 0 range 26 .. 28;
FORD at 0 range 29 .. 31;
end record;
subtype DFSDM1_JDATAR_JDATACH_Field is HAL.UInt3;
subtype DFSDM1_JDATAR_JDATA_Field is HAL.UInt24;
-- data register for injected group
type DFSDM1_JDATAR_Register is record
-- Read-only. Injected channel most recently converted
JDATACH : DFSDM1_JDATAR_JDATACH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Injected group conversion data
JDATA : DFSDM1_JDATAR_JDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_JDATAR_Register use record
JDATACH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
JDATA at 0 range 8 .. 31;
end record;
subtype DFSDM1_RDATAR_RDATACH_Field is HAL.UInt3;
subtype DFSDM1_RDATAR_RDATA_Field is HAL.UInt24;
-- data register for the regular channel
type DFSDM1_RDATAR_Register is record
-- Read-only. Regular channel most recently converted
RDATACH : DFSDM1_RDATAR_RDATACH_Field;
-- unspecified
Reserved_3_3 : HAL.Bit;
-- Read-only. Regular channel pending data
RPEND : Boolean;
-- unspecified
Reserved_5_7 : HAL.UInt3;
-- Read-only. Regular channel conversion data
RDATA : DFSDM1_RDATAR_RDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_RDATAR_Register use record
RDATACH at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RPEND at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
RDATA at 0 range 8 .. 31;
end record;
subtype DFSDM1_AWHTR_BKAWH_Field is HAL.UInt4;
subtype DFSDM1_AWHTR_AWHT_Field is HAL.UInt24;
-- analog watchdog high threshold register
type DFSDM1_AWHTR_Register is record
-- Break signal assignment to analog watchdog high threshold event
BKAWH : DFSDM1_AWHTR_BKAWH_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog high threshold
AWHT : DFSDM1_AWHTR_AWHT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_AWHTR_Register use record
BKAWH at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWHT at 0 range 8 .. 31;
end record;
subtype DFSDM1_AWLTR_BKAWL_Field is HAL.UInt4;
subtype DFSDM1_AWLTR_AWLT_Field is HAL.UInt24;
-- analog watchdog low threshold register
type DFSDM1_AWLTR_Register is record
-- Break signal assignment to analog watchdog low threshold event
BKAWL : DFSDM1_AWLTR_BKAWL_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog low threshold
AWLT : DFSDM1_AWLTR_AWLT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_AWLTR_Register use record
BKAWL at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWLT at 0 range 8 .. 31;
end record;
subtype DFSDM1_AWSR_AWLTF_Field is HAL.UInt8;
subtype DFSDM1_AWSR_AWHTF_Field is HAL.UInt8;
-- analog watchdog status register
type DFSDM1_AWSR_Register is record
-- Read-only. Analog watchdog low threshold flag
AWLTF : DFSDM1_AWSR_AWLTF_Field;
-- Read-only. Analog watchdog high threshold flag
AWHTF : DFSDM1_AWSR_AWHTF_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_AWSR_Register use record
AWLTF at 0 range 0 .. 7;
AWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM1_AWCFR_CLRAWLTF_Field is HAL.UInt8;
subtype DFSDM1_AWCFR_CLRAWHTF_Field is HAL.UInt8;
-- analog watchdog clear flag register
type DFSDM1_AWCFR_Register is record
-- Clear the analog watchdog low threshold flag
CLRAWLTF : DFSDM1_AWCFR_CLRAWLTF_Field := 16#0#;
-- Clear the analog watchdog high threshold flag
CLRAWHTF : DFSDM1_AWCFR_CLRAWHTF_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_AWCFR_Register use record
CLRAWLTF at 0 range 0 .. 7;
CLRAWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM1_EXMAX_EXMAXCH_Field is HAL.UInt3;
subtype DFSDM1_EXMAX_EXMAX_Field is HAL.UInt24;
-- Extremes detector maximum register
type DFSDM1_EXMAX_Register is record
-- Read-only. Extremes detector maximum data channel
EXMAXCH : DFSDM1_EXMAX_EXMAXCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector maximum value
EXMAX : DFSDM1_EXMAX_EXMAX_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_EXMAX_Register use record
EXMAXCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMAX at 0 range 8 .. 31;
end record;
subtype DFSDM1_EXMIN_EXMINCH_Field is HAL.UInt3;
subtype DFSDM1_EXMIN_EXMIN_Field is HAL.UInt24;
-- Extremes detector minimum register
type DFSDM1_EXMIN_Register is record
-- Read-only. Extremes detector minimum data channel
EXMINCH : DFSDM1_EXMIN_EXMINCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. EXMIN
EXMIN : DFSDM1_EXMIN_EXMIN_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_EXMIN_Register use record
EXMINCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMIN at 0 range 8 .. 31;
end record;
subtype DFSDM1_CNVTIMR_CNVCNT_Field is HAL.UInt28;
-- conversion timer register
type DFSDM1_CNVTIMR_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4;
-- Read-only. 28-bit timer counting conversion time t = CNVCNT[27:0] /
-- fDFSDM_CKIN
CNVCNT : DFSDM1_CNVTIMR_CNVCNT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM1_CNVTIMR_Register use record
Reserved_0_3 at 0 range 0 .. 3;
CNVCNT at 0 range 4 .. 31;
end record;
subtype DFSDM2_CR1_JEXTSEL_Field is HAL.UInt3;
subtype DFSDM2_CR1_JEXTEN_Field is HAL.UInt2;
subtype DFSDM2_CR1_RCH_Field is HAL.UInt3;
-- control register 1
type DFSDM2_CR1_Register is record
-- DFSDM enable
DFEN : Boolean := False;
-- Start a conversion of the injected group of channels
JSWSTART : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Launch an injected conversion synchronously with the DFSDM0 JSWSTART
-- trigger
JSYNC : Boolean := False;
-- Scanning conversion mode for injected conversions
JSCAN : Boolean := False;
-- DMA channel enabled to read data for the injected channel group
JDMAEN : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Trigger signal selection for launching injected conversions
JEXTSEL : DFSDM2_CR1_JEXTSEL_Field := 16#0#;
-- unspecified
Reserved_11_12 : HAL.UInt2 := 16#0#;
-- Trigger enable and trigger edge selection for injected conversions
JEXTEN : DFSDM2_CR1_JEXTEN_Field := 16#0#;
-- unspecified
Reserved_15_16 : HAL.UInt2 := 16#0#;
-- Software start of a conversion on the regular channel
RSWSTART : Boolean := False;
-- Continuous mode selection for regular conversions
RCONT : Boolean := False;
-- Launch regular conversion synchronously with DFSDM0
RSYNC : Boolean := False;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- DMA channel enabled to read data for the regular conversion
RDMAEN : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Regular channel selection
RCH : DFSDM2_CR1_RCH_Field := 16#0#;
-- unspecified
Reserved_27_28 : HAL.UInt2 := 16#0#;
-- Fast conversion mode selection for regular conversions
FAST : Boolean := False;
-- Analog watchdog fast mode select
AWFSEL : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_CR1_Register use record
DFEN at 0 range 0 .. 0;
JSWSTART at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
JSYNC at 0 range 3 .. 3;
JSCAN at 0 range 4 .. 4;
JDMAEN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
JEXTSEL at 0 range 8 .. 10;
Reserved_11_12 at 0 range 11 .. 12;
JEXTEN at 0 range 13 .. 14;
Reserved_15_16 at 0 range 15 .. 16;
RSWSTART at 0 range 17 .. 17;
RCONT at 0 range 18 .. 18;
RSYNC at 0 range 19 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
RDMAEN at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
RCH at 0 range 24 .. 26;
Reserved_27_28 at 0 range 27 .. 28;
FAST at 0 range 29 .. 29;
AWFSEL at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DFSDM2_CR2_EXCH_Field is HAL.UInt8;
subtype DFSDM2_CR2_AWDCH_Field is HAL.UInt8;
-- control register 2
type DFSDM2_CR2_Register is record
-- Injected end of conversion interrupt enable
JEOCIE : Boolean := False;
-- Regular end of conversion interrupt enable
REOCIE : Boolean := False;
-- Injected data overrun interrupt enable
JOVRIE : Boolean := False;
-- Regular data overrun interrupt enable
ROVRIE : Boolean := False;
-- Analog watchdog interrupt enable
AWDIE : Boolean := False;
-- Short-circuit detector interrupt enable
SCDIE : Boolean := False;
-- Clock absence interrupt enable
CKABIE : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Extremes detector channel selection
EXCH : DFSDM2_CR2_EXCH_Field := 16#0#;
-- Analog watchdog channel selection
AWDCH : DFSDM2_CR2_AWDCH_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_CR2_Register use record
JEOCIE at 0 range 0 .. 0;
REOCIE at 0 range 1 .. 1;
JOVRIE at 0 range 2 .. 2;
ROVRIE at 0 range 3 .. 3;
AWDIE at 0 range 4 .. 4;
SCDIE at 0 range 5 .. 5;
CKABIE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
EXCH at 0 range 8 .. 15;
AWDCH at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM2_ISR_CKABF_Field is HAL.UInt8;
subtype DFSDM2_ISR_SCDF_Field is HAL.UInt8;
-- interrupt and status register
type DFSDM2_ISR_Register is record
-- Read-only. End of injected conversion flag
JEOCF : Boolean;
-- Read-only. End of regular conversion flag
REOCF : Boolean;
-- Read-only. Injected conversion overrun flag
JOVRF : Boolean;
-- Read-only. Regular conversion overrun flag
ROVRF : Boolean;
-- Read-only. Analog watchdog
AWDF : Boolean;
-- unspecified
Reserved_5_12 : HAL.UInt8;
-- Read-only. Injected conversion in progress status
JCIP : Boolean;
-- Read-only. Regular conversion in progress status
RCIP : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Clock absence flag
CKABF : DFSDM2_ISR_CKABF_Field;
-- Read-only. short-circuit detector flag
SCDF : DFSDM2_ISR_SCDF_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_ISR_Register use record
JEOCF at 0 range 0 .. 0;
REOCF at 0 range 1 .. 1;
JOVRF at 0 range 2 .. 2;
ROVRF at 0 range 3 .. 3;
AWDF at 0 range 4 .. 4;
Reserved_5_12 at 0 range 5 .. 12;
JCIP at 0 range 13 .. 13;
RCIP at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CKABF at 0 range 16 .. 23;
SCDF at 0 range 24 .. 31;
end record;
subtype DFSDM2_ICR_CLRCKABF_Field is HAL.UInt8;
subtype DFSDM2_ICR_CLRSCDF_Field is HAL.UInt8;
-- interrupt flag clear register
type DFSDM2_ICR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Clear the injected conversion overrun flag
CLRJOVRF : Boolean := False;
-- Clear the regular conversion overrun flag
CLRROVRF : Boolean := False;
-- unspecified
Reserved_4_15 : HAL.UInt12 := 16#0#;
-- Clear the clock absence flag
CLRCKABF : DFSDM2_ICR_CLRCKABF_Field := 16#0#;
-- Clear the short-circuit detector flag
CLRSCDF : DFSDM2_ICR_CLRSCDF_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_ICR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
CLRJOVRF at 0 range 2 .. 2;
CLRROVRF at 0 range 3 .. 3;
Reserved_4_15 at 0 range 4 .. 15;
CLRCKABF at 0 range 16 .. 23;
CLRSCDF at 0 range 24 .. 31;
end record;
subtype DFSDM2_JCHGR_JCHG_Field is HAL.UInt8;
-- injected channel group selection register
type DFSDM2_JCHGR_Register is record
-- Injected channel group selection
JCHG : DFSDM2_JCHGR_JCHG_Field := 16#1#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_JCHGR_Register use record
JCHG at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DFSDM2_FCR_IOSR_Field is HAL.UInt8;
subtype DFSDM2_FCR_FOSR_Field is HAL.UInt10;
subtype DFSDM2_FCR_FORD_Field is HAL.UInt3;
-- filter control register
type DFSDM2_FCR_Register is record
-- Integrator oversampling ratio (averaging length)
IOSR : DFSDM2_FCR_IOSR_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Sinc filter oversampling ratio (decimation rate)
FOSR : DFSDM2_FCR_FOSR_Field := 16#0#;
-- unspecified
Reserved_26_28 : HAL.UInt3 := 16#0#;
-- Sinc filter order
FORD : DFSDM2_FCR_FORD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_FCR_Register use record
IOSR at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
FOSR at 0 range 16 .. 25;
Reserved_26_28 at 0 range 26 .. 28;
FORD at 0 range 29 .. 31;
end record;
subtype DFSDM2_JDATAR_JDATACH_Field is HAL.UInt3;
subtype DFSDM2_JDATAR_JDATA_Field is HAL.UInt24;
-- data register for injected group
type DFSDM2_JDATAR_Register is record
-- Read-only. Injected channel most recently converted
JDATACH : DFSDM2_JDATAR_JDATACH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Injected group conversion data
JDATA : DFSDM2_JDATAR_JDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_JDATAR_Register use record
JDATACH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
JDATA at 0 range 8 .. 31;
end record;
subtype DFSDM2_RDATAR_RDATACH_Field is HAL.UInt3;
subtype DFSDM2_RDATAR_RDATA_Field is HAL.UInt24;
-- data register for the regular channel
type DFSDM2_RDATAR_Register is record
-- Read-only. Regular channel most recently converted
RDATACH : DFSDM2_RDATAR_RDATACH_Field;
-- unspecified
Reserved_3_3 : HAL.Bit;
-- Read-only. Regular channel pending data
RPEND : Boolean;
-- unspecified
Reserved_5_7 : HAL.UInt3;
-- Read-only. Regular channel conversion data
RDATA : DFSDM2_RDATAR_RDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_RDATAR_Register use record
RDATACH at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RPEND at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
RDATA at 0 range 8 .. 31;
end record;
subtype DFSDM2_AWHTR_BKAWH_Field is HAL.UInt4;
subtype DFSDM2_AWHTR_AWHT_Field is HAL.UInt24;
-- analog watchdog high threshold register
type DFSDM2_AWHTR_Register is record
-- Break signal assignment to analog watchdog high threshold event
BKAWH : DFSDM2_AWHTR_BKAWH_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog high threshold
AWHT : DFSDM2_AWHTR_AWHT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_AWHTR_Register use record
BKAWH at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWHT at 0 range 8 .. 31;
end record;
subtype DFSDM2_AWLTR_BKAWL_Field is HAL.UInt4;
subtype DFSDM2_AWLTR_AWLT_Field is HAL.UInt24;
-- analog watchdog low threshold register
type DFSDM2_AWLTR_Register is record
-- Break signal assignment to analog watchdog low threshold event
BKAWL : DFSDM2_AWLTR_BKAWL_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog low threshold
AWLT : DFSDM2_AWLTR_AWLT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_AWLTR_Register use record
BKAWL at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWLT at 0 range 8 .. 31;
end record;
subtype DFSDM2_AWSR_AWLTF_Field is HAL.UInt8;
subtype DFSDM2_AWSR_AWHTF_Field is HAL.UInt8;
-- analog watchdog status register
type DFSDM2_AWSR_Register is record
-- Read-only. Analog watchdog low threshold flag
AWLTF : DFSDM2_AWSR_AWLTF_Field;
-- Read-only. Analog watchdog high threshold flag
AWHTF : DFSDM2_AWSR_AWHTF_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_AWSR_Register use record
AWLTF at 0 range 0 .. 7;
AWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM2_AWCFR_CLRAWLTF_Field is HAL.UInt8;
subtype DFSDM2_AWCFR_CLRAWHTF_Field is HAL.UInt8;
-- analog watchdog clear flag register
type DFSDM2_AWCFR_Register is record
-- Clear the analog watchdog low threshold flag
CLRAWLTF : DFSDM2_AWCFR_CLRAWLTF_Field := 16#0#;
-- Clear the analog watchdog high threshold flag
CLRAWHTF : DFSDM2_AWCFR_CLRAWHTF_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_AWCFR_Register use record
CLRAWLTF at 0 range 0 .. 7;
CLRAWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM2_EXMAX_EXMAXCH_Field is HAL.UInt3;
subtype DFSDM2_EXMAX_EXMAX_Field is HAL.UInt24;
-- Extremes detector maximum register
type DFSDM2_EXMAX_Register is record
-- Read-only. Extremes detector maximum data channel
EXMAXCH : DFSDM2_EXMAX_EXMAXCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector maximum value
EXMAX : DFSDM2_EXMAX_EXMAX_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_EXMAX_Register use record
EXMAXCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMAX at 0 range 8 .. 31;
end record;
subtype DFSDM2_EXMIN_EXMINCH_Field is HAL.UInt3;
subtype DFSDM2_EXMIN_EXMIN_Field is HAL.UInt24;
-- Extremes detector minimum register
type DFSDM2_EXMIN_Register is record
-- Read-only. Extremes detector minimum data channel
EXMINCH : DFSDM2_EXMIN_EXMINCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. EXMIN
EXMIN : DFSDM2_EXMIN_EXMIN_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_EXMIN_Register use record
EXMINCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMIN at 0 range 8 .. 31;
end record;
subtype DFSDM2_CNVTIMR_CNVCNT_Field is HAL.UInt28;
-- conversion timer register
type DFSDM2_CNVTIMR_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4;
-- Read-only. 28-bit timer counting conversion time t = CNVCNT[27:0] /
-- fDFSDM_CKIN
CNVCNT : DFSDM2_CNVTIMR_CNVCNT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM2_CNVTIMR_Register use record
Reserved_0_3 at 0 range 0 .. 3;
CNVCNT at 0 range 4 .. 31;
end record;
subtype DFSDM3_CR1_JEXTSEL_Field is HAL.UInt3;
subtype DFSDM3_CR1_JEXTEN_Field is HAL.UInt2;
subtype DFSDM3_CR1_RCH_Field is HAL.UInt3;
-- control register 1
type DFSDM3_CR1_Register is record
-- DFSDM enable
DFEN : Boolean := False;
-- Start a conversion of the injected group of channels
JSWSTART : Boolean := False;
-- unspecified
Reserved_2_2 : HAL.Bit := 16#0#;
-- Launch an injected conversion synchronously with the DFSDM0 JSWSTART
-- trigger
JSYNC : Boolean := False;
-- Scanning conversion mode for injected conversions
JSCAN : Boolean := False;
-- DMA channel enabled to read data for the injected channel group
JDMAEN : Boolean := False;
-- unspecified
Reserved_6_7 : HAL.UInt2 := 16#0#;
-- Trigger signal selection for launching injected conversions
JEXTSEL : DFSDM3_CR1_JEXTSEL_Field := 16#0#;
-- unspecified
Reserved_11_12 : HAL.UInt2 := 16#0#;
-- Trigger enable and trigger edge selection for injected conversions
JEXTEN : DFSDM3_CR1_JEXTEN_Field := 16#0#;
-- unspecified
Reserved_15_16 : HAL.UInt2 := 16#0#;
-- Software start of a conversion on the regular channel
RSWSTART : Boolean := False;
-- Continuous mode selection for regular conversions
RCONT : Boolean := False;
-- Launch regular conversion synchronously with DFSDM0
RSYNC : Boolean := False;
-- unspecified
Reserved_20_20 : HAL.Bit := 16#0#;
-- DMA channel enabled to read data for the regular conversion
RDMAEN : Boolean := False;
-- unspecified
Reserved_22_23 : HAL.UInt2 := 16#0#;
-- Regular channel selection
RCH : DFSDM3_CR1_RCH_Field := 16#0#;
-- unspecified
Reserved_27_28 : HAL.UInt2 := 16#0#;
-- Fast conversion mode selection for regular conversions
FAST : Boolean := False;
-- Analog watchdog fast mode select
AWFSEL : Boolean := False;
-- unspecified
Reserved_31_31 : HAL.Bit := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_CR1_Register use record
DFEN at 0 range 0 .. 0;
JSWSTART at 0 range 1 .. 1;
Reserved_2_2 at 0 range 2 .. 2;
JSYNC at 0 range 3 .. 3;
JSCAN at 0 range 4 .. 4;
JDMAEN at 0 range 5 .. 5;
Reserved_6_7 at 0 range 6 .. 7;
JEXTSEL at 0 range 8 .. 10;
Reserved_11_12 at 0 range 11 .. 12;
JEXTEN at 0 range 13 .. 14;
Reserved_15_16 at 0 range 15 .. 16;
RSWSTART at 0 range 17 .. 17;
RCONT at 0 range 18 .. 18;
RSYNC at 0 range 19 .. 19;
Reserved_20_20 at 0 range 20 .. 20;
RDMAEN at 0 range 21 .. 21;
Reserved_22_23 at 0 range 22 .. 23;
RCH at 0 range 24 .. 26;
Reserved_27_28 at 0 range 27 .. 28;
FAST at 0 range 29 .. 29;
AWFSEL at 0 range 30 .. 30;
Reserved_31_31 at 0 range 31 .. 31;
end record;
subtype DFSDM3_CR2_EXCH_Field is HAL.UInt8;
subtype DFSDM3_CR2_AWDCH_Field is HAL.UInt8;
-- control register 2
type DFSDM3_CR2_Register is record
-- Injected end of conversion interrupt enable
JEOCIE : Boolean := False;
-- Regular end of conversion interrupt enable
REOCIE : Boolean := False;
-- Injected data overrun interrupt enable
JOVRIE : Boolean := False;
-- Regular data overrun interrupt enable
ROVRIE : Boolean := False;
-- Analog watchdog interrupt enable
AWDIE : Boolean := False;
-- Short-circuit detector interrupt enable
SCDIE : Boolean := False;
-- Clock absence interrupt enable
CKABIE : Boolean := False;
-- unspecified
Reserved_7_7 : HAL.Bit := 16#0#;
-- Extremes detector channel selection
EXCH : DFSDM3_CR2_EXCH_Field := 16#0#;
-- Analog watchdog channel selection
AWDCH : DFSDM3_CR2_AWDCH_Field := 16#0#;
-- unspecified
Reserved_24_31 : HAL.UInt8 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_CR2_Register use record
JEOCIE at 0 range 0 .. 0;
REOCIE at 0 range 1 .. 1;
JOVRIE at 0 range 2 .. 2;
ROVRIE at 0 range 3 .. 3;
AWDIE at 0 range 4 .. 4;
SCDIE at 0 range 5 .. 5;
CKABIE at 0 range 6 .. 6;
Reserved_7_7 at 0 range 7 .. 7;
EXCH at 0 range 8 .. 15;
AWDCH at 0 range 16 .. 23;
Reserved_24_31 at 0 range 24 .. 31;
end record;
subtype DFSDM3_ISR_CKABF_Field is HAL.UInt8;
subtype DFSDM3_ISR_SCDF_Field is HAL.UInt8;
-- interrupt and status register
type DFSDM3_ISR_Register is record
-- Read-only. End of injected conversion flag
JEOCF : Boolean;
-- Read-only. End of regular conversion flag
REOCF : Boolean;
-- Read-only. Injected conversion overrun flag
JOVRF : Boolean;
-- Read-only. Regular conversion overrun flag
ROVRF : Boolean;
-- Read-only. Analog watchdog
AWDF : Boolean;
-- unspecified
Reserved_5_12 : HAL.UInt8;
-- Read-only. Injected conversion in progress status
JCIP : Boolean;
-- Read-only. Regular conversion in progress status
RCIP : Boolean;
-- unspecified
Reserved_15_15 : HAL.Bit;
-- Read-only. Clock absence flag
CKABF : DFSDM3_ISR_CKABF_Field;
-- Read-only. short-circuit detector flag
SCDF : DFSDM3_ISR_SCDF_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_ISR_Register use record
JEOCF at 0 range 0 .. 0;
REOCF at 0 range 1 .. 1;
JOVRF at 0 range 2 .. 2;
ROVRF at 0 range 3 .. 3;
AWDF at 0 range 4 .. 4;
Reserved_5_12 at 0 range 5 .. 12;
JCIP at 0 range 13 .. 13;
RCIP at 0 range 14 .. 14;
Reserved_15_15 at 0 range 15 .. 15;
CKABF at 0 range 16 .. 23;
SCDF at 0 range 24 .. 31;
end record;
subtype DFSDM3_ICR_CLRCKABF_Field is HAL.UInt8;
subtype DFSDM3_ICR_CLRSCDF_Field is HAL.UInt8;
-- interrupt flag clear register
type DFSDM3_ICR_Register is record
-- unspecified
Reserved_0_1 : HAL.UInt2 := 16#0#;
-- Clear the injected conversion overrun flag
CLRJOVRF : Boolean := False;
-- Clear the regular conversion overrun flag
CLRROVRF : Boolean := False;
-- unspecified
Reserved_4_15 : HAL.UInt12 := 16#0#;
-- Clear the clock absence flag
CLRCKABF : DFSDM3_ICR_CLRCKABF_Field := 16#0#;
-- Clear the short-circuit detector flag
CLRSCDF : DFSDM3_ICR_CLRSCDF_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_ICR_Register use record
Reserved_0_1 at 0 range 0 .. 1;
CLRJOVRF at 0 range 2 .. 2;
CLRROVRF at 0 range 3 .. 3;
Reserved_4_15 at 0 range 4 .. 15;
CLRCKABF at 0 range 16 .. 23;
CLRSCDF at 0 range 24 .. 31;
end record;
subtype DFSDM3_JCHGR_JCHG_Field is HAL.UInt8;
-- injected channel group selection register
type DFSDM3_JCHGR_Register is record
-- Injected channel group selection
JCHG : DFSDM3_JCHGR_JCHG_Field := 16#1#;
-- unspecified
Reserved_8_31 : HAL.UInt24 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_JCHGR_Register use record
JCHG at 0 range 0 .. 7;
Reserved_8_31 at 0 range 8 .. 31;
end record;
subtype DFSDM3_FCR_IOSR_Field is HAL.UInt8;
subtype DFSDM3_FCR_FOSR_Field is HAL.UInt10;
subtype DFSDM3_FCR_FORD_Field is HAL.UInt3;
-- filter control register
type DFSDM3_FCR_Register is record
-- Integrator oversampling ratio (averaging length)
IOSR : DFSDM3_FCR_IOSR_Field := 16#0#;
-- unspecified
Reserved_8_15 : HAL.UInt8 := 16#0#;
-- Sinc filter oversampling ratio (decimation rate)
FOSR : DFSDM3_FCR_FOSR_Field := 16#0#;
-- unspecified
Reserved_26_28 : HAL.UInt3 := 16#0#;
-- Sinc filter order
FORD : DFSDM3_FCR_FORD_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_FCR_Register use record
IOSR at 0 range 0 .. 7;
Reserved_8_15 at 0 range 8 .. 15;
FOSR at 0 range 16 .. 25;
Reserved_26_28 at 0 range 26 .. 28;
FORD at 0 range 29 .. 31;
end record;
subtype DFSDM3_JDATAR_JDATACH_Field is HAL.UInt3;
subtype DFSDM3_JDATAR_JDATA_Field is HAL.UInt24;
-- data register for injected group
type DFSDM3_JDATAR_Register is record
-- Read-only. Injected channel most recently converted
JDATACH : DFSDM3_JDATAR_JDATACH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Injected group conversion data
JDATA : DFSDM3_JDATAR_JDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_JDATAR_Register use record
JDATACH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
JDATA at 0 range 8 .. 31;
end record;
subtype DFSDM3_RDATAR_RDATACH_Field is HAL.UInt3;
subtype DFSDM3_RDATAR_RDATA_Field is HAL.UInt24;
-- data register for the regular channel
type DFSDM3_RDATAR_Register is record
-- Read-only. Regular channel most recently converted
RDATACH : DFSDM3_RDATAR_RDATACH_Field;
-- unspecified
Reserved_3_3 : HAL.Bit;
-- Read-only. Regular channel pending data
RPEND : Boolean;
-- unspecified
Reserved_5_7 : HAL.UInt3;
-- Read-only. Regular channel conversion data
RDATA : DFSDM3_RDATAR_RDATA_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_RDATAR_Register use record
RDATACH at 0 range 0 .. 2;
Reserved_3_3 at 0 range 3 .. 3;
RPEND at 0 range 4 .. 4;
Reserved_5_7 at 0 range 5 .. 7;
RDATA at 0 range 8 .. 31;
end record;
subtype DFSDM3_AWHTR_BKAWH_Field is HAL.UInt4;
subtype DFSDM3_AWHTR_AWHT_Field is HAL.UInt24;
-- analog watchdog high threshold register
type DFSDM3_AWHTR_Register is record
-- Break signal assignment to analog watchdog high threshold event
BKAWH : DFSDM3_AWHTR_BKAWH_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog high threshold
AWHT : DFSDM3_AWHTR_AWHT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_AWHTR_Register use record
BKAWH at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWHT at 0 range 8 .. 31;
end record;
subtype DFSDM3_AWLTR_BKAWL_Field is HAL.UInt4;
subtype DFSDM3_AWLTR_AWLT_Field is HAL.UInt24;
-- analog watchdog low threshold register
type DFSDM3_AWLTR_Register is record
-- Break signal assignment to analog watchdog low threshold event
BKAWL : DFSDM3_AWLTR_BKAWL_Field := 16#0#;
-- unspecified
Reserved_4_7 : HAL.UInt4 := 16#0#;
-- Analog watchdog low threshold
AWLT : DFSDM3_AWLTR_AWLT_Field := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_AWLTR_Register use record
BKAWL at 0 range 0 .. 3;
Reserved_4_7 at 0 range 4 .. 7;
AWLT at 0 range 8 .. 31;
end record;
subtype DFSDM3_AWSR_AWLTF_Field is HAL.UInt8;
subtype DFSDM3_AWSR_AWHTF_Field is HAL.UInt8;
-- analog watchdog status register
type DFSDM3_AWSR_Register is record
-- Read-only. Analog watchdog low threshold flag
AWLTF : DFSDM3_AWSR_AWLTF_Field;
-- Read-only. Analog watchdog high threshold flag
AWHTF : DFSDM3_AWSR_AWHTF_Field;
-- unspecified
Reserved_16_31 : HAL.UInt16;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_AWSR_Register use record
AWLTF at 0 range 0 .. 7;
AWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM3_AWCFR_CLRAWLTF_Field is HAL.UInt8;
subtype DFSDM3_AWCFR_CLRAWHTF_Field is HAL.UInt8;
-- analog watchdog clear flag register
type DFSDM3_AWCFR_Register is record
-- Clear the analog watchdog low threshold flag
CLRAWLTF : DFSDM3_AWCFR_CLRAWLTF_Field := 16#0#;
-- Clear the analog watchdog high threshold flag
CLRAWHTF : DFSDM3_AWCFR_CLRAWHTF_Field := 16#0#;
-- unspecified
Reserved_16_31 : HAL.UInt16 := 16#0#;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_AWCFR_Register use record
CLRAWLTF at 0 range 0 .. 7;
CLRAWHTF at 0 range 8 .. 15;
Reserved_16_31 at 0 range 16 .. 31;
end record;
subtype DFSDM3_EXMAX_EXMAXCH_Field is HAL.UInt3;
subtype DFSDM3_EXMAX_EXMAX_Field is HAL.UInt24;
-- Extremes detector maximum register
type DFSDM3_EXMAX_Register is record
-- Read-only. Extremes detector maximum data channel
EXMAXCH : DFSDM3_EXMAX_EXMAXCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. Extremes detector maximum value
EXMAX : DFSDM3_EXMAX_EXMAX_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_EXMAX_Register use record
EXMAXCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMAX at 0 range 8 .. 31;
end record;
subtype DFSDM3_EXMIN_EXMINCH_Field is HAL.UInt3;
subtype DFSDM3_EXMIN_EXMIN_Field is HAL.UInt24;
-- Extremes detector minimum register
type DFSDM3_EXMIN_Register is record
-- Read-only. Extremes detector minimum data channel
EXMINCH : DFSDM3_EXMIN_EXMINCH_Field;
-- unspecified
Reserved_3_7 : HAL.UInt5;
-- Read-only. EXMIN
EXMIN : DFSDM3_EXMIN_EXMIN_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_EXMIN_Register use record
EXMINCH at 0 range 0 .. 2;
Reserved_3_7 at 0 range 3 .. 7;
EXMIN at 0 range 8 .. 31;
end record;
subtype DFSDM3_CNVTIMR_CNVCNT_Field is HAL.UInt28;
-- conversion timer register
type DFSDM3_CNVTIMR_Register is record
-- unspecified
Reserved_0_3 : HAL.UInt4;
-- Read-only. 28-bit timer counting conversion time t = CNVCNT[27:0] /
-- fDFSDM_CKIN
CNVCNT : DFSDM3_CNVTIMR_CNVCNT_Field;
end record
with Volatile_Full_Access, Size => 32,
Bit_Order => System.Low_Order_First;
for DFSDM3_CNVTIMR_Register use record
Reserved_0_3 at 0 range 0 .. 3;
CNVCNT at 0 range 4 .. 31;
end record;
-----------------
-- Peripherals --
-----------------
-- Digital filter for sigma delta modulators
type DFSDM_Peripheral is record
-- channel configuration y register
CHCFG0R1 : aliased CHCFG0R1_Register;
-- channel configuration y register
CHCFG0R2 : aliased CHCFG0R2_Register;
-- analog watchdog and short-circuit detector register
AWSCD0R : aliased AWSCD0R_Register;
-- channel watchdog filter data register
CHWDAT0R : aliased CHWDAT0R_Register;
-- channel data input register
CHDATIN0R : aliased CHDATIN0R_Register;
-- CHCFG1R1
CHCFG1R1 : aliased CHCFG1R1_Register;
-- CHCFG1R2
CHCFG1R2 : aliased CHCFG1R2_Register;
-- AWSCD1R
AWSCD1R : aliased AWSCD1R_Register;
-- CHWDAT1R
CHWDAT1R : aliased CHWDAT1R_Register;
-- CHDATIN1R
CHDATIN1R : aliased CHDATIN1R_Register;
-- CHCFG2R1
CHCFG2R1 : aliased CHCFG2R1_Register;
-- CHCFG2R2
CHCFG2R2 : aliased CHCFG2R2_Register;
-- AWSCD2R
AWSCD2R : aliased AWSCD2R_Register;
-- CHWDAT2R
CHWDAT2R : aliased CHWDAT2R_Register;
-- CHDATIN2R
CHDATIN2R : aliased CHDATIN2R_Register;
-- CHCFG3R1
CHCFG3R1 : aliased CHCFG3R1_Register;
-- CHCFG3R2
CHCFG3R2 : aliased CHCFG3R2_Register;
-- AWSCD3R
AWSCD3R : aliased AWSCD3R_Register;
-- CHWDAT3R
CHWDAT3R : aliased CHWDAT3R_Register;
-- CHDATIN3R
CHDATIN3R : aliased CHDATIN3R_Register;
-- CHCFG4R1
CHCFG4R1 : aliased CHCFG4R1_Register;
-- CHCFG4R2
CHCFG4R2 : aliased CHCFG4R2_Register;
-- AWSCD4R
AWSCD4R : aliased AWSCD4R_Register;
-- CHWDAT4R
CHWDAT4R : aliased CHWDAT4R_Register;
-- CHDATIN4R
CHDATIN4R : aliased CHDATIN4R_Register;
-- CHCFG5R1
CHCFG5R1 : aliased CHCFG5R1_Register;
-- CHCFG5R2
CHCFG5R2 : aliased CHCFG5R2_Register;
-- AWSCD5R
AWSCD5R : aliased AWSCD5R_Register;
-- CHWDAT5R
CHWDAT5R : aliased CHWDAT5R_Register;
-- CHDATIN5R
CHDATIN5R : aliased CHDATIN5R_Register;
-- CHCFG6R1
CHCFG6R1 : aliased CHCFG6R1_Register;
-- CHCFG6R2
CHCFG6R2 : aliased CHCFG6R2_Register;
-- AWSCD6R
AWSCD6R : aliased AWSCD6R_Register;
-- CHWDAT6R
CHWDAT6R : aliased CHWDAT6R_Register;
-- CHDATIN6R
CHDATIN6R : aliased CHDATIN6R_Register;
-- CHCFG7R1
CHCFG7R1 : aliased CHCFG7R1_Register;
-- CHCFG7R2
CHCFG7R2 : aliased CHCFG7R2_Register;
-- AWSCD7R
AWSCD7R : aliased AWSCD7R_Register;
-- CHWDAT7R
CHWDAT7R : aliased CHWDAT7R_Register;
-- CHDATIN7R
CHDATIN7R : aliased CHDATIN7R_Register;
-- control register 1
DFSDM0_CR1 : aliased DFSDM0_CR1_Register;
-- control register 2
DFSDM0_CR2 : aliased DFSDM0_CR2_Register;
-- interrupt and status register
DFSDM0_ISR : aliased DFSDM0_ISR_Register;
-- interrupt flag clear register
DFSDM0_ICR : aliased DFSDM0_ICR_Register;
-- injected channel group selection register
DFSDM0_JCHGR : aliased DFSDM0_JCHGR_Register;
-- filter control register
DFSDM0_FCR : aliased DFSDM0_FCR_Register;
-- data register for injected group
DFSDM0_JDATAR : aliased DFSDM0_JDATAR_Register;
-- data register for the regular channel
DFSDM0_RDATAR : aliased DFSDM0_RDATAR_Register;
-- analog watchdog high threshold register
DFSDM0_AWHTR : aliased DFSDM0_AWHTR_Register;
-- analog watchdog low threshold register
DFSDM0_AWLTR : aliased DFSDM0_AWLTR_Register;
-- analog watchdog status register
DFSDM0_AWSR : aliased DFSDM0_AWSR_Register;
-- analog watchdog clear flag register
DFSDM0_AWCFR : aliased DFSDM0_AWCFR_Register;
-- Extremes detector maximum register
DFSDM0_EXMAX : aliased DFSDM0_EXMAX_Register;
-- Extremes detector minimum register
DFSDM0_EXMIN : aliased DFSDM0_EXMIN_Register;
-- conversion timer register
DFSDM0_CNVTIMR : aliased DFSDM0_CNVTIMR_Register;
-- control register 1
DFSDM1_CR1 : aliased DFSDM1_CR1_Register;
-- control register 2
DFSDM1_CR2 : aliased DFSDM1_CR2_Register;
-- interrupt and status register
DFSDM1_ISR : aliased DFSDM1_ISR_Register;
-- interrupt flag clear register
DFSDM1_ICR : aliased DFSDM1_ICR_Register;
-- injected channel group selection register
DFSDM1_JCHGR : aliased DFSDM1_JCHGR_Register;
-- filter control register
DFSDM1_FCR : aliased DFSDM1_FCR_Register;
-- data register for injected group
DFSDM1_JDATAR : aliased DFSDM1_JDATAR_Register;
-- data register for the regular channel
DFSDM1_RDATAR : aliased DFSDM1_RDATAR_Register;
-- analog watchdog high threshold register
DFSDM1_AWHTR : aliased DFSDM1_AWHTR_Register;
-- analog watchdog low threshold register
DFSDM1_AWLTR : aliased DFSDM1_AWLTR_Register;
-- analog watchdog status register
DFSDM1_AWSR : aliased DFSDM1_AWSR_Register;
-- analog watchdog clear flag register
DFSDM1_AWCFR : aliased DFSDM1_AWCFR_Register;
-- Extremes detector maximum register
DFSDM1_EXMAX : aliased DFSDM1_EXMAX_Register;
-- Extremes detector minimum register
DFSDM1_EXMIN : aliased DFSDM1_EXMIN_Register;
-- conversion timer register
DFSDM1_CNVTIMR : aliased DFSDM1_CNVTIMR_Register;
-- control register 1
DFSDM2_CR1 : aliased DFSDM2_CR1_Register;
-- control register 2
DFSDM2_CR2 : aliased DFSDM2_CR2_Register;
-- interrupt and status register
DFSDM2_ISR : aliased DFSDM2_ISR_Register;
-- interrupt flag clear register
DFSDM2_ICR : aliased DFSDM2_ICR_Register;
-- injected channel group selection register
DFSDM2_JCHGR : aliased DFSDM2_JCHGR_Register;
-- filter control register
DFSDM2_FCR : aliased DFSDM2_FCR_Register;
-- data register for injected group
DFSDM2_JDATAR : aliased DFSDM2_JDATAR_Register;
-- data register for the regular channel
DFSDM2_RDATAR : aliased DFSDM2_RDATAR_Register;
-- analog watchdog high threshold register
DFSDM2_AWHTR : aliased DFSDM2_AWHTR_Register;
-- analog watchdog low threshold register
DFSDM2_AWLTR : aliased DFSDM2_AWLTR_Register;
-- analog watchdog status register
DFSDM2_AWSR : aliased DFSDM2_AWSR_Register;
-- analog watchdog clear flag register
DFSDM2_AWCFR : aliased DFSDM2_AWCFR_Register;
-- Extremes detector maximum register
DFSDM2_EXMAX : aliased DFSDM2_EXMAX_Register;
-- Extremes detector minimum register
DFSDM2_EXMIN : aliased DFSDM2_EXMIN_Register;
-- conversion timer register
DFSDM2_CNVTIMR : aliased DFSDM2_CNVTIMR_Register;
-- control register 1
DFSDM3_CR1 : aliased DFSDM3_CR1_Register;
-- control register 2
DFSDM3_CR2 : aliased DFSDM3_CR2_Register;
-- interrupt and status register
DFSDM3_ISR : aliased DFSDM3_ISR_Register;
-- interrupt flag clear register
DFSDM3_ICR : aliased DFSDM3_ICR_Register;
-- injected channel group selection register
DFSDM3_JCHGR : aliased DFSDM3_JCHGR_Register;
-- filter control register
DFSDM3_FCR : aliased DFSDM3_FCR_Register;
-- data register for injected group
DFSDM3_JDATAR : aliased DFSDM3_JDATAR_Register;
-- data register for the regular channel
DFSDM3_RDATAR : aliased DFSDM3_RDATAR_Register;
-- analog watchdog high threshold register
DFSDM3_AWHTR : aliased DFSDM3_AWHTR_Register;
-- analog watchdog low threshold register
DFSDM3_AWLTR : aliased DFSDM3_AWLTR_Register;
-- analog watchdog status register
DFSDM3_AWSR : aliased DFSDM3_AWSR_Register;
-- analog watchdog clear flag register
DFSDM3_AWCFR : aliased DFSDM3_AWCFR_Register;
-- Extremes detector maximum register
DFSDM3_EXMAX : aliased DFSDM3_EXMAX_Register;
-- Extremes detector minimum register
DFSDM3_EXMIN : aliased DFSDM3_EXMIN_Register;
-- conversion timer register
DFSDM3_CNVTIMR : aliased DFSDM3_CNVTIMR_Register;
end record
with Volatile;
for DFSDM_Peripheral use record
CHCFG0R1 at 16#0# range 0 .. 31;
CHCFG0R2 at 16#4# range 0 .. 31;
AWSCD0R at 16#8# range 0 .. 31;
CHWDAT0R at 16#C# range 0 .. 31;
CHDATIN0R at 16#10# range 0 .. 31;
CHCFG1R1 at 16#20# range 0 .. 31;
CHCFG1R2 at 16#24# range 0 .. 31;
AWSCD1R at 16#28# range 0 .. 31;
CHWDAT1R at 16#2C# range 0 .. 31;
CHDATIN1R at 16#30# range 0 .. 31;
CHCFG2R1 at 16#40# range 0 .. 31;
CHCFG2R2 at 16#44# range 0 .. 31;
AWSCD2R at 16#48# range 0 .. 31;
CHWDAT2R at 16#4C# range 0 .. 31;
CHDATIN2R at 16#50# range 0 .. 31;
CHCFG3R1 at 16#60# range 0 .. 31;
CHCFG3R2 at 16#64# range 0 .. 31;
AWSCD3R at 16#68# range 0 .. 31;
CHWDAT3R at 16#6C# range 0 .. 31;
CHDATIN3R at 16#70# range 0 .. 31;
CHCFG4R1 at 16#80# range 0 .. 31;
CHCFG4R2 at 16#84# range 0 .. 31;
AWSCD4R at 16#88# range 0 .. 31;
CHWDAT4R at 16#8C# range 0 .. 31;
CHDATIN4R at 16#90# range 0 .. 31;
CHCFG5R1 at 16#A0# range 0 .. 31;
CHCFG5R2 at 16#A4# range 0 .. 31;
AWSCD5R at 16#A8# range 0 .. 31;
CHWDAT5R at 16#AC# range 0 .. 31;
CHDATIN5R at 16#B0# range 0 .. 31;
CHCFG6R1 at 16#C0# range 0 .. 31;
CHCFG6R2 at 16#C4# range 0 .. 31;
AWSCD6R at 16#C8# range 0 .. 31;
CHWDAT6R at 16#CC# range 0 .. 31;
CHDATIN6R at 16#D0# range 0 .. 31;
CHCFG7R1 at 16#E0# range 0 .. 31;
CHCFG7R2 at 16#E4# range 0 .. 31;
AWSCD7R at 16#E8# range 0 .. 31;
CHWDAT7R at 16#EC# range 0 .. 31;
CHDATIN7R at 16#F0# range 0 .. 31;
DFSDM0_CR1 at 16#100# range 0 .. 31;
DFSDM0_CR2 at 16#104# range 0 .. 31;
DFSDM0_ISR at 16#108# range 0 .. 31;
DFSDM0_ICR at 16#10C# range 0 .. 31;
DFSDM0_JCHGR at 16#110# range 0 .. 31;
DFSDM0_FCR at 16#114# range 0 .. 31;
DFSDM0_JDATAR at 16#118# range 0 .. 31;
DFSDM0_RDATAR at 16#11C# range 0 .. 31;
DFSDM0_AWHTR at 16#120# range 0 .. 31;
DFSDM0_AWLTR at 16#124# range 0 .. 31;
DFSDM0_AWSR at 16#128# range 0 .. 31;
DFSDM0_AWCFR at 16#12C# range 0 .. 31;
DFSDM0_EXMAX at 16#130# range 0 .. 31;
DFSDM0_EXMIN at 16#134# range 0 .. 31;
DFSDM0_CNVTIMR at 16#138# range 0 .. 31;
DFSDM1_CR1 at 16#200# range 0 .. 31;
DFSDM1_CR2 at 16#204# range 0 .. 31;
DFSDM1_ISR at 16#208# range 0 .. 31;
DFSDM1_ICR at 16#20C# range 0 .. 31;
DFSDM1_JCHGR at 16#210# range 0 .. 31;
DFSDM1_FCR at 16#214# range 0 .. 31;
DFSDM1_JDATAR at 16#218# range 0 .. 31;
DFSDM1_RDATAR at 16#21C# range 0 .. 31;
DFSDM1_AWHTR at 16#220# range 0 .. 31;
DFSDM1_AWLTR at 16#224# range 0 .. 31;
DFSDM1_AWSR at 16#228# range 0 .. 31;
DFSDM1_AWCFR at 16#22C# range 0 .. 31;
DFSDM1_EXMAX at 16#230# range 0 .. 31;
DFSDM1_EXMIN at 16#234# range 0 .. 31;
DFSDM1_CNVTIMR at 16#238# range 0 .. 31;
DFSDM2_CR1 at 16#300# range 0 .. 31;
DFSDM2_CR2 at 16#304# range 0 .. 31;
DFSDM2_ISR at 16#308# range 0 .. 31;
DFSDM2_ICR at 16#30C# range 0 .. 31;
DFSDM2_JCHGR at 16#310# range 0 .. 31;
DFSDM2_FCR at 16#314# range 0 .. 31;
DFSDM2_JDATAR at 16#318# range 0 .. 31;
DFSDM2_RDATAR at 16#31C# range 0 .. 31;
DFSDM2_AWHTR at 16#320# range 0 .. 31;
DFSDM2_AWLTR at 16#324# range 0 .. 31;
DFSDM2_AWSR at 16#328# range 0 .. 31;
DFSDM2_AWCFR at 16#32C# range 0 .. 31;
DFSDM2_EXMAX at 16#330# range 0 .. 31;
DFSDM2_EXMIN at 16#334# range 0 .. 31;
DFSDM2_CNVTIMR at 16#338# range 0 .. 31;
DFSDM3_CR1 at 16#400# range 0 .. 31;
DFSDM3_CR2 at 16#404# range 0 .. 31;
DFSDM3_ISR at 16#408# range 0 .. 31;
DFSDM3_ICR at 16#40C# range 0 .. 31;
DFSDM3_JCHGR at 16#410# range 0 .. 31;
DFSDM3_FCR at 16#414# range 0 .. 31;
DFSDM3_JDATAR at 16#418# range 0 .. 31;
DFSDM3_RDATAR at 16#41C# range 0 .. 31;
DFSDM3_AWHTR at 16#420# range 0 .. 31;
DFSDM3_AWLTR at 16#424# range 0 .. 31;
DFSDM3_AWSR at 16#428# range 0 .. 31;
DFSDM3_AWCFR at 16#42C# range 0 .. 31;
DFSDM3_EXMAX at 16#430# range 0 .. 31;
DFSDM3_EXMIN at 16#434# range 0 .. 31;
DFSDM3_CNVTIMR at 16#438# range 0 .. 31;
end record;
-- Digital filter for sigma delta modulators
DFSDM_Periph : aliased DFSDM_Peripheral
with Import, Address => System'To_Address (16#40016000#);
end STM32_SVD.DFSDM;
| 35.139769 | 78 | 0.604078 |
296811efdecf79e4c7de0b86879920e762f01e1e | 801 | adb | Ada | test.adb | zorodc/ada-http1 | 7ff6ccd5add273fc27edc128c5a2447c64687a96 | [
"0BSD"
] | null | null | null | test.adb | zorodc/ada-http1 | 7ff6ccd5add273fc27edc128c5a2447c64687a96 | [
"0BSD"
] | null | null | null | test.adb | zorodc/ada-http1 | 7ff6ccd5add273fc27edc128c5a2447c64687a96 | [
"0BSD"
] | null | null | null | with HTTP; use HTTP;
with HTTP.Request; use HTTP.Request;
procedure Test is
CRLF : constant String := ASCII.CR & ASCII.LF;
Test_String : constant String :=
"GET /index.html HTTP/1.1" & CRLF &
"User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)" & CRLF &
"Host: www.adaisquitecool.com" & CRLF &
"Accept-Language: en-us" & CRLF &
"Accept-Encoding: gzip, deflate" & CRLF &
"Connection: Keep-Alive" & CRLF & CRLF;
HTTP_Parser : Parse.Context;
Read_Length : Natural;
begin
Parse.Str_Read (HTTP_Parser, Test_String, Read_Length);
Parse.Debug (HTTP_Parser, Test_String);
end Test;
| 42.157895 | 77 | 0.52809 |
57a6ee7c26a44fc021fca8a5e5d8002820376d60 | 4,247 | ads | Ada | source/amf/utp/amf-utp-log_actions.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/amf/utp/amf-utp-log_actions.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/amf/utp/amf-utp-log_actions.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- 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.
------------------------------------------------------------------------------
limited with AMF.UML.Send_Object_Actions;
package AMF.Utp.Log_Actions is
pragma Preelaborate;
type Utp_Log_Action is limited interface;
type Utp_Log_Action_Access is
access all Utp_Log_Action'Class;
for Utp_Log_Action_Access'Storage_Size use 0;
not overriding function Get_Base_Send_Object_Action
(Self : not null access constant Utp_Log_Action)
return AMF.UML.Send_Object_Actions.UML_Send_Object_Action_Access is abstract;
-- Getter of LogAction::base_SendObjectAction.
--
not overriding procedure Set_Base_Send_Object_Action
(Self : not null access Utp_Log_Action;
To : AMF.UML.Send_Object_Actions.UML_Send_Object_Action_Access) is abstract;
-- Setter of LogAction::base_SendObjectAction.
--
end AMF.Utp.Log_Actions;
| 59.816901 | 84 | 0.45538 |
3dbcdf7b4d27d00523a80512b65edc3d6dde61df | 4,911 | adb | Ada | source/web/soap/web_services-soap-headers-encoders-registry.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/web/soap/web_services-soap-headers-encoders-registry.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/web/soap/web_services-soap-headers-encoders-registry.adb | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Web 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$
------------------------------------------------------------------------------
with Ada.Containers.Hashed_Maps;
with Ada.Strings.Hash;
with Ada.Tags.Generic_Dispatching_Constructor;
package body Web_Services.SOAP.Headers.Encoders.Registry is
function Hash (Item : Ada.Tags.Tag) return Ada.Containers.Hash_Type;
function Create is
new Ada.Tags.Generic_Dispatching_Constructor
(Web_Services.SOAP.Headers.Encoders.SOAP_Header_Encoder,
Boolean,
Web_Services.SOAP.Headers.Encoders.Create);
package Tag_Tag_Maps is
new Ada.Containers.Hashed_Maps
(Ada.Tags.Tag,
Ada.Tags.Tag,
Hash,
Ada.Tags."=",
Ada.Tags."=");
Registry : Tag_Tag_Maps.Map;
----------
-- Hash --
----------
function Hash (Item : Ada.Tags.Tag) return Ada.Containers.Hash_Type is
begin
return Ada.Strings.Hash (Ada.Tags.External_Tag (Item));
end Hash;
--------------
-- Register --
--------------
procedure Register
(Header_Tag : Ada.Tags.Tag; Encoder_Tag : Ada.Tags.Tag) is
begin
Registry.Insert (Header_Tag, Encoder_Tag);
end Register;
-------------
-- Resolve --
-------------
function Resolve
(Message_Tag : Ada.Tags.Tag)
return
not null
Web_Services.SOAP.Headers.Encoders.SOAP_Header_Encoder_Access
is
Aux : aliased Boolean := False;
begin
return
new Web_Services.SOAP.Headers.Encoders.SOAP_Header_Encoder'Class'
(Create (Registry.Element (Message_Tag), Aux'Access));
end Resolve;
end Web_Services.SOAP.Headers.Encoders.Registry;
| 46.330189 | 78 | 0.463042 |
3dc8e54f75eb24eb2ed40a68cafc205474ad846c | 6,848 | ads | Ada | tools-src/gnu/gcc/gcc/ada/4aintnam.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | tools-src/gnu/gcc/gcc/ada/4aintnam.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | tools-src/gnu/gcc/gcc/ada/4aintnam.ads | modern-tomato/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | ------------------------------------------------------------------------------
-- --
-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
-- --
-- A D A . I N T E R R U P T S . N A M E S --
-- --
-- S p e c --
-- --
-- $Revision$
-- --
-- Copyright (C) 1991-2001 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNARL; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNARL was developed by the GNARL team at Florida State University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This is the DEC Unix 4.0 version of this package.
--
-- The following signals are reserved by the run time:
--
-- SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGABRT, SIGTRAP, SIGINT, SIGALRM,
-- SIGSTOP, SIGKILL
--
-- The pragma Unreserve_All_Interrupts affects the following signal(s):
--
-- SIGINT: made available for Ada handler
-- SIGILL, SIGBUS, SIGSEGV: disconnected from runtime exception mapping
with System.OS_Interface;
-- used for names of interrupts
package Ada.Interrupts.Names is
-- Beware that the mapping of names to signals may be
-- many-to-one. There may be aliases. Also, for all
-- signal names that are not supported on the current system
-- the value of the corresponding constant will be zero.
SIGHUP : constant Interrupt_ID :=
System.OS_Interface.SIGHUP; -- hangup
SIGINT : constant Interrupt_ID :=
System.OS_Interface.SIGINT; -- interrupt (rubout)
SIGQUIT : constant Interrupt_ID :=
System.OS_Interface.SIGQUIT; -- quit (ASCD FS)
SIGILL : constant Interrupt_ID :=
System.OS_Interface.SIGILL; -- illegal instruction (not reset)
SIGTRAP : constant Interrupt_ID :=
System.OS_Interface.SIGTRAP; -- trace trap (not reset)
SIGIOT : constant Interrupt_ID :=
System.OS_Interface.SIGIOT; -- IOT instruction
SIGABRT : constant Interrupt_ID := -- used by abort,
System.OS_Interface.SIGABRT; -- replace SIGIOT in the future
SIGEMT : constant Interrupt_ID :=
System.OS_Interface.SIGEMT; -- EMT instruction
SIGFPE : constant Interrupt_ID :=
System.OS_Interface.SIGFPE; -- floating point exception
SIGKILL : constant Interrupt_ID :=
System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored)
SIGBUS : constant Interrupt_ID :=
System.OS_Interface.SIGBUS; -- bus error
SIGSEGV : constant Interrupt_ID :=
System.OS_Interface.SIGSEGV; -- segmentation violation
SIGSYS : constant Interrupt_ID :=
System.OS_Interface.SIGSYS; -- bad argument to system call
SIGPIPE : constant Interrupt_ID := -- write on a pipe with
System.OS_Interface.SIGPIPE; -- no one to read it
SIGALRM : constant Interrupt_ID :=
System.OS_Interface.SIGALRM; -- alarm clock
SIGTERM : constant Interrupt_ID :=
System.OS_Interface.SIGTERM; -- software termination signal from kill
SIGUSR1 : constant Interrupt_ID :=
System.OS_Interface.SIGUSR1; -- user defined signal 1
SIGUSR2 : constant Interrupt_ID :=
System.OS_Interface.SIGUSR2; -- user defined signal 2
SIGCHLD : constant Interrupt_ID :=
System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD
SIGWINCH : constant Interrupt_ID :=
System.OS_Interface.SIGWINCH; -- window size change
SIGURG : constant Interrupt_ID :=
System.OS_Interface.SIGURG; -- urgent condition on IO channel
SIGPOLL : constant Interrupt_ID :=
System.OS_Interface.SIGPOLL; -- pollable event occurred
SIGIO : constant Interrupt_ID := -- input/output possible,
System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris)
SIGSTOP : constant Interrupt_ID :=
System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored)
SIGTSTP : constant Interrupt_ID :=
System.OS_Interface.SIGTSTP; -- user stop requested from tty
SIGCONT : constant Interrupt_ID :=
System.OS_Interface.SIGCONT; -- stopped process has been continued
SIGTTIN : constant Interrupt_ID :=
System.OS_Interface.SIGTTIN; -- background tty read attempted
SIGTTOU : constant Interrupt_ID :=
System.OS_Interface.SIGTTOU; -- background tty write attempted
SIGVTALRM : constant Interrupt_ID :=
System.OS_Interface.SIGVTALRM; -- virtual timer expired
SIGPROF : constant Interrupt_ID :=
System.OS_Interface.SIGPROF; -- profiling timer expired
SIGXCPU : constant Interrupt_ID :=
System.OS_Interface.SIGXCPU; -- CPU time limit exceeded
SIGXFSZ : constant Interrupt_ID :=
System.OS_Interface.SIGXFSZ; -- filesize limit exceeded
end Ada.Interrupts.Names;
| 44.180645 | 79 | 0.576081 |
294517767d6b3a8b81536fcc99afb21af78da27a | 34,469 | adb | Ada | arch/ARM/STM32/driversF1/i2c_stm32f1/stm32-i2c.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | 2 | 2018-05-16T03:56:39.000Z | 2019-07-31T13:53:56.000Z | arch/ARM/STM32/driversF1/i2c_stm32f1/stm32-i2c.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | arch/ARM/STM32/driversF1/i2c_stm32f1/stm32-i2c.adb | morbos/Ada_Drivers_Library | a4ab26799be60997c38735f4056160c4af597ef7 | [
"BSD-3-Clause"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- 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_i2c.c --
-- @author MCD Application Team --
-- @version V1.1.0 --
-- @date 19-June-2014 --
-- @brief I2C HAL module driver. --
-- --
-- COPYRIGHT(c) 2014 STMicroelectronics --
------------------------------------------------------------------------------
with Ada.Real_Time; use Ada.Real_Time;
with STM32_SVD.I2C; use STM32_SVD.I2C;
with STM32.Device; use STM32.Device;
package body STM32.I2C is
use type HAL.I2C.I2C_Status;
type I2C_Status_Flag is
(Start_Bit,
Address_Sent,
Byte_Transfer_Finished,
Address_Sent_10bit,
Stop_Detection,
Rx_Data_Register_Not_Empty,
Tx_Data_Register_Empty,
Bus_Error,
Arbitration_Lost,
Ack_Failure,
UnderOverrun,
Packet_Error,
Timeout,
SMB_Alert,
Master_Slave_Mode,
Busy,
Transmitter_Receiver_Mode,
General_Call,
SMB_Default,
SMB_Host,
Dual_Flag);
-- Low level flag handling
function Flag_Status (This : I2C_Port;
Flag : I2C_Status_Flag)
return Boolean;
procedure Clear_Address_Sent_Status (This : I2C_Port);
-- Higher level flag handling
procedure Wait_Flag
(This : in out I2C_Port;
Flag : I2C_Status_Flag;
F_State : Boolean;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status);
procedure Wait_Master_Flag
(This : in out I2C_Port;
Flag : I2C_Status_Flag;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status);
procedure Master_Request_Write
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status);
procedure Master_Request_Read
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status);
procedure Mem_Request_Write
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Mem_Addr : UInt16;
Mem_Addr_Size : HAL.I2C.I2C_Memory_Address_Size;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status);
procedure Mem_Request_Read
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Mem_Addr : UInt16;
Mem_Addr_Size : HAL.I2C.I2C_Memory_Address_Size;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status);
---------------
-- Configure --
---------------
procedure Configure
(This : in out I2C_Port;
Conf : I2C_Configuration)
is
CR1 : CR1_Register;
CCR : CCR_Register;
OAR1 : OAR1_Register;
PCLK1 : constant UInt32 := System_Clock_Frequencies.PCLK1;
Freq_Range : constant UInt16 := UInt16 (PCLK1 / 1_000_000);
begin
if This.State /= Reset then
return;
end if;
This.Config := Conf;
-- Disable the I2C port
if Freq_Range < 2 or else Freq_Range > 45 then
raise Program_Error with
"PCLK1 too high or too low: expected 2-45 MHz, current" &
Freq_Range'Img & " MHz";
end if;
Set_State (This, False);
-- Load CR2 and clear FREQ
This.Periph.CR2 :=
(LAST => False,
DMAEN => False,
ITBUFEN => False,
ITEVTEN => False,
ITERREN => False,
FREQ => UInt6 (Freq_Range),
others => <>);
-- Set the port timing
if Conf.Clock_Speed <= 100_000 then
-- Mode selection to Standard Mode
CCR.F_S := False;
CCR.CCR := UInt12 (PCLK1 / (Conf.Clock_Speed * 2));
if CCR.CCR < 4 then
CCR.CCR := 4;
end if;
This.Periph.TRISE.TRISE := UInt6 (Freq_Range + 1);
else
-- Fast mode
CCR.F_S := True;
if Conf.Duty_Cycle = DutyCycle_2 then
CCR.CCR := UInt12 (PCLK1 / (Conf.Clock_Speed * 3));
else
CCR.CCR := UInt12 (PCLK1 / (Conf.Clock_Speed * 25));
CCR.DUTY := True;
end if;
if CCR.CCR = 0 then
CCR.CCR := 1;
end if;
This.Periph.TRISE.TRISE :=
UInt6 ((UInt32 (Freq_Range) * 300) / 1000 + 1);
end if;
This.Periph.CCR := CCR;
-- CR1 configuration
case Conf.Mode is
when I2C_Mode =>
CR1.SMBUS := False;
CR1.SMBTYPE := False;
when SMBusDevice_Mode =>
CR1.SMBUS := True;
CR1.SMBTYPE := False;
when SMBusHost_Mode =>
CR1.SMBUS := True;
CR1.SMBTYPE := True;
end case;
CR1.ENGC := Conf.General_Call_Enabled;
CR1.NOSTRETCH := not Conf.Clock_Stretching_Enabled;
This.Periph.CR1 := CR1;
-- Address mode (slave mode) configuration
OAR1.ADDMODE := Conf.Addressing_Mode = Addressing_Mode_10bit;
case Conf.Addressing_Mode is
when Addressing_Mode_7bit =>
OAR1.ADD0 := False;
OAR1.ADD7 := UInt7 (Conf.Own_Address / 2);
OAR1.ADD10 := 0;
when Addressing_Mode_10bit =>
OAR1.ADD0 := (Conf.Own_Address and 2#1#) /= 0;
OAR1.ADD7 := UInt7 ((Conf.Own_Address / 2) and 2#1111111#);
OAR1.ADD10 := UInt2 (Conf.Own_Address / 2 ** 8);
end case;
This.Periph.OAR1 := OAR1;
Set_State (This, True);
This.State := Ready;
end Configure;
-----------------
-- Flag_Status --
-----------------
function Flag_Status
(This : I2C_Port; Flag : I2C_Status_Flag) return Boolean
is
begin
case Flag is
when Start_Bit =>
return This.Periph.SR1.SB;
when Address_Sent =>
return This.Periph.SR1.ADDR;
when Byte_Transfer_Finished =>
return This.Periph.SR1.BTF;
when Address_Sent_10bit =>
return This.Periph.SR1.ADD10;
when Stop_Detection =>
return This.Periph.SR1.STOPF;
when Rx_Data_Register_Not_Empty =>
return This.Periph.SR1.RxNE;
when Tx_Data_Register_Empty =>
return This.Periph.SR1.TxE;
when Bus_Error =>
return This.Periph.SR1.BERR;
when Arbitration_Lost =>
return This.Periph.SR1.ARLO;
when Ack_Failure =>
return This.Periph.SR1.AF;
when UnderOverrun =>
return This.Periph.SR1.OVR;
when Packet_Error =>
return This.Periph.SR1.PECERR;
when Timeout =>
return This.Periph.SR1.TIMEOUT;
when SMB_Alert =>
return This.Periph.SR1.SMBALERT;
when Master_Slave_Mode =>
return This.Periph.SR2.MSL;
when Busy =>
return This.Periph.SR2.BUSY;
when Transmitter_Receiver_Mode =>
return This.Periph.SR2.TRA;
when General_Call =>
return This.Periph.SR2.GENCALL;
when SMB_Default =>
return This.Periph.SR2.SMBDEFAULT;
when SMB_Host =>
return This.Periph.SR2.SMBHOST;
when Dual_Flag =>
return This.Periph.SR2.DUALF;
end case;
end Flag_Status;
-- ----------------
-- -- Clear_Flag --
-- ----------------
--
-- procedure Clear_Flag
-- (Port : in out I2C_Port;
-- Target : Clearable_I2C_Status_Flag)
-- is
-- Unref : Bit with Unreferenced;
-- begin
-- case Target is
-- when Bus_Error =>
-- Port.SR1.BERR := 0;
-- when Arbitration_Lost =>
-- Port.SR1.ARLO := 0;
-- when Ack_Failure =>
-- Port.SR1.AF := 0;
-- when UnderOverrun =>
-- Port.SR1.OVR := 0;
-- when Packet_Error =>
-- Port.SR1.PECERR := 0;
-- when Timeout =>
-- Port.SR1.TIMEOUT := 0;
-- when SMB_Alert =>
-- Port.SR1.SMBALERT := 0;
-- end case;
-- end Clear_Flag;
-------------------------------
-- Clear_Address_Sent_Status --
-------------------------------
procedure Clear_Address_Sent_Status (This : I2C_Port)
is
Unref : Boolean with Volatile, Unreferenced;
begin
-- ADDR is cleared after reading both SR1 and SR2
Unref := This.Periph.SR1.ADDR;
Unref := This.Periph.SR2.MSL;
end Clear_Address_Sent_Status;
-- ---------------------------------
-- -- Clear_Stop_Detection_Status --
-- ---------------------------------
--
-- procedure Clear_Stop_Detection_Status (Port : in out I2C_Port) is
-- Unref : Bit with Volatile, Unreferenced;
-- begin
-- Unref := Port.SR1.STOPF;
-- Port.CR1.PE := True;
-- end Clear_Stop_Detection_Status;
---------------
-- Wait_Flag --
---------------
procedure Wait_Flag
(This : in out I2C_Port;
Flag : I2C_Status_Flag;
F_State : Boolean;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status)
is
Start : constant Time := Clock;
begin
while Flag_Status (This, Flag) = F_State loop
if Clock - Start > Milliseconds (Timeout) then
This.State := Ready;
Status := HAL.I2C.Err_Timeout;
return;
end if;
end loop;
Status := HAL.I2C.Ok;
end Wait_Flag;
----------------------
-- Wait_Master_Flag --
----------------------
procedure Wait_Master_Flag
(This : in out I2C_Port;
Flag : I2C_Status_Flag;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status)
is
Start : constant Time := Clock;
begin
while not Flag_Status (This, Flag) loop
if This.Periph.SR1.AF then
-- Generate STOP
This.Periph.CR1.STOP := True;
-- Clear the AF flag
This.Periph.SR1.AF := False;
This.State := Ready;
Status := HAL.I2C.Err_Error;
return;
end if;
if Clock - Start > Milliseconds (Timeout) then
This.State := Ready;
Status := HAL.I2C.Err_Timeout;
return;
end if;
end loop;
Status := HAL.I2C.Ok;
end Wait_Master_Flag;
--------------------------
-- Master_Request_Write --
--------------------------
procedure Master_Request_Write
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status)
is
begin
This.Periph.CR1.START := True;
Wait_Flag (This, Start_Bit, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
if This.Config.Addressing_Mode = Addressing_Mode_7bit then
This.Periph.DR.DR := UInt8 (Addr) and not 2#1#;
else
declare
MSB : constant UInt8 :=
UInt8 (Shift_Right (UInt16 (Addr) and 16#300#, 7));
LSB : constant UInt8 :=
UInt8 (Addr and 16#FF#);
begin
-- We need to send 2#1111_MSB0# when MSB are the 3 most
-- significant bits of the address
This.Periph.DR.DR := MSB or 16#F0#;
Wait_Master_Flag (This, Address_Sent_10bit, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.DR.DR := LSB;
end;
end if;
Wait_Master_Flag (This, Address_Sent, Timeout, Status);
end Master_Request_Write;
--------------------------
-- Master_Request_Write --
--------------------------
procedure Master_Request_Read
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status)
is
begin
This.Periph.CR1.ACK := True;
This.Periph.CR1.START := True;
Wait_Flag (This, Start_Bit, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
if This.Config.Addressing_Mode = Addressing_Mode_7bit then
This.Periph.DR.DR := UInt8 (Addr) or 2#1#;
else
declare
MSB : constant UInt8 :=
UInt8 (Shift_Right (UInt16 (Addr) and 16#300#, 7));
LSB : constant UInt8 :=
UInt8 (Addr and 16#FF#);
begin
-- We need to write the address bit. So let's start with a
-- write header
-- We need to send 2#1111_MSB0# when MSB are the 3 most
-- significant bits of the address
This.Periph.DR.DR := MSB or 16#F0#;
Wait_Master_Flag (This, Address_Sent_10bit, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.DR.DR := LSB;
Wait_Master_Flag (This, Address_Sent, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
Clear_Address_Sent_Status (This);
-- Generate a re-start
This.Periph.CR1.START := True;
Wait_Flag (This, Start_Bit, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
-- resend the MSB with the read bit set.
This.Periph.DR.DR := MSB or 16#F1#;
end;
end if;
Wait_Master_Flag (This, Address_Sent, Timeout, Status);
end Master_Request_Read;
-----------------------
-- Mem_Request_Write --
-----------------------
procedure Mem_Request_Write
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Mem_Addr : UInt16;
Mem_Addr_Size : HAL.I2C.I2C_Memory_Address_Size;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status)
is
begin
This.Periph.CR1.START := True;
Wait_Flag (This, Start_Bit, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
-- Send slave address
This.Periph.DR.DR := UInt8 (Addr) and not 2#1#;
Wait_Master_Flag (This, Address_Sent, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
Clear_Address_Sent_Status (This);
-- Wait until TXE flag is set
Wait_Flag (This, Tx_Data_Register_Empty, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
case Mem_Addr_Size is
when HAL.I2C.Memory_Size_8b =>
This.Periph.DR.DR := UInt8 (Mem_Addr);
when HAL.I2C.Memory_Size_16b =>
This.Periph.DR.DR := UInt8 (Shift_Right (Mem_Addr, 8));
Wait_Flag (This, Tx_Data_Register_Empty, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.DR.DR := UInt8 (Mem_Addr and 16#FF#);
end case;
-- Wait until TXE flag is set
Wait_Flag (This, Tx_Data_Register_Empty, False, Timeout, Status);
end Mem_Request_Write;
----------------------
-- Mem_Request_Read --
----------------------
procedure Mem_Request_Read
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Mem_Addr : UInt16;
Mem_Addr_Size : HAL.I2C.I2C_Memory_Address_Size;
Timeout : Natural;
Status : out HAL.I2C.I2C_Status)
is
begin
This.Periph.CR1.ACK := True;
This.Periph.CR1.START := True;
Wait_Flag (This, Start_Bit, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
-- Send slave address in write mode
This.Periph.DR.DR := UInt8 (Addr) and not 16#1#;
Wait_Master_Flag (This, Address_Sent, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
Clear_Address_Sent_Status (This);
-- Wait until TXE flag is set
Wait_Flag (This, Tx_Data_Register_Empty, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
case Mem_Addr_Size is
when HAL.I2C.Memory_Size_8b =>
This.Periph.DR.DR := UInt8 (Mem_Addr);
when HAL.I2C.Memory_Size_16b =>
This.Periph.DR.DR := UInt8 (Shift_Right (Mem_Addr, 8));
Wait_Flag (This, Tx_Data_Register_Empty, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.DR.DR := UInt8 (Mem_Addr and 16#FF#);
end case;
-- Wait until TXE flag is set
Wait_Flag (This, Tx_Data_Register_Empty, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
-- We now need to reset and send the slave address in read mode
This.Periph.CR1.START := True;
Wait_Flag (This, Start_Bit, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
-- Send slave address in read mode
This.Periph.DR.DR := UInt8 (Addr) or 16#1#;
Wait_Master_Flag (This, Address_Sent, Timeout, Status);
end Mem_Request_Read;
---------------------
-- Master_Transmit --
---------------------
overriding
procedure Master_Transmit
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Data : HAL.I2C.I2C_Data;
Status : out HAL.I2C.I2C_Status;
Timeout : Natural := 1000)
is
Idx : Natural := Data'First;
begin
if This.State = Reset then
Status := HAL.I2C.Err_Error;
return;
elsif Data'Length = 0 then
Status := HAL.I2C.Err_Error;
return;
end if;
Wait_Flag (This, Busy, True, Timeout, Status);
if Status /= HAL.I2C.Ok then
Status := HAL.I2C.Busy;
return;
end if;
if This.State /= Ready then
Status := HAL.I2C.Busy;
return;
end if;
This.State := Master_Busy_Tx;
This.Periph.CR1.POS := False;
Master_Request_Write (This, Addr, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
Clear_Address_Sent_Status (This);
while Idx <= Data'Last loop
Wait_Flag (This, Tx_Data_Register_Empty, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.DR.DR := Data (Idx);
Idx := Idx + 1;
if Flag_Status (This, Byte_Transfer_Finished)
and then
Idx <= Data'Last
and then
Status = HAL.I2C.Ok
then
This.Periph.DR.DR := Data (Idx);
Idx := Idx + 1;
end if;
end loop;
Wait_Flag (This, Tx_Data_Register_Empty, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
-- Generate STOP
This.Periph.CR1.STOP := True;
This.State := Ready;
end Master_Transmit;
--------------------
-- Master_Receive --
--------------------
overriding
procedure Master_Receive
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Data : out HAL.I2C.I2C_Data;
Status : out HAL.I2C.I2C_Status;
Timeout : Natural := 1000)
is
Idx : Natural := Data'First;
begin
if This.State = Reset then
Status := HAL.I2C.Err_Error;
return;
elsif Data'Length = 0 then
Status := HAL.I2C.Err_Error;
return;
end if;
Wait_Flag (This, Busy, True, Timeout, Status);
if Status /= HAL.I2C.Ok then
Status := HAL.I2C.Busy;
return;
end if;
if This.State /= Ready then
Status := HAL.I2C.Busy;
return;
end if;
This.State := Master_Busy_Rx;
This.Periph.CR1.POS := False;
Master_Request_Read (This, Addr, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
if Data'Length = 1 then
-- Disable acknowledge
This.Periph.CR1.ACK := False;
Clear_Address_Sent_Status (This);
This.Periph.CR1.STOP := True;
elsif Data'Length = 2 then
-- Disable acknowledge
This.Periph.CR1.POS := True;
Clear_Address_Sent_Status (This);
This.Periph.CR1.ACK := False;
Wait_Flag
(This,
Byte_Transfer_Finished,
False,
Timeout,
Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.CR1.STOP := True;
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
Data (Idx) := This.Periph.DR.DR;
This.State := Ready;
return;
else
-- Automatic acknowledge
This.Periph.CR1.ACK := True;
Clear_Address_Sent_Status (This);
end if;
while Idx <= Data'Last loop
if Idx = Data'Last then
-- One UInt8 to read
Wait_Flag
(This,
Rx_Data_Register_Not_Empty,
False,
Timeout,
Status);
if Status /= HAL.I2C.Ok then
return;
end if;
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
elsif Idx + 1 = Data'Last then
-- Two bytes to read
This.Periph.CR1.ACK := False;
Wait_Flag (This,
Byte_Transfer_Finished,
False,
Timeout,
Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.CR1.STOP := True;
-- read the data from DR
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
elsif Idx + 2 = Data'Last then
-- Three bytes to read
Wait_Flag (This,
Byte_Transfer_Finished,
False,
Timeout,
Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.CR1.ACK := False;
-- read the data from DR
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
Wait_Flag (This,
Byte_Transfer_Finished,
False,
Timeout,
Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.CR1.STOP := True;
-- read the data from DR
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
else
-- One byte to read
Wait_Flag
(This,
Rx_Data_Register_Not_Empty,
False,
Timeout,
Status);
if Status /= HAL.I2C.Ok then
return;
end if;
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
Wait_Flag (This,
Byte_Transfer_Finished,
False,
Timeout,
Status);
if Status = HAL.I2C.Ok then
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
end if;
end if;
end loop;
This.State := Ready;
end Master_Receive;
---------------
-- Mem_Write --
---------------
overriding
procedure Mem_Write
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Mem_Addr : UInt16;
Mem_Addr_Size : HAL.I2C.I2C_Memory_Address_Size;
Data : HAL.I2C.I2C_Data;
Status : out HAL.I2C.I2C_Status;
Timeout : Natural := 1000)
is
Idx : Natural := Data'First;
begin
if This.State = Reset then
Status := HAL.I2C.Err_Error;
return;
elsif Data'Length = 0 then
Status := HAL.I2C.Err_Error;
return;
end if;
Wait_Flag (This, Busy, True, Timeout, Status);
if Status /= HAL.I2C.Ok then
Status := HAL.I2C.Busy;
return;
end if;
if This.State /= Ready then
Status := HAL.I2C.Busy;
return;
end if;
This.State := Mem_Busy_Tx;
This.Periph.CR1.POS := False;
Mem_Request_Write
(This, Addr, Mem_Addr, Mem_Addr_Size, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
while Idx <= Data'Last loop
Wait_Flag (This,
Tx_Data_Register_Empty,
False,
Timeout,
Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.DR.DR := Data (Idx);
Idx := Idx + 1;
if Flag_Status (This, Byte_Transfer_Finished)
and then
Idx <= Data'Last
and then
Status = HAL.I2C.Ok
then
This.Periph.DR.DR := Data (Idx);
Idx := Idx + 1;
end if;
end loop;
Wait_Flag (This,
Tx_Data_Register_Empty,
False,
Timeout,
Status);
if Status /= HAL.I2C.Ok then
return;
end if;
-- Generate STOP
This.Periph.CR1.STOP := True;
This.State := Ready;
end Mem_Write;
--------------
-- Mem_Read --
--------------
overriding
procedure Mem_Read
(This : in out I2C_Port;
Addr : HAL.I2C.I2C_Address;
Mem_Addr : UInt16;
Mem_Addr_Size : HAL.I2C.I2C_Memory_Address_Size;
Data : out HAL.I2C.I2C_Data;
Status : out HAL.I2C.I2C_Status;
Timeout : Natural := 1000)
is
Idx : Natural := Data'First;
begin
if This.State = Reset then
Status := HAL.I2C.Err_Error;
return;
elsif Data'Length = 0 then
Status := HAL.I2C.Err_Error;
return;
end if;
Wait_Flag (This, Busy, True, Timeout, Status);
if Status /= HAL.I2C.Ok then
Status := HAL.I2C.Busy;
return;
end if;
if This.State /= Ready then
Status := HAL.I2C.Busy;
return;
end if;
This.State := Mem_Busy_Rx;
This.Periph.CR1.POS := False;
Mem_Request_Read
(This, Addr, Mem_Addr, Mem_Addr_Size, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
if Data'Length = 1 then
This.Periph.CR1.ACK := False;
Clear_Address_Sent_Status (This);
This.Periph.CR1.STOP := True;
elsif Data'Length = 2 then
This.Periph.CR1.ACK := False;
This.Periph.CR1.POS := True;
Clear_Address_Sent_Status (This);
else
-- Automatic acknowledge
This.Periph.CR1.ACK := True;
Clear_Address_Sent_Status (This);
end if;
while Idx <= Data'Last loop
if Idx = Data'Last then
-- One byte to read
Wait_Flag
(This, Rx_Data_Register_Not_Empty, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
elsif Idx + 1 = Data'Last then
-- Two bytes to read
This.Periph.CR1.ACK := False;
Wait_Flag (This, Byte_Transfer_Finished, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.CR1.STOP := True;
-- read the data from DR
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
elsif Idx + 2 = Data'Last then
-- Three bytes to read
Wait_Flag (This, Byte_Transfer_Finished, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.CR1.ACK := False;
-- read the data from DR
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
Wait_Flag (This, Byte_Transfer_Finished, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
This.Periph.CR1.STOP := True;
-- read the data from DR
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
else
-- One byte to read
Wait_Flag
(This, Rx_Data_Register_Not_Empty, False, Timeout, Status);
if Status /= HAL.I2C.Ok then
return;
end if;
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
Wait_Flag (This, Byte_Transfer_Finished, False, Timeout, Status);
if Status = HAL.I2C.Ok then
Data (Idx) := This.Periph.DR.DR;
Idx := Idx + 1;
end if;
end if;
end loop;
This.State := Ready;
end Mem_Read;
---------------
-- Set_State --
---------------
procedure Set_State (This : in out I2C_Port; Enabled : Boolean)
is
begin
This.Periph.CR1.PE := Enabled;
end Set_State;
------------------
-- Port_Enabled --
------------------
function Port_Enabled (This : I2C_Port) return Boolean
is
begin
return This.Periph.CR1.PE;
end Port_Enabled;
----------------------
-- Enable_Interrupt --
----------------------
procedure Enable_Interrupt
(This : in out I2C_Port;
Source : I2C_Interrupt)
is
begin
case Source is
when Error_Interrupt =>
This.Periph.CR2.ITERREN := True;
when Event_Interrupt =>
This.Periph.CR2.ITEVTEN := True;
when Buffer_Interrupt =>
This.Periph.CR2.ITBUFEN := True;
end case;
end Enable_Interrupt;
-----------------------
-- Disable_Interrupt --
-----------------------
procedure Disable_Interrupt
(This : in out I2C_Port;
Source : I2C_Interrupt)
is
begin
case Source is
when Error_Interrupt =>
This.Periph.CR2.ITERREN := False;
when Event_Interrupt =>
This.Periph.CR2.ITEVTEN := False;
when Buffer_Interrupt =>
This.Periph.CR2.ITBUFEN := False;
end case;
end Disable_Interrupt;
-------------
-- Enabled --
-------------
function Enabled
(This : I2C_Port;
Source : I2C_Interrupt)
return Boolean
is
begin
case Source is
when Error_Interrupt =>
return This.Periph.CR2.ITERREN;
when Event_Interrupt =>
return This.Periph.CR2.ITEVTEN;
when Buffer_Interrupt =>
return This.Periph.CR2.ITBUFEN;
end case;
end Enabled;
end STM32.I2C;
| 28.276456 | 78 | 0.499231 |
1d1f33a827f56dfdef170cbb28a33caea1a3fc22 | 3,146 | ads | Ada | llvm-gcc-4.2-2.9/gcc/ada/mdll-utl.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | 1 | 2016-04-09T02:58:13.000Z | 2016-04-09T02:58:13.000Z | llvm-gcc-4.2-2.9/gcc/ada/mdll-utl.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/mdll-utl.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- M D L L . T O O L S --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Interface to externals tools used to build DLL and import libraries
package MDLL.Utl is
procedure Dlltool
(Def_Filename : String;
DLL_Name : String;
Library : String;
Exp_Table : String := "";
Base_File : String := "";
Build_Import : Boolean);
-- Run dlltool binary.
-- This tools is used to build an import library and an export table
procedure Gcc
(Output_File : String;
Files : Argument_List;
Options : Argument_List;
Base_File : String := "";
Build_Lib : Boolean := False);
-- Run gcc binary
procedure Gnatbind
(Alis : Argument_List;
Args : Argument_List := Null_Argument_List);
-- Run gnatbind binary to build the binder program.
-- it Runs the command : gnatbind -n alis... to build the binder program.
procedure Gnatlink
(Ali : String;
Args : Argument_List := Null_Argument_List);
-- Run gnatlink binary.
-- It runs the command : gnatlink ali arg1 arg2...
procedure Locate;
-- Look for the needed tools in the path and record the full path for each
-- one in a variable.
end MDLL.Utl;
| 47.666667 | 78 | 0.462492 |
063ab081c3cd570b943c3d95b1896b1617a2a1ce | 9,819 | adb | Ada | Src/bdf_font.adb | SMerrony/dashera | 74961f34a44cabae414e84537e8baae0ecb373c9 | [
"MIT"
] | 23 | 2021-12-12T15:20:22.000Z | 2022-03-19T19:55:06.000Z | Src/bdf_font.adb | SMerrony/dashera | 74961f34a44cabae414e84537e8baae0ecb373c9 | [
"MIT"
] | 1 | 2022-03-10T00:09:35.000Z | 2022-03-15T08:16:00.000Z | Src/bdf_font.adb | SMerrony/dashera | 74961f34a44cabae414e84537e8baae0ecb373c9 | [
"MIT"
] | 1 | 2022-03-11T19:42:02.000Z | 2022-03-11T19:42:02.000Z | -- Copyright ©2021,2022 Steve Merrony
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
with Ada.Text_IO; use Ada.Text_IO;
with Interfaces; use Interfaces;
with Logging; use Logging;
package body BDF_Font is
procedure Parse_BBX
(Font_Line : in String;
Font_Line_Length : in Positive;
Pix_Width, Pix_Height : out Integer;
X_Offset, Y_Offset : out Integer)
is
Start_Pos, End_Pos : Positive;
begin
Start_Pos := 5; -- "BBX n..."
End_Pos := Start_Pos;
while Font_Line (End_Pos) /= ' ' loop
End_Pos := End_Pos + 1;
end loop;
Pix_Width := Integer'Value (Font_Line (Start_Pos .. End_Pos - 1));
Start_Pos := End_Pos + 1;
End_Pos := Start_Pos;
while Font_Line (End_Pos) /= ' ' loop
End_Pos := End_Pos + 1;
end loop;
Pix_Height := Integer'Value (Font_Line (Start_Pos .. End_Pos - 1));
Start_Pos := End_Pos + 1;
End_Pos := Start_Pos;
while Font_Line (End_Pos) /= ' ' loop
End_Pos := End_Pos + 1;
end loop;
X_Offset := Integer'Value (Font_Line (Start_Pos .. End_Pos - 1));
Start_Pos := End_Pos + 1;
End_Pos := Font_Line_Length;
Y_Offset := Integer'Value (Font_Line (Start_Pos .. End_Pos));
end Parse_BBX;
protected body Font is
procedure Load_Font (File_Name : String; Zoom : Zoom_T) is
-- Font : aliased Decoded_Acc_T := new Decoded_T;
Char_Count : Positive;
Font_File : File_Type;
Font_Line : String (1 .. 80);
Font_Line_Length : Natural;
Tmp_Pix_Buf, Tmp_Dim_Pix_Buf, Tmp_Reverse_Pix_Buf,
Green_Pix_Buf, Dim_Pix_Buf, Black_Pix_Buf : Gdk_Pixbuf;
ASCII_Code : Natural;
Pix_Width, Pix_Height : Integer;
X_Offset, Y_Offset : Integer;
X, Y : Gint;
Line_Byte : Unsigned_8;
begin
case Zoom is
when Large =>
Decoded.Char_Width := 10;
Decoded.Char_Height := 24;
when Normal =>
Decoded.Char_Width := 10;
Decoded.Char_Height := 18;
when Smaller =>
Decoded.Char_Width := 8;
Decoded.Char_Height := 12;
when Tiny =>
Decoded.Char_Width := 7;
Decoded.Char_Height := 10;
end case;
begin
Open (File => Font_File, Mode => In_File, Name => File_Name);
exception
when others =>
raise OPEN_FAILURE with "ERROR: Cannot open the file '" & File_Name &
"'. Does it exist?";
end;
for C of Decoded.Font loop
C.Loaded := False;
end loop;
loop
Get_Line (Font_File, Font_Line, Font_Line_Length);
-- Log (DEBUG, "" & Font_Line (1 .. Font_Line_Length));
exit when Font_Line (1 .. Font_Line_Length) = "ENDPROPERTIES";
end loop;
Get_Line (Font_File, Font_Line, Font_Line_Length);
if Font_Line (1 .. 5) /= "CHARS" then
raise BDF_DECODE with "ERROR: BDF_Font - CHARS line not found";
end if;
Log (INFO, "BDF Font " & Font_Line (1 .. Font_Line_Length));
Char_Count := Positive'Value (Font_Line (7 .. Font_Line_Length));
Tmp_Pix_Buf := Gdk_New (Has_Alpha => False, Width => Font_Width, Height => Font_Height);
Tmp_Dim_Pix_Buf := Gdk_New (Width => Font_Width, Height => Font_Height);
Tmp_Reverse_Pix_Buf := Gdk_New (Width => Font_Width, Height => Font_Height);
Green_Pix_Buf := Gdk_New (Width => 1, Height => 1);
Fill (Green_Pix_Buf, 16#00ff00ff#);
Dim_Pix_Buf := Gdk_New (Width => 1, Height => 1);
Fill (Dim_Pix_Buf, 16#008800ff#);
Black_Pix_Buf := Gdk_New (Width => 1, Height => 1);
Fill (Black_Pix_Buf, 16#000000ff#);
for CC in 0 .. Char_Count - 1 loop
Log (DEBUG, "Loading char No. " & Integer'Image(CC));
loop
Get_Line (Font_File, Font_Line, Font_Line_Length);
exit when Font_Line (1 .. 9) = "STARTCHAR";
end loop;
Get_Line (Font_File, Font_Line, Font_Line_Length);
if Font_Line (1 .. 8) /= "ENCODING" then
raise BDF_DECODE with "ERROR: BDF_Font - ENCODING line not found";
end if;
ASCII_Code := Natural'Value (Font_Line (10 .. Font_Line_Length));
Log (DEBUG, "... ASCII Code: " & ASCII_Code'Image);
-- skip 2 lines
Get_Line (Font_File, Font_Line, Font_Line_Length);
Get_Line (Font_File, Font_Line, Font_Line_Length);
Get_Line (Font_File, Font_Line, Font_Line_Length);
Parse_BBX (Font_Line, Font_Line_Length, Pix_Width, Pix_Height, X_Offset, Y_Offset);
-- skip the BITMAP line
Get_Line (Font_File, Font_Line, Font_Line_Length);
-- load the actual bitmap for this char a row at a time from the top down
Fill (Tmp_Pix_Buf, 0);
Fill (Tmp_Dim_Pix_Buf, 0);
Fill (Tmp_Reverse_Pix_Buf, 16#00FF_0000#);
for Bitmap_Line in 0 .. Pix_Height - 1 loop
Get_Line (Font_File, Font_Line, Font_Line_Length);
Line_Byte := Unsigned_8'Value ("16#" & Font_Line (1 .. 2) & "#");
for I in 0 .. Pix_Width - 1 loop
if (Line_Byte and 16#80#) /= 0 then
X := Gint(X_Offset + I);
Y := Gint(Bitmap_Line + 12 - Pix_Height - Y_Offset);
Gdk.Pixbuf.Copy_Area (Src_Pixbuf => Green_Pix_Buf, Src_X => 0, Src_Y => 0, Width => 1, Height => 1,
Dest_Pixbuf => Tmp_Pix_Buf, Dest_X => X, Dest_Y => Y);
Gdk.Pixbuf.Copy_Area (Src_Pixbuf => Dim_Pix_Buf, Src_X => 0, Src_Y => 0, Width => 1, Height => 1,
Dest_Pixbuf => Tmp_Dim_Pix_Buf, Dest_X => X, Dest_Y => Y);
Gdk.Pixbuf.Copy_Area (Src_Pixbuf => Black_Pix_Buf, Src_X => 0, Src_Y => 0, Width => 1, Height => 1,
Dest_Pixbuf => Tmp_Reverse_Pix_Buf, Dest_X => X, Dest_Y => Y);
-- Decoded.Font(ASCII_Code).Pixels (X_Offset + I, Y_Offset + Bitmap_Line) := True;
end if;
Line_Byte := Shift_Left (Line_Byte, 1);
end loop;
end loop;
Decoded.Font(ASCII_Code).Pix_Buf := Gdk.Pixbuf.Scale_Simple (Src => Tmp_Pix_Buf,
Dest_Width => Decoded.Char_Width,
Dest_Height => Decoded.Char_Height,
Inter_Type => Interp_Bilinear);
Decoded.Font(ASCII_Code).Dim_Pix_Buf := Gdk.Pixbuf.Scale_Simple (Src => Tmp_Dim_Pix_Buf,
Dest_Width => Decoded.Char_Width,
Dest_Height => Decoded.Char_Height,
Inter_Type => Interp_Bilinear);
Decoded.Font(ASCII_Code).Reverse_Pix_Buf := Gdk.Pixbuf.Scale_Simple (Src => Tmp_Reverse_Pix_Buf,
Dest_Width => Decoded.Char_Width,
Dest_Height => Decoded.Char_Height,
Inter_Type => Interp_Bilinear);
Decoded.Font(ASCII_Code).Loaded := true;
end loop;
Close (File => Font_File);
end Load_Font;
function Get_Char_Width return Gint is
(Decoded.Char_Width);
function Get_Char_Height return Gint is
(Decoded.Char_Height);
function Is_Loaded (Ix : in Natural) return Boolean is
(Decoded.Font(Ix).Loaded);
function Get_Dim_Pixbuf (Ix : in Natural) return Gdk_Pixbuf is
(Decoded.Font(Ix).Dim_Pix_Buf);
function Get_Rev_Pixbuf (Ix : in Natural) return Gdk_Pixbuf is
(Decoded.Font(Ix).Reverse_Pix_Buf);
function Get_Pixbuf (Ix : in Natural) return Gdk_Pixbuf is
(Decoded.Font(Ix).Pix_Buf);
end Font;
end BDF_Font;
| 44.835616 | 121 | 0.539872 |
3d8b8c7037d11bb2b290e695b2f6dc265d988dd0 | 2,598 | adb | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-regexp.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-regexp.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/libgnat/g-regexp.adb | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . R E G E X P --
-- --
-- B o d y --
-- --
-- Copyright (C) 1999-2020, AdaCore --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package does not require a body, since it is a package renaming. We
-- provide a dummy file containing a No_Body pragma so that previous versions
-- of the body (which did exist) will not interfere.
pragma No_Body;
| 70.216216 | 78 | 0.390685 |
419f4d82b5f7db4b415a2a262de1b93f3a8e5ef7 | 2,617 | ads | Ada | boards/nucleo_f303re/stm32gd-board.ads | ekoeppen/STM32_Generic_Ada_Drivers | 4ff29c3026c4b24280baf22a5b81ea9969375466 | [
"MIT"
] | 1 | 2021-04-06T07:57:56.000Z | 2021-04-06T07:57:56.000Z | boards/nucleo_f303re/stm32gd-board.ads | ekoeppen/STM32_Generic_Ada_Drivers | 4ff29c3026c4b24280baf22a5b81ea9969375466 | [
"MIT"
] | null | null | null | boards/nucleo_f303re/stm32gd-board.ads | ekoeppen/STM32_Generic_Ada_Drivers | 4ff29c3026c4b24280baf22a5b81ea9969375466 | [
"MIT"
] | 2 | 2018-05-29T13:59:31.000Z | 2019-02-03T19:48:08.000Z | with STM32GD.GPIO; use STM32GD.GPIO;
with STM32GD.GPIO.Pin;
with STM32GD.Clocks;
with STM32GD.Clocks.Tree;
with STM32GD.SPI;
with STM32GD.SPI.Peripheral;
with STM32GD.USART;
with STM32GD.USART.Peripheral;
with STM32_SVD.Interrupts;
with Drivers.Text_IO;
package STM32GD.Board is
package GPIO renames STM32GD.GPIO;
package Clocks is new STM32GD.Clocks.Tree;
package SCLK is new Pin (Pin => Pin_5,
Port => Port_A,
Mode => Mode_AF,
Alternate_Function => 5);
package MISO is new Pin (Pin => Pin_6,
Port => Port_A,
Mode => Mode_AF,
Alternate_Function => 5);
package MOSI is new Pin (Pin => Pin_7,
Port => Port_A,
Mode => Mode_AF,
Alternate_Function => 5);
package CSN is new Pin (Pin => Pin_6,
Port => Port_B,
Mode => Mode_Out);
package BUTTON is new Pin (Pin => Pin_13,
Port => Port_C);
package LED is new Pin (Pin => Pin_5,
Port => Port_A,
Mode => Mode_Out);
package LED2 is new Pin (Pin => Pin_8,
Port => Port_C,
Mode => Mode_Out);
package LED3 is new Pin (Pin => Pin_6,
Port => Port_C,
Mode => Mode_Out);
package TX is new Pin (Pin => Pin_2,
Port => Port_A,
Pull_Resistor => Pull_Up,
Mode => Mode_AF,
Alternate_Function => 7);
package RX is new Pin (Pin => Pin_3,
Port => Port_A,
Pull_Resistor => Pull_Up,
Mode => Mode_AF,
Alternate_Function => 7);
package USART is new STM32GD.USART.Peripheral (
USART => STM32GD.USART.USART_2, Speed => 115200,
RX_DMA_Buffer_Size => 64,
IRQ => STM32_SVD.Interrupts.USART2_EXTI26,
Clock => Clocks.PCLK1);
package Text_IO is new Drivers.Text_IO (USART => STM32GD.Board.USART);
package SPI is new STM32GD.SPI.Peripheral (SPI => STM32GD.SPI.SPI_1);
procedure Init;
end STM32GD.Board;
| 40.890625 | 76 | 0.449752 |
314eca274d1c33a42d621416068dc22cbd2f681d | 1,759 | adb | Ada | tools/scitools/sample/mahjongg/tile.adb | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | tools/scitools/sample/mahjongg/tile.adb | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | tools/scitools/sample/mahjongg/tile.adb | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | PACKAGE BODY TileADT IS
--
-- Implementation of Tile ADT for Mahjongg solitaire game
--
FUNCTION Create (TheCol: Col; TheRow : Row; TheLayer : Layer) RETURN Tile IS
-- Assumes : TheCol, TheRow, TheLayer have values.
-- Uses : TheRow indicates which row on the board.
-- TheCol indicates which column on the board.
-- TheLayer indicates which layer on the board.
-- Results : A Tile is created and assigned a position TheCol,TheRow,TheLayer.
New_Tile: Tile := (TheCol, TheRow, TheLayer, 0);
BEGIN
RETURN New_Tile;
END Create;
PROCEDURE SetValue (TheTile : IN OUT Tile; Value : TileValue) IS
-- Assumes : nothing (though it makes sense that it have been created).
-- Uses : TheTile and Value
-- Results : TheTile is assigned Value
BEGIN
TheTile.Value := Value;
END SetValue;
FUNCTION GetValue (TheTile : Tile) RETURN TileValue IS
-- Assumes : TheTile has a value
-- Uses : TheTile
-- Results : Returns the current value of TheTile.
BEGIN
RETURN (TheTile.Value);
END GetValue;
FUNCTION GetLayer (TheTile :Tile) RETURN Layer IS
BEGIN
RETURN (theTile.Layer_Pos);
END GetLayer;
FUNCTION GetRow (TheTile :Tile) RETURN Row IS
BEGIN
RETURN (theTile.Row_Pos);
END GetRow;
FUNCTION GetCol (TheTile :Tile) RETURN Col IS
BEGIN
RETURN (theTile.Col_Pos);
END GetCol;
FUNCTION IsMatch (Tile1, Tile2 : Tile) RETURN BOOLEAN IS
-- Assumes : Tile1, Tile2 have values.
-- Uses : Tile1, Tile2.
-- Results : Returns TRUE if Tile1 has the same value as Tile2, FALSE otherwise.
-- Notes : TRUE only on exact match. Doesn't deal with seasons or other
-- "suit" type tiles.
BEGIN
RETURN Tile1.Value = Tile2.Value;
END ISMatch;
END TileADT;
| 28.836066 | 81 | 0.686185 |
3dac0c4763ec9b90037dcf3cd71cab291a60c0d9 | 2,862 | ads | Ada | llvm-gcc-4.2-2.9/gcc/ada/s-widcha.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | 1 | 2016-04-09T02:58:13.000Z | 2016-04-09T02:58:13.000Z | llvm-gcc-4.2-2.9/gcc/ada/s-widcha.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/s-widcha.ads | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . W I D _ C H A R --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the routine used for Character'Width
package System.Wid_Char is
pragma Pure;
function Width_Character (Lo, Hi : Character) return Natural;
-- Compute Width attribute for non-static type derived from Character.
-- The arguments are the low and high bounds for the type.
end System.Wid_Char;
| 65.045455 | 78 | 0.447939 |
3d90215806fe8fea501a71b13915de691a62a499 | 3,544 | ads | Ada | source/uaflex/debug.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 24 | 2016-11-29T06:59:41.000Z | 2021-08-30T11:55:16.000Z | source/uaflex/debug.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 2 | 2019-01-16T05:15:20.000Z | 2019-02-03T10:03:32.000Z | source/uaflex/debug.ads | svn2github/matreshka | 9d222b3ad9da508855fb1f5adbe5e8a4fad4c530 | [
"BSD-3-Clause"
] | 4 | 2017-07-18T07:11:05.000Z | 2020-06-21T03:02:25.000Z | ------------------------------------------------------------------------------
-- --
-- Matreshka Project --
-- --
-- Localization, Internationalization, Globalization for Ada --
-- --
-- Tools 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 Matreshka.Internals.Finite_Automatons;
package Debug is
procedure Print;
procedure Print_Character_Classes
(Vector : Matreshka.Internals.Finite_Automatons.Vectors.Vector);
end Debug;
| 64.436364 | 78 | 0.418172 |
1d82b66f67ab47247e3a4efc7ececd6623f9ed40 | 9,581 | adb | Ada | llvm-gcc-4.2-2.9/gcc/ada/g-trasym-vms-ia64.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | 1 | 2016-04-09T02:58:13.000Z | 2016-04-09T02:58:13.000Z | llvm-gcc-4.2-2.9/gcc/ada/g-trasym-vms-ia64.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | llvm-gcc-4.2-2.9/gcc/ada/g-trasym-vms-ia64.adb | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- G N A T . T R A C E B A C K . S Y M B O L I C --
-- --
-- B o d y --
-- --
-- Copyright (C) 2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Run-time symbolic traceback support for IA64/VMS
with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback;
with Interfaces.C;
with System;
with System.Aux_DEC;
with System.Soft_Links;
with System.Traceback_Entries;
package body GNAT.Traceback.Symbolic is
pragma Warnings (Off);
pragma Linker_Options ("--for-linker=sys$library:trace.exe");
use Interfaces.C;
use System;
use System.Aux_DEC;
use System.Traceback_Entries;
subtype User_Arg_Type is Unsigned_Longword;
subtype Cond_Value_Type is Unsigned_Longword;
type ASCIC is record
Count : unsigned_char;
Data : char_array (1 .. 255);
end record;
pragma Convention (C, ASCIC);
for ASCIC use record
Count at 0 range 0 .. 7;
Data at 1 range 0 .. 8 * 255 - 1;
end record;
for ASCIC'Size use 8 * 256;
function Fetch_ASCIC is new Fetch_From_Address (ASCIC);
procedure Symbolize
(Status : out Cond_Value_Type;
Current_PC : in Address;
Filename_Name : out Address;
Library_Name : out Address;
Record_Number : out Integer;
Image_Name : out Address;
Module_Name : out Address;
Routine_Name : out Address;
Line_Number : out Integer;
Relative_PC : out Address);
pragma Interface (External, Symbolize);
pragma Import_Valued_Procedure
(Symbolize, "TBK$I64_SYMBOLIZE",
(Cond_Value_Type, Address,
Address, Address, Integer,
Address, Address, Address, Integer,
Address),
(Value, Value,
Reference, Reference, Reference,
Reference, Reference, Reference, Reference,
Reference));
function Decode_Ada_Name (Encoded_Name : String) return String;
-- Decodes an Ada identifier name. Removes leading "_ada_" and trailing
-- __{DIGIT}+ or ${DIGIT}+, converts other "__" to '.'
---------------------
-- Decode_Ada_Name --
---------------------
function Decode_Ada_Name (Encoded_Name : String) return String is
Decoded_Name : String (1 .. Encoded_Name'Length);
Pos : Integer := Encoded_Name'First;
Last : Integer := Encoded_Name'Last;
DPos : Integer := 1;
begin
if Pos > Last then
return "";
end if;
-- Skip leading _ada_
if Encoded_Name'Length > 4
and then Encoded_Name (Pos .. Pos + 4) = "_ada_"
then
Pos := Pos + 5;
end if;
-- Skip trailing __{DIGIT}+ or ${DIGIT}+
if Encoded_Name (Last) in '0' .. '9' then
for J in reverse Pos + 2 .. Last - 1 loop
case Encoded_Name (J) is
when '0' .. '9' =>
null;
when '$' =>
Last := J - 1;
exit;
when '_' =>
if Encoded_Name (J - 1) = '_' then
Last := J - 2;
end if;
exit;
when others =>
exit;
end case;
end loop;
end if;
-- Now just copy encoded name to decoded name, converting "__" to '.'
while Pos <= Last loop
if Encoded_Name (Pos) = '_' and then Encoded_Name (Pos + 1) = '_'
and then Pos /= Encoded_Name'First
then
Decoded_Name (DPos) := '.';
Pos := Pos + 2;
else
Decoded_Name (DPos) := Encoded_Name (Pos);
Pos := Pos + 1;
end if;
DPos := DPos + 1;
end loop;
return Decoded_Name (1 .. DPos - 1);
end Decode_Ada_Name;
------------------------
-- Symbolic_Traceback --
------------------------
function Symbolic_Traceback (Traceback : Tracebacks_Array) return String is
Status : Cond_Value_Type;
Filename_Name_Addr : Address;
Library_Name_Addr : Address;
Record_Number : Integer;
Image_Name : ASCIC;
Image_Name_Addr : Address;
Module_Name : ASCIC;
Module_Name_Addr : Address;
Routine_Name : ASCIC;
Routine_Name_Addr : Address;
Line_Number : Integer;
Relative_PC : Address;
Res : String (1 .. 256 * Traceback'Length);
Len : Integer;
begin
if Traceback'Length > 0 then
Len := 0;
-- Since image computation is not thread-safe we need task lockout
System.Soft_Links.Lock_Task.all;
for J in Traceback'Range loop
Symbolize
(Status,
PC_For (Traceback (J)),
Filename_Name_Addr,
Library_Name_Addr,
Record_Number,
Image_Name_Addr,
Module_Name_Addr,
Routine_Name_Addr,
Line_Number,
Relative_PC);
Image_Name := Fetch_ASCIC (Image_Name_Addr);
Module_Name := Fetch_ASCIC (Module_Name_Addr);
Routine_Name := Fetch_ASCIC (Routine_Name_Addr);
declare
First : Integer := Len + 1;
Last : Integer := First + 80 - 1;
Pos : Integer;
Routine_Name_D : String := Decode_Ada_Name
(To_Ada
(Routine_Name.Data (1 .. size_t (Routine_Name.Count)),
False));
begin
Res (First .. Last) := (others => ' ');
Res (First .. First + Integer (Image_Name.Count) - 1) :=
To_Ada
(Image_Name.Data (1 .. size_t (Image_Name.Count)),
False);
Res (First + 10 ..
First + 10 + Integer (Module_Name.Count) - 1) :=
To_Ada
(Module_Name.Data (1 .. size_t (Module_Name.Count)),
False);
Res (First + 30 ..
First + 30 + Routine_Name_D'Length - 1) :=
Routine_Name_D;
-- If routine name doesn't fit 20 characters, output
-- the line number on next line at 50th position
if Routine_Name_D'Length > 20 then
Pos := First + 30 + Routine_Name_D'Length;
Res (Pos) := ASCII.LF;
Last := Pos + 80;
Res (Pos + 1 .. Last) := (others => ' ');
Pos := Pos + 51;
else
Pos := First + 50;
end if;
Res (Pos .. Pos + Integer'Image (Line_Number)'Length - 1) :=
Integer'Image (Line_Number);
Res (Last) := ASCII.LF;
Len := Last;
end;
end loop;
System.Soft_Links.Unlock_Task.all;
return Res (1 .. Len);
else
return "";
end if;
end Symbolic_Traceback;
function Symbolic_Traceback (E : Exception_Occurrence) return String is
begin
return Symbolic_Traceback (Tracebacks (E));
end Symbolic_Traceback;
end GNAT.Traceback.Symbolic;
| 35.354244 | 78 | 0.490867 |
4dd0f70d3aea3a09c808c1d211b14a1e716e3836 | 6,195 | adb | Ada | src/rejuvenation-pretty_print.adb | TNO/Rejuvenation-Ada | 8113ec28da3923ccde40d76cbab70e0e614f4b75 | [
"BSD-3-Clause"
] | null | null | null | src/rejuvenation-pretty_print.adb | TNO/Rejuvenation-Ada | 8113ec28da3923ccde40d76cbab70e0e614f4b75 | [
"BSD-3-Clause"
] | null | null | null | src/rejuvenation-pretty_print.adb | TNO/Rejuvenation-Ada | 8113ec28da3923ccde40d76cbab70e0e614f4b75 | [
"BSD-3-Clause"
] | null | null | null | with Ada.Assertions; use Ada.Assertions;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with Interfaces.C; use Interfaces.C;
with Rejuvenation.File_Utils; use Rejuvenation.File_Utils;
with Rejuvenation.Indentation; use Rejuvenation.Indentation;
with Rejuvenation.Navigation; use Rejuvenation.Navigation;
with Rejuvenation.Nested; use Rejuvenation.Nested;
with Rejuvenation.Node_Locations; use Rejuvenation.Node_Locations;
with Rejuvenation.String_Utils; use Rejuvenation.String_Utils;
package body Rejuvenation.Pretty_Print is
function Sys (Arg : char_array) return Integer;
pragma Import (C, Sys, "system");
procedure Surround_Node_By_Pretty_Print_Section
(T_R : in out Text_Rewrite'Class; Node : Ada_Node'Class)
is
function Predicate (Node : Ada_Node'Class) return Boolean;
function Predicate (Node : Ada_Node'Class) return Boolean
-- workaround for https://gt3-prod-1.adacore.com/#/tickets/UB17-034
-- not only look for node on separate lines,
-- but also require a particular kind
is
begin
return
Node.Kind in Ada_Stmt | Ada_Stmt_List | Ada_Basic_Decl |
Ada_Compilation_Unit
and then Node_On_Separate_Lines (Node);
end Predicate;
Ctx : constant Ada_Node :=
Get_Reflexive_Ancestor (Node, Predicate'Access);
begin
T_R.Prepend (Ctx, Pretty_Print_On, Before => Trivia_On_Same_Line);
T_R.Append (Ctx, Pretty_Print_Off, After => Trivia_On_Same_Line);
end Surround_Node_By_Pretty_Print_Section;
procedure Turn_Pretty_Printing_Initially_Off
(T_R : in out Text_Rewrite_Unit)
is
Unit : constant Analysis_Unit := T_R.Get_Unit;
begin
T_R.Prepend (Unit.Root, Pretty_Print_Off, All_Trivia, Unit.Get_Charset);
end Turn_Pretty_Printing_Initially_Off;
procedure Turn_Pretty_Printing_Initially_Off (Filename : String) is
Original_Content : constant String := Get_String_From_File (Filename);
begin
Write_String_To_File (Pretty_Print_Off & Original_Content, Filename);
end Turn_Pretty_Printing_Initially_Off;
procedure Remove_Cr_Cr_Lf (Filename : String);
procedure Remove_Cr_Cr_Lf (Filename : String)
-- repair gnatpp screwed up
-- see https://gt3-prod-1.adacore.com/#/tickets/U617-042
is
Contents : constant String := Get_String_From_File (Filename);
Final_Contents : constant String :=
Replace_All
(Contents, ASCII.CR & ASCII.CR & ASCII.LF, ASCII.CR & ASCII.LF);
begin
Write_String_To_File (Final_Contents, Filename);
end Remove_Cr_Cr_Lf;
procedure Remove_Nested_Pretty_Print_Flags (Filename : String);
procedure Remove_Nested_Pretty_Print_Flags (Filename : String) is
Contents : constant String := Get_String_From_File (Filename);
Final_Contents : constant String :=
Remove_Nested_Flags (Contents, Pretty_Print_On, Pretty_Print_Off, 1);
begin
Write_String_To_File (Final_Contents, Filename);
end Remove_Nested_Pretty_Print_Flags;
procedure Pretty_Print_Sections_Options
(Filename : String; Options : String);
procedure Pretty_Print_Sections_Options
(Filename : String; Options : String)
is
Command : constant String :=
"gnatpp" & Options & " --pp-on=" & Flag_On & " --pp-off=" & Flag_Off &
" " & Filename;
begin
Remove_Nested_Pretty_Print_Flags (Filename);
declare
Original_Content : constant String := Get_String_From_File (Filename);
Original_Last_Char : constant Character :=
Original_Content (Original_Content'Last);
Ret_Val : constant Integer := Sys (To_C (Command));
begin
Assert
(Check => Ret_Val = 0,
Message => "System call to gnatpp returned " & Ret_Val'Image);
declare
Current_Content : constant String :=
Get_String_From_File (Filename);
Current_Last_Char : constant Character :=
Current_Content (Current_Content'Last);
begin
if Current_Last_Char /= Original_Last_Char then
-- correct GNATPP bug (additional LF at end of file)
Write_String_To_File
(Current_Content
(Current_Content'First .. Current_Content'Last - 1),
Filename);
end if;
end;
end;
Remove_Cr_Cr_Lf (Filename);
end Pretty_Print_Sections_Options;
procedure Pretty_Print_Sections (Filename : String) is
begin
Pretty_Print_Sections_Options (Filename, "");
end Pretty_Print_Sections;
procedure Pretty_Print_Sections (Filename : String; Projectname : String) is
begin
Pretty_Print_Sections_Options (Filename, " -P " & Projectname);
end Pretty_Print_Sections;
procedure Remove_Pretty_Print_Flags (Filename : String) is
Contents : constant String := Get_String_From_File (Filename);
New_Contents : constant String :=
Replace_All
(Replace_All
(Replace_All
(Replace_All (Contents, Pretty_Print_On, ""),
Alt_Pretty_Print_On, ""),
Pretty_Print_Off, ""),
Alt_Pretty_Print_Off, "");
begin
Write_String_To_File (New_Contents, Filename);
end Remove_Pretty_Print_Flags;
procedure Enforce_GNATPP_In_Environment;
procedure Enforce_GNATPP_In_Environment is
Command : constant String := "gnatpp --version";
Ret_Val : constant Integer := Sys (To_C (Command));
begin
if Ret_Val /= 0 then
Put_Line
(Standard_Error,
"System call to gnatpp returned " & Ret_Val'Image & ".");
Put_Line
(Standard_Error, "Probably, gnatpp not present on your PATH.");
Put_Line
(Standard_Error,
"Please, install gnatpp using " &
"`alr get --build libadalang_tools`" & " on your PATH");
OS_Exit (99);
end if;
end Enforce_GNATPP_In_Environment;
begin
Enforce_GNATPP_In_Environment;
end Rejuvenation.Pretty_Print;
| 38.962264 | 79 | 0.668765 |
57b4d55387ef926db7d66328040230611c5c8674 | 20,029 | ads | Ada | Validation/pyFrame3DD-master/gcc-master/gcc/ada/stand.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/stand.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | Validation/pyFrame3DD-master/gcc-master/gcc/ada/stand.ads | djamal2727/Main-Bearing-Analytical-Model | 2f00c2219c71be0175c6f4f8f1d4cca231d97096 | [
"Apache-2.0"
] | null | null | null | ------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- S T A N D --
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2020, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package contains the declarations of entities in package Standard,
-- These values are initialized either by calling CStand.Create_Standard,
-- or by calling Stand.Tree_Read.
with Types; use Types;
package Stand is
-- Warning: the entities defined in this package are written out by the
-- Tree_Write routine, and read back in by the Tree_Read routine, so be
-- sure to modify these two routines if you add entities that are not
-- part of Standard_Entity.
type Standard_Entity_Type is (
-- This enumeration type contains an entry for each name in Standard
-- Package names
S_Standard,
S_ASCII,
-- Types and subtypes defined in package Standard (in the order in which
-- they appear in the RM, so that the declarations are in the right
-- order for the purposes of e.g. ASIS traversals
S_Boolean,
S_Short_Short_Integer,
S_Short_Integer,
S_Integer,
S_Long_Integer,
S_Long_Long_Integer,
S_Long_Long_Long_Integer,
S_Natural,
S_Positive,
S_Short_Float,
S_Float,
S_Long_Float,
S_Long_Long_Float,
S_Character,
S_Wide_Character,
S_Wide_Wide_Character,
S_String,
S_Wide_String,
S_Wide_Wide_String,
S_Duration,
-- Enumeration literals for type Boolean
S_False,
S_True,
-- Exceptions declared in package Standard
S_Constraint_Error,
S_Numeric_Error,
S_Program_Error,
S_Storage_Error,
S_Tasking_Error,
-- Binary Operators declared in package Standard
S_Op_Add,
S_Op_And,
S_Op_Concat,
S_Op_Concatw,
S_Op_Concatww,
S_Op_Divide,
S_Op_Eq,
S_Op_Expon,
S_Op_Ge,
S_Op_Gt,
S_Op_Le,
S_Op_Lt,
S_Op_Mod,
S_Op_Multiply,
S_Op_Ne,
S_Op_Or,
S_Op_Rem,
S_Op_Subtract,
S_Op_Xor,
-- Unary operators declared in package Standard
S_Op_Abs,
S_Op_Minus,
S_Op_Not,
S_Op_Plus,
-- Constants defined in package ASCII (with value in hex).
-- First the thirty-two C0 control characters)
S_NUL, -- 16#00#
S_SOH, -- 16#01#
S_STX, -- 16#02#
S_ETX, -- 16#03#
S_EOT, -- 16#04#
S_ENQ, -- 16#05#
S_ACK, -- 16#06#
S_BEL, -- 16#07#
S_BS, -- 16#08#
S_HT, -- 16#09#
S_LF, -- 16#0A#
S_VT, -- 16#0B#
S_FF, -- 16#0C#
S_CR, -- 16#0D#
S_SO, -- 16#0E#
S_SI, -- 16#0F#
S_DLE, -- 16#10#
S_DC1, -- 16#11#
S_DC2, -- 16#12#
S_DC3, -- 16#13#
S_DC4, -- 16#14#
S_NAK, -- 16#15#
S_SYN, -- 16#16#
S_ETB, -- 16#17#
S_CAN, -- 16#18#
S_EM, -- 16#19#
S_SUB, -- 16#1A#
S_ESC, -- 16#1B#
S_FS, -- 16#1C#
S_GS, -- 16#1D#
S_RS, -- 16#1E#
S_US, -- 16#1F#
-- Here are the ones for Colonel Whitaker's O26 keypunch
S_Exclam, -- 16#21#
S_Quotation, -- 16#22#
S_Sharp, -- 16#23#
S_Dollar, -- 16#24#
S_Percent, -- 16#25#
S_Ampersand, -- 16#26#
S_Colon, -- 16#3A#
S_Semicolon, -- 16#3B#
S_Query, -- 16#3F#
S_At_Sign, -- 16#40#
S_L_Bracket, -- 16#5B#
S_Back_Slash, -- 16#5C#
S_R_Bracket, -- 16#5D#
S_Circumflex, -- 16#5E#
S_Underline, -- 16#5F#
S_Grave, -- 16#60#
S_LC_A, -- 16#61#
S_LC_B, -- 16#62#
S_LC_C, -- 16#63#
S_LC_D, -- 16#64#
S_LC_E, -- 16#65#
S_LC_F, -- 16#66#
S_LC_G, -- 16#67#
S_LC_H, -- 16#68#
S_LC_I, -- 16#69#
S_LC_J, -- 16#6A#
S_LC_K, -- 16#6B#
S_LC_L, -- 16#6C#
S_LC_M, -- 16#6D#
S_LC_N, -- 16#6E#
S_LC_O, -- 16#6F#
S_LC_P, -- 16#70#
S_LC_Q, -- 16#71#
S_LC_R, -- 16#72#
S_LC_S, -- 16#73#
S_LC_T, -- 16#74#
S_LC_U, -- 16#75#
S_LC_V, -- 16#76#
S_LC_W, -- 16#77#
S_LC_X, -- 16#78#
S_LC_Y, -- 16#79#
S_LC_Z, -- 16#7A#
S_L_BRACE, -- 16#7B#
S_BAR, -- 16#7C#
S_R_BRACE, -- 16#7D#
S_TILDE, -- 16#7E#
-- And one more control character, all on its own
S_DEL); -- 16#7F#
subtype S_Types is
Standard_Entity_Type range S_Boolean .. S_Duration;
subtype S_Exceptions is
Standard_Entity_Type range S_Constraint_Error .. S_Tasking_Error;
subtype S_ASCII_Names is
Standard_Entity_Type range S_NUL .. S_DEL;
subtype S_Binary_Ops is
Standard_Entity_Type range S_Op_Add .. S_Op_Xor;
subtype S_Unary_Ops is
Standard_Entity_Type range S_Op_Abs .. S_Op_Plus;
type Standard_Entity_Array_Type is array (Standard_Entity_Type) of Node_Id;
Standard_Entity : Standard_Entity_Array_Type;
-- This array contains pointers to the Defining Identifier nodes for each
-- of the visible entities defined in Standard_Entities_Type. The array is
-- initialized by the Create_Standard procedure.
Standard_Package_Node : Node_Id;
-- Points to the N_Package_Declaration node for standard. Also
-- initialized by the Create_Standard procedure.
-- The following Entities are the pointers to the Defining Identifier
-- nodes for some visible entities defined in Standard_Entities_Type.
SE : Standard_Entity_Array_Type renames Standard_Entity;
Standard_Standard : Entity_Id renames SE (S_Standard);
Standard_ASCII : Entity_Id renames SE (S_ASCII);
Standard_Character : Entity_Id renames SE (S_Character);
Standard_Wide_Character : Entity_Id renames SE (S_Wide_Character);
Standard_Wide_Wide_Character : Entity_Id renames SE (S_Wide_Wide_Character);
Standard_String : Entity_Id renames SE (S_String);
Standard_Wide_String : Entity_Id renames SE (S_Wide_String);
Standard_Wide_Wide_String : Entity_Id renames SE (S_Wide_Wide_String);
Standard_Boolean : Entity_Id renames SE (S_Boolean);
Standard_False : Entity_Id renames SE (S_False);
Standard_True : Entity_Id renames SE (S_True);
Standard_Duration : Entity_Id renames SE (S_Duration);
Standard_Natural : Entity_Id renames SE (S_Natural);
Standard_Positive : Entity_Id renames SE (S_Positive);
Standard_Constraint_Error : Entity_Id renames SE (S_Constraint_Error);
Standard_Numeric_Error : Entity_Id renames SE (S_Numeric_Error);
Standard_Program_Error : Entity_Id renames SE (S_Program_Error);
Standard_Storage_Error : Entity_Id renames SE (S_Storage_Error);
Standard_Tasking_Error : Entity_Id renames SE (S_Tasking_Error);
Standard_Short_Float : Entity_Id renames SE (S_Short_Float);
Standard_Float : Entity_Id renames SE (S_Float);
Standard_Long_Float : Entity_Id renames SE (S_Long_Float);
Standard_Long_Long_Float : Entity_Id renames SE (S_Long_Long_Float);
Standard_Short_Short_Integer : Entity_Id renames SE (S_Short_Short_Integer);
Standard_Short_Integer : Entity_Id renames SE (S_Short_Integer);
Standard_Integer : Entity_Id renames SE (S_Integer);
Standard_Long_Integer : Entity_Id renames SE (S_Long_Integer);
Standard_Long_Long_Integer : Entity_Id renames SE (S_Long_Long_Integer);
Standard_Long_Long_Long_Integer : Entity_Id renames
SE (S_Long_Long_Long_Integer);
Standard_Op_Add : Entity_Id renames SE (S_Op_Add);
Standard_Op_And : Entity_Id renames SE (S_Op_And);
Standard_Op_Concat : Entity_Id renames SE (S_Op_Concat);
Standard_Op_Concatw : Entity_Id renames SE (S_Op_Concatw);
Standard_Op_Concatww : Entity_Id renames SE (S_Op_Concatww);
Standard_Op_Divide : Entity_Id renames SE (S_Op_Divide);
Standard_Op_Eq : Entity_Id renames SE (S_Op_Eq);
Standard_Op_Expon : Entity_Id renames SE (S_Op_Expon);
Standard_Op_Ge : Entity_Id renames SE (S_Op_Ge);
Standard_Op_Gt : Entity_Id renames SE (S_Op_Gt);
Standard_Op_Le : Entity_Id renames SE (S_Op_Le);
Standard_Op_Lt : Entity_Id renames SE (S_Op_Lt);
Standard_Op_Mod : Entity_Id renames SE (S_Op_Mod);
Standard_Op_Multiply : Entity_Id renames SE (S_Op_Multiply);
Standard_Op_Ne : Entity_Id renames SE (S_Op_Ne);
Standard_Op_Or : Entity_Id renames SE (S_Op_Or);
Standard_Op_Rem : Entity_Id renames SE (S_Op_Rem);
Standard_Op_Subtract : Entity_Id renames SE (S_Op_Subtract);
Standard_Op_Xor : Entity_Id renames SE (S_Op_Xor);
Standard_Op_Abs : Entity_Id renames SE (S_Op_Abs);
Standard_Op_Minus : Entity_Id renames SE (S_Op_Minus);
Standard_Op_Not : Entity_Id renames SE (S_Op_Not);
Standard_Op_Plus : Entity_Id renames SE (S_Op_Plus);
Last_Standard_Node_Id : Node_Id;
-- Highest Node_Id value used by Standard
Last_Standard_List_Id : List_Id;
-- Highest List_Id value used by Standard (including those used by
-- normal list headers, element list headers, and list elements)
Boolean_Literals : array (Boolean) of Entity_Id;
-- Entities for the two boolean literals, used by the expander
-------------------------------------
-- Semantic Phase Special Entities --
-------------------------------------
-- The semantic phase needs a number of entities for internal processing
-- that are logically at the level of Standard, and hence defined in this
-- package. However, they are never visible to a program, and are not
-- chained on to the Decls list of Standard. The names of all these
-- types are relevant only in certain debugging and error message
-- situations. They have names that are suitable for use in such
-- error messages (see body for actual names used).
Standard_Void_Type : Entity_Id;
-- This is a type used to represent the return type of procedures
Standard_Exception_Type : Entity_Id;
-- This is a type used to represent the Etype of exceptions
Standard_A_String : Entity_Id;
-- An access to String type used for building elements of tables
-- carrying the enumeration literal names.
Standard_A_Char : Entity_Id;
-- Access to character, used as a component of the exception type to denote
-- a thin pointer component.
Standard_Debug_Renaming_Type : Entity_Id;
-- A zero-size subtype of Integer, used as the type of variables used to
-- provide the debugger with name encodings for renaming declarations.
Predefined_Float_Types : Elist_Id;
-- Entities for predefined floating point types. These are used by
-- the semantic phase to select appropriate types for floating point
-- declarations. This list is ordered by preference. All types up to
-- Long_Long_Float_Type are considered for plain "digits N" declarations,
-- while selection of later types requires a range specification and
-- possibly other attributes or pragmas.
-- The entities labeled Any_xxx are used in situations where the full
-- characteristics of an entity are not yet known, e.g. Any_Character
-- is used to label a character literal before resolution is complete.
-- These entities are also used to construct appropriate references in
-- error messages ("expecting an integer type").
Any_Id : Entity_Id;
-- Used to represent some unknown identifier. Used to label undefined
-- identifier references to prevent cascaded errors.
Any_Type : Entity_Id;
-- Used to represent some unknown type. Any_Type is the type of an
-- unresolved operator, and it is the type of a node where a type error
-- has been detected. Any_Type plays an important role in avoiding cascaded
-- errors, because it is compatible with all other types, and is propagated
-- to any expression that has a subexpression of Any_Type. When resolving
-- operators, Any_Type is the initial type of the node before any of its
-- candidate interpretations has been examined. If after examining all of
-- them the type is still Any_Type, the node has no possible interpretation
-- and an error can be emitted (and Any_Type will be propagated upwards).
Any_Access : Entity_Id;
-- Used to resolve the overloaded literal NULL
Any_Array : Entity_Id;
-- Used to represent some unknown array type
Any_Boolean : Entity_Id;
-- The context type of conditions in IF and WHILE statements
Any_Character : Entity_Id;
-- Any_Character is used to label character literals, which in general
-- will not have an explicit declaration (this is true of the predefined
-- character types).
Any_Composite : Entity_Id;
-- The type Any_Composite is used for aggregates before type resolution.
-- It is compatible with any array or non-limited record type.
Any_Discrete : Entity_Id;
-- Used to represent some unknown discrete type
Any_Fixed : Entity_Id;
-- Used to represent some unknown fixed-point type
Any_Integer : Entity_Id;
-- Used to represent some unknown integer type
Any_Modular : Entity_Id;
-- Used to represent the result type of a boolean operation on an integer
-- literal. The result is not Universal_Integer, because it is only legal
-- in a modular context.
Any_Numeric : Entity_Id;
-- Used to represent some unknown numeric type
Any_Real : Entity_Id;
-- Used to represent some unknown real type
Any_Scalar : Entity_Id;
-- Used to represent some unknown scalar type
Any_String : Entity_Id;
-- The type Any_String is used for string literals before type resolution.
-- It corresponds to array (Positive range <>) of character where the
-- component type is compatible with any character type, not just
-- Standard_Character.
Raise_Type : Entity_Id;
-- The type Raise_Type denotes the type of a Raise_Expression. It is
-- compatible with all other types, and must eventually resolve to a
-- concrete type that is imposed by the context.
--
-- Historical note: we used to use Any_Type for this purpose, but the
-- confusion of meanings (Any_Type normally indicates an error) caused
-- difficulties. In particular some needed expansions were skipped since
-- the nodes in question looked like they had an error.
Universal_Integer : Entity_Id;
-- Entity for universal integer type. The bounds of this type correspond
-- to the largest supported integer type (i.e. Long_Long_Integer). It is
-- the type used for runtime calculations in type universal integer.
Universal_Real : Entity_Id;
-- Entity for universal real type. The bounds of this type correspond to
-- to the largest supported real type (i.e. Long_Long_Float). It is the
-- type used for runtime calculations in type universal real. Note that
-- this type is always IEEE format.
Universal_Fixed : Entity_Id;
-- Entity for universal fixed type. This is a type with arbitrary
-- precision that can only appear in a context with a specific type.
-- Universal_Fixed labels the result of multiplication or division of
-- two fixed point numbers, and has no specified bounds (since, unlike
-- universal integer and universal real, it is never used for runtime
-- calculations).
Standard_Integer_8 : Entity_Id;
Standard_Integer_16 : Entity_Id;
Standard_Integer_32 : Entity_Id;
Standard_Integer_64 : Entity_Id;
-- These are signed integer types with the indicated sizes. Used for the
-- underlying implementation types for fixed-point and enumeration types.
Standard_Short_Short_Unsigned : Entity_Id;
Standard_Short_Unsigned : Entity_Id;
Standard_Unsigned : Entity_Id;
Standard_Long_Unsigned : Entity_Id;
Standard_Long_Long_Unsigned : Entity_Id;
-- Unsigned types with same Esize as corresponding signed integer types
Standard_Unsigned_64 : Entity_Id;
-- Entity for an unsigned type mod 2 ** 64, size of 64 bits.
Standard_Address : Entity_Id;
-- Entity for an unsigned type mod 2 ** System_Address_Size, size of
-- System_Address_Size bits. Used for implementing Allow_Integer_Address.
Abort_Signal : Entity_Id;
-- Entity for abort signal exception
Standard_Op_Rotate_Left : Entity_Id;
Standard_Op_Rotate_Right : Entity_Id;
Standard_Op_Shift_Left : Entity_Id;
Standard_Op_Shift_Right : Entity_Id;
Standard_Op_Shift_Right_Arithmetic : Entity_Id;
-- These entities are used for shift operators generated by the expander
end Stand;
| 40.70935 | 79 | 0.606221 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.