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