]>
Commit | Line | Data |
---|---|---|
1eee94d3 GM |
1 | (* M2Check.def perform rigerous type checking for fully declared symbols. |
2 | ||
83ffe9cd | 3 | Copyright (C) 2020-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 M2Check ; | |
23 | ||
24 | (* | |
25 | Title : M2Check | |
26 | Author : Gaius Mulley | |
27 | System : GNU Modula-2 | |
28 | Date : Fri Mar 6 15:32:10 2020 | |
29 | Revision : $Version$ | |
30 | Description: provides a module to check the symbol type compatibility. | |
31 | It assumes that the declaration of all dependants | |
32 | is complete. | |
33 | *) | |
34 | ||
35 | ||
36 | (* | |
37 | ParameterTypeCompatible - returns TRUE if the nth procedure parameter formal | |
38 | is compatible with actual. If the string is empty then | |
39 | no error is issued. | |
40 | *) | |
41 | ||
42 | PROCEDURE ParameterTypeCompatible (token: CARDINAL; format: ARRAY OF CHAR; | |
43 | procedure, formal, actual, nth: CARDINAL; | |
44 | isvar: BOOLEAN) : BOOLEAN ; | |
45 | ||
46 | ||
47 | (* | |
48 | AssignmentTypeCompatible - returns TRUE if the des and the expr are assignment compatible. | |
49 | If the string is empty then no error is issued. | |
50 | *) | |
51 | ||
52 | PROCEDURE AssignmentTypeCompatible (token: CARDINAL; format: ARRAY OF CHAR; | |
53 | des, expr: CARDINAL) : BOOLEAN ; | |
54 | ||
55 | ||
56 | (* | |
57 | ExpressionTypeCompatible - returns TRUE if the expressions, left and right, | |
58 | are expression compatible. | |
59 | If the string is empty then no error is issued. | |
60 | *) | |
61 | ||
62 | PROCEDURE ExpressionTypeCompatible (token: CARDINAL; format: ARRAY OF CHAR; | |
63 | left, right: CARDINAL; | |
64 | strict, isin: BOOLEAN) : BOOLEAN ; | |
65 | ||
66 | ||
67 | END M2Check. |