| 1 |
/* do not edit automatically generated by mc from decl. */ |
| 2 |
/* decl.def declaration nodes used to create the AST. |
| 3 |
|
| 4 |
Copyright (C) 2015-2025 Free Software Foundation, Inc. |
| 5 |
Contributed by Gaius Mulley <[email protected]>. |
| 6 |
|
| 7 |
This file is part of GNU Modula-2. |
| 8 |
|
| 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) |
| 12 |
any later version. |
| 13 |
|
| 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. |
| 18 |
|
| 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/>. */ |
| 22 |
|
| 23 |
|
| 24 |
#if !defined (_decl_H) |
| 25 |
# define _decl_H |
| 26 |
|
| 27 |
#include "config.h" |
| 28 |
#include "system.h" |
| 29 |
# ifdef __cplusplus |
| 30 |
extern "C" { |
| 31 |
# endif |
| 32 |
#include <stdbool.h> |
| 33 |
# if !defined (PROC_D) |
| 34 |
# define PROC_D |
| 35 |
typedef void (*PROC_t) (void); |
| 36 |
typedef struct { PROC_t proc; } PROC; |
| 37 |
# endif |
| 38 |
|
| 39 |
# include "GnameKey.h" |
| 40 |
# include "GsymbolKey.h" |
| 41 |
# include "GmcReserved.h" |
| 42 |
# include "GmcComment.h" |
| 43 |
|
| 44 |
# if defined (_decl_C) |
| 45 |
# define EXTERN |
| 46 |
# else |
| 47 |
# define EXTERN extern |
| 48 |
# endif |
| 49 |
|
| 50 |
#if !defined (decl_node_D) |
| 51 |
# define decl_node_D |
| 52 |
typedef void *decl_node; |
| 53 |
#endif |
| 54 |
|
| 55 |
typedef struct decl_isNodeF_p decl_isNodeF; |
| 56 |
|
| 57 |
typedef bool (*decl_isNodeF_t) (decl_node); |
| 58 |
struct decl_isNodeF_p { decl_isNodeF_t proc; }; |
| 59 |
|
| 60 |
|
| 61 |
/* |
| 62 |
getDeclaredMod - returns the token number associated with the nodes declaration |
| 63 |
in the implementation or program module. |
| 64 |
*/ |
| 65 |
|
| 66 |
EXTERN unsigned int decl_getDeclaredMod (decl_node n); |
| 67 |
|
| 68 |
/* |
| 69 |
getDeclaredDef - returns the token number associated with the nodes declaration |
| 70 |
in the definition module. |
| 71 |
*/ |
| 72 |
|
| 73 |
EXTERN unsigned int decl_getDeclaredDef (decl_node n); |
| 74 |
|
| 75 |
/* |
| 76 |
getFirstUsed - returns the token number associated with the first use of |
| 77 |
node, n. |
| 78 |
*/ |
| 79 |
|
| 80 |
EXTERN unsigned int decl_getFirstUsed (decl_node n); |
| 81 |
|
| 82 |
/* |
| 83 |
isDef - return TRUE if node, n, is a definition module. |
| 84 |
*/ |
| 85 |
|
| 86 |
EXTERN bool decl_isDef (decl_node n); |
| 87 |
|
| 88 |
/* |
| 89 |
isImp - return TRUE if node, n, is an implementation module. |
| 90 |
*/ |
| 91 |
|
| 92 |
EXTERN bool decl_isImp (decl_node n); |
| 93 |
|
| 94 |
/* |
| 95 |
isImpOrModule - returns TRUE if, n, is a program module or implementation module. |
| 96 |
*/ |
| 97 |
|
| 98 |
EXTERN bool decl_isImpOrModule (decl_node n); |
| 99 |
|
| 100 |
/* |
| 101 |
isVisited - returns TRUE if the node was visited. |
| 102 |
*/ |
| 103 |
|
| 104 |
EXTERN bool decl_isVisited (decl_node n); |
| 105 |
|
| 106 |
/* |
| 107 |
unsetVisited - unset the visited flag on a def/imp/module node. |
| 108 |
*/ |
| 109 |
|
| 110 |
EXTERN void decl_unsetVisited (decl_node n); |
| 111 |
|
| 112 |
/* |
| 113 |
setVisited - set the visited flag on a def/imp/module node. |
| 114 |
*/ |
| 115 |
|
| 116 |
EXTERN void decl_setVisited (decl_node n); |
| 117 |
|
| 118 |
/* |
| 119 |
setEnumsComplete - sets the field inside the def or imp or module, n. |
| 120 |
*/ |
| 121 |
|
| 122 |
EXTERN void decl_setEnumsComplete (decl_node n); |
| 123 |
|
| 124 |
/* |
| 125 |
getEnumsComplete - gets the field from the def or imp or module, n. |
| 126 |
*/ |
| 127 |
|
| 128 |
EXTERN bool decl_getEnumsComplete (decl_node n); |
| 129 |
|
| 130 |
/* |
| 131 |
resetEnumPos - resets the index into the saved list of enums inside |
| 132 |
module, n. |
| 133 |
*/ |
| 134 |
|
| 135 |
EXTERN void decl_resetEnumPos (decl_node n); |
| 136 |
|
| 137 |
/* |
| 138 |
getNextEnum - returns the next enumeration node. |
| 139 |
*/ |
| 140 |
|
| 141 |
EXTERN decl_node decl_getNextEnum (void); |
| 142 |
|
| 143 |
/* |
| 144 |
isModule - return TRUE if node, n, is a program module. |
| 145 |
*/ |
| 146 |
|
| 147 |
EXTERN bool decl_isModule (decl_node n); |
| 148 |
|
| 149 |
/* |
| 150 |
isMainModule - return TRUE if node, n, is the main module specified |
| 151 |
by the source file. This might be a definition, |
| 152 |
implementation or program module. |
| 153 |
*/ |
| 154 |
|
| 155 |
EXTERN bool decl_isMainModule (decl_node n); |
| 156 |
|
| 157 |
/* |
| 158 |
setMainModule - sets node, n, as the main module to be compiled. |
| 159 |
*/ |
| 160 |
|
| 161 |
EXTERN void decl_setMainModule (decl_node n); |
| 162 |
|
| 163 |
/* |
| 164 |
setCurrentModule - sets node, n, as the current module being compiled. |
| 165 |
*/ |
| 166 |
|
| 167 |
EXTERN void decl_setCurrentModule (decl_node n); |
| 168 |
|
| 169 |
/* |
| 170 |
lookupDef - returns a definition module node named, n. |
| 171 |
*/ |
| 172 |
|
| 173 |
EXTERN decl_node decl_lookupDef (nameKey_Name n); |
| 174 |
|
| 175 |
/* |
| 176 |
lookupImp - returns an implementation module node named, n. |
| 177 |
*/ |
| 178 |
|
| 179 |
EXTERN decl_node decl_lookupImp (nameKey_Name n); |
| 180 |
|
| 181 |
/* |
| 182 |
lookupModule - returns a module node named, n. |
| 183 |
*/ |
| 184 |
|
| 185 |
EXTERN decl_node decl_lookupModule (nameKey_Name n); |
| 186 |
|
| 187 |
/* |
| 188 |
putDefForC - the definition module was defined FOR "C". |
| 189 |
*/ |
| 190 |
|
| 191 |
EXTERN void decl_putDefForC (decl_node n); |
| 192 |
|
| 193 |
/* |
| 194 |
putDefUnqualified - the definition module uses export unqualified. |
| 195 |
*/ |
| 196 |
|
| 197 |
EXTERN void decl_putDefUnqualified (decl_node n); |
| 198 |
|
| 199 |
/* |
| 200 |
isDefUnqualified - returns TRUE if the definition module uses unqualified. |
| 201 |
*/ |
| 202 |
|
| 203 |
EXTERN bool decl_isDefUnqualified (decl_node n); |
| 204 |
|
| 205 |
/* |
| 206 |
lookupInScope - looks up a symbol named, n, from, scope. |
| 207 |
*/ |
| 208 |
|
| 209 |
EXTERN decl_node decl_lookupInScope (decl_node scope, nameKey_Name n); |
| 210 |
|
| 211 |
/* |
| 212 |
isConst - returns TRUE if node, n, is a const. |
| 213 |
*/ |
| 214 |
|
| 215 |
EXTERN bool decl_isConst (decl_node n); |
| 216 |
|
| 217 |
/* |
| 218 |
isType - returns TRUE if node, n, is a type. |
| 219 |
*/ |
| 220 |
|
| 221 |
EXTERN bool decl_isType (decl_node n); |
| 222 |
|
| 223 |
/* |
| 224 |
putType - places, exp, as the type alias to des. |
| 225 |
TYPE des = exp ; |
| 226 |
*/ |
| 227 |
|
| 228 |
EXTERN void decl_putType (decl_node des, decl_node exp); |
| 229 |
|
| 230 |
/* |
| 231 |
getType - returns the type associated with node, n. |
| 232 |
*/ |
| 233 |
|
| 234 |
EXTERN decl_node decl_getType (decl_node n); |
| 235 |
|
| 236 |
/* |
| 237 |
skipType - skips over type aliases. |
| 238 |
*/ |
| 239 |
|
| 240 |
EXTERN decl_node decl_skipType (decl_node n); |
| 241 |
|
| 242 |
/* |
| 243 |
putTypeHidden - marks type, des, as being a hidden type. |
| 244 |
TYPE des ; |
| 245 |
*/ |
| 246 |
|
| 247 |
EXTERN void decl_putTypeHidden (decl_node des); |
| 248 |
|
| 249 |
/* |
| 250 |
isTypeHidden - returns TRUE if type, n, is hidden. |
| 251 |
*/ |
| 252 |
|
| 253 |
EXTERN bool decl_isTypeHidden (decl_node n); |
| 254 |
|
| 255 |
/* |
| 256 |
hasHidden - returns TRUE if module, n, has a hidden type. |
| 257 |
*/ |
| 258 |
|
| 259 |
EXTERN bool decl_hasHidden (decl_node n); |
| 260 |
|
| 261 |
/* |
| 262 |
putTypeOpaque - marks type, des, as being an opaque type. |
| 263 |
TYPE des ; |
| 264 |
*/ |
| 265 |
|
| 266 |
EXTERN void decl_putTypeOpaque (decl_node des); |
| 267 |
|
| 268 |
/* |
| 269 |
isTypeOpaque - returns TRUE if type, n, is an opaque type. |
| 270 |
*/ |
| 271 |
|
| 272 |
EXTERN bool decl_isTypeOpaque (decl_node n); |
| 273 |
|
| 274 |
/* |
| 275 |
isVar - returns TRUE if node, n, is a type. |
| 276 |
*/ |
| 277 |
|
| 278 |
EXTERN bool decl_isVar (decl_node n); |
| 279 |
|
| 280 |
/* |
| 281 |
isTemporary - returns TRUE if node, n, is a variable and temporary. |
| 282 |
*/ |
| 283 |
|
| 284 |
EXTERN bool decl_isTemporary (decl_node n); |
| 285 |
|
| 286 |
/* |
| 287 |
isExported - returns TRUE if symbol, n, is exported from |
| 288 |
the definition module. |
| 289 |
*/ |
| 290 |
|
| 291 |
EXTERN bool decl_isExported (decl_node n); |
| 292 |
|
| 293 |
/* |
| 294 |
getDeclScope - returns the node representing the |
| 295 |
current declaration scope. |
| 296 |
*/ |
| 297 |
|
| 298 |
EXTERN decl_node decl_getDeclScope (void); |
| 299 |
|
| 300 |
/* |
| 301 |
getScope - returns the scope associated with node, n. |
| 302 |
*/ |
| 303 |
|
| 304 |
EXTERN decl_node decl_getScope (decl_node n); |
| 305 |
|
| 306 |
/* |
| 307 |
isLiteral - returns TRUE if, n, is a literal. |
| 308 |
*/ |
| 309 |
|
| 310 |
EXTERN bool decl_isLiteral (decl_node n); |
| 311 |
|
| 312 |
/* |
| 313 |
isConstSet - returns TRUE if, n, is a constant set. |
| 314 |
*/ |
| 315 |
|
| 316 |
EXTERN bool decl_isConstSet (decl_node n); |
| 317 |
|
| 318 |
/* |
| 319 |
isEnumerationField - returns TRUE if, n, is an enumeration field. |
| 320 |
*/ |
| 321 |
|
| 322 |
EXTERN bool decl_isEnumerationField (decl_node n); |
| 323 |
|
| 324 |
/* |
| 325 |
isEnumeration - returns TRUE if node, n, is an enumeration type. |
| 326 |
*/ |
| 327 |
|
| 328 |
EXTERN bool decl_isEnumeration (decl_node n); |
| 329 |
|
| 330 |
/* |
| 331 |
isUnbounded - returns TRUE if, n, is an unbounded array. |
| 332 |
*/ |
| 333 |
|
| 334 |
EXTERN bool decl_isUnbounded (decl_node n); |
| 335 |
|
| 336 |
/* |
| 337 |
isParameter - returns TRUE if, n, is a parameter. |
| 338 |
*/ |
| 339 |
|
| 340 |
EXTERN bool decl_isParameter (decl_node n); |
| 341 |
|
| 342 |
/* |
| 343 |
isVarParam - returns TRUE if, n, is a var parameter. |
| 344 |
*/ |
| 345 |
|
| 346 |
EXTERN bool decl_isVarParam (decl_node n); |
| 347 |
|
| 348 |
/* |
| 349 |
isParam - returns TRUE if, n, is a non var parameter. |
| 350 |
*/ |
| 351 |
|
| 352 |
EXTERN bool decl_isParam (decl_node n); |
| 353 |
|
| 354 |
/* |
| 355 |
isNonVarParam - is an alias to isParam. |
| 356 |
*/ |
| 357 |
|
| 358 |
EXTERN bool decl_isNonVarParam (decl_node n); |
| 359 |
|
| 360 |
/* |
| 361 |
addOptParameter - returns an optarg which has been created and added to |
| 362 |
procedure node, proc. It has a name, id, and, type, |
| 363 |
and an initial value, init. |
| 364 |
*/ |
| 365 |
|
| 366 |
EXTERN decl_node decl_addOptParameter (decl_node proc, nameKey_Name id, decl_node type, decl_node init); |
| 367 |
|
| 368 |
/* |
| 369 |
isOptarg - returns TRUE if, n, is an optarg. |
| 370 |
*/ |
| 371 |
|
| 372 |
EXTERN bool decl_isOptarg (decl_node n); |
| 373 |
|
| 374 |
/* |
| 375 |
isRecord - returns TRUE if, n, is a record. |
| 376 |
*/ |
| 377 |
|
| 378 |
EXTERN bool decl_isRecord (decl_node n); |
| 379 |
|
| 380 |
/* |
| 381 |
isRecordField - returns TRUE if, n, is a record field. |
| 382 |
*/ |
| 383 |
|
| 384 |
EXTERN bool decl_isRecordField (decl_node n); |
| 385 |
|
| 386 |
/* |
| 387 |
isVarientField - returns TRUE if, n, is a varient field. |
| 388 |
*/ |
| 389 |
|
| 390 |
EXTERN bool decl_isVarientField (decl_node n); |
| 391 |
|
| 392 |
/* |
| 393 |
isArray - returns TRUE if, n, is an array. |
| 394 |
*/ |
| 395 |
|
| 396 |
EXTERN bool decl_isArray (decl_node n); |
| 397 |
|
| 398 |
/* |
| 399 |
isProcType - returns TRUE if, n, is a procedure type. |
| 400 |
*/ |
| 401 |
|
| 402 |
EXTERN bool decl_isProcType (decl_node n); |
| 403 |
|
| 404 |
/* |
| 405 |
isPointer - returns TRUE if, n, is a pointer. |
| 406 |
*/ |
| 407 |
|
| 408 |
EXTERN bool decl_isPointer (decl_node n); |
| 409 |
|
| 410 |
/* |
| 411 |
isProcedure - returns TRUE if, n, is a procedure. |
| 412 |
*/ |
| 413 |
|
| 414 |
EXTERN bool decl_isProcedure (decl_node n); |
| 415 |
|
| 416 |
/* |
| 417 |
isVarient - returns TRUE if, n, is a varient record. |
| 418 |
*/ |
| 419 |
|
| 420 |
EXTERN bool decl_isVarient (decl_node n); |
| 421 |
|
| 422 |
/* |
| 423 |
isSet - returns TRUE if, n, is a set type. |
| 424 |
*/ |
| 425 |
|
| 426 |
EXTERN bool decl_isSet (decl_node n); |
| 427 |
|
| 428 |
/* |
| 429 |
isSubrange - returns TRUE if, n, is a subrange type. |
| 430 |
*/ |
| 431 |
|
| 432 |
EXTERN bool decl_isSubrange (decl_node n); |
| 433 |
|
| 434 |
/* |
| 435 |
isZtype - returns TRUE if, n, is the Z type. |
| 436 |
*/ |
| 437 |
|
| 438 |
EXTERN bool decl_isZtype (decl_node n); |
| 439 |
|
| 440 |
/* |
| 441 |
isRtype - returns TRUE if, n, is the R type. |
| 442 |
*/ |
| 443 |
|
| 444 |
EXTERN bool decl_isRtype (decl_node n); |
| 445 |
|
| 446 |
/* |
| 447 |
makeConst - create, initialise and return a const node. |
| 448 |
*/ |
| 449 |
|
| 450 |
EXTERN decl_node decl_makeConst (nameKey_Name n); |
| 451 |
|
| 452 |
/* |
| 453 |
putConst - places value, v, into node, n. |
| 454 |
*/ |
| 455 |
|
| 456 |
EXTERN void decl_putConst (decl_node n, decl_node v); |
| 457 |
|
| 458 |
/* |
| 459 |
makeType - create, initialise and return a type node. |
| 460 |
*/ |
| 461 |
|
| 462 |
EXTERN decl_node decl_makeType (nameKey_Name n); |
| 463 |
|
| 464 |
/* |
| 465 |
makeTypeImp - lookup a type in the definition module |
| 466 |
and return it. Otherwise create a new type. |
| 467 |
*/ |
| 468 |
|
| 469 |
EXTERN decl_node decl_makeTypeImp (nameKey_Name n); |
| 470 |
|
| 471 |
/* |
| 472 |
makeVar - create, initialise and return a var node. |
| 473 |
*/ |
| 474 |
|
| 475 |
EXTERN decl_node decl_makeVar (nameKey_Name n); |
| 476 |
|
| 477 |
/* |
| 478 |
putVar - places, type, as the type for var. |
| 479 |
*/ |
| 480 |
|
| 481 |
EXTERN void decl_putVar (decl_node var, decl_node type, decl_node decl); |
| 482 |
|
| 483 |
/* |
| 484 |
makeVarDecl - creates a variable declaration list from |
| 485 |
identlist, i, and, type, in the current scope. |
| 486 |
*/ |
| 487 |
|
| 488 |
EXTERN decl_node decl_makeVarDecl (decl_node i, decl_node type); |
| 489 |
|
| 490 |
/* |
| 491 |
makeEnum - creates an enumerated type and returns the node. |
| 492 |
*/ |
| 493 |
|
| 494 |
EXTERN decl_node decl_makeEnum (void); |
| 495 |
|
| 496 |
/* |
| 497 |
makeEnumField - returns an enumeration field, named, n. |
| 498 |
*/ |
| 499 |
|
| 500 |
EXTERN decl_node decl_makeEnumField (decl_node e, nameKey_Name n); |
| 501 |
|
| 502 |
/* |
| 503 |
makeSubrange - returns a subrange node, built from range: low..high. |
| 504 |
*/ |
| 505 |
|
| 506 |
EXTERN decl_node decl_makeSubrange (decl_node low, decl_node high); |
| 507 |
|
| 508 |
/* |
| 509 |
putSubrangeType - assigns, type, to the subrange type, sub. |
| 510 |
*/ |
| 511 |
|
| 512 |
EXTERN void decl_putSubrangeType (decl_node sub, decl_node type); |
| 513 |
|
| 514 |
/* |
| 515 |
makePointer - returns a pointer of, type, node. |
| 516 |
*/ |
| 517 |
|
| 518 |
EXTERN decl_node decl_makePointer (decl_node type); |
| 519 |
|
| 520 |
/* |
| 521 |
makeSet - returns a set of, type, node. |
| 522 |
*/ |
| 523 |
|
| 524 |
EXTERN decl_node decl_makeSet (decl_node type); |
| 525 |
|
| 526 |
/* |
| 527 |
makeArray - returns a node representing ARRAY subrange OF type. |
| 528 |
*/ |
| 529 |
|
| 530 |
EXTERN decl_node decl_makeArray (decl_node subr, decl_node type); |
| 531 |
|
| 532 |
/* |
| 533 |
putUnbounded - sets array, n, as unbounded. |
| 534 |
*/ |
| 535 |
|
| 536 |
EXTERN void decl_putUnbounded (decl_node n); |
| 537 |
|
| 538 |
/* |
| 539 |
makeRecord - creates and returns a record node. |
| 540 |
*/ |
| 541 |
|
| 542 |
EXTERN decl_node decl_makeRecord (void); |
| 543 |
|
| 544 |
/* |
| 545 |
makeVarient - creates a new symbol, a varient symbol for record or varient field |
| 546 |
symbol, r. |
| 547 |
*/ |
| 548 |
|
| 549 |
EXTERN decl_node decl_makeVarient (decl_node r); |
| 550 |
|
| 551 |
/* |
| 552 |
addFieldsToRecord - adds fields, i, of type, t, into a record, r. |
| 553 |
It returns, r. |
| 554 |
*/ |
| 555 |
|
| 556 |
EXTERN decl_node decl_addFieldsToRecord (decl_node r, decl_node v, decl_node i, decl_node t); |
| 557 |
|
| 558 |
/* |
| 559 |
buildVarientSelector - builds a field of name, tag, of, type, t, varient, r. |
| 560 |
*/ |
| 561 |
|
| 562 |
EXTERN void decl_buildVarientSelector (decl_node r, decl_node v, nameKey_Name tag, decl_node type); |
| 563 |
|
| 564 |
/* |
| 565 |
buildVarientFieldRecord - builds a varient field into a varient symbol, v. |
| 566 |
The varient field is returned. |
| 567 |
*/ |
| 568 |
|
| 569 |
EXTERN decl_node decl_buildVarientFieldRecord (decl_node v, decl_node p); |
| 570 |
|
| 571 |
/* |
| 572 |
getSymName - returns the name of symbol, n. |
| 573 |
*/ |
| 574 |
|
| 575 |
EXTERN nameKey_Name decl_getSymName (decl_node n); |
| 576 |
|
| 577 |
/* |
| 578 |
import - attempts to add node, n, into the scope of module, m. |
| 579 |
It might fail due to a name clash in which case the |
| 580 |
previous named symbol is returned. On success, n, |
| 581 |
is returned. |
| 582 |
*/ |
| 583 |
|
| 584 |
EXTERN decl_node decl_import (decl_node m, decl_node n); |
| 585 |
|
| 586 |
/* |
| 587 |
lookupExported - attempts to lookup a node named, i, from definition |
| 588 |
module, n. The node is returned if found. |
| 589 |
NIL is returned if not found. |
| 590 |
*/ |
| 591 |
|
| 592 |
EXTERN decl_node decl_lookupExported (decl_node n, nameKey_Name i); |
| 593 |
|
| 594 |
/* |
| 595 |
lookupSym - returns the symbol named, n, from the scope stack. |
| 596 |
*/ |
| 597 |
|
| 598 |
EXTERN decl_node decl_lookupSym (nameKey_Name n); |
| 599 |
|
| 600 |
/* |
| 601 |
addImportedModule - add module, i, to be imported by, m. |
| 602 |
If scoped then module, i, is added to the |
| 603 |
module, m, scope. |
| 604 |
*/ |
| 605 |
|
| 606 |
EXTERN void decl_addImportedModule (decl_node m, decl_node i, bool scoped); |
| 607 |
|
| 608 |
/* |
| 609 |
setSource - sets the source filename for module, n, to s. |
| 610 |
*/ |
| 611 |
|
| 612 |
EXTERN void decl_setSource (decl_node n, nameKey_Name s); |
| 613 |
|
| 614 |
/* |
| 615 |
getSource - returns the source filename for module, n. |
| 616 |
*/ |
| 617 |
|
| 618 |
EXTERN nameKey_Name decl_getSource (decl_node n); |
| 619 |
|
| 620 |
/* |
| 621 |
getMainModule - returns the main module node. |
| 622 |
*/ |
| 623 |
|
| 624 |
EXTERN decl_node decl_getMainModule (void); |
| 625 |
|
| 626 |
/* |
| 627 |
getCurrentModule - returns the current module being compiled. |
| 628 |
*/ |
| 629 |
|
| 630 |
EXTERN decl_node decl_getCurrentModule (void); |
| 631 |
|
| 632 |
/* |
| 633 |
foreachDefModuleDo - foreach definition node, n, in the module universe, |
| 634 |
call p (n). |
| 635 |
*/ |
| 636 |
|
| 637 |
EXTERN void decl_foreachDefModuleDo (symbolKey_performOperation p); |
| 638 |
|
| 639 |
/* |
| 640 |
foreachModModuleDo - foreach implementation or module node, n, in the module universe, |
| 641 |
call p (n). |
| 642 |
*/ |
| 643 |
|
| 644 |
EXTERN void decl_foreachModModuleDo (symbolKey_performOperation p); |
| 645 |
|
| 646 |
/* |
| 647 |
enterScope - pushes symbol, n, to the scope stack. |
| 648 |
*/ |
| 649 |
|
| 650 |
EXTERN void decl_enterScope (decl_node n); |
| 651 |
|
| 652 |
/* |
| 653 |
leaveScope - removes the top level scope and all enumeration transparent scopes. |
| 654 |
*/ |
| 655 |
|
| 656 |
EXTERN void decl_leaveScope (void); |
| 657 |
|
| 658 |
/* |
| 659 |
makeProcedure - create, initialise and return a procedure node. |
| 660 |
*/ |
| 661 |
|
| 662 |
EXTERN decl_node decl_makeProcedure (nameKey_Name n); |
| 663 |
|
| 664 |
/* |
| 665 |
putCommentDefProcedure - remembers the procedure comment (if it exists) as a |
| 666 |
definition module procedure heading. NIL is placed |
| 667 |
if there is no procedure comment available. |
| 668 |
*/ |
| 669 |
|
| 670 |
EXTERN void decl_putCommentDefProcedure (decl_node n); |
| 671 |
|
| 672 |
/* |
| 673 |
putCommentModProcedure - remembers the procedure comment (if it exists) as an |
| 674 |
implementation/program module procedure heading. NIL is placed |
| 675 |
if there is no procedure comment available. |
| 676 |
*/ |
| 677 |
|
| 678 |
EXTERN void decl_putCommentModProcedure (decl_node n); |
| 679 |
|
| 680 |
/* |
| 681 |
makeProcType - returns a proctype node. |
| 682 |
*/ |
| 683 |
|
| 684 |
EXTERN decl_node decl_makeProcType (void); |
| 685 |
|
| 686 |
/* |
| 687 |
putReturnType - sets the return type of procedure or proctype, proc, to, type. |
| 688 |
*/ |
| 689 |
|
| 690 |
EXTERN void decl_putReturnType (decl_node proc, decl_node type); |
| 691 |
|
| 692 |
/* |
| 693 |
putOptReturn - sets, proctype or procedure, proc, to have an optional return type. |
| 694 |
*/ |
| 695 |
|
| 696 |
EXTERN void decl_putOptReturn (decl_node proc); |
| 697 |
|
| 698 |
/* |
| 699 |
makeVarParameter - returns a var parameter node with namelist and type. |
| 700 |
Where the parameters are declared as l: type. |
| 701 |
*/ |
| 702 |
|
| 703 |
EXTERN decl_node decl_makeVarParameter (decl_node l, decl_node type, decl_node proc, bool isused); |
| 704 |
|
| 705 |
/* |
| 706 |
makeNonVarParameter - returns a non var parameter node with namelist and type. |
| 707 |
Where the parameters are declared as l: type. |
| 708 |
*/ |
| 709 |
|
| 710 |
EXTERN decl_node decl_makeNonVarParameter (decl_node l, decl_node type, decl_node proc, bool isused); |
| 711 |
|
| 712 |
/* |
| 713 |
paramEnter - reset the parameter count. |
| 714 |
*/ |
| 715 |
|
| 716 |
EXTERN void decl_paramEnter (decl_node n); |
| 717 |
|
| 718 |
/* |
| 719 |
paramLeave - set paramater checking to TRUE from now onwards. |
| 720 |
*/ |
| 721 |
|
| 722 |
EXTERN void decl_paramLeave (decl_node n); |
| 723 |
|
| 724 |
/* |
| 725 |
makeIdentList - returns a node which will be used to maintain an ident list. |
| 726 |
*/ |
| 727 |
|
| 728 |
EXTERN decl_node decl_makeIdentList (void); |
| 729 |
|
| 730 |
/* |
| 731 |
putIdent - places ident, i, into identlist, n. |
| 732 |
*/ |
| 733 |
|
| 734 |
EXTERN bool decl_putIdent (decl_node n, nameKey_Name i); |
| 735 |
|
| 736 |
/* |
| 737 |
addVarParameters - adds the identlist, i, of, type, to be VAR parameters |
| 738 |
in procedure, n. |
| 739 |
*/ |
| 740 |
|
| 741 |
EXTERN void decl_addVarParameters (decl_node n, decl_node i, decl_node type, bool isused); |
| 742 |
|
| 743 |
/* |
| 744 |
addNonVarParameters - adds the identlist, i, of, type, to be parameters |
| 745 |
in procedure, n. |
| 746 |
*/ |
| 747 |
|
| 748 |
EXTERN void decl_addNonVarParameters (decl_node n, decl_node i, decl_node type, bool isused); |
| 749 |
|
| 750 |
/* |
| 751 |
makeVarargs - returns a varargs node. |
| 752 |
*/ |
| 753 |
|
| 754 |
EXTERN decl_node decl_makeVarargs (void); |
| 755 |
|
| 756 |
/* |
| 757 |
isVarargs - returns TRUE if, n, is a varargs node. |
| 758 |
*/ |
| 759 |
|
| 760 |
EXTERN bool decl_isVarargs (decl_node n); |
| 761 |
|
| 762 |
/* |
| 763 |
addParameter - adds a parameter, param, to procedure or proctype, proc. |
| 764 |
*/ |
| 765 |
|
| 766 |
EXTERN void decl_addParameter (decl_node proc, decl_node param); |
| 767 |
|
| 768 |
/* |
| 769 |
makeBinaryTok - creates and returns a boolean type node with, |
| 770 |
l, and, r, nodes. |
| 771 |
*/ |
| 772 |
|
| 773 |
EXTERN decl_node decl_makeBinaryTok (mcReserved_toktype op, decl_node l, decl_node r); |
| 774 |
|
| 775 |
/* |
| 776 |
makeUnaryTok - creates and returns a boolean type node with, |
| 777 |
e, node. |
| 778 |
*/ |
| 779 |
|
| 780 |
EXTERN decl_node decl_makeUnaryTok (mcReserved_toktype op, decl_node e); |
| 781 |
|
| 782 |
/* |
| 783 |
makeComponentRef - build a componentref node which accesses, field, |
| 784 |
within, record, rec. |
| 785 |
*/ |
| 786 |
|
| 787 |
EXTERN decl_node decl_makeComponentRef (decl_node rec, decl_node field); |
| 788 |
|
| 789 |
/* |
| 790 |
makePointerRef - build a pointerref node which accesses, field, |
| 791 |
within, pointer to record, ptr. |
| 792 |
*/ |
| 793 |
|
| 794 |
EXTERN decl_node decl_makePointerRef (decl_node ptr, decl_node field); |
| 795 |
|
| 796 |
/* |
| 797 |
isPointerRef - returns TRUE if, n, is a pointerref node. |
| 798 |
*/ |
| 799 |
|
| 800 |
EXTERN bool decl_isPointerRef (decl_node n); |
| 801 |
|
| 802 |
/* |
| 803 |
makeDeRef - dereferences the pointer defined by, n. |
| 804 |
*/ |
| 805 |
|
| 806 |
EXTERN decl_node decl_makeDeRef (decl_node n); |
| 807 |
|
| 808 |
/* |
| 809 |
makeArrayRef - build an arrayref node which access element, |
| 810 |
index, in, array. array is a variable/expression/constant |
| 811 |
which has a type array. |
| 812 |
*/ |
| 813 |
|
| 814 |
EXTERN decl_node decl_makeArrayRef (decl_node array, decl_node index); |
| 815 |
|
| 816 |
/* |
| 817 |
getLastOp - return the right most non leaf node. |
| 818 |
*/ |
| 819 |
|
| 820 |
EXTERN decl_node decl_getLastOp (decl_node n); |
| 821 |
|
| 822 |
/* |
| 823 |
getCardinal - returns the cardinal type node. |
| 824 |
*/ |
| 825 |
|
| 826 |
EXTERN decl_node decl_getCardinal (void); |
| 827 |
|
| 828 |
/* |
| 829 |
makeLiteralInt - creates and returns a literal node based on an integer type. |
| 830 |
*/ |
| 831 |
|
| 832 |
EXTERN decl_node decl_makeLiteralInt (nameKey_Name n); |
| 833 |
|
| 834 |
/* |
| 835 |
makeLiteralReal - creates and returns a literal node based on a real type. |
| 836 |
*/ |
| 837 |
|
| 838 |
EXTERN decl_node decl_makeLiteralReal (nameKey_Name n); |
| 839 |
|
| 840 |
/* |
| 841 |
makeString - creates and returns a node containing string, n. |
| 842 |
*/ |
| 843 |
|
| 844 |
EXTERN decl_node decl_makeString (nameKey_Name n); |
| 845 |
|
| 846 |
/* |
| 847 |
makeSetValue - creates and returns a setvalue node. |
| 848 |
*/ |
| 849 |
|
| 850 |
EXTERN decl_node decl_makeSetValue (void); |
| 851 |
|
| 852 |
/* |
| 853 |
isSetValue - returns TRUE if, n, is a setvalue node. |
| 854 |
*/ |
| 855 |
|
| 856 |
EXTERN bool decl_isSetValue (decl_node n); |
| 857 |
|
| 858 |
/* |
| 859 |
putSetValue - assigns the type, t, to the set value, n. The |
| 860 |
node, n, is returned. |
| 861 |
*/ |
| 862 |
|
| 863 |
EXTERN decl_node decl_putSetValue (decl_node n, decl_node t); |
| 864 |
|
| 865 |
/* |
| 866 |
includeSetValue - includes the range l..h into the setvalue. |
| 867 |
h might be NIL indicating that a single element |
| 868 |
is to be included into the set. |
| 869 |
n is returned. |
| 870 |
*/ |
| 871 |
|
| 872 |
EXTERN decl_node decl_includeSetValue (decl_node n, decl_node l, decl_node h); |
| 873 |
|
| 874 |
/* |
| 875 |
getBuiltinConst - creates and returns a builtin const if available. |
| 876 |
*/ |
| 877 |
|
| 878 |
EXTERN decl_node decl_getBuiltinConst (nameKey_Name n); |
| 879 |
|
| 880 |
/* |
| 881 |
makeExpList - creates and returns an expList node. |
| 882 |
*/ |
| 883 |
|
| 884 |
EXTERN decl_node decl_makeExpList (void); |
| 885 |
|
| 886 |
/* |
| 887 |
isExpList - returns TRUE if, n, is an explist node. |
| 888 |
*/ |
| 889 |
|
| 890 |
EXTERN bool decl_isExpList (decl_node n); |
| 891 |
|
| 892 |
/* |
| 893 |
putExpList - places, expression, e, within the explist, n. |
| 894 |
*/ |
| 895 |
|
| 896 |
EXTERN void decl_putExpList (decl_node n, decl_node e); |
| 897 |
|
| 898 |
/* |
| 899 |
makeConstExp - returns a constexp node. |
| 900 |
*/ |
| 901 |
|
| 902 |
EXTERN decl_node decl_makeConstExp (void); |
| 903 |
|
| 904 |
/* |
| 905 |
getNextConstExp - returns the next constexp node. |
| 906 |
*/ |
| 907 |
|
| 908 |
EXTERN decl_node decl_getNextConstExp (void); |
| 909 |
|
| 910 |
/* |
| 911 |
setConstExpComplete - sets the field inside the def or imp or module, n. |
| 912 |
*/ |
| 913 |
|
| 914 |
EXTERN void decl_setConstExpComplete (decl_node n); |
| 915 |
|
| 916 |
/* |
| 917 |
fixupConstExp - assign fixup expression, e, into the argument of, c. |
| 918 |
*/ |
| 919 |
|
| 920 |
EXTERN decl_node decl_fixupConstExp (decl_node c, decl_node e); |
| 921 |
|
| 922 |
/* |
| 923 |
resetConstExpPos - resets the index into the saved list of constexps inside |
| 924 |
module, n. |
| 925 |
*/ |
| 926 |
|
| 927 |
EXTERN void decl_resetConstExpPos (decl_node n); |
| 928 |
|
| 929 |
/* |
| 930 |
makeFuncCall - builds a function call to c with param list, n. |
| 931 |
*/ |
| 932 |
|
| 933 |
EXTERN decl_node decl_makeFuncCall (decl_node c, decl_node n); |
| 934 |
|
| 935 |
/* |
| 936 |
makeStatementSequence - create and return a statement sequence node. |
| 937 |
*/ |
| 938 |
|
| 939 |
EXTERN decl_node decl_makeStatementSequence (void); |
| 940 |
|
| 941 |
/* |
| 942 |
isStatementSequence - returns TRUE if node, n, is a statement sequence. |
| 943 |
*/ |
| 944 |
|
| 945 |
EXTERN bool decl_isStatementSequence (decl_node n); |
| 946 |
|
| 947 |
/* |
| 948 |
addStatement - adds node, n, as a statement to statememt sequence, s. |
| 949 |
*/ |
| 950 |
|
| 951 |
EXTERN void decl_addStatement (decl_node s, decl_node n); |
| 952 |
|
| 953 |
/* |
| 954 |
addCommentBody - adds a body comment to a statement sequence node. |
| 955 |
*/ |
| 956 |
|
| 957 |
EXTERN void decl_addCommentBody (decl_node n); |
| 958 |
|
| 959 |
/* |
| 960 |
addCommentAfter - adds an after comment to a statement sequence node. |
| 961 |
*/ |
| 962 |
|
| 963 |
EXTERN void decl_addCommentAfter (decl_node n); |
| 964 |
|
| 965 |
/* |
| 966 |
addIfComments - adds the, body, and, after, comments to if node, n. |
| 967 |
*/ |
| 968 |
|
| 969 |
EXTERN void decl_addIfComments (decl_node n, decl_node body, decl_node after); |
| 970 |
|
| 971 |
/* |
| 972 |
addElseComments - adds the, body, and, after, comments to an, if, or an elsif, node, n. |
| 973 |
*/ |
| 974 |
|
| 975 |
EXTERN void decl_addElseComments (decl_node n, decl_node body, decl_node after); |
| 976 |
|
| 977 |
/* |
| 978 |
addIfEndComments - adds the, body, and, after, comments to an, if, node, n. |
| 979 |
*/ |
| 980 |
|
| 981 |
EXTERN void decl_addIfEndComments (decl_node n, decl_node body, decl_node after); |
| 982 |
|
| 983 |
/* |
| 984 |
makeReturn - creates and returns a return node. |
| 985 |
*/ |
| 986 |
|
| 987 |
EXTERN decl_node decl_makeReturn (void); |
| 988 |
|
| 989 |
/* |
| 990 |
isReturn - returns TRUE if node, n, is a return. |
| 991 |
*/ |
| 992 |
|
| 993 |
EXTERN bool decl_isReturn (decl_node n); |
| 994 |
|
| 995 |
/* |
| 996 |
putReturn - assigns node, e, as the expression on the return node. |
| 997 |
*/ |
| 998 |
|
| 999 |
EXTERN void decl_putReturn (decl_node n, decl_node e); |
| 1000 |
|
| 1001 |
/* |
| 1002 |
makeWhile - creates and returns a while node. |
| 1003 |
*/ |
| 1004 |
|
| 1005 |
EXTERN decl_node decl_makeWhile (void); |
| 1006 |
|
| 1007 |
/* |
| 1008 |
putWhile - places an expression, e, and statement sequence, s, into the while |
| 1009 |
node, n. |
| 1010 |
*/ |
| 1011 |
|
| 1012 |
EXTERN void decl_putWhile (decl_node n, decl_node e, decl_node s); |
| 1013 |
|
| 1014 |
/* |
| 1015 |
isWhile - returns TRUE if node, n, is a while. |
| 1016 |
*/ |
| 1017 |
|
| 1018 |
EXTERN bool decl_isWhile (decl_node n); |
| 1019 |
|
| 1020 |
/* |
| 1021 |
addWhileDoComment - adds body and after comments to while node, w. |
| 1022 |
*/ |
| 1023 |
|
| 1024 |
EXTERN void decl_addWhileDoComment (decl_node w, decl_node body, decl_node after); |
| 1025 |
|
| 1026 |
/* |
| 1027 |
addWhileEndComment - adds body and after comments to the end of a while node, w. |
| 1028 |
*/ |
| 1029 |
|
| 1030 |
EXTERN void decl_addWhileEndComment (decl_node w, decl_node body, decl_node after); |
| 1031 |
|
| 1032 |
/* |
| 1033 |
makeAssignment - creates and returns an assignment node. |
| 1034 |
The designator is, d, and expression, e. |
| 1035 |
*/ |
| 1036 |
|
| 1037 |
EXTERN decl_node decl_makeAssignment (decl_node d, decl_node e); |
| 1038 |
|
| 1039 |
/* |
| 1040 |
putBegin - assigns statements, s, to be the normal part in |
| 1041 |
block, b. The block may be a procedure or module, |
| 1042 |
or implementation node. |
| 1043 |
*/ |
| 1044 |
|
| 1045 |
EXTERN void decl_putBegin (decl_node b, decl_node s); |
| 1046 |
|
| 1047 |
/* |
| 1048 |
putFinally - assigns statements, s, to be the final part in |
| 1049 |
block, b. The block may be a module |
| 1050 |
or implementation node. |
| 1051 |
*/ |
| 1052 |
|
| 1053 |
EXTERN void decl_putFinally (decl_node b, decl_node s); |
| 1054 |
|
| 1055 |
/* |
| 1056 |
makeExit - creates and returns an exit node. |
| 1057 |
*/ |
| 1058 |
|
| 1059 |
EXTERN decl_node decl_makeExit (decl_node l, unsigned int n); |
| 1060 |
|
| 1061 |
/* |
| 1062 |
isExit - returns TRUE if node, n, is an exit. |
| 1063 |
*/ |
| 1064 |
|
| 1065 |
EXTERN bool decl_isExit (decl_node n); |
| 1066 |
|
| 1067 |
/* |
| 1068 |
makeLoop - creates and returns a loop node. |
| 1069 |
*/ |
| 1070 |
|
| 1071 |
EXTERN decl_node decl_makeLoop (void); |
| 1072 |
|
| 1073 |
/* |
| 1074 |
isLoop - returns TRUE if, n, is a loop node. |
| 1075 |
*/ |
| 1076 |
|
| 1077 |
EXTERN bool decl_isLoop (decl_node n); |
| 1078 |
|
| 1079 |
/* |
| 1080 |
putLoop - places statement sequence, s, into loop, l. |
| 1081 |
*/ |
| 1082 |
|
| 1083 |
EXTERN void decl_putLoop (decl_node l, decl_node s); |
| 1084 |
|
| 1085 |
/* |
| 1086 |
makeComment - creates and returns a comment node. |
| 1087 |
*/ |
| 1088 |
|
| 1089 |
EXTERN decl_node decl_makeComment (const char *a_, unsigned int _a_high); |
| 1090 |
|
| 1091 |
/* |
| 1092 |
makeCommentS - creates and returns a comment node. |
| 1093 |
*/ |
| 1094 |
|
| 1095 |
EXTERN decl_node decl_makeCommentS (mcComment_commentDesc c); |
| 1096 |
|
| 1097 |
/* |
| 1098 |
makeIf - creates and returns an if node. The if node |
| 1099 |
will have expression, e, and statement sequence, s, |
| 1100 |
as the then component. |
| 1101 |
*/ |
| 1102 |
|
| 1103 |
EXTERN decl_node decl_makeIf (decl_node e, decl_node s); |
| 1104 |
|
| 1105 |
/* |
| 1106 |
isIf - returns TRUE if, n, is an if node. |
| 1107 |
*/ |
| 1108 |
|
| 1109 |
EXTERN bool decl_isIf (decl_node n); |
| 1110 |
|
| 1111 |
/* |
| 1112 |
makeElsif - creates and returns an elsif node. |
| 1113 |
This node has an expression, e, and statement |
| 1114 |
sequence, s. |
| 1115 |
*/ |
| 1116 |
|
| 1117 |
EXTERN decl_node decl_makeElsif (decl_node i, decl_node e, decl_node s); |
| 1118 |
|
| 1119 |
/* |
| 1120 |
isElsif - returns TRUE if node, n, is an elsif node. |
| 1121 |
*/ |
| 1122 |
|
| 1123 |
EXTERN bool decl_isElsif (decl_node n); |
| 1124 |
|
| 1125 |
/* |
| 1126 |
putElse - the else is grafted onto the if/elsif node, i, |
| 1127 |
and the statement sequence will be, s. |
| 1128 |
*/ |
| 1129 |
|
| 1130 |
EXTERN void decl_putElse (decl_node i, decl_node s); |
| 1131 |
|
| 1132 |
/* |
| 1133 |
makeFor - creates and returns a for node. |
| 1134 |
*/ |
| 1135 |
|
| 1136 |
EXTERN decl_node decl_makeFor (void); |
| 1137 |
|
| 1138 |
/* |
| 1139 |
isFor - returns TRUE if node, n, is a for node. |
| 1140 |
*/ |
| 1141 |
|
| 1142 |
EXTERN bool decl_isFor (decl_node n); |
| 1143 |
|
| 1144 |
/* |
| 1145 |
putFor - assigns the fields of the for node with |
| 1146 |
ident, i, |
| 1147 |
start, s, |
| 1148 |
end, e, |
| 1149 |
increment, i, |
| 1150 |
statements, sq. |
| 1151 |
*/ |
| 1152 |
|
| 1153 |
EXTERN void decl_putFor (decl_node f, decl_node i, decl_node s, decl_node e, decl_node b, decl_node sq); |
| 1154 |
|
| 1155 |
/* |
| 1156 |
makeRepeat - creates and returns a repeat node. |
| 1157 |
*/ |
| 1158 |
|
| 1159 |
EXTERN decl_node decl_makeRepeat (void); |
| 1160 |
|
| 1161 |
/* |
| 1162 |
isRepeat - returns TRUE if node, n, is a repeat node. |
| 1163 |
*/ |
| 1164 |
|
| 1165 |
EXTERN bool decl_isRepeat (decl_node n); |
| 1166 |
|
| 1167 |
/* |
| 1168 |
putRepeat - places statements, s, and expression, e, into |
| 1169 |
repeat statement, n. |
| 1170 |
*/ |
| 1171 |
|
| 1172 |
EXTERN void decl_putRepeat (decl_node n, decl_node s, decl_node e); |
| 1173 |
|
| 1174 |
/* |
| 1175 |
addRepeatComment - adds body and after comments to repeat node, r. |
| 1176 |
*/ |
| 1177 |
|
| 1178 |
EXTERN void decl_addRepeatComment (decl_node r, decl_node body, decl_node after); |
| 1179 |
|
| 1180 |
/* |
| 1181 |
addUntilComment - adds body and after comments to the until section of a repeat node, r. |
| 1182 |
*/ |
| 1183 |
|
| 1184 |
EXTERN void decl_addUntilComment (decl_node r, decl_node body, decl_node after); |
| 1185 |
|
| 1186 |
/* |
| 1187 |
makeCase - builds and returns a case statement node. |
| 1188 |
*/ |
| 1189 |
|
| 1190 |
EXTERN decl_node decl_makeCase (void); |
| 1191 |
|
| 1192 |
/* |
| 1193 |
isCase - returns TRUE if node, n, is a case statement. |
| 1194 |
*/ |
| 1195 |
|
| 1196 |
EXTERN bool decl_isCase (decl_node n); |
| 1197 |
|
| 1198 |
/* |
| 1199 |
putCaseExpression - places expression, e, into case statement, n. |
| 1200 |
n is returned. |
| 1201 |
*/ |
| 1202 |
|
| 1203 |
EXTERN decl_node decl_putCaseExpression (decl_node n, decl_node e); |
| 1204 |
|
| 1205 |
/* |
| 1206 |
putCaseElse - places else statement, e, into case statement, n. |
| 1207 |
n is returned. |
| 1208 |
*/ |
| 1209 |
|
| 1210 |
EXTERN decl_node decl_putCaseElse (decl_node n, decl_node e); |
| 1211 |
|
| 1212 |
/* |
| 1213 |
putCaseStatement - places a caselist, l, and associated |
| 1214 |
statement sequence, s, into case statement, n. |
| 1215 |
n is returned. |
| 1216 |
*/ |
| 1217 |
|
| 1218 |
EXTERN decl_node decl_putCaseStatement (decl_node n, decl_node l, decl_node s); |
| 1219 |
|
| 1220 |
/* |
| 1221 |
makeCaseLabelList - creates and returns a caselabellist node. |
| 1222 |
*/ |
| 1223 |
|
| 1224 |
EXTERN decl_node decl_makeCaseLabelList (decl_node l, decl_node s); |
| 1225 |
|
| 1226 |
/* |
| 1227 |
isCaseLabelList - returns TRUE if, n, is a caselabellist. |
| 1228 |
*/ |
| 1229 |
|
| 1230 |
EXTERN bool decl_isCaseLabelList (decl_node n); |
| 1231 |
|
| 1232 |
/* |
| 1233 |
makeCaseList - creates and returns a case statement node. |
| 1234 |
*/ |
| 1235 |
|
| 1236 |
EXTERN decl_node decl_makeCaseList (void); |
| 1237 |
|
| 1238 |
/* |
| 1239 |
isCaseList - returns TRUE if, n, is a case list. |
| 1240 |
*/ |
| 1241 |
|
| 1242 |
EXTERN bool decl_isCaseList (decl_node n); |
| 1243 |
|
| 1244 |
/* |
| 1245 |
putCaseRange - places the case range lo..hi into caselist, n. |
| 1246 |
*/ |
| 1247 |
|
| 1248 |
EXTERN decl_node decl_putCaseRange (decl_node n, decl_node lo, decl_node hi); |
| 1249 |
|
| 1250 |
/* |
| 1251 |
makeRange - creates and returns a case range. |
| 1252 |
*/ |
| 1253 |
|
| 1254 |
EXTERN decl_node decl_makeRange (decl_node lo, decl_node hi); |
| 1255 |
|
| 1256 |
/* |
| 1257 |
isRange - returns TRUE if node, n, is a range. |
| 1258 |
*/ |
| 1259 |
|
| 1260 |
EXTERN bool decl_isRange (decl_node n); |
| 1261 |
|
| 1262 |
/* |
| 1263 |
setNoReturn - sets noreturn field inside procedure. |
| 1264 |
*/ |
| 1265 |
|
| 1266 |
EXTERN void decl_setNoReturn (decl_node n, bool value); |
| 1267 |
|
| 1268 |
/* |
| 1269 |
dupExpr - duplicate the expression nodes, it does not duplicate |
| 1270 |
variables, literals, constants but only the expression |
| 1271 |
operators (including function calls and parameter lists). |
| 1272 |
*/ |
| 1273 |
|
| 1274 |
EXTERN decl_node decl_dupExpr (decl_node n); |
| 1275 |
|
| 1276 |
/* |
| 1277 |
setLangC - set the target language as ansi C. |
| 1278 |
*/ |
| 1279 |
|
| 1280 |
EXTERN void decl_setLangC (void); |
| 1281 |
|
| 1282 |
/* |
| 1283 |
setLangCP - set the target language as C++. |
| 1284 |
*/ |
| 1285 |
|
| 1286 |
EXTERN void decl_setLangCP (void); |
| 1287 |
|
| 1288 |
/* |
| 1289 |
setLangM2 - set the target language as Modula-2. |
| 1290 |
*/ |
| 1291 |
|
| 1292 |
EXTERN void decl_setLangM2 (void); |
| 1293 |
|
| 1294 |
/* |
| 1295 |
out - walks the tree of node declarations for the main module |
| 1296 |
and writes the output to the outputFile specified in |
| 1297 |
mcOptions. It outputs the declarations in the language |
| 1298 |
specified above. |
| 1299 |
*/ |
| 1300 |
|
| 1301 |
EXTERN void decl_out (void); |
| 1302 |
# ifdef __cplusplus |
| 1303 |
} |
| 1304 |
# endif |
| 1305 |
|
| 1306 |
# undef EXTERN |
| 1307 |
#endif |