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

Last change on this file since 4689 was 4650, checked in by nmedfort, 4 years ago

Partial roll back of Trie structure. Seemed to introduce the potential of generating a cycle in the AST. More analysis is needed here before mixing together multiple Advance DAG traversals.

File size: 1.3 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 NextAllocator = VectorAllocator::rebind<Next*>::other;
21    using NextVars = std::vector<Next *, NextAllocator>;
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 const NextVars & getVariants() const {
35        return mNext;
36    }
37    inline PabloBlock & getBody() {
38        return mBody;
39    }
40    inline PabloBlock & getBody() const {
41        return mBody;
42    }
43protected:
44    While(PabloAST * expr, const std::initializer_list<Next *> nextVars, PabloBlock &body);
45    While(PabloAST * expr, const std::vector<Next *> & nextVars, PabloBlock &body);
46
47private:
48    PabloBlock &    mBody;
49    NextVars        mNext;
50};
51
52}
53
54#endif // PS_WHILE_H
55
56
Note: See TracBrowser for help on using the repository browser.