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

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

Implemented slab allocator based on the original Parabix StringPool?; intergrated it with RE and Pablo AST nodes.

File size: 1.3 KB
RevLine 
[3850]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
[4213]10#include <pablo/pe_string.h>
[3850]11
[4199]12namespace pablo {
13
[4244]14class Assign : public PabloAST {
[4227]15    friend class PabloBlock;
[4252]16    friend class Next;
[3850]17public:
[4244]18    static inline bool classof(const PabloAST * e) {
[4200]19        return e->getClassTypeId() == ClassTypeId::Assign;
[4199]20    }
[4200]21    static inline bool classof(const void *) {
22        return false;
23    }
[4199]24    virtual ~Assign() {
25    }
[4257]26    inline const String * getName() const {
27        return mName;
[4199]28    }
[4244]29    inline PabloAST * getExpr() const {
[4199]30        return mExpr;
31    }
[4268]32    inline bool isOutputAssignment() const {
33        return mOutputIndex >= 0;
[4266]34    }
[4268]35    inline int getOutputIndex() const {
36        return mOutputIndex;
37    }
[4200]38protected:
[4272]39    void* operator new (std::size_t size) noexcept {
40        return mAllocator.allocate(size);
41    }
[4268]42    Assign(PabloAST * name, PabloAST * expr, const int outputIndex)
[4244]43    : PabloAST(ClassTypeId::Assign)
[4214]44    , mName(cast<String>(name))
[4200]45    , mExpr(expr)
[4268]46    , mOutputIndex(outputIndex)
[4200]47    {
48
49    }
[3850]50private:
[4252]51    String * const          mName;
52    PabloAST * const        mExpr;
[4268]53    const int               mOutputIndex;
[3850]54};
55
[4199]56}
57
[3850]58#endif // PS_SETMARKER_H
59
Note: See TracBrowser for help on using the repository browser.