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
15mal_export InstrPtr newStmt(MalBlkPtr mb, const char *module, const char *name);
16mal_export InstrPtr newStmtArgs(MalBlkPtr mb, const char *module, const char *name, int args);
17mal_export InstrPtr newAssignment(MalBlkPtr mb);
18mal_export InstrPtr newComment(MalBlkPtr mb, const char *val);
19mal_export InstrPtr newCatchStmt(MalBlkPtr mb, str nme);
20mal_export InstrPtr newRaiseStmt(MalBlkPtr mb, str nme);
21mal_export InstrPtr newExitStmt(MalBlkPtr mb, str nme);
22mal_export InstrPtr newReturnStmt(MalBlkPtr mb);
23mal_export InstrPtr newFcnCall(MalBlkPtr mb, char *mod, char *fcn);
24mal_export InstrPtr pushSht(MalBlkPtr mb, InstrPtr q, sht val);
25mal_export InstrPtr pushEndInstruction(MalBlkPtr mb);
26mal_export InstrPtr pushInt(MalBlkPtr mb, InstrPtr q, int val);
27mal_export InstrPtr pushLng(MalBlkPtr mb, InstrPtr q, lng val);
28#ifdef HAVE_HGE
29mal_export InstrPtr pushHge(MalBlkPtr mb, InstrPtr q, hge val);
30#endif
31mal_export InstrPtr pushBte(MalBlkPtr mb, InstrPtr q, bte val);
32mal_export InstrPtr pushOid(MalBlkPtr mb, InstrPtr q, oid val);
33mal_export InstrPtr pushVoid(MalBlkPtr mb, InstrPtr q);
34mal_export InstrPtr pushDbl(MalBlkPtr mb, InstrPtr q, dbl val);
35mal_export InstrPtr pushFlt(MalBlkPtr mb, InstrPtr q, flt val);
36mal_export InstrPtr pushStr(MalBlkPtr mb, InstrPtr q, const char *val);
37mal_export InstrPtr pushBit(MalBlkPtr mb, InstrPtr q, bit val);
38mal_export InstrPtr pushNil(MalBlkPtr mb, InstrPtr q, int tpe);
39mal_export InstrPtr pushType(MalBlkPtr mb, InstrPtr q, int tpe);
40mal_export InstrPtr pushNilType(MalBlkPtr mb, InstrPtr q, char *tpe);
41mal_export InstrPtr pushZero(MalBlkPtr mb, InstrPtr q, int tpe);
42mal_export InstrPtr pushEmptyBAT(MalBlkPtr mb, InstrPtr q, int tpe);
43mal_export InstrPtr pushValue(MalBlkPtr mb, InstrPtr q, ValPtr cst);
44
45mal_export int getIntConstant(MalBlkPtr mb, int val);
46mal_export int getLngConstant(MalBlkPtr mb, lng val);
47mal_export int getShtConstant(MalBlkPtr mb, sht val);
48mal_export int getBteConstant(MalBlkPtr mb, bte val);
49mal_export int getOidConstant(MalBlkPtr mb, oid val);
50mal_export int getDblConstant(MalBlkPtr mb, dbl val);
51mal_export int getFltConstant(MalBlkPtr mb, flt val);
52mal_export int getStrConstant(MalBlkPtr mb, str val);
53mal_export int getBitConstant(MalBlkPtr mb, bit val);
54#ifdef HAVE_HGE
55mal_export int getHgeConstant(MalBlkPtr mb, hge val);
56#endif
57#endif /* _MAL_BUILDER_ */
58
59