| |
| /pliant/language/compiler/instruction/instruction1.pli |
| |
| 1 |
# Copyright Hubert Tonneau hubert.tonneau@pliant.cx | |
| 2 |
# | |
| 3 |
# This program is free software; you can redistribute it and/or | |
| 4 |
# modify it under the terms of the GNU General Public License version 2 | |
| 5 |
# as published by the Free Software Foundation. | |
| 6 |
# | |
| 7 |
# This program is distributed in the hope that it will be useful, | |
| 8 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 9 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 10 |
# GNU General Public License for more details. | |
| 11 |
# | |
| 12 |
# You should have received a copy of the GNU General Public License | |
| 13 |
# version 2 along with this program; if not, write to the Free Software | |
| 14 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
| 15 |
| |
| 16 |
scope "/pliant/language/" "/pliant/install/" | |
| 17 |
module "/pliant/install/ring1.pli" | |
| 18 |
| |
| 19 |
public | |
| 20 |
| |
| 21 |
method i size -> s | |
| 22 |
arg Instruction i ; arg Int s | |
| 23 |
s := i:arguments:size | |
| 24 |
| |
| 25 |
| |
| 26 |
method i 'size :=' n | |
| 27 |
arg_rw Instruction i ; arg Int n | |
| 28 |
i:arguments 'size :=' n | |
| 29 |
| |
| 30 |
| |
| 31 |
method i '' u -> iu | |
| 32 |
arg Instruction i ; arg Int u ; arg_C Link:Argument iu | |
| 33 |
return ((addressof i:arguments:u) map Link:Argument) | |
| 34 |
| |
| 35 |
| |
| 36 |
function compare i1 i2 -> c | |
| 37 |
arg Instruction i1 i2 ; arg Int c | |
| 38 |
if addressof:i1=addressof:i2 | |
| 39 |
c := compare_equal | |
| 40 |
else | |
| 41 |
c := compare_different | |
| 42 |
| |
| |