Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/ada/acats/tests/cb/cb40a030.a @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 -- CB40A030.A | |
2 -- | |
3 -- Grant of Unlimited Rights | |
4 -- | |
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687, | |
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained | |
7 -- unlimited rights in the software and documentation contained herein. | |
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making | |
9 -- this public release, the Government intends to confer upon all | |
10 -- recipients unlimited rights equal to those held by the Government. | |
11 -- These rights include rights to use, duplicate, release or disclose the | |
12 -- released technical data and computer software in whole or in part, in | |
13 -- any manner and for any purpose whatsoever, and to have or permit others | |
14 -- to do so. | |
15 -- | |
16 -- DISCLAIMER | |
17 -- | |
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR | |
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED | |
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE | |
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE | |
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A | |
23 -- PARTICULAR PURPOSE OF SAID MATERIAL. | |
24 --* | |
25 -- | |
26 -- OBJECTIVE: | |
27 -- See CB40A031.AM. | |
28 -- | |
29 -- TEST DESCRIPTION: | |
30 -- See CB40A031.AM. | |
31 -- | |
32 -- TEST FILES: | |
33 -- This test consists of the following files: | |
34 -- | |
35 -- FB40A00.A | |
36 -- => CB40A030.A | |
37 -- CB40A031.AM | |
38 -- | |
39 -- | |
40 -- CHANGE HISTORY: | |
41 -- 06 Dec 94 SAIC ACVC 2.0 | |
42 -- 02 Nov 96 SAIC ACVC 2.1: Modified prologue. | |
43 -- | |
44 --! | |
45 | |
46 | |
47 package FB40A00.CB40A030_0 is -- package Text_Parser.Character_Counting | |
48 | |
49 function Count_AlphaNumerics (Text : in String) return Natural; | |
50 | |
51 end FB40A00.CB40A030_0; | |
52 | |
53 | |
54 --=================================================================-- | |
55 | |
56 | |
57 private package FB40A00.CB40A030_1 is -- package Text_Parser.Processing | |
58 | |
59 procedure Process_Text (Text : in String); | |
60 | |
61 end FB40A00.CB40A030_1; | |
62 | |
63 | |
64 --=================================================================-- | |
65 | |
66 | |
67 package body FB40A00.CB40A030_1 is | |
68 | |
69 procedure Process_Text (Text : in String) is | |
70 Loop_Count : Integer := Text'Length + 1; | |
71 begin | |
72 for Pos in 1..Loop_Count loop -- Process string, force the | |
73 -- raise of Constraint_Error. | |
74 if (Text (Pos) in 'a'..'z') or | |
75 (Text (Pos) in 'A'..'Z') or | |
76 (Text (Pos) in '0'..'9') then | |
77 Increment_AlphaNumeric_Count; | |
78 else | |
79 Increment_Non_AlphaNumeric_Count; | |
80 end if; | |
81 | |
82 end loop; | |
83 -- No exception handler here, exception propagates. | |
84 end Process_Text; | |
85 | |
86 end FB40A00.CB40A030_1; | |
87 | |
88 | |
89 --=================================================================-- | |
90 | |
91 | |
92 with FB40A00.CB40A030_1; -- private sibling package Text_Parser.Processing; | |
93 | |
94 package body FB40A00.CB40A030_0 is | |
95 | |
96 function Count_AlphaNumerics (Text : in String) return Natural is | |
97 begin | |
98 FB40A00.CB40A030_1.Process_Text (Text); -- Call proc in prvt child | |
99 -- package that is a | |
100 -- sibling of this package. | |
101 return (AlphaNumeric_Count); | |
102 -- No exception handler here, exception propagates. | |
103 end Count_AlphaNumerics; | |
104 | |
105 end FB40A00.CB40A030_0; |