1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
/*****
* builtin.h
* Tom Prince 2004/08/25
*
* Initialize builtins.
*****/
#ifndef BUILTIN_H
#define BUILTIN_H
#include "vm.h"
#include "types.h"
namespace trans {
class tenv;
class venv;
// The base environments for built-in types and functions
void base_tenv(tenv &);
void base_venv(venv &);
extern const types::formal noformal;
// Add a function with one or more default arguments.
void addFunc(venv &ve, vm::bltin f, types::ty *result, symbol *name,
types::formal f1=noformal, types::formal f2=noformal,
types::formal f3=noformal, types::formal f4=noformal,
types::formal f5=noformal, types::formal f6=noformal,
types::formal f7=noformal, types::formal f8=noformal,
types::formal f9=noformal, types::formal fA=noformal,
types::formal fB=noformal, types::formal fC=noformal,
types::formal fD=noformal, types::formal fE=noformal,
types::formal fF=noformal, types::formal fG=noformal,
types::formal fH=noformal, types::formal fI=noformal);
// Adds standard functions for a newly added types.
void addArrayOps(venv &ve, types::array *t);
void addRecordOps(venv &ve, types::record *r);
void addFunctionOps(venv &ve, types::function *f);
types::record *getGSLModule();
} //namespace trans
namespace run {
extern double infinity;
void single(vm::stack *Stack);
void arrayDeleteHelper(vm::stack *Stack);
}
#endif //BUILTIN_H
|