1 | /* |
2 | * This Source Code Form is subject to the terms of the Mozilla Public |
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
5 | * |
6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
7 | */ |
8 | |
9 | #ifndef _MAL_BUILDER_ |
10 | #define _MAL_BUILDER_ |
11 | |
12 | #include "mal.h" |
13 | #include "mal_instruction.h" |
14 | |
15 | mal_export InstrPtr newStmt(MalBlkPtr mb, const char *module, const char *name); |
16 | mal_export InstrPtr newStmtArgs(MalBlkPtr mb, const char *module, const char *name, int args); |
17 | mal_export InstrPtr newAssignment(MalBlkPtr mb); |
18 | mal_export InstrPtr (MalBlkPtr mb, const char *val); |
19 | mal_export InstrPtr newCatchStmt(MalBlkPtr mb, str nme); |
20 | mal_export InstrPtr newRaiseStmt(MalBlkPtr mb, str nme); |
21 | mal_export InstrPtr newExitStmt(MalBlkPtr mb, str nme); |
22 | mal_export InstrPtr newReturnStmt(MalBlkPtr mb); |
23 | mal_export InstrPtr newFcnCall(MalBlkPtr mb, char *mod, char *fcn); |
24 | mal_export InstrPtr pushSht(MalBlkPtr mb, InstrPtr q, sht val); |
25 | mal_export InstrPtr pushEndInstruction(MalBlkPtr mb); |
26 | mal_export InstrPtr pushInt(MalBlkPtr mb, InstrPtr q, int val); |
27 | mal_export InstrPtr pushLng(MalBlkPtr mb, InstrPtr q, lng val); |
28 | #ifdef HAVE_HGE |
29 | mal_export InstrPtr pushHge(MalBlkPtr mb, InstrPtr q, hge val); |
30 | #endif |
31 | mal_export InstrPtr pushBte(MalBlkPtr mb, InstrPtr q, bte val); |
32 | mal_export InstrPtr pushOid(MalBlkPtr mb, InstrPtr q, oid val); |
33 | mal_export InstrPtr pushVoid(MalBlkPtr mb, InstrPtr q); |
34 | mal_export InstrPtr pushDbl(MalBlkPtr mb, InstrPtr q, dbl val); |
35 | mal_export InstrPtr pushFlt(MalBlkPtr mb, InstrPtr q, flt val); |
36 | mal_export InstrPtr pushStr(MalBlkPtr mb, InstrPtr q, const char *val); |
37 | mal_export InstrPtr pushBit(MalBlkPtr mb, InstrPtr q, bit val); |
38 | mal_export InstrPtr pushNil(MalBlkPtr mb, InstrPtr q, int tpe); |
39 | mal_export InstrPtr pushType(MalBlkPtr mb, InstrPtr q, int tpe); |
40 | mal_export InstrPtr pushNilType(MalBlkPtr mb, InstrPtr q, char *tpe); |
41 | mal_export InstrPtr pushZero(MalBlkPtr mb, InstrPtr q, int tpe); |
42 | mal_export InstrPtr pushEmptyBAT(MalBlkPtr mb, InstrPtr q, int tpe); |
43 | mal_export InstrPtr pushValue(MalBlkPtr mb, InstrPtr q, ValPtr cst); |
44 | |
45 | mal_export int getIntConstant(MalBlkPtr mb, int val); |
46 | mal_export int getLngConstant(MalBlkPtr mb, lng val); |
47 | mal_export int getShtConstant(MalBlkPtr mb, sht val); |
48 | mal_export int getBteConstant(MalBlkPtr mb, bte val); |
49 | mal_export int getOidConstant(MalBlkPtr mb, oid val); |
50 | mal_export int getDblConstant(MalBlkPtr mb, dbl val); |
51 | mal_export int getFltConstant(MalBlkPtr mb, flt val); |
52 | mal_export int getStrConstant(MalBlkPtr mb, str val); |
53 | mal_export int getBitConstant(MalBlkPtr mb, bit val); |
54 | #ifdef HAVE_HGE |
55 | mal_export int getHgeConstant(MalBlkPtr mb, hge val); |
56 | #endif |
57 | #endif /* _MAL_BUILDER_ */ |
58 | |
59 | |