source: icGREP/icgrep-devel/icgrep/pablo/builder.hpp @ 4432

Last change on this file since 4432 was 4432, checked in by nmedfort, 5 years ago

Temporary check in.

File size: 1.7 KB
Line 
1#ifndef BUILDER_HPP
2#define BUILDER_HPP
3
4#include "codegenstate.h"
5#include "expression_map.hpp"
6
7namespace pablo {
8
9class Builder {
10public:
11    PabloAST * createAdvance(PabloAST * expr, const int shiftAmount);
12
13    inline Zeroes * createZeroes() const {
14        return mPb->createZeroes();
15    }
16
17    inline Ones * createOnes() const {
18        return mPb->createOnes();
19    }
20
21    inline Call * createCall(const std::string name) {
22        return createCall(mPb->getName(name));
23    }
24
25    Call * createCall(String * name);
26
27    Assign * createAssign(const std::string prefix, PabloAST * expr, const int outputIndex = -1);
28
29    Var * createVar(const std::string name) {
30        return createVar(mPb->getName(name));
31    }
32
33    Var * createVar(String * name);
34
35    PabloAST * createVar(const PabloAST * const) {
36        throw std::runtime_error("Var objects should only refer to external Vars (i.e., input basis bit streams). Use Assign objects directly.");
37    }
38
39    Next * createNext(Assign * assign, PabloAST * expr);
40
41    PabloAST * createAnd(PabloAST * expr1, PabloAST * expr2);
42
43    PabloAST * createNot(PabloAST * expr);
44
45    PabloAST * createOr(PabloAST * expr1, PabloAST * expr2);
46
47    PabloAST * createXor(PabloAST * expr1, PabloAST * expr2);
48
49    PabloAST * createMatchStar(PabloAST * marker, PabloAST * charclass);
50
51    PabloAST * createScanThru(PabloAST * from, PabloAST * thru);
52
53    PabloAST * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr);
54
55    If * createIf(PabloAST * condition, std::vector<Assign *> && definedVars, PabloBlock & body);
56
57    While * createWhile(PabloAST * cond, PabloBlock & body);
58
59private:
60
61    PabloBlock * mPb;
62
63};
64
65
66}
67
68
69#endif // BUILDER_HPP
Note: See TracBrowser for help on using the repository browser.