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
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
[4206]10#include <pablo/pe_pabloe.h>
[3850]11#include <list>
12
[4199]13namespace pablo {
14
[4214]15class While : public PabloE {
16    friend struct CodeGenState;
[4200]17public:
[4209]18    typedef std::list<PabloE*> List;
19    friend While * makeWhile(PabloE * expr, List psl);
[4200]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    }
[4199]27    virtual ~While() {
28    }
29    inline PabloE * getExpr() const {
30        return mExpr;
31    }
32    inline const List & getPSList() const {
33        return mPSList;
34    }
[4209]35protected:
36    While(PabloE * expr, List psl)
37    : PabloE(ClassTypeId::While)
38    , mExpr(expr)
39    , mPSList(psl)
40    {
41
42    }
[3850]43private:
[4200]44    PabloE * const  mExpr;
45    List            mPSList;
[3850]46};
47
[4209]48inline While * makeWhile(PabloE * cond, While::List statements) {
49    return new While(cond, statements);
[4199]50}
51
[4209]52}
53
[3850]54#endif // PS_WHILE_H
55
56
Note: See TracBrowser for help on using the repository browser.