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

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

Replaced dynamic_cast with llvm::dyn_cast in pablo code; implemented make functions for pablo constructors. Disabled RTTI.

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