Title: Ada-95
1 Ada-95
- Ada-95 programming language fundamentals
- Ada-95 source codes
- Ada-95 Information Resources
- dr. salih yurttas computer science
2Ada-95 Sources for Programming Language
Fundamentals
- program units and overall structure
- flow of control
- data types
- type extension
3program units and overall structure
- Search-Sort
- MinMax
- ProgUnits
4program units and overall structure
5Search Algorithms
- Linear Search
- Binary Search
- LinearBinary Search
6Linear Search
- Linear Search - Integer
- Linear Search - Float
- Linear Search - Generic
7Linear Search -Integer
- 00
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
8Linear Search -Float
- 00
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
9Linear Search - Generic
10program units and overall structure
- linear_search_element_00.adb
- common_type_parameters_p.ads
- linear_search_element_p.ads
- linear_search_element_p.adb
- io_integer_p.ads
- io_integer_p.adb
- d-unsorted-integer
11program units and overall structure
- linear_search_element_01.adb
- common_type_parameters_p.ads
- linear_search_element_p.ads
- linear_search_element_p.adb
- io_float_p.ads
- io_float_p.adb
- d-unsorted-float
12program units and overall structure
- linear_search_element_02.adb
- common_type_parameters_p.ads
- i_choice_p.ads
- i_choice_p.adb
- linear_search_element_p.ads
- linear_search_element_p.adb
- io_integer_p.ads
- io_integer_p.adb
- io_float_p.ads
- io_float_p.adb
- d-unsorted-integer
- d-unsorted-float
13program units and overall structure
- linear_search_element_03.adb
- common_type_parameters_p.ads
- i_choice_p.ads
- i_choice_p.adb
- linear_search_element_p.ads
- linear_search_element_p.adb
- io_integer_p.ads
- io_integer_p.adb
- io_float_p.ads
- io_float_p.adb
- d-unsorted-integer
- d-unsorted-float
14program units and overall structure
- linear_search_element_04.adb
- common_type_parameters_p.ads
- i_choice_p.ads
- i_choice_p.adb
- linear_search_element_p.ads
- linear_search_element_p.adb
- io_integer_p.ads
- io_integer_p.adb
- io_float_p.ads
- io_float_p.adb
- d-unsorted-integer
- d-unsorted-float
15Binary Search
- Binary Search - Integer
- Binary Search - Float
- Binary Search - Generic
16Binary Search - Integer
- binary_search_integer_08.adb
- common_type_parameters_p.ads
- io_integer_p.ads
- io_integer_p.adb
- binary_search_integer_p.ads
- binary_search_integer_p.adb
- d-sorted-integer
17Binary Search - Float
- binary_search_float_08.adb
- common_type_parameters_p.ads
- io_float_p.ads
- io_float_p.adb
- binary_search_float_p.ads
- binary_search_float_p.adb
- d-sorted-float
18Binary Search - Generic
19program units and overall structure
- binary_search_element_00.adb
- common_type_parameters_p.ads
- binary_search_element_p.ads
- binary_search_element_p.adb
- io_integer_p.ads
- io_integer_p.adb
- d-sorted-integer
20program units and overall structure
- binary_search_element_01.adb
- common_type_parameters_p.ads
- binary_search_element_p.ads
- binary_search_element_p.adb
- io_float_p.ads
- io_float_p.adb
- d-sorted-float
21program units and overall structure
- binary_search_element_02.adb
- common_type_parameters_p.ads
- i_choice_p.ads
- i_choice_p.adb
- binary_search_element_p.ads
- binary_search_element_p.adb
- io_integer_p.ads
- io_integer_p.adb
- io_float_p.ads
- io_float_p.adb
- d-unsorted-integer
- d-unsorted-float
22program units and overall structure
- binary_search_element_03.adb
- common_type_parameters_p.ads
- i_choice_p.ads
- i_choice_p.adb
- binary_search_element_p.ads
- binary_search_element_p.adb
- io_integer_p.ads
- io_integer_p.adb
- io_float_p.ads
- io_float_p.adb
- d-sorted-integer
- d-sorted-float
23program units and overall structure
- binary_search_element_04.adb
- common_type_parameters_p.ads
- i_choice_p.ads
- i_choice_p.adb
- binary_search_element_p.ads
- binary_search_element_p.adb
- io_integer_p.ads
- io_integer_p.adb
- io_float_p.ads
- io_float_p.adb
- d-sorted-integer
- d-sorted-float
24Linear-Binary Search
- Linear-Binary Search - Integer
- Linear-Binary Search - Float
- Linear-Binary Search - Generic
25Linear-Binary Search - Integer
26Linear-Binary Search Integer
- search_integer_00.adb
- common_type_parameters_p.ads
- io_integer_p.ads
- io_integer_p.adb
- search_integer_p.ads
- search_integer_p.adb
- d-unsorted-integer
- d-sorted-integer
27Linear-Binary Search - Integer
- search_integer_01.adb
- common_type_parameters_p.ads
- io_integer_p.ads
- io_integer_p.adb
- search_integer_p.ads
- search_integer_p.adb
- d-unsorted-integer
- d-sorted-integer
28Linear-Binary Search - Integer
- search_integer_02.adb
- common_type_parameters_p.ads
- io_integer_p.ads
- io_integer_p.adb
- search_integer_p.ads
- search_integer_p.adb
- d-unsorted-integer
- d-sorted-integer
29Linear-Binary Search - Integer
- search_integer_03.adb
- common_type_parameters_p.ads
- io_integer_p.ads
- io_integer_p.adb
- search_integer_p.ads
- search_integer_p.adb
- d-unsorted-integer
- d-sorted-integer
30Linear-Binary Search - Float
31Linear-Binary Search - Float
- search_float_00.adb
- common_type_parameters_p.ads
- io_float_p.ads
- io_float_p.adb
- search_float_p.ads
- search_float_p.adb
- d-unsorted-float
- d-sorted-float
32Linear-Binary Search - Float
- search_float_01.adb
- common_type_parameters_p.ads
- io_float_p.ads
- io_float_p.adb
- search_float_p.ads
- search_float_p.adb
- d-unsorted-float
- d-sorted-float
33Linear-Binary Search - Float
- search_float_02.adb
- common_type_parameters_p.ads
- io_float_p.ads
- io_float_p.adb
- search_float_p.ads
- search_float_p.adb
- d-unsorted-float
- d-sorted-float
34Linear-Binary Search - Float
- search_float_03.adb
- common_type_parameters_p.ads
- io_float_p.ads
- io_float_p.adb
- search_float_p.ads
- search_float_p.adb
- d-unsorted-float
- d-sorted-float
35Linear-Binary Search - Generic
36Linear-Binary Search - Generic
- search_element_00.adb
- common_type_parameters_p.ads
- io_integer_p.ads
- io_integer_p.adb
- search_element_p.ads
- search_element_p.adb
- d-unsorted-integer
- d-sorted-integer
37Linear-Binary Search - Generic
- search_element_01.adb
- common_type_parameters_p.ads
- io_float_p.ads
- io_float_p.adb
- search_element_p.ads
- search_element_p.adb
- d-unsorted-float
- d-sorted-float
38Linear-Binary Search - Generic
- search_element_02.adb
- common_type_parameters_p.ads
- io_integer_p.ads
- io_integer_p.adb
- io_float_p.ads
- io_float_p.adb
- search_element_p.ads
- search_element_p.adb
- d-unsorted-integer
- d-sorted-integer
- d-unsorted-float
- d-sorted-float
39Linear-Binary Search - Generic
- search_element_03.adb
- common_type_parameters_p.ads
- io_integer_p.ads
- io_integer_p.adb
- io_float_p.ads
- io_float_p.adb
- search_element_p.ads
- search_element_p.adb
- d-unsorted-integer
- d-sorted-integer
- d-unsorted-float
- d-sorted-float
40Linear-Binary Search - Generic
- search_element_04.adb
- common_type_parameters_p.ads
- io_integer_p.ads
- io_integer_p.adb
- io_float_p.ads
- io_float_p.adb
- search_element_p.ads
- search_element_p.adb
- d-unsorted-integer
- d-sorted-integer
- d-unsorted-float
- d-sorted-float
41Sort Algorithms
- BubbleSort
- InsertionSort
- QuickSort
- SelectionSort
- Generic Sort Package
42BubbleSort
- BubbleSort - Integer
- BubbleSort - Float
- BubbleSort - Generic
43BubbleSort - Integer
44BubbleSort - Integer
- bubblesort_asc_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- bubblesort_asc_integer_p.ads
- bubblesort_asc_integer_p.adb
45BubbleSort - Integer
- bubblesort_des_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- bubblesort_des_integer_p.ads
- bubblesort_des_integer_p.adb
46BubbleSort - Float
47BubbleSort - Float
- bubblesort_asc_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- bubblesort_asc_float_p.ads
- bubblesort_asc_float_p.adb
48BubbleSort - Float
- bubblesort_des_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- bubblesort_des_float_p.ads
- bubblesort_des_float_p.adb
49BubbleSort - generic
- 00
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
50BubbleSort - generic
- bubblesort_asc_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- bubblesort_asc_des_element_p.ads
- bubblesort_asc_des_element_p.adb
51BubbleSort - generic
- bubblesort_des_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- bubblesort_asc_des_element_p.ads
- bubblesort_asc_des_element_p.adb
52BubbleSort - generic
- bubblesort_asc_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- bubblesort_asc_des_element_p.ads
- bubblesort_asc_des_element_p.adb
53BubbleSort - generic
- bubblesort_des_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- bubblesort_asc_des_element_p.ads
- bubblesort_asc_des_element_p.adb
54BubbleSort - generic
- bubblesort_asc_des_integer_00.adb
bubblesort_asc_des_integer_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- bubblesort_asc_des_element_p.ads
- bubblesort_asc_des_element_p.adb
55BubbleSort - generic
- bubblesort_asc_des_float_00.adb
bubblesort_asc_des_float_01.adb - common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- bubblesort_asc_des_element_p.ads
- bubblesort_asc_des_element_p.adb
56BubbleSort - generic
- bubblesort_asc_integer_float_00.adb
bubblesort_asc_integer_float_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- bubblesort_asc_des_element_p.ads
- bubblesort_asc_des_element_p.adb
57BubbleSort - generic
- bubblesort_des_integer_float_00.adb
bubblesort_asc_integer_float_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- bubblesort_asc_des_element_p.ads
- bubblesort_asc_des_element_p.adb
58BubbleSort - generic
- bubblesort_asc_des_integer_float_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- bubblesort_asc_des_element_p.ads
- bubblesort_asc_des_element_p.adb
59InsertionSort
- InsertionSort - Integer
- InsertionSort - Float
- InsertionSort - Generic
60Insertion Sort - Integer
61Insertion Sort - Integer
- insertionsort_asc_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- insertionsort_asc_integer_p.ads
- insertionsort_asc_integer_p.adb
62Insertion Sort - Integer
- insertionsort_des_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- insertionsort_des_integer_p.ads
- insertionsort_des_integer_p.adb
63Insertion Sort - Float
64Insertion Sort - Float
- insertionsort_asc_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- insertionsort_asc_float_p.ads
- insertionsort_asc_float_p.adb
65Insertion Sort - Float
- insertionsort_des_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- insertionsort_des_float_p.ads
- insertionsort_des_float_p.adb
66Insertion Sort - generic
- 00
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
67Insertion Sort - generic
- insertionsort_asc_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- insertionsort_asc_des_element_p.ads
- insertionsort_asc_des_element_p.adb
68Insertion Sort - generic
- insertionsort_des_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- insertionsort_asc_des_element_p.ads
- insertionsort_asc_des_element_p.adb
69Insertion Sort - generic
- insertionsort_asc_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- insertionsort_asc_des_element_p.ads
- insertionsort_asc_des_element_p.adb
70Insertion Sort - generic
- insertionsort_des_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- insertionsort_asc_des_element_p.ads
- insertionsort_asc_des_element_p.adb
71Insertion Sort - generic
- insertionsort_asc_des_integer_00.adb
insertionsort_asc_des_integer_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- insertionsort_asc_des_element_p.ads
- insertionsort_asc_des_element_p.adb
72Insertion Sort - generic
- insertionsort_asc_des_float_00.adb
insertionsort_asc_des_float_01.adb - common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- insertionsort_asc_des_element_p.ads
- insertionsort_asc_des_element_p.adb
73Insertion Sort - generic
- insertionsort_asc_integer_float_00.adb
insertionsort_asc_integer_float_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- insertionsort_asc_des_element_p.ads
- insertionsort_asc_des_element_p.adb
74Insertion Sort - generic
- insertionsort_des_integer_float_00.adb
insertionsort_asc_integer_float_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- insertionsort_asc_des_element_p.ads
- insertionsort_asc_des_element_p.adb
75Insertion Sort - generic
- insertionsort_asc_des_integer_float_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- insertionsort_asc_des_element_p.ads
- insertionsort_asc_des_element_p.adb
76QuickSort
- QuickSort - Integer
- QuickSort - Float
- QuickSort - Generic
77Quick Sort - Integer
78Quick Sort - Integer
- quicksort_asc_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- quicksort_asc_integer_p.ads
- quicksort_asc_integer_p.adb
79Quick Sort - Integer
- quicksort_asc_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- quicksort_asc_integer_p.ads
- quicksort_asc_integer_p.adb
80Quick Sort Float
81Quick Sort Float
- quicksort_asc_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- quicksort_asc_float_p.ads
- quicksort_asc_float_p.adb
82Quick Sort Float
- quicksort_asc_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- quicksort_asc_float_p.ads
- quicksort_asc_float_p.adb
83Quick Sort - Generic
- 00
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
84Quick Sort - Generic
- quicksort_asc_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- quicksort_asc_des_element_p.ads
- quicksort_asc_des_element_p.adb
85Quick Sort - Generic
- quicksort_des_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- quicksort_asc_des_element_p.ads
- quicksort_asc_des_element_p.adb
86Quick Sort - Generic
- quicksort_asc_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- quicksort_asc_des_element_p.ads
- quicksort_asc_des_element_p.adb
87Quick Sort - Generic
- quicksort_des_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- quicksort_asc_des_element_p.ads
- quicksort_asc_des_element_p.adb
88Quick Sort - Generic
- quicksort_asc_des_integer_00.adb
quicksort_asc_des_integer_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- quicksort_asc_des_element_p.ads
- quicksort_asc_des_element_p.adb
89Quick Sort - Generic
- quicksort_asc_des_float_00.adb
quicksort_asc_des_float_01.adb - common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- quicksort_asc_des_element_p.ads
- quicksort_asc_des_element_p.adb
90Quick Sort - Generic
- quicksort_asc_integer_float_00.adb
quicksort_asc_integer_float_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- quicksort_asc_des_element_p.ads
- quicksort_asc_des_element_p.adb
91Quick Sort - Generic
- quicksort_des_integer_float_00.adb
quicksort_asc_integer_float_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- quicksort_asc_des_element_p.ads
- quicksort_asc_des_element_p.adb
92Quick Sort - Generic
- quicksort_asc_des_integer_float_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- quicksort_asc_des_element_p.ads
- quicksort_asc_des_element_p.adb
93SelectionSort
- SelectionSort - Integer
- SelectionSort - Float
- SelectionSort - Generic
94Selection Sort - Integer
95Selection Sort - Integer
- selectionsort_asc_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- selectionsort_asc_integer_p.ads
- selectionsort_asc_integer_p.adb
96Selection Sort - Integer
- selectionsort_des_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- selectionsort_des_integer_p.ads
- selectionsort_des_integer_p.adb
97Selection Sort - float
98Selection Sort - float
- selectionsort_asc_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- selectionsort_asc_float_p.ads
- selectionsort_asc_float_p.adb
99Selection Sort - float
- selectionsort_des_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- selectionsort_des_float_p.ads
- selectionsort_des_float_p.adb
100Selection Sort - generic
- 00
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
101Selection Sort - generic
- selectionsort_asc_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- selectionsort_asc_des_element_p.ads
- selectionsort_asc_des_element_p.adb
102Selection Sort - generic
- selectionsort_des_integer_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- selectionsort_asc_des_element_p.ads
- selectionsort_asc_des_element_p.adb
103Selection Sort - generic
- selectionsort_asc_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- selectionsort_asc_des_element_p.ads
- selectionsort_asc_des_element_p.adb
104Selection Sort - generic
- selectionsort_des_float_00.adb
- common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- selectionsort_asc_des_element_p.ads
- selectionsort_asc_des_element_p.adb
105Selection Sort - generic
- selectionsort_asc_des_integer_00.adb
selectionsort_asc_des_integer_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- selectionsort_asc_des_element_p.ads
- selectionsort_asc_des_element_p.adb
106Selection Sort - generic
- selectionsort_asc_des_float_00.adb
selectionsort_asc_des_float_01.adb - common_type_parameters_p.ads
- io_list_float_p.ads
- io_list_float_p.adb
- selectionsort_asc_des_element_p.ads
- selectionsort_asc_des_element_p.adb
107Selection Sort - generic
- selectionsort_asc_integer_float_00.adb
selectionsort_asc_integer_float_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- selectionsort_asc_des_element_p.ads
- selectionsort_asc_des_element_p.adb
108Selection Sort - generic
- selectionsort_des_integer_float_00.adb
selectionsort_asc_integer_float_01.adb - common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- selectionsort_asc_des_element_p.ads
- selectionsort_asc_des_element_p.adb
109Selection Sort - generic
- selectionsort_asc_des_integer_float_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- selectionsort_asc_des_element_p.ads
- selectionsort_asc_des_element_p.adb
110Generic Sort Package
- sort package with generic BubbleSort
InsertionSort QuickSort SelectionSort
procedures - generic sort package with BubbleSort
InsertionSort QuickSort SelectionSort
procedures
111Generic Sort Package
- bubblesort_asc_des_integer_float_00.adb
- insertionsort_asc_des_integer_float_00.adb
- quicksort_asc_des_integer_float_00.adb
- selectionsort_asc_des_integer_float_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- sort_asc_des_element_p.ads
- sort_asc_des_element_p.adb
112Generic Sort Package
- bubblesort_asc_des_integer_float_00.adb
- insertionsort_asc_des_integer_float_00.adb
- quicksort_asc_des_integer_float_00.adb
- selectionsort_asc_des_integer_float_00.adb
- common_type_parameters_p.ads
- io_list_integer_p.ads
- io_list_integer_p.adb
- io_list_float_p.ads
- io_list_float_p.adb
- sort_asc_des_element_p.ads
- sort_asc_des_element_p.adb
113Search-Sort Algorithms
- generic Search and generic Sort packages
- generic Search-Sort package
114Search-Sort Algorithms
- search_sort_00.adb
- common_type_parameters_p.ads
- i_choice_p.ads
- i_choice_p.adb
- io_integer_p.ads
- io_integer_p.adb
- io_float_p.ads
- io_float_p.adb
- search_p.ads
- search_p.adb
- sort_p.ads
- sort_p.adb
- d-unsorted-integer
- d-sorted-integer
- d-unsorted-float
- d-sorted-float
115ProgUnits
116 Type extension
- Hierarchical Packages
- Extended Data Types
- OO with Ada-95
117Hierarchical Packages
- sy.ads
- sy-a_p.ads
- sy-a_p.adb
- sy-a_p-aa_p.ads
- sy-a_p-aa_p.adb
- sy-b_p.ads
- sy-b_p.adb
- a_00.adb
- aa_00.adb
- b_00.adb
- ab_00.adb
118Extended Data Types
- shapes_00.adb
- shapes_p.ads
- shapes_p.adb
- object_p.ads
- object_p.adb
119Ada-95 programming language fundamentals
- program units and overall structure
- a. physical design, logical design.
- procedure, package, generic units, task,
protected objects. - separation of units specification, body.
- the standard libraries annexes.
- b. reference manual ,
- gnatpath environment set-up for solaris.
- editing source text, compilation, execution.
- ada-83, ada-95 gnat
120Ada-95 programming language fundamentals
- flow of control
- a. statements.
- sequence
- decision
- repetition
- b. block.
- declare
- c. subprograms.
- procedure/function
- separate, nested
- d. exceptions
- e. tasking
121Ada-95 programming language fundamentals
- 3. data types
- a. type hierarchy
- elementary types
- composite types arrays, records discriminants
- enumeration type
- numeric types
- access type
- private type
- b. task type
122Ada-95 programming language fundamentals
- 4. type extension
- tagged records
- class wide types and operations
- abstractions and multiple implementations
- hierarchical packages parent/child hierarchy
123Ada-95 programming language fundamentals
- a. physical design, logical design.
- procedure, package, generic units, task,
protected objects. - separation of units specification, body.
- the standard libraries annexes.
- b. reference manual ,
- gnatpath environment set-up for solaris.
- editing source text, compilation, execution.
- ada-83, ada-95 gnat
124program units and overall structure
- Every application program in Ada-95 is, at least,
one identified procedure. - procedure Something is
- - - declarations/definitions/instantiations
- begin
- null - - replaced by the algorithmic
sequence. - end Something
125program units and overall structure
- Each and every application program in Ada-95 is,
at least, one identified procedure and possibly
several abstracted procedures with packages. - - -date January 1, 2000.
- - - author Salih Yurttas.
- - - purpose computation of the minimum of a
given integer list. - - - minni.adb
- with Minimum_of_N_Integers_P use
Minimum_of_N_Integers_P
126program units and overall structure
- procedure Minimum_of_N_Integers is
- Max_Size constant Integer 16
- Data_Count, Minimum_Found, Minimum_Index
Integer - Data Integer_List(1..Max_Size)
- begin
- - - input the list of elements, and
- - - count for the number of elements in the
given list - Get_Integer_List(Data_Count, Data)
- - - compute the minimum of Data_CountltMax_Siz
e integers. - Find_Min_of_Integer_List(Minimum_Found,
Minimum_Index, Data_Count, Data) - - - output the minimum found.
- Put_Minimum_of_Integer_List(Minimum_Found,
Minimum_Index) - end Minimum_of_N_Integers
127program units and overall structure
- package unit is composed of two parts
specification and body as follows - - - date January 1, 2000.
- - author Salih Yurttas.
- - package specification
- - - minni_p.ads
- with Text_IO use Text_IO
128program units and overall structure
- package Minimum_of_N_Integers_P is
- type Integer_List is array(Integer range ltgt) of
Integer - procedure Get_Integer_List(K out Integer D
out Integer_List) - procedure Find_Minimum_of_Integer_List(Min, J
out Integer K in Integer D in
Integer_List) - procedure Put_Minimum_of_Integer_List(Min, J
in Integer) - end Minimum_of_N_Integers_P
129program units and overall structure
- -- -- date January 1, 2000.
- -- author Salih Yurttas.
- -- package body
- -- -- minni_p.adb
- package body Minimum_of_N_Integers_P is
- package Int_IO is new Integer_IO(Integer)
- use Int_IO
130program units and overall structure
- procedure Get_Integer_List(K out Integer D
out Integer_List) is - In_File_P File_Type
- I Integer 0
- begin
- Open(In_File_P, In_File, "in.txt")
- while not End_of_File(In_File_P)
- loop
- I I 1
- Get(In_File_P, D(I))
- end loop
- K I
- Close(In_File_P)
- end Get_Integer_List
131program units and overall structure
- M Integer
- begin
- M D(1)
- J 1
- for I in 2..K
- loop
- if D(I)then
- M D(I)
- J I
- end if
- end loop
- Min M
- end Find_Minimum_of_Integer_List
132program units and overall structure
- procedure Put_Minimum_of_Integer_List(Min, J in
Integer) is - Out_File_P File_Type
- begin
- Create(Out_File_P, Out_File, "out.txt")
- Put(Out_File_P,"D(")
- Put(Out_File_P,J,1)
- Put(Out_File_P,") ")
- Put(Out_File_P,Min,5)
- Put(Out_File_P," is the minimum of the
list.") - Close(Out_File_P)
- end Put_Minimum_of_Integer_List
- end Minimum_of_N_Integers_P
133gnat - Set-up documentation for Ada-95 on a
Solaris machine.
- copy gnatpath into your .login file, so that,
set path ( /share/gnat/3.13p/bin path )
automatically sets up your environment variables
and give access to gnat resources each time you
login. (copy is done for once for the entire
semester!) - You need to structure your working directories,
i.e. "mkdir ADA" and keep all your Ada work
hidden in subdirectories of your "ADA" directory.
134gnat - Set-up documentation for Ada-95 on a
Solaris machine.
- Assuming that your environment is set-up
correctly, then compilation and linkage can be
done with the gnatmake utility as follows - gnatmake filename
- source code for ada procedure should be named as
filename.adb For execution, all you need to type
in is "filename" of executable that is used in
gnatmake filename. - For detailed information
- GNAT Reference Manual
- GNAT User's Guide
- Using GNU CC
- Debugging with GDB - Source Level debugger
- Using the Graphical Interface to GDB
135using gnat resources for source code editing,
compilation/linkage, and execution
- editing - use vi/vim or emacs, or any simpler,
available editor. separate/individual procedure
textfiles should be named by ada-95 conventions
as filename.adb. you will be given main
procedures usually with numbering like
filename_00.adb. packages are either as
filename_p.ads for spec and filename_p.adb for
body in two separate/individual textfiles, or
filename_p.ads for spec only in one textfile.
136using gnat resources for source code editing,
compilation/linkage, and execution
- compiling -
- gnatmake filename (assuming main procedure is in
a textfile filename.adb) This is compile and
link to get an executable named filename - gcc -c filename.adb (assuming main procedure is
in a textfile filename.adb) This is compile
only and you need to link the compilation results
to get an executable by gnatbl filename as
filename - gcc -c filename_p.adb gcc -c filename.adb
(assuming main procedure is in a textfile
filename.adb using a package in a textfile
filename_p.adb ) the order of compilation is
irrelevant, i.e., in any order. This is
separate, individual compilation and you need to
link the compilation results to get an executable
by gnatbl filename as filename
137using gnat resources for source code editing,
compilation/linkage, and execution
- executing - filename (assuming
compilation/linkage produced an executable.) - For detailed information
- GNAT Reference Manual
- GNAT User's Guide
- Using GNU CC
- Debugging with GDB - Source Level debugger
- Using the Graphical Interface to GDB
138program units and overall structure
- Ada-95 is case-insensitive and free-formatted
language for source text. - procedureProcedurePROCEDUREare all
identical to Ada-95 compiler. - procedure Something is
- -- declarations/definitions/instantiations
- begin
- null -- replaced by the algorithmic
sequence. - end Something
- reserved keywords, standard identifiers, and
user-defined identifiers are coded differently as
a style convention.
139Ada reserved words (Ada-95)
- abort declare goto
others select - abs delay
out separate - abstract delta if
subtype - accept digits in
package - access do is
pragma tagged - aliased
private task - all else limited
procedure terminate - and elsif loop
protected then - array end
type - at entry mod
raise - exception
range until - exit new
record use - begin not
rem - Body for null
renames when - function
requeue while - case of
return with - constant generic or
reverse xor
140Ada-95
- Ada-95 Language Reference Manual Ada-95
Rationale - AdaCore - GNAT
- Ada Books
- ACM SIGAda