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

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

Minor revisions

File size: 1.1 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 "pe_pabloe.h"
11#include <string>
12
13namespace pablo {
14
15class Assign : public PabloE {
16    friend Assign * makeAssign(const std::string, PabloE *);
17public:
18    static inline bool classof(const PabloE * e) {
19        return e->getClassTypeId() == ClassTypeId::Assign;
20    }
21    static inline bool classof(const void *) {
22        return false;
23    }
24    virtual ~Assign() {
25        delete mExpr;
26    }
27
28    inline const std::string & getM() const {
29        return mM;
30    }
31
32    inline PabloE * getExpr() const {
33        return mExpr;
34    }
35protected:
36    Assign(const std::string m, PabloE * expr)
37    : PabloE(ClassTypeId::Assign)
38    , mM(m)
39    , mExpr(expr)
40    {
41
42    }
43private:
44    const std::string   mM;
45    PabloE * const      mExpr;
46};
47
48inline Assign * makeAssign(const std::string marker, PabloE * expr) {
49    return new Assign(marker, expr);
50}
51
52}
53
54#endif // PS_SETMARKER_H
55
Note: See TracBrowser for help on using the repository browser.