source: icGREP/icgrep-devel/icgrep/pablo/ps_while.h @ 5157

Last change on this file since 5157 was 5037, checked in by nmedfort, 3 years ago

UnicodeSet? bug fix and compile warning clean-up.

File size: 1.4 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_WHILE_H
8#define PS_WHILE_H
9
10#include <pablo/pabloAST.h>
11
12namespace pablo {
13
14class Next;
15
16class While : public Statement {
17    friend class PabloBlock;
18public:
19
20    using VariantAllocator = SlabAllocator<Next *>;
21    using Variants = std::vector<Next *, VariantAllocator>;
22
23    static inline bool classof(const PabloAST * e) {
24        return e->getClassTypeId() == ClassTypeId::While;
25    }
26    static inline bool classof(const void *) {
27        return false;
28    }
29    virtual ~While() {
30    }
31    inline PabloAST * getCondition() const {
32        return getOperand(0);
33    }
34    inline Variants & getVariants() {
35        return mVariant;
36    }
37    inline const Variants & getVariants() const {
38        return mVariant;
39    }
40    inline PabloBlock * getBody() {
41        return mBody;
42    }
43    inline PabloBlock * getBody() const {
44        return mBody;
45    }
46    PabloBlock * setBody(PabloBlock * body);
47protected:
48    While(PabloAST * expr, const std::initializer_list<Next *> nextVars, PabloBlock * body);
49    While(PabloAST * expr, const std::vector<Next *> & nextVars, PabloBlock * body);
50
51private:
52    PabloBlock *            mBody;
53    Variants                mVariant;
54    static VariantAllocator mVariantAllocator;
55};
56
57}
58
59#endif // PS_WHILE_H
60
61
Note: See TracBrowser for help on using the repository browser.