source: icGREP/icgrep-devel/icgrep/pablo/pe_next.h @ 4713

Last change on this file since 4713 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: 863 bytes
Line 
1#ifndef PE_NEXT_H
2#define PE_NEXT_H
3
4#include <pablo/pabloAST.h>
5#include <pablo/ps_assign.h>
6#include <pablo/symbol_generator.h>
7#include <array>
8
9namespace pablo {
10
11class Next : public Statement {
12    friend class PabloBlock;
13public:
14    static inline bool classof(const PabloAST * e) {
15        return e->getClassTypeId() == ClassTypeId::Next;
16    }
17    static inline bool classof(const void *) {
18        return false;
19    }
20    inline const Assign * getInitial() const {
21        return cast<const Assign>(getOperand(1));
22    }
23    inline PabloAST * getExpr() const {
24        return getOperand(0);
25    }
26    virtual ~Next() {}
27protected:
28    explicit Next(PabloAST * initial, PabloAST * expr)
29    : Statement(ClassTypeId::Next, {expr, cast<Assign>(initial)}, cast<Assign>(initial)->getName()) {
30        this->addUser(initial);
31    }
32};
33
34}
35
36
37#endif // PE_NEXT_H
Note: See TracBrowser for help on using the repository browser.