nabaztag_hack_kit 0.1.0.beta3 → 0.1.0.beta8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +7 -2
- data/.gitmodules +3 -0
- data/.travis.yml +2 -2
- data/CHANGELOG.md +17 -2
- data/LICENSE +21 -0
- data/README.md +115 -44
- data/Rakefile +2 -6
- data/bytecode/{Commands.md → _docs/commands.md} +0 -0
- data/bytecode/{Docs.md → _docs/grammar.md} +0 -0
- data/bytecode/_docs/grammar.pdf +0 -0
- data/bytecode/{src → _original}/README.md +0 -0
- data/bytecode/{src → _original}/lib/arp.mtl +0 -0
- data/bytecode/{src → _original}/lib/cfg.mtl +0 -0
- data/bytecode/{src → _original}/lib/choreos.mtl +0 -0
- data/bytecode/{src → _original}/lib/dhcp.mtl +0 -0
- data/bytecode/{src → _original}/lib/dns.mtl +0 -0
- data/bytecode/{src → _original}/lib/http.mtl +0 -0
- data/bytecode/{src → _original}/lib/tcp.mtl +0 -0
- data/bytecode/{src → _original}/lib/udp.mtl +0 -0
- data/bytecode/{src → _original}/lib/util.mtl +0 -0
- data/bytecode/{src → _original}/lib/var.mtl +0 -0
- data/bytecode/{src → _original}/lib/wav.mtl +0 -0
- data/bytecode/{src → _original}/lib/wifi.mtl +0 -0
- data/bytecode/{src → _original}/nominal-ping.mtl +0 -0
- data/bytecode/main.mtl +11 -11
- data/bytecode/test/test.mtl +8 -8
- data/examples/basic/Gemfile +1 -3
- data/examples/basic/config.ru +14 -4
- data/examples/record/Gemfile +0 -5
- data/examples/record/{config.ru.example → config.ru} +2 -2
- data/examples/record/server.rb +0 -2
- data/ext/Makefile +10 -0
- data/ext/bin/mtl_comp +29 -0
- data/{bytecode → ext}/bin/mtl_merge +0 -0
- data/ext/bin/mtl_simu +29 -0
- data/{bytecode/src/mtl → ext}/extconf.rb +0 -0
- data/ext/mtl_linux/.gitignore +7 -0
- data/ext/mtl_linux/LICENSE +21 -0
- data/ext/mtl_linux/Makefile +116 -0
- data/ext/mtl_linux/MetalC.project +196 -0
- data/ext/mtl_linux/conf.bin +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux}/conf.bin.sans_password +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux}/config.txt +0 -0
- data/ext/mtl_linux/inc/log.h +21 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc}/properties.h +0 -0
- data/{bytecode/src/mtl/linux_simuaudio.h → ext/mtl_linux/inc/simu/linux/simuaudio.h} +0 -0
- data/{bytecode/src/mtl/linux_simunet.h → ext/mtl_linux/inc/simu/linux/simunet.h} +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc/simu/win}/simuaudio.h +18 -18
- data/{bytecode/src/mtl → ext/mtl_linux/inc/simu/win}/simunet.h +0 -0
- data/ext/mtl_linux/inc/vcomp/compiler.h +200 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc}/vcomp/file.h +11 -11
- data/{bytecode/src/mtl → ext/mtl_linux/inc}/vcomp/filesystem.h +0 -0
- data/ext/mtl_linux/inc/vcomp/interpreter.h +121 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc}/vcomp/memory.h +120 -92
- data/{bytecode/src/mtl → ext/mtl_linux/inc}/vcomp/param.h +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc}/vcomp/parser.h +27 -27
- data/ext/mtl_linux/inc/vcomp/prodbuffer.h +42 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc}/vcomp/resource.h +1 -1
- data/{bytecode/src/mtl → ext/mtl_linux/inc}/vcomp/terminal.h +8 -8
- data/{bytecode/src/mtl → ext/mtl_linux/inc}/vcomp/util.h +7 -7
- data/{bytecode/src/mtl → ext/mtl_linux/inc/vm}/vaudio.h +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc/vm}/vbc.h +1 -1
- data/ext/mtl_linux/inc/vm/vbc_str.h +167 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc/vm}/vinterp.h +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc/vm}/vloader.h +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc/vm}/vlog.h +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc/vm}/vmem.h +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux/inc/vm}/vnet.h +0 -0
- data/ext/mtl_linux/nominal.mtl +3959 -0
- data/ext/mtl_linux/src/comp/main.cpp +123 -0
- data/ext/mtl_linux/src/simu/dumpbc.c +2566 -0
- data/ext/mtl_linux/src/simu/linux/main.cpp +288 -0
- data/ext/mtl_linux/src/simu/linux/simu.c +309 -0
- data/ext/mtl_linux/src/simu/linux/simuaudio.c +44 -0
- data/ext/mtl_linux/src/simu/linux/simunet.c +707 -0
- data/ext/mtl_linux/src/simu/log.c +340 -0
- data/ext/mtl_linux/src/simu/properties.c +368 -0
- data/{bytecode/src/mtl → ext/mtl_linux/src/simu/win}/mp3/GTKANAL.H +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux/src/simu/win}/mp3/LAYER3.C +0 -0
- data/{bytecode/src/mtl → ext/mtl_linux/src/simu/win}/mp3/TABINIT.C +0 -0
- data/ext/mtl_linux/src/simu/win/mp3/common.c +302 -0
- data/ext/mtl_linux/src/simu/win/mp3/dct64_i386.c +316 -0
- data/ext/mtl_linux/src/simu/win/mp3/decode_i386.c +160 -0
- data/ext/mtl_linux/src/simu/win/mp3/huffman.h +332 -0
- data/ext/mtl_linux/src/simu/win/mp3/interface.c +276 -0
- data/{bytecode/src/mtl → ext/mtl_linux/src/simu/win}/mp3/mpg123.h +34 -30
- data/ext/mtl_linux/src/simu/win/mp3/mpglib.h +47 -0
- data/ext/mtl_linux/src/simu/win/simu.c +819 -0
- data/ext/mtl_linux/src/simu/win/simuaudio.c +787 -0
- data/ext/mtl_linux/src/simu/win/simunet.c +489 -0
- data/ext/mtl_linux/src/vcomp/bootstrap.cpp +95 -0
- data/ext/mtl_linux/src/vcomp/compiler.cpp +587 -0
- data/ext/mtl_linux/src/vcomp/compiler_file.cpp +1253 -0
- data/ext/mtl_linux/src/vcomp/compiler_prog.cpp +437 -0
- data/ext/mtl_linux/src/vcomp/compiler_term.cpp +1500 -0
- data/ext/mtl_linux/src/vcomp/compiler_type.cpp +1238 -0
- data/ext/mtl_linux/src/vcomp/compiler_var.cpp +502 -0
- data/ext/mtl_linux/src/vcomp/file.cpp +100 -0
- data/ext/mtl_linux/src/vcomp/interpreter.cpp +93 -0
- data/ext/mtl_linux/src/vcomp/memory.cpp +313 -0
- data/ext/mtl_linux/src/vcomp/parser.cpp +584 -0
- data/ext/mtl_linux/src/vcomp/parser_xml.cpp +137 -0
- data/{bytecode/src/mtl → ext/mtl_linux/src}/vcomp/prodbuffer.cpp +57 -36
- data/ext/mtl_linux/src/vcomp/stdlib_core.cpp +130 -0
- data/ext/mtl_linux/src/vcomp/terminal.cpp +80 -0
- data/{bytecode/src/mtl → ext/mtl_linux/src}/vcomp/util.cpp +18 -11
- data/ext/mtl_linux/src/vm/vaudio.c +830 -0
- data/ext/mtl_linux/src/vm/vinterp.c +1780 -0
- data/ext/mtl_linux/src/vm/vloader.c +139 -0
- data/ext/mtl_linux/src/vm/vlog.c +782 -0
- data/ext/mtl_linux/src/vm/vmem.c +461 -0
- data/ext/mtl_linux/src/vm/vnet.c +298 -0
- data/{bytecode/src/mtl → ext/mtl_linux}/utils/correct_const.sh +0 -0
- data/lib/nabaztag_hack_kit/server.rb +4 -7
- data/lib/nabaztag_hack_kit/version.rb +1 -1
- data/lib/nabaztag_hack_kit.rb +2 -2
- data/nabaztag_hack_kit.gemspec +10 -11
- data/spec/integration/server_spec.rb +3 -3
- data/spec/spec_helper.rb +2 -0
- data/spec/unit/message_spec.rb +12 -18
- data/spec/unit/server_spec.rb +13 -10
- metadata +145 -137
- data/bytecode/bin/mtl_comp +0 -50
- data/bytecode/bin/mtl_simu +0 -49
- data/bytecode/src/mtl/Makefile +0 -42
- data/bytecode/src/mtl/README.md +0 -13
- data/bytecode/src/mtl/bc.cpp +0 -1891
- data/bytecode/src/mtl/dumpbc.c +0 -2566
- data/bytecode/src/mtl/linux_simu.c +0 -271
- data/bytecode/src/mtl/linux_simuaudio.c +0 -16
- data/bytecode/src/mtl/linux_simunet.c +0 -620
- data/bytecode/src/mtl/log.c +0 -297
- data/bytecode/src/mtl/log.h +0 -20
- data/bytecode/src/mtl/main_compiler.cpp +0 -104
- data/bytecode/src/mtl/main_simu.cpp +0 -221
- data/bytecode/src/mtl/mp3/common.c +0 -265
- data/bytecode/src/mtl/mp3/dct64_i386.c +0 -316
- data/bytecode/src/mtl/mp3/decode_i386.c +0 -155
- data/bytecode/src/mtl/mp3/huffman.h +0 -332
- data/bytecode/src/mtl/mp3/interface.c +0 -258
- data/bytecode/src/mtl/mp3/mpglib.h +0 -44
- data/bytecode/src/mtl/properties.c +0 -293
- data/bytecode/src/mtl/simu.c +0 -750
- data/bytecode/src/mtl/simuaudio.c +0 -662
- data/bytecode/src/mtl/simunet.c +0 -400
- data/bytecode/src/mtl/vaudio.c +0 -677
- data/bytecode/src/mtl/vbc_str.h +0 -166
- data/bytecode/src/mtl/vcomp/Makefile +0 -29
- data/bytecode/src/mtl/vcomp/bootstrap.cpp +0 -89
- data/bytecode/src/mtl/vcomp/compiler.cpp +0 -470
- data/bytecode/src/mtl/vcomp/compiler.h +0 -200
- data/bytecode/src/mtl/vcomp/compiler_file.cpp +0 -929
- data/bytecode/src/mtl/vcomp/compiler_prog.cpp +0 -250
- data/bytecode/src/mtl/vcomp/compiler_term.cpp +0 -1053
- data/bytecode/src/mtl/vcomp/compiler_type.cpp +0 -872
- data/bytecode/src/mtl/vcomp/compiler_var.cpp +0 -289
- data/bytecode/src/mtl/vcomp/file.cpp +0 -79
- data/bytecode/src/mtl/vcomp/interpreter.cpp +0 -85
- data/bytecode/src/mtl/vcomp/interpreter.h +0 -121
- data/bytecode/src/mtl/vcomp/memory.cpp +0 -241
- data/bytecode/src/mtl/vcomp/parser.cpp +0 -427
- data/bytecode/src/mtl/vcomp/parser_xml.cpp +0 -124
- data/bytecode/src/mtl/vcomp/prodbuffer.h +0 -42
- data/bytecode/src/mtl/vcomp/stdlib_core.cpp +0 -122
- data/bytecode/src/mtl/vcomp/terminal.cpp +0 -73
- data/bytecode/src/mtl/vinterp.c +0 -1349
- data/bytecode/src/mtl/vloader.c +0 -127
- data/bytecode/src/mtl/vlog.c +0 -589
- data/bytecode/src/mtl/vmem.c +0 -424
- data/bytecode/src/mtl/vnet.c +0 -255
- data/examples/basic/Procfile +0 -2
- data/examples/basic/server.rb +0 -14
@@ -0,0 +1,313 @@
|
|
1
|
+
//-------------------
|
2
|
+
// MV
|
3
|
+
// version WIN32 et POCKETPC
|
4
|
+
// Sylvain Huet
|
5
|
+
// Premiere version : 07/01/2003
|
6
|
+
// Derniere mise a jour : 07/01/2003
|
7
|
+
//
|
8
|
+
|
9
|
+
#include <stdio.h>
|
10
|
+
#include <string.h>
|
11
|
+
#include <stdint.h>
|
12
|
+
|
13
|
+
#include "param.h"
|
14
|
+
#include "terminal.h"
|
15
|
+
#include "memory.h"
|
16
|
+
#include "util.h"
|
17
|
+
#include "interpreter.h"
|
18
|
+
|
19
|
+
#define GCincPeriod 20
|
20
|
+
|
21
|
+
|
22
|
+
// Gestion de la pile
|
23
|
+
Stack::Stack()
|
24
|
+
{
|
25
|
+
base=NULL;
|
26
|
+
}
|
27
|
+
Stack::~Stack()
|
28
|
+
{
|
29
|
+
if (base)
|
30
|
+
{
|
31
|
+
delete base;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
void Stack::dump(FILE *f)
|
36
|
+
{
|
37
|
+
const char* buf="stck";
|
38
|
+
fwrite((void*)buf,1,4,f);
|
39
|
+
fwrite((void*)&size,1,4,f);
|
40
|
+
fwrite((void*)&pp,1,4,f);
|
41
|
+
fwrite((void*)&base,1,4,f);
|
42
|
+
fwrite((void*)base,1,4*size,f);
|
43
|
+
}
|
44
|
+
|
45
|
+
void Stack::initialize(int s)
|
46
|
+
{
|
47
|
+
size=s;
|
48
|
+
base=new intptr_t[size];
|
49
|
+
pp=base;
|
50
|
+
}
|
51
|
+
|
52
|
+
int Stack::bigger(Memory* m)
|
53
|
+
{
|
54
|
+
int currentpp=pp-base;
|
55
|
+
|
56
|
+
size*=2;
|
57
|
+
|
58
|
+
intptr_t* newbase=new intptr_t[size];
|
59
|
+
if (!newbase)
|
60
|
+
{
|
61
|
+
PRINTF(m)(LOG_RUNTIME,"Stack : out of Stack Memory\n");
|
62
|
+
AbortMetal(m,1);
|
63
|
+
return MTLERR_OM; // impossible d'augmenter la taille de la pile
|
64
|
+
}
|
65
|
+
int i;
|
66
|
+
for(i=0; i<=currentpp; i++)
|
67
|
+
{
|
68
|
+
newbase[i]=base[i];
|
69
|
+
}
|
70
|
+
delete base;
|
71
|
+
base=newbase;
|
72
|
+
pp=&base[currentpp];
|
73
|
+
return 0;
|
74
|
+
}
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
// ajout d'une racine
|
80
|
+
intptr_t Memory::addroot(intptr_t *p)
|
81
|
+
{
|
82
|
+
intptr_t k;
|
83
|
+
|
84
|
+
if (k=push(PNTTOVAL(p)))
|
85
|
+
{
|
86
|
+
return k;
|
87
|
+
}
|
88
|
+
intptr_t* r=malloc(LIST_LENGTH,TYPE_TAB);
|
89
|
+
TABSET(this,r,LIST_VAL,PNTTOVAL(p));
|
90
|
+
TABSET(this,r,LIST_NEXT,root);
|
91
|
+
root=PNTTOVAL(r);
|
92
|
+
STACKDROP(this);
|
93
|
+
return 0;
|
94
|
+
}
|
95
|
+
|
96
|
+
// suppression d'une racine
|
97
|
+
void Memory::removeroot(intptr_t *p)
|
98
|
+
{
|
99
|
+
intptr_t* last=NULL; // pointeur vers le précédent maillon de la liste
|
100
|
+
intptr_t vq=root;
|
101
|
+
while(vq!=NIL)
|
102
|
+
{
|
103
|
+
intptr_t* q=VALTOPNT(vq);
|
104
|
+
if (TABGET(q,LIST_VAL)==PNTTOVAL(p))
|
105
|
+
{
|
106
|
+
if (last)
|
107
|
+
{
|
108
|
+
TABSET(this,last,LIST_NEXT,TABGET(q,LIST_NEXT));
|
109
|
+
}
|
110
|
+
else
|
111
|
+
{
|
112
|
+
root=TABGET(q,LIST_NEXT);
|
113
|
+
}
|
114
|
+
return;
|
115
|
+
}
|
116
|
+
last=q;
|
117
|
+
vq=TABGET(q,LIST_NEXT);
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
Memory::Memory(int size,Terminal *t,FileSystem *fs)
|
122
|
+
{
|
123
|
+
term=t;
|
124
|
+
filesystem=fs;
|
125
|
+
size0=size; // on retient la taille initiale, elle sert d'ordre de grandeur
|
126
|
+
gcincperiod=GCincPeriod;
|
127
|
+
abort=0;
|
128
|
+
|
129
|
+
util=new Util(this);
|
130
|
+
winutil=NULL;
|
131
|
+
// listing();
|
132
|
+
}
|
133
|
+
|
134
|
+
Memory::~Memory()
|
135
|
+
{
|
136
|
+
// if (winutil) delete winutil;
|
137
|
+
delete util;
|
138
|
+
}
|
139
|
+
|
140
|
+
void Memory::stop()
|
141
|
+
{
|
142
|
+
abort=1;
|
143
|
+
util->stop();
|
144
|
+
root=NIL;
|
145
|
+
stack.pp=0;
|
146
|
+
}
|
147
|
+
|
148
|
+
int Memory::start()
|
149
|
+
{
|
150
|
+
root=NIL;
|
151
|
+
|
152
|
+
stack.initialize(STACK_FIRST_SIZE);
|
153
|
+
|
154
|
+
PRINTF(this)(LOG_RUNTIME,"Metal Virtual Machine\n");
|
155
|
+
PRINTF(this)(LOG_RUNTIME,"V0.2 - Sylvain Huet - 2005\n");
|
156
|
+
PRINTF(this)(LOG_RUNTIME,"--------------------------\n");
|
157
|
+
return util->start();
|
158
|
+
}
|
159
|
+
|
160
|
+
void Memory::dump()
|
161
|
+
{
|
162
|
+
}
|
163
|
+
|
164
|
+
|
165
|
+
intptr_t* Memory::malloc(int size,int type)
|
166
|
+
{
|
167
|
+
intptr_t *p=NULL;
|
168
|
+
|
169
|
+
int blocsize=size+HEADER_LENGTH;
|
170
|
+
p=new intptr_t[blocsize];
|
171
|
+
if (!p)
|
172
|
+
{
|
173
|
+
return p;
|
174
|
+
}
|
175
|
+
|
176
|
+
HEADERSETSIZETYPE(p,blocsize,type);
|
177
|
+
|
178
|
+
return p;
|
179
|
+
}
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
intptr_t* Memory::mallocClear(int size)
|
184
|
+
{
|
185
|
+
intptr_t* p=malloc(size,TYPE_TAB);
|
186
|
+
if (!p)
|
187
|
+
{
|
188
|
+
return p;
|
189
|
+
}
|
190
|
+
int i;
|
191
|
+
for(i=0; i<size; i++)
|
192
|
+
{
|
193
|
+
TABSET(this,p,i,NIL);
|
194
|
+
}
|
195
|
+
return p;
|
196
|
+
}
|
197
|
+
|
198
|
+
// allocation de type TYPE_EXT (la fonction fun(pnt) sera appelée lors de l'oubli du bloc)
|
199
|
+
intptr_t* Memory::mallocExternal(void* pnt,FORGET fun)
|
200
|
+
{
|
201
|
+
intptr_t* p=malloc(2,TYPE_EXT);
|
202
|
+
if (!p)
|
203
|
+
{
|
204
|
+
return p;
|
205
|
+
}
|
206
|
+
TABSET(this,p,0,*((intptr_t*)pnt));
|
207
|
+
TABSET(this,p,1,*((intptr_t*)fun));
|
208
|
+
return p;
|
209
|
+
}
|
210
|
+
|
211
|
+
// allocation de type TYPE_EXT (la fonction fun(pnt) sera appelée lors de l'oubli du bloc)
|
212
|
+
intptr_t Memory::pushExternal(void* pnt,FORGET fun)
|
213
|
+
{
|
214
|
+
intptr_t* p=mallocExternal(pnt,fun);
|
215
|
+
if (!p)
|
216
|
+
{
|
217
|
+
return MTLERR_OM;
|
218
|
+
}
|
219
|
+
return push(PNTTOVAL(p));
|
220
|
+
}
|
221
|
+
|
222
|
+
intptr_t* Memory::storenosrc(int size)
|
223
|
+
{
|
224
|
+
// calcul de la taille d'un bloc pouvant contenir une certain nombre de caractères
|
225
|
+
// il faut 1 mot pour la taille et un octet nul final
|
226
|
+
int l=2+(size>>2);
|
227
|
+
|
228
|
+
intptr_t* p=malloc(l,TYPE_BINARY);
|
229
|
+
if (!p)
|
230
|
+
{
|
231
|
+
return p;
|
232
|
+
}
|
233
|
+
STRSETLEN(p,size);
|
234
|
+
STRSTART(p)[size]=0;
|
235
|
+
return p;
|
236
|
+
}
|
237
|
+
|
238
|
+
intptr_t* Memory::storebinary(const char *src,int size)
|
239
|
+
{
|
240
|
+
// calcul de la taille d'un bloc pouvant contenir une certain nombre de caractères
|
241
|
+
// il faut 1 mot pour la taille et un octet nul final
|
242
|
+
int l=2+(size>>2);
|
243
|
+
|
244
|
+
intptr_t* p=malloc(l,TYPE_BINARY);
|
245
|
+
if (!p)
|
246
|
+
{
|
247
|
+
return p;
|
248
|
+
}
|
249
|
+
STRSETLEN(p,size);
|
250
|
+
memcpy(STRSTART(p),src,size);
|
251
|
+
STRSTART(p)[size]=0;
|
252
|
+
return p;
|
253
|
+
}
|
254
|
+
|
255
|
+
intptr_t* Memory::storestring(const char *src)
|
256
|
+
{
|
257
|
+
return storebinary(src,strlen(src));
|
258
|
+
}
|
259
|
+
|
260
|
+
int Memory::deftab(int size)
|
261
|
+
{
|
262
|
+
intptr_t* p=malloc(size,TYPE_TAB);
|
263
|
+
if (!p)
|
264
|
+
{
|
265
|
+
return MTLERR_OM;
|
266
|
+
}
|
267
|
+
int i;
|
268
|
+
for(i=size-1; i>=0; i--)
|
269
|
+
{
|
270
|
+
TABSET(this,p,i,STACKPULL(this));
|
271
|
+
}
|
272
|
+
return push(PNTTOVAL(p));
|
273
|
+
}
|
274
|
+
|
275
|
+
const char* Memory::errorname(int err)
|
276
|
+
{
|
277
|
+
if (err==MTLERR_OM)
|
278
|
+
{
|
279
|
+
return "Out of memory";
|
280
|
+
}
|
281
|
+
else if (err==MTLERR_OP)
|
282
|
+
{
|
283
|
+
return "Unknown Operand";
|
284
|
+
}
|
285
|
+
else if (err==MTLERR_DIV)
|
286
|
+
{
|
287
|
+
return "Division by zero";
|
288
|
+
}
|
289
|
+
else if (err==MTLERR_RET)
|
290
|
+
{
|
291
|
+
return "Bad implementation on 'return'";
|
292
|
+
}
|
293
|
+
else if (err==MTLERR_NOFUN)
|
294
|
+
{
|
295
|
+
return "No function defined";
|
296
|
+
}
|
297
|
+
else if (err==MTLERR_SN)
|
298
|
+
{
|
299
|
+
return "Syntax error";
|
300
|
+
}
|
301
|
+
else if (err==MTLERR_TYPE)
|
302
|
+
{
|
303
|
+
return "Typechecking error";
|
304
|
+
}
|
305
|
+
else if (err==MTLERR_ABORT)
|
306
|
+
{
|
307
|
+
return "Application aborted";
|
308
|
+
}
|
309
|
+
else
|
310
|
+
{
|
311
|
+
return "Unknown error";
|
312
|
+
}
|
313
|
+
}
|