1 | /* |
2 | * This Source Code Form is subject to the terms of the Mozilla Public |
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
5 | * |
6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
7 | */ |
8 | |
9 | #ifndef _MAL_RESOLVE_H |
10 | #define _MAL_RESOLVE_H |
11 | |
12 | #include "mal_exception.h" |
13 | #include "mal_function.h" |
14 | #include "mal_listing.h" |
15 | #include "mal_exception.h" |
16 | |
17 | /* |
18 | #define DEBUG_MAL_RESOLVE 1 |
19 | */ |
20 | #define MAXTYPEVAR 10 |
21 | |
22 | mal_export void chkProgram(Module s, MalBlkPtr mb); |
23 | mal_export int chkInstruction(Module s, MalBlkPtr mb, InstrPtr p); |
24 | mal_export void chkTypes(Module s, MalBlkPtr mb, int silent); |
25 | mal_export void typeChecker(Module scope, MalBlkPtr mb, InstrPtr p, int silent); |
26 | |
27 | /* |
28 | * @- Type resolution algorithm. |
29 | * Every actual argument of a function call should be type compatible |
30 | * with the formal argument, and the function result type should be |
31 | * compatible with the destination variable. |
32 | * In both cases the 'receiving' variable may not be fully qualified, |
33 | * i.e. of type 'any'. The type resolution algorithm creates the concrete |
34 | * type for subsequent use. |
35 | */ |
36 | mal_export int resolveType(int dsttype, int srctype); |
37 | |
38 | #endif /* _MAL_RESOLVE_H*/ |
39 | |