source: icGREP/icgrep-devel/icgrep/pablo/ps_assign.h @ 4214

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

Partial implementation of 'PabloBuilder?'.

File size: 1.2 KB
Line 
1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef PS_SETMARKER_H
8#define PS_SETMARKER_H
9
10#include <pablo/pe_pabloe.h>
11#include <pablo/pe_string.h>
12
13namespace pablo {
14
15class Var;
16
17class Assign : public PabloE {
18    friend Assign * makeAssign(String *, PabloE *);
19    friend Var * makeVar(Assign *);
20    friend struct CodeGenState;
21public:
22    static inline bool classof(const PabloE * e) {
23        return e->getClassTypeId() == ClassTypeId::Assign;
24    }
25    static inline bool classof(const void *) {
26        return false;
27    }
28    virtual ~Assign() {
29    }
30    inline const std::string & getName() const {
31        return *mName;
32    }
33    inline PabloE * getExpr() const {
34        return mExpr;
35    }
36protected:
37    Assign(PabloE * name, PabloE * expr)
38    : PabloE(ClassTypeId::Assign)
39    , mName(cast<String>(name))
40    , mExpr(expr)
41    {
42
43    }
44private:
45    const String * const    mName;
46    PabloE * const          mExpr;
47};
48
49inline Assign * makeAssign(String * marker, PabloE * expr) {
50    return new Assign(marker, expr);
51}
52
53}
54
55#endif // PS_SETMARKER_H
56
Note: See TracBrowser for help on using the repository browser.