1 /* do not edit automatically generated by mc from keyc. */
2 /* keyc.def provides an interface to emitting symbols which.
4 Copyright (C) 2016-2024 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
7 This file is part of GNU Modula-2.
9 GNU Modula-2 is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
14 GNU Modula-2 is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with GNU Modula-2; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
24 #if !defined (_keyc_H)
33 # if !defined (PROC_D)
35 typedef void (*PROC_t
) (void);
36 typedef struct { PROC_t proc
; } PROC
;
39 # include "GmcPretty.h"
40 # include "GDynamicStrings.h"
42 # include "GnameKey.h"
44 # if defined (_keyc_C)
47 # define EXTERN extern
52 useGccTree - indicate we have imported tree from gcctypes.
55 EXTERN
void keyc_useGccTree (void);
58 useGccLocation - indicate we have imported tree from gcctypes.
61 EXTERN
void keyc_useGccLocation (void);
64 useUnistd - need to use unistd.h call using open/close/read/write require this header.
67 EXTERN
void keyc_useUnistd (void);
70 useThrow - use the throw function.
73 EXTERN
void keyc_useThrow (void);
76 useStorage - indicate we have used storage.
79 EXTERN
void keyc_useStorage (void);
82 useFree - indicate we have used free.
85 EXTERN
void keyc_useFree (void);
88 useMalloc - indicate we have used malloc.
91 EXTERN
void keyc_useMalloc (void);
94 useProc - indicate we have used proc.
97 EXTERN
void keyc_useProc (void);
100 useTrue - indicate we have used TRUE.
103 EXTERN
void keyc_useTrue (void);
106 useFalse - indicate we have used FALSE.
109 EXTERN
void keyc_useFalse (void);
112 useNull - indicate we have used NULL.
115 EXTERN
void keyc_useNull (void);
118 useMemcpy - indicate we have used memcpy.
121 EXTERN
void keyc_useMemcpy (void);
124 useIntMin - indicate we have used INT_MIN.
127 EXTERN
void keyc_useIntMin (void);
130 useUIntMin - indicate we have used UINT_MIN.
133 EXTERN
void keyc_useUIntMin (void);
136 useLongMin - indicate we have used LONG_MIN.
139 EXTERN
void keyc_useLongMin (void);
142 useULongMin - indicate we have used ULONG_MIN.
145 EXTERN
void keyc_useULongMin (void);
148 useCharMin - indicate we have used CHAR_MIN.
151 EXTERN
void keyc_useCharMin (void);
154 useUCharMin - indicate we have used UCHAR_MIN.
157 EXTERN
void keyc_useUCharMin (void);
160 useIntMax - indicate we have used INT_MAX.
163 EXTERN
void keyc_useIntMax (void);
166 useUIntMax - indicate we have used UINT_MAX.
169 EXTERN
void keyc_useUIntMax (void);
172 useLongMax - indicate we have used LONG_MAX.
175 EXTERN
void keyc_useLongMax (void);
178 useULongMax - indicate we have used ULONG_MAX.
181 EXTERN
void keyc_useULongMax (void);
184 useCharMax - indicate we have used CHAR_MAX.
187 EXTERN
void keyc_useCharMax (void);
190 useUCharMax - indicate we have used UChar_MAX.
193 EXTERN
void keyc_useUCharMax (void);
196 useSize_t - indicate we have used size_t.
199 EXTERN
void keyc_useSize_t (void);
202 useSSize_t - indicate we have used ssize_t.
205 EXTERN
void keyc_useSSize_t (void);
208 useLabs - indicate we have used labs.
211 EXTERN
void keyc_useLabs (void);
214 useAbs - indicate we have used abs.
217 EXTERN
void keyc_useAbs (void);
220 useFabs - indicate we have used fabs.
223 EXTERN
void keyc_useFabs (void);
226 useFabsl - indicate we have used fabsl.
229 EXTERN
void keyc_useFabsl (void);
232 useException - use the exceptions module, mcrts.
235 EXTERN
void keyc_useException (void);
238 useComplex - use the complex data type.
241 EXTERN
void keyc_useComplex (void);
244 useM2RTS - indicate we have used M2RTS in the converted code.
247 EXTERN
void keyc_useM2RTS (void);
250 useStrlen - indicate we have used strlen in the converted code.
253 EXTERN
void keyc_useStrlen (void);
256 useCtype - indicate we have used the toupper function.
259 EXTERN
void keyc_useCtype (void);
262 genDefs - generate definitions or includes for all
263 macros and prototypes used.
266 EXTERN
void keyc_genDefs (mcPretty_pretty p
);
269 genConfigSystem - generate include files for config.h and system.h
270 within the GCC framework.
273 EXTERN
void keyc_genConfigSystem (mcPretty_pretty p
);
276 enterScope - enter a scope defined by, n.
279 EXTERN
void keyc_enterScope (decl_node n
);
282 leaveScope - leave the scope defined by, n.
285 EXTERN
void keyc_leaveScope (decl_node n
);
288 cname - attempts to declare a symbol with name, n, in the
289 current scope. If there is no conflict with the
290 target language then NIL is returned, otherwise
291 a mangled name is returned as a String.
292 If scopes is FALSE then only the keywords and
293 macros are detected for a clash (all scoping
297 EXTERN DynamicStrings_String
keyc_cname (nameKey_Name n
, bool scopes
);
300 cnamen - attempts to declare a symbol with name, n, in the
301 current scope. If there is no conflict with the
302 target language then NIL is returned, otherwise
303 a mangled name is returned as a Name
304 If scopes is FALSE then only the keywords and
305 macros are detected for a clash (all scoping
309 EXTERN nameKey_Name
keyc_cnamen (nameKey_Name n
, bool scopes
);
312 cp - include C++ keywords and standard declarations to avoid.
315 EXTERN
void keyc_cp (void);