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

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

Partial implementation of 'PabloBuilder?'.

File size: 1.1 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/pe_pabloe.h>
11#include <list>
12
13namespace pablo {
14
15class While : public PabloE {
16    friend struct CodeGenState;
17public:
18    typedef std::list<PabloE*> List;
19    friend While * makeWhile(PabloE * expr, List psl);
20
21    static inline bool classof(const PabloE * e) {
22        return e->getClassTypeId() == ClassTypeId::While;
23    }
24    static inline bool classof(const void *) {
25        return false;
26    }
27    virtual ~While() {
28    }
29    inline PabloE * getExpr() const {
30        return mExpr;
31    }
32    inline const List & getPSList() const {
33        return mPSList;
34    }
35protected:
36    While(PabloE * expr, List psl)
37    : PabloE(ClassTypeId::While)
38    , mExpr(expr)
39    , mPSList(psl)
40    {
41
42    }
43private:
44    PabloE * const  mExpr;
45    List            mPSList;
46};
47
48inline While * makeWhile(PabloE * cond, While::List statements) {
49    return new While(cond, statements);
50}
51
52}
53
54#endif // PS_WHILE_H
55
56
Note: See TracBrowser for help on using the repository browser.