| 1 |
(* SymbolConversion.def mapping between m2 symbols and gcc symbols. |
| 2 |
|
| 3 |
Copyright (C) 2001-2025 Free Software Foundation, Inc. |
| 4 |
Contributed by Gaius Mulley <[email protected]>. |
| 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 SymbolConversion ; |
| 23 |
|
| 24 |
(* |
| 25 |
Title : SymbolConversion |
| 26 |
Author : Gaius Mulley |
| 27 |
System : UNIX (gm2) |
| 28 |
Date : Mon Jul 26 09:49:36 1999 |
| 29 |
Description: mapping between m2 symbols and gcc symbols. |
| 30 |
*) |
| 31 |
|
| 32 |
FROM gcctypes IMPORT tree ; |
| 33 |
FROM SYSTEM IMPORT WORD ; |
| 34 |
|
| 35 |
|
| 36 |
(* |
| 37 |
Mod2Gcc - given a modula-2 symbol, sym, return the gcc equivalent. |
| 38 |
*) |
| 39 |
|
| 40 |
PROCEDURE Mod2Gcc (sym: CARDINAL) : tree ; |
| 41 |
|
| 42 |
|
| 43 |
(* |
| 44 |
Gcc2Mod - given a gcc tree return the modula-2 symbol. |
| 45 |
*) |
| 46 |
|
| 47 |
PROCEDURE Gcc2Mod (tree: tree) : CARDINAL ; |
| 48 |
|
| 49 |
|
| 50 |
(* |
| 51 |
AddModGcc - adds the tuple [ sym, gcc ] into the database. |
| 52 |
*) |
| 53 |
|
| 54 |
PROCEDURE AddModGcc (sym: CARDINAL; gcc: tree) ; |
| 55 |
|
| 56 |
|
| 57 |
(* |
| 58 |
RemoveMod2Gcc - removes the gcc symbol from the lookup table. |
| 59 |
*) |
| 60 |
|
| 61 |
PROCEDURE RemoveMod2Gcc (sym: CARDINAL) ; |
| 62 |
|
| 63 |
|
| 64 |
(* |
| 65 |
GccKnowsAbout - returns TRUE if gcc knows about the symbol, sym. |
| 66 |
*) |
| 67 |
|
| 68 |
PROCEDURE GccKnowsAbout (sym: CARDINAL) : BOOLEAN ; |
| 69 |
|
| 70 |
|
| 71 |
(* |
| 72 |
AddTemporaryKnown - adds a temporary gcc symbol against the modula-2 sym. |
| 73 |
*) |
| 74 |
|
| 75 |
PROCEDURE AddTemporaryKnown (sym: CARDINAL) ; |
| 76 |
|
| 77 |
|
| 78 |
(* |
| 79 |
RemoveTemporaryKnown - removes the temporary symbol. |
| 80 |
*) |
| 81 |
|
| 82 |
PROCEDURE RemoveTemporaryKnown (sym: CARDINAL) ; |
| 83 |
|
| 84 |
|
| 85 |
(* |
| 86 |
Poison - poisons a symbol. |
| 87 |
*) |
| 88 |
|
| 89 |
PROCEDURE Poison (sym: WORD) ; |
| 90 |
|
| 91 |
|
| 92 |
END SymbolConversion. |