]>
Commit | Line | Data |
---|---|---|
1eee94d3 GM |
1 | (* M2CaseList.def implement ISO case label lists. |
2 | ||
83ffe9cd | 3 | Copyright (C) 2009-2023 Free Software Foundation, Inc. |
1eee94d3 GM |
4 | Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>. |
5 | ||
6 | This file is part of GNU Modula-2. | |
7 | ||
8 | GNU Modula-2 is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 3, or (at your option) | |
11 | any later version. | |
12 | ||
13 | GNU Modula-2 is distributed in the hope that it will be useful, but | |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 | General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
19 | along with GNU Modula-2; see the file COPYING3. If not see | |
20 | <http://www.gnu.org/licenses/>. *) | |
21 | ||
22 | DEFINITION MODULE M2CaseList ; | |
23 | ||
24 | (* | |
25 | Title : M2CaseList | |
26 | Author : Gaius Mulley | |
27 | System : GNU Modula-2 | |
28 | Date : Fri Jul 24 09:53:48 2009 | |
29 | Revision : $Version$ | |
30 | Description: | |
31 | *) | |
32 | ||
33 | FROM DynamicStrings IMPORT String ; | |
34 | FROM Lists IMPORT List ; | |
35 | ||
36 | ||
37 | (* | |
38 | PushCase - create a case entity and push it to an internal stack. | |
39 | Return the case id. | |
40 | *) | |
41 | ||
42 | PROCEDURE PushCase (r: CARDINAL; v: CARDINAL) : CARDINAL ; | |
43 | ||
44 | ||
45 | (* | |
46 | PopCase - pop the top element of the case entity from the internal | |
47 | stack. | |
48 | *) | |
49 | ||
50 | PROCEDURE PopCase ; | |
51 | ||
52 | ||
53 | (* | |
54 | ElseCase - indicates that this case varient does have an else clause. | |
55 | *) | |
56 | ||
57 | PROCEDURE ElseCase (f: CARDINAL) ; | |
58 | ||
59 | ||
60 | (* | |
61 | BeginCaseList - create a new label list. | |
62 | *) | |
63 | ||
64 | PROCEDURE BeginCaseList (v: CARDINAL) ; | |
65 | ||
66 | ||
67 | (* | |
68 | EndCaseList - terminate the current label list. | |
69 | *) | |
70 | ||
71 | PROCEDURE EndCaseList ; | |
72 | ||
73 | ||
74 | (* | |
75 | AddRange - add a range to the current label list. | |
76 | *) | |
77 | ||
78 | PROCEDURE AddRange (r1, r2: CARDINAL; tok: CARDINAL) ; | |
79 | ||
80 | ||
81 | (* | |
82 | CaseBoundsResolved - returns TRUE if all constants in the case list, c, | |
83 | are known to GCC. | |
84 | *) | |
85 | ||
86 | PROCEDURE CaseBoundsResolved (tokenno: CARDINAL; c: CARDINAL) : BOOLEAN ; | |
87 | ||
88 | ||
89 | (* | |
90 | TypeCaseBounds - returns TRUE if all bounds in case list, c, are | |
91 | compatible with the tagged type. | |
92 | *) | |
93 | ||
94 | PROCEDURE TypeCaseBounds (c: CARDINAL) : BOOLEAN ; | |
95 | ||
96 | ||
97 | (* | |
98 | OverlappingCaseBounds - returns TRUE if there were any overlapping bounds | |
99 | in the case list, c. It will generate an error | |
100 | messages for each overlapping bound found. | |
101 | *) | |
102 | ||
103 | PROCEDURE OverlappingCaseBounds (c: CARDINAL) : BOOLEAN ; | |
104 | ||
105 | ||
106 | (* | |
107 | MissingCaseBounds - returns TRUE if there were any missing bounds | |
108 | in the varient record case list, c. It will | |
109 | generate an error message for each missing | |
110 | bounds found. | |
111 | *) | |
112 | ||
113 | PROCEDURE MissingCaseBounds (tokenno: CARDINAL; c: CARDINAL) : BOOLEAN ; | |
114 | ||
115 | ||
116 | (* | |
117 | WriteCase - displays the case list. | |
118 | *) | |
119 | ||
120 | PROCEDURE WriteCase (c: CARDINAL) ; | |
121 | ||
122 | ||
123 | END M2CaseList. |